name: title class: title, middle

LaTeX tips

Alex Hernández-García (he/il/él)

.turquoise[Rolnick Lab · Montréal · Oct. 27th 2021]

.center[ Mila ]

.footer[alexhernandezgarcia.github.io alex.hernandez-garcia@mila.quebec @alexhdezgcia] :scale 1em

Citations

\citep{} and \citet{}

natbib provides handy commands and great functionality for handling citations:

\usepackage{natbib}

\citep{} and \citet{} allow to correctly integrate citations within a sentence:

Pro tip: you can tweak the details of citations, for example:

\RequirePackage{natbib}
\setcitestyle{authoryear,round,citesep={;},aysep={,},yysep={;}}

Further reading:


Citations

Clean organisation of the bib entries

.conclusion[Do as you wish, but mostly be consistent]


Cross-references

Different parts of a document can be identified with the command \label{id} and referenced elsewhere with \ref{id}


Cross-references

cleveref for improved references

cleveref improves standard references with extra features, such as:

Further reading:


Colours

LaTeX’s default colours are bad for you and your readers, but that’s easy to fix:

\usepackage{xcolor}
\definecolor{highlightblue}{rgb}{0.435,0.659,0.863}
\hypersetup{citecolor=highlightblue}

Using colours is a great idea for highlighting text during paper writing, for example different authors may have different colours, etc.


Miscellaneous


LaTeX for big documents

Theses, reports, long papers, etc.

One of the main advantages of LaTeX is that we can easily separate style and content. Keeping this philosophy in mind while writing LaTeX documents will save us time and help us focus. Usually we have style.sty files for specifying all style and format details, and content.tex files to include our content.

Having content as plain text enables version control, handling lightweight files and makes collaboration and sharing easy.

For long documents these features become particularly important. I took good advantage of them for my PhD thesis, which is available on GitHub.