Search code examples
rr-markdown

Rmarkdown: Turn off title


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.


Solution

  • 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