Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

LaTeX for Dissertations

Access Berkeley Dissertation Template

LaTeX Basics

Introduction

LaTeX is a typesetting system that allows you to focus on your content instead of formatting - formatting is done separately from entry.

You tell LaTeX “what it is” not “how it looks.”

LaTeX using Overleaf

Example template

Look at the template below to get a sense of how Overleaf works. On the left side, the content is written in LaTeX. On the right side, the rendered document.

two panel view of Overleaf platform

Structure of a document

TermDescriptionExample
CommandControl sequence which performs an action\newpage
PreambleBlock of commands that define the type of document you are writing, the language you are writing in, the packages you would like to use. Comes before \begin{document}\documentclass{article}
PackageEnable you to create bibliographies, insert images and figures, and write formulas.\usepackage{amsmath}
EnvironmentBlock of code with specific behavior depending on its type\begin{} & \end{}
BodyContent of document enclosed inside an environment\begin{document}

Document Metadata

Generic Document Metadata + Titles

The simplest option for making a title is to use the \maketitle command which draws from the following metadata declarations within the preamble:
\author
\date
\thanks
\title

Thesis and Dissertation Document Metadata

The UC Berkeley Accessible Thesis Template also includes a section for metadata under the \hypersetup block in the preamble listed as:
pdftitle = {Thesis Title},
pdfauthor = {Bear, Oski},
pdflang=en-US

Basic Commands

Lists

Use the \begin{itemize}...\end{itemize} environment to create unnumbered lists.

List syntax

\begin{itemize}
\item Apples
\item Cherries
\item Oranges
\item Peaches
\item Watermelon
\end{itemize}

Formatted List

  • Apples

  • Cherries

  • Oranges

  • Peaches

  • Watermelon

Use the \begin{enumerate}...\end{enumerate} environment to create numbered lists.

Accessible PDFs

Take steps to create an accessible PDF when you initiate any new project.

  1. Enable basic tagging essential for an accessible PDF in the document’s metadata with the syntax below. Tagging assists screen readers, differentiating elements like headers, body text, figures, and equations.

PDF tagging syntax for general documents

\DocumentMetadata{tagging=on,
    tagging-setup={math/setup=mathml-SE},
    pdfstandard=ua-2,
    lang=en-US
}

PDF tagging syntax for Dissertation Template

\DocumentMetadata{
  lang         = en-US,
  pdfstandard  = ua-2,
  pdfstandard  = a-4,
  tagging-setup = {
    modules = {phase-III, title, table, firstaid, names, toc, sec},
    table/tagging       = presentation,
    table/header-rows   = {1},
  }
}
  1. Descriptions or alternative text are required for particular content elements:

  1. Artifacts for decorative content: Mark purely decorative or duplicative graphics so assistive technology skips them.

  2. Following the export and download of your PDF, verify the tag structure in Adobe Acrobat.

Read more about accessibility:

Structuring your dissertation chapters

You may choose to compose your thesis or dissertation in one file (main.tex), but it can be advantageous to split your chapters into separate files to better organize your project, particularly if your chapters will act as standalone articles. Find instructions below for creating individual chapter files in the template.

Exercise 1

Mathematics and Equations

To render simple equations, you also need to know syntax and commands for operators, relations, subscripts, superscripts, and fractions.

Operators & Relations

+, -, =, >, < work as expected. Here are some other commands:

CommandDisplayCommandDisplay
\times×\times\leq≤\leq
\div÷\div\pm±
\geq≥\geq\approx≈\approx
\neq≠\neq\cdot⋅\cdot

Math Modes

  1. Inline Mode: Enclose math in $...$ to display equation or formula inline with text:

$x + y = z$ renders inline: x+y=zx + y = z

  1. Display mode: \[ x + y = z \] or $$ x + y = z $$ will center the equation on its own line:

    x+y=zx + y = z

Math Syntax

Subscripts/Superscripts

Fractions

To display a fraction, use the command \frac followed by the numerator and denominator in curly brackets.

Example: \frac{1}{x} gives 1x\frac{1}{x}

More Advanced: Math Packages

amsmath & amssymb Packages

The amsmath and amssymb packages provide you with additional symbols and commands for structuring equations.

To include them, add these commands to the preamble of your LaTeX document: \usepackage{amsmath}
\usepackage{amssymb}

amsmath: Equations Environment

Use the \begin{equation}...\end{equation} command to include a numbered equation in display mode. Use \begin{equation*} for unnumbered equations.

\begin{equation*}
\frac{\partial Q}{\partial t} = \frac{\partial s}{\partial t}
\end{equation}

results in

∂Q∂t=∂s∂t\frac{\partial Q}{\partial t} = \frac{\partial s}{\partial t}

Exercise 2

Tables

Tables use the table environment for positioning and captions. The table environment is wrapped around the tabular environment to layout the actual data/cell grid. We will also introduce the package booktabs in the preamble to enable more formatting options.

Basic CommandsDescription
l, r, ccolumn alignment
&ampersand separates columns
\\double backslash begins new row
\hline or \toprule \bottomrulehorizontal line
|vertical line

Example: Two column table

Table syntax

\usepackage{booktabs}
....
\begin{table}
\caption{Inventory}
\tagpdfsetup{table/header-rows={1}} 
\begin{tabular}{lc}
Item & Quantity 
\midrule
Widget & 1 \\
Gadget & 2 \\
Cable & 3 \\
\end{tabular}
\end{table}

Table example

Table 1:Inventory

ItemQuantity
Widget1
Gadget2
Cable3

Exercise 3

Figures and Images

Uploading a figure or images

Incorporating images and figures into your project is best accomplished by creating your figures, particularly graphs and plots, outside of Overleaf and then importing them into Overleaf.

  1. Add \usepackage{graphicx} in the preamble of your document.

  2. Upload images using the “upload” icon and navigate to the location of your figure.

Overleaf menu to upload images
  1. Within the text, place the image using the command \includegraphics{filename.jpg}

  2. Or use the the figure environment for proper positioning, alt text, and captioning.

Example syntax

\begin{figure}[ ]
\centering
\includegraphics[width=0.5\linewidth,
  alt={photo of cat from above with left paw near keyboard}]{keyboard_cat.png}
\caption{Cat sitting at keyboard}
\label{fig:keyboard_cat}
\end{figure}

Exercise 4

Creating Bibliographies in LaTeX

Objective: Learn the basic commands to create and edit in-text citations and bibliographies

Step 1: Getting started with a .bib file

In order to include in-text citations and a bibliography, the document needs to reference a .bib file. There are three ways to include a .bib file in a project in Overleaf.

We will follow the first option.

Step 2: Populate the .bib file, following the example code below

@article{drachen2016sharing,
  title = {Sharing data increases citations},
  author={Drachen, Thean and Ellegaard, Ole and Larsen,
  Asger and Dorch, S{\o}ren},
  journal={Liber Quarterly},
  volume={26},
  number={2},
  year={2016},
  url={https://doi.org/10.18352/lq.10149},
}

@misc{fsci2021,
  author={Teplitzky, Samantha, and Tranfield, Wynn},
  title={Introduction to Open and Reproducible Practices in 
  {Earth Sciences}},
  maintitle={Case Studies in the {Earth Sciences: Current} 
  Approaches to publishing, data and computation},
  eventtitle={{Force 11 Scholary Communication Institute (FSCI)}},
  venue={Virtual},
  eventdate={2021-07-27/2021-08-03},
}

Step 3: Configure the preamble & body

Bibliography Packages

We will use the biblatex package to generate in-text citations and bibliographies. Biblatex is a flexible package for generating citations.

Commands required for the preambleExplanation
\usepackage[backend=biber,style=apa]{biblatex}calls in the biblatex package
--> backend=biberdefines Biber as the interface between the .bib data file and the LaTeX document
--> style=apasets your citation rules to APA style (this can be swapped for ieee, mla, nature, etc.)
\addbibresource{example.bib}calls in the .bib file, which has the citation information for in-text citations and the bibliography
Commands required for the bodyExplanation
\printbibliographyinserts the bibliography, which will contain citations referenced in the text
\nocite{*}prints all publications in bibliography without a citation

Find more information visit the Overleaf page on bibliography management.

In-text citations

Key: The citation key is the internal label inside the \cite{} command used to call in a citation or reference a source.

Example: To cite Drachen 2016 within your text, type \cite{drachen2016sharing}

CommandDescriptionExample
\cite{}bare citation command (according to style)Knyazeva and Pohl 2013
\parencite{}parenthetical citation(Singh et al. 2013)
\citeauthor{}prints author name(s)Campbell and Cabrera
\textcite{}prints authors followed by a citation label enclosed in ()Elsabbagh, Hamouda, and Taha (2014)

Exercise 5

Compare your LaTeX code to the solutions at: https://www.overleaf.com/read/hfbmjwstnbwh#f2e2e9 to troubleshoot.

Link to this workshop: https://ucblib.link/volt-latex-dissertation