Preenting with knitr/LaTeX
Christopher Gandrud · 2018
This chapter provides a more detailed and comprehensive introduction to basic LaTeX document structures and commands. For basic LaTeX documents, such as short articles or simple presentations, it may often be quicker and simpler to write the markup using an R Markdown document and compile it to PDF with the rmarkdown package. The chapter presents basic LaTeX document structures and syntax as well as how to dynamically create LaTeX bibliographies with BibTeX, R, and knitr . It discusses how to create a LaTeX article including what editor programs to use, the basic structure of a LaTeX document, including preamble and body, LaTeX syntax for creating headings, paragraphs, lines, text formatting, math, lists, footnotes, and cross-references. In LaTeX, paragraphs are simply created by adding a blank line between lines. LaTeX is particularly popular among quantitative researchers and mathematicians because it is very good at rendering mathematics.