This tutorial will walk you through creating a simple \LaTeX document that showcases some of the commonly used functionality.
Emacs setup (optional)
Emacs has great \LaTeX support. Install the Auctex
package with M-x
package-install RET auctex RET
. If you like autocomplete and use
CompAny, install the Auctex backend
as well (company-auctex
).
Starting a document
A document starts with a document class declaration. To start an article, for example, you would use this:
\documentclass{article}
The actual document content is contained inside of document
markup,
like so:
\begin{document}
\end{document}
Sections
Start a new section with the \section{}
markup:
\section{Why EMACS is Technically Capitalized}
Labels
Labels allow you to reference places or figures in the document. Place a label like so:
\section{Why EMACS is Tecnically Capitalized}
\label{sec:emacs-capitalized}
References
Reference a label with the same test used when the label was created:
Blah blah blah \ref{sec:emacs-capitalized}.
Footnotes
Footnotes are automatically numbered, and put at the bottom of a page:
Foo bar baz \footnote{buf bum} bar baz foo.
Citations
Assuming you have a BibTex file set up, citations are done with the
cite
markup:
This is a sentence \cite{pitts2020}.
Appendix
To generate a plain appendix if you have a bibliography file called
foo.bib
:
\bibliographystyle{plain}
\bibliography{foo}
A sample document with all the elements can be found here.