28.2 Basic LaTeX Template
20200602 LaTeX is a language for programming, like R—programming over words and sections and chapters and page layout, rather than programming over data. It is what we call a markup language and has its own collection of commands that tell the LaTeX software what to do. Within RStudio when we create a new knitr (Xie 2025) document a skeleton of LaTeX commands will be automatically inserted into the document for us. From this initial script we can readily produce well formatted reports and presentations.
Once we have a new text document with a filename extension of .Rnw we will enter the LaTeX commands intermixed with the text of our narrative intermixed with the R commands performing the data wrangling and the analyses we perform.
\documentclass{article}
\begin{document}
\end{document}
This is the most basic of documents—something we often call the
Hello World example, though perhaps we would want to include
the string Hello World between the begin and
end of the document.
\documentclass{article}
\begin{document}
Hello World.
\end{document}
LaTeX provides an extensive collection of commands including the
basics like highlighting text (for example, \bold{...} or
\italic{...}) and creating a list of items:
* Text for the \bold{first} item.
* Text for the \italic{second} item.
* ...
We will see many examples as we proceed through this chapter and there are very many guides to LaTeX available on the Internet. Our aim is to quickly be comfortable with using LaTeX and not to let it get in our way, recognising it as a very powerful language.
References
If you find this curated material useful then you can consider a donation to support it's ongoing availability and give you access to the PDF version of this book. The material has been scoped up by Generative AI without permission or any kind of recompense so do consider a donation if you can afford it. Unlike Generative AI your access to this materials is freely given. Desktop Survival Guides include Data Science, GNU/Linux, and MLHub. Books available on Amazon include Data Mining with Rattle and Essentials of Data Science. Togaware has a 30 year tradition of making popular open source software which includes sold privacy preserving productivity apps, rattle, wajig, and mlhub. Hosted by Togaware, a pioneer of free and open source software since 1984. Copyright © 1995-2022 Graham.Williams@togaware.com Creative Commons Attribution-ShareAlike 4.0