How to add whitespace to an RMarkdown document?

RMarkdownR Markdown

R Problem Overview


Is there a way to do it by adding latex code in the text or does the solution lie in (R)Markdown?

No sign of a solution here: http://rmarkdown.rstudio.com/pdf_document_format.html

At present I'm bodging a solution by adding my monospace signature to the bottom of the 1st page, to force the next section to start on page 2: https://github.com/Robinlovelace/Creating-maps-in-R/blob/master/intro-spatial-rl.pdf

R Solutions


Solution 1 - R

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 - R

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

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

Solution 3 - R

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 - R

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]$$

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionRobinLovelaceView Question on Stackoverflow
Solution 1 - RZoë ClarkView Answer on Stackoverflow
Solution 2 - RNotYourIPhone SiriView Answer on Stackoverflow
Solution 3 - Ralko989View Answer on Stackoverflow
Solution 4 - RDavid LovellView Answer on Stackoverflow