-
Notifications
You must be signed in to change notification settings - Fork 0
1.2.1.2 R Markdown and TeX
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, 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.
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}
Below is a list of references that are very useful in formatting TeX and LaTeX. Box links are provided as backups.
- TeX Reference Card by J. H. Silverman (Box)
- Comprehensive List by S. Pakin (Box)