Skip to content

1.2.1.2 R Markdown and TeX

David Kahler edited this page Aug 2, 2021 · 1 revision

R Markdown

Markdown is a basic formatting syntax. All of these Wiki pages are in Markdown. This allows for a very simple version of formatting across platforms. R Markdown is a version of Markdown that runs in RStudio. It has some specific advantages, specifically, TeX or LaTeX tags for equation editing.

TeX

TeX, pronounced like tech, is a formatting and typesetting syntax that allows for a wide range of characters, formats, etc. TeX is the formatting style, which is a trademark of the American Mathematical Society. LaTeX is a common computer system that interprets TeX; however, these are often used interchangeably.

Required Headers

Your R Markdown document starts off with document headers. To use TeX, you need to include:

header-includes:
\usepackage{amsmath}

If you also plan to export (knit directly from RStudio), you will also need a TeX converter. The recommended one is a full-service TeX interpreter called MacTeX, which is notoriously large. A smaller, suitable package is available called TinyTeX. Install by running the following commands in the console:

install.packages("tinytex")
tinytex::install_tinytex()

You may also need to add the following package in your header-includes: line:

 \usepackage{pdfpages}  

References

Below is a list of references that are very useful in formatting TeX and LaTeX. Box links are provided as backups.

Clone this wiki locally