# LaTeX Tips for your Dissertation or Project Write-up

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:

1. 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
2. Do not edit the original template, your own customizations should be in your own main .tex file
3. 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
4. Remember the typesetting dogma: If it doesn’t look good — it needs fixing! (doh!)
5. 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
6. 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
7. All .tex/.bib files for each chapter should go under their own directory (as shown in the above template)
8. Figures should go under subdirectory images in the root folder.  Here, too, you should use subdirectories for each chapter to organize your work
9. Use proper sectioning/subsectioning/subsubsectioning commands.  These allow you to organize your work and make it easier for an examiner/reader to follow
10. Bibliographic entries do not need url (for some entry types, e.g. article), eprint, DOI, pdf, keywords or abstract keys.  The important thing is to make sure all the references are consistent with each other
11. If you have an online resource in your bibliography you then need the url (but not for papers) and last accessed timestamp
12. For references use BibTeX in (one or more) separate .bib files. Do reference manually!
13. Ideally, you use some reference management software such as Zotero or Mendeley. These tools export to BibTeX
14. For more BibTeX tips run texdoc bibtex on Linux
15. 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.
16. It is the bibliography style file that determines which fields of a given .bib entry are shown, but heed the BibTeX warnings
17. 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.
18. Take note of accents in.bib entries.  Also make sure accents in names are correctly typeset, e.g. Sch\"{u}tze.
19. 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
20. Bibliographic entries should have consistent keys (e.g. AuthorYYYY)
21. 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.)
22. Use a non-breaking space between a Figure, Table, or Equation and its number, e.g. Figure~\ref{fig:jp}
23. 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
24. Index entries should be human (not a machine!) readable, with proper capitalizations (for section titles)
25. Index entries must be meaningful (e.g. overview is not a good index entry, overview of what??)
26. 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
27. 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}.”
28. Use one \citep command even for multiple citations, e.g. \citep{ebejer2019, pace2020}
29. Do not hardcode author names ever — always use \citep or \citet commands
30. Do not hardcode chapter, section, figure, table, equation numbers. Use \label and \ref.
31. 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.
32. The punctuation for the sentence goes after the parenthesis of a citation
33. Do not use double quotes character ” or fancy single quotes character. In LaTeX to get double quotes use “this”. For single quotes use this’
34. 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.
35. URLs should be typeset in \url, typically in footnotes (i.e. \footnote{\url{…}})
36. You should use linebreaks (\\, \newline), page breaks and \noindent sparingly. Again, the template should take care of the typesetting for you
37. 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
38. 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
39. No text operators (e.g. \textbf{…}) inside maths environments (e.g. equation or $…$)
40. 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)
41. 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
42. 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.
43. 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.

Published
Categorized as Students

1. Kale says:

This is a fantastic little article. I’ve been writing with LaTeX for a few years and like to revisit the best practices, and got a good refresher from this. If I may, I’d recommend the following package: siunitx (for tabular alignment as well). I don’t see it mentioned as often as it should, and it has been a game changer for me.

2. Kale says:

A great little “hack” to comment out large blocks of code, shown as […], is: \iffalse […] \fi

3. Christa Pisani says:

Thank you! This and the template on Overleaf is just what I needed with just over a month until submission

Eternally grateful 😀