5 minute read

This short tutorial documents how I modified an awesome UCB thesis Overleaf template to build my own dissertation. I am not including my own Overleaf document publicly because formatting guidelines from the Grad Div might change over time, and I have no interest in maintaining my own template. But feel free to get in touch and I’ll send it to you.

The Berkeley Grad Div’s page on Formatting your Thesis warns, “The most common mistake is following a fellow (or previous) student’s example.” This is horrendous advice, and will lead to every student wasting time dealing with nitpicky formatting guidelines. Thank goodness that LaTex exists, and in particular that Paul Vojta (math professor - never met him) maintains a ucbthesis.cls class file and Overleaf template. So I used that as my starting point. If you work for the Grad Div and somehow happen to see this, please get in touch! It would be awesome if y’all would maintain a good LaTex template for a science thesis, and I’d be happy to advise.

I needed to insert astronomy and earth science publications that were written in LaTex but used classfiles from AAS, Icarus, and GRL, and lots of the LaTex commands I used in those publications did not exist in ucbthesis.cls. I added \usepackage{amsmath} and \usepackage{amssymb}, but there were still many commands missing, e.g. arcseconds as \arcsec and journal name shortcuts like \grl. For those, I used latexdefs.tex (link will download!) from some Caltech Astronomy site (unknown author), and put \include{latexdefs} into the preamble of thesis.tex. I changed the way Biblatex was handling citations, too; I used \usepackage[style=authoryear-comp, backend=biber, uniquename=false, uniquelist=true, maxcitenames=1]{biblatex} .

I then implemented the following steps to remove/replace formatting from my other publications and convert them into chapters:

  • make a new .tex file for the chapter, and copy everything in there
  • add the chapter name to the list of \include{} calls in thesis.tex
  • remove all calls to begin and end document, remove package imports
  • comment out all authors and affiliations
  • change \title{} to \chapter{}
  • remove calls to \abstract{}
  • copy-paste all references into the references.bib, then delete call to bibliography within chapter
  • change citations: \citet{} becomes \textcite{}, and \citep becomes \parencite[][]{}
  • import all figures into the Figures directory
  • change all the file paths in calls to \includegraphics to point to Figures directory
  • fix tables - no fancytable allowed, but can import other packages. see example tables
    • \usepackage{longtable} for multi-page tables
    • \usepackage{rotating} for sidewaystable and sidewaysfigure to get tables and figures to fit within margins
    • \footnotesize and \tiny to get tables to fit within margins. The Grad Div is apparently very serious about margins. But they did not complain that the fontsizes were different in different tables, even though I think this is technically against the formatting guidelines.
    • \centering within each table and figure call to make things look nice
  • remove calls to \acknowledgements, \appendix, \software
  • put acknowledgements into the front matter, with text clarifying which chapter(s) certain acknowledgements (e.g. funding) apply to
  • Reformat all software citations previously included with \software{}: find DOIs, make BibTeX entries with doi2bib, include them in bibliography and text using \parencite{}
  • remove special commands to make appendix numbering like A1, A2, etc.
  • Check for places in the text where the margin is violated. This often happens with special text formats like \texttt{} because LaTex doesn't know how to hyphenate it. To fix these, surround the entire paragraph with \begin{sloppypar} and \end{sloppypar}
  • try compiling and see what fails

At this stage, the document renders successfully and looks pretty good! But the Grad Div gives zero guidelines for how to include published material in the thesis. All they say is “Publishable papers and article-length essays arising from your research project are acceptable only if you incorporate that text into a larger argument that binds together the whole dissertation or thesis. Include introductory, transitional, and concluding sections with the papers or essays.” …the “only” in that sentence a bit ominous. To meet the bare minimum of that requirement, here are the decisions I made to finish formatting stuff. These ended up getting approved without any issues, although I’m sure you could make different decisions that would also be okay:

  • At the start of each chapter, I put an italicized note saying, "The published version of this chapter was coauthored by the following people, and is included in the thesis with their express permission: "
  • I did actually get email approval from all those people (there is an official way to do this, and the form needs to be submitted like a month before the dissertation deadline. see dissertation filing guidelines)
  • Instead of having a chapter section entitled Abstract, I just put the text of the abstract directly after the italicized list of coauthors without any header.
  • I retained sections of each chapter entitled Introduction and Conclusions. I changed the name of the Introduction chapter of the dissertation to be called Background to avoid confusion.
  • I wanted to keep the appendices of the different chapters within the chapters themselves. To do so, I just changed all the Appendix chapter sections to be regular sections named "Appendix: whatever." It's an ugly solution and maybe there is a better way, but that's what I went with. I was concerned the Grad Div would make me put them at the end, but they didn't.
  • I ended up writing a reasonably long introductory chapter, which contained primarily grad-level textbook material that was relevant to my different chapters. And even though this initially felt like busywork, it was actually really instructive to do and I'm glad I did it.

Update 08/15/22

The dissertation was approved! I found some problems with the steps I had listed in an earlier version of this blog post, and those have now been changed to reflect what I actually turned in. I also learned that there’s no reason to stress too much about formatting, because if there are small formatting issues after the deadline you are allowed to change them, as long as your full committee has approved the dissertation before the deadline.