7

How do I turn off the title in an Rmd HTML document?

---
title: ""
output: html_document
---

rmarkdown::render("index.Rmd")

[WARNING] This document format requires a nonempty element. Please specify either 'title' or 'pagetitle' in the metadata. Falling back to 'index.utf8'

Looking for a quick easy fix without having to modify the underlying template.

1
  • 2
    Note that the document is actually created without a title, despite the warning... the 'title' mentioned in the warning is in fact the html's title tag, i.e. the text that is shown in the browser tab. It can be also set independently of the document title via "pagetitle" yaml element
    – Max
    Mar 11, 2021 at 15:20

1 Answer 1

10

This creates a blank page.

---
title: " "
output: html_document
---

Further, it might be the case that " " adds unwanted white space to the top of the corresponding webpage. Using " " does the same thing without adding the potential white space.

For background, &...; are known as "entities" in HTML language, with   being an entity name standing for "non-breaking space" while   is an entity code indicating a "space." More description and other entities can be found here, for example: https://www.w3schools.com/html/html_entities.asp

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.