I see many students who struggle with LaTeX write-ups and who burn in typesetting hell for their mortal sins (hanging lists, anyone?). This post will focus on some of the more sophisticated details to publish a perfectly set document. This post is the first of a two-part series; focusing on LaTeX hints. The second part will focus on the actual write-up/content.
Without further ado, these are the tips:
- First things first, you need a proper dissertation/thesis template. A good template will guide you a long way, showing you how to organize your work in terms of files and folders
- Do not edit the original template, your own customizations should be in your own main
.tex
file - Your submission should compile (
pdflatex
), and obvious warnings fixed (these may affect your document in subtle ways). Some warnings (e.g.underfull
) are harder to fix, and nine times out of ten may be safely ignored. Others are easier to fix (e.g. bibtex), and should be sorted out - Remember the typesetting dogma: If it doesn’t look good — it needs fixing! (doh!)
- Compile small units (comment out any
\include
statements which you are not working on). This will save you a ton of time in the long run - Use a version control (e.g. git), with a LaTeX specific ignore file. Make sure to not commit platform specific files, e.g.
.DS_Store
- All
.tex
/.bib
files for each chapter should go under their own directory (as shown in the above template) - Figures should go under subdirectory
images
in the root folder. Here, too, you should use subdirectories for each chapter to organize your work - Use proper sectioning/subsectioning/subsubsectioning commands. These allow you to organize your work and make it easier for an examiner/reader to follow
- Bibliographic entries do not need
url
(for some entry types, e.g.article
),eprint
,DOI
,pdf
,keywords
orabstract
keys. The important thing is to make sure all the references are consistent with each other - If you have an online resource in your bibliography you then need the
url
(but not for papers) and last accessed timestamp - For references use BibTeX in (one or more) separate
.bib
files. Do reference manually! - Ideally, you use some reference management software such as Zotero or Mendeley. These tools export to BibTeX
- For more BibTeX tips run
texdoc bibtex
on Linux - A good key for BibTeX entries is the first author surname (all lowercase) followed by the year of publication, e.g.
Ebejer2019
. If you have two or more of these suffix with a, b, c etc. - It is the bibliography style file that determines which fields of a given
.bib
entry are shown, but heed the BibTeX warnings - Take note of capitalization in
.bib
entries. Downloading BiBTeX entries from Cite this links on journals will inevitably lead to inconsistencies. Use curly brackets to keep letters in publication title, e.g. {C}apitalized. - Take note of accents in
.bib
entries. Also make sure accents in names are correctly typeset, e.g.Sch\"{u}tze
. - Page ranges in
.bib
entries should be en-dash, i.e.--
. In LaTeX you should realize the difference between hyphen (-
), en-dash (--
) and em-dash (---
) and how, and where, they are used - Bibliographic entries should have consistent keys (e.g. AuthorYYYY)
- Make sure your references are not duplicated. Fix all BibTeX warnings. Ideally, you use some software (e,g, JabRef) to organize your bibliography (sorts entries, uses abbreviations for journals etc.)
- Use a non-breaking space between a Figure, Table, or Equation and its number, e.g. Figure~\ref{fig:jp}
- Make sure to index important keywords in your entry (look here for details on how to do this). Multi-page index entries should have paired start and end delimiters
- Index entries should be human (not a machine!) readable, with proper capitalizations (for section titles)
- Index entries must be meaningful (e.g. overview is not a good index entry, overview of what??)
- Do not, for the love of any of your gods, hardcode spaces and line breaks in your document. The template should typeset your document, don’t fight it
- Understand the difference between
\citet
(reference in text) and\citep
(reference in brackets). So “\citet{ebejer2019}
propose that […]” but “[…] is an optimization applied when alpha is zero\citep{ebejer2019}
.” - Use one
\citep
command even for multiple citations, e.g.\citep{ebejer2019, pace2020}
- Do not hardcode author names ever — always use \citep or \citet commands
- Do not hardcode chapter, section, figure, table, equation numbers. Use \label and \ref.
- For \label identifiers use a constant prefix for the entity you want to refer to. Examples of good labels are: chap:results, sec:background, fig:auc, tab:timings, and eq:bayes.
- The punctuation for the sentence goes after the parenthesis of a citation
- Do not use double quotes character ” or fancy single quotes character. In LaTeX to get double quotes use “this”. For single quotes use `this’
- LaTeX adds spacing after periods, but you don’t want this after common abbreviations such as e.g., i.e., et al.). To tell LaTeX this is not the end of a sentence, mark the space with a backslash –e.g.\ this entry.
- URLs should be typeset in \url, typically in footnotes (i.e. \footnote{\url{…}})
- You should use linebreaks (\\, \newline), page breaks and \noindent sparingly. Again, the template should take care of the typesetting for you
- No hanging statements at bottom of page (e.g. The operations which take place are the following: with a list at the top of the next page). Use pagebreak hints to avoid this \pagebreak[1]. Note the number (0 to 4) in square brackets (that is how badly you want the space). The higher the number, the more insistent the request
- Sometimes a chapter ends with a few words on a new page (a hanging sentence). This looks silly and is a waste of your (page) real estate. You can enlarge a single page to stop this from happening using \enlargethispage{\baselineskip}. Note that \baselineskip is the amount by which you want to enlarge the page; more specifically the minimum space between the bottom of two successive lines in a paragraph
- No text operators (e.g. \textbf{…}) inside maths environments (e.g. equation or $…$)
- Do not use above or below in your text, as things may move around and there is no above (on top of page) or below (at end of page). Always use sectioning and internal references (i.e. \ref)
- In between supervisor feedback loops, when you go through various iterations of each chapter it is a good idea to use a tool like
latexdiff
. This will highlight just the differences between versions, reducing correction time. Also note that after your viva-voce, you may be given corrections that need to be highlighted. This tool is a good way to annotate the differences between the final and the submitted (uncorrected) version - For figures and tables use the short caption; e.g.
\caption[Short LoF Caption]{Long, detailed caption}
. This is to avoid clutter in the list of figures/tables. - Check out this guide for making beautiful LaTeX tables.
Do you have more hints and tips for the budding dissertation writer? If so drop me a comment, an email or a tweet.
Leave a Reply