How to add whitespace to an RMarkdown document?

Solution 1:

Another easy way to do this is to just use HTML tags. Adding <br> will give a single line break and I've used that when, for whatever reason, using the (two-space indentation) is ignored.

Solution 2:

To create vertical space (Markdown to PDF), I use &nbsp;

This command works like \vspace{12pt} for latex.

Solution 3:

You can use latex inside your Rmd file. To have a page break, just add \newpage.

example.Rmd

Title
====================

This is a test Rmd document. 

\newpage

Second page
====================

This text is on the second page

You make a pdf using render("example.Rmd", output_format='pdf_document')

Hope it helps,

alex

Solution 4:

You can also use inline LaTeX to create a 1-inch vertical space like this:

text text text

$$\\[1in]$$

text text text 

Note that you have to leave a blank line before and after the $$\\[1in]$$