UoA LaTeX Workshop

Sam Kavanagh

08 Oct 2018

Point everyone to this document and explain how it will be updated at the end of the day with any changes that are required after the workshop, and that they can follow along during the lesson and if we don't manage to get through everything today they can finish off at home.

Key Workshop Objectives

Contents

Why use Latex? What’s wrong with Word?

…And most importantly, impress your peers who think you have to be some crazy tech-wizard to actually want to write your documents in Latex.

Voldemort Laughing

Typical Workflow

Do your writing in a Latex .tex file + Bibliography .bib file (optional) → Run the files through a Latex distribution (sometimes called a compiler) → LaTeX outputs a PDF

This is a different way of working to WYSIWYG editors like Microsoft Word. Some people claim this allows you to focus more on your content, instead of its appearance. On the other hand your writing now has Latex specific commands intermingled with it.

Latex Editors

These are what you actually do your writing in. Because Latex is written in plain text, if you wanted to (and plenty of people do) you could use a simple text editor like Notepad to do your writing, and then run the Latex distribution (the software that takes all your Latex files and outputs a PDF) yourself.

However, this is unnecessarily complicated and newer Latex editors provide lots of nice features like spell checking, code highlighting, and autocompletion.

You must have a Latex distribution installed on your computer to be able to build your Latex files. MikTeX and TeX Live are by far the most popular. On most Linux distributions and Mac OS, Latex comes pre-installed. Once you’ve got a distribution, go ahead and download the editor of your choosing.

For this workshop you don't need to install anything!

My personal recommendations for desktop Latex editors:

  1. TeXstudio
  2. TeXmaker
  3. Texworks

However a more recent development in the Latex world is web based Latex editors. This is what we will be using today.

Overleaf

Overleaf is a modern web based Latex editor that allows you to work on Latex documents anywhere in the world without needing to install any software, all you need is your browser (and an active Internet connection).

Overleaf Homepage

Because it is a web based tool, it also has some other helpful features that you typically don’t get from desktop-based editors, the most useful of which are:

Overleaf has a free plan. However, for full features they charge a monthly fee. Half price plans are available for students. In my opinion, the only major limiting feature to the free plan is that it only allows you to share your document with a single collaborator. Provided this isn’t a deal breaker, the free plan still provides heaps of features and allows you to create unlimited private projects.

Demonstrate and make sure everyone can log in. Tell the students to make a new blank project and delete the autogenerated text.
Tell the students to turn off autocomplete for learning purposes.

Basic Latex

Explain how Latex documents are a mixture of commands and content. Explain what commands look like.

Every Latex document is comprised of a mixture of Latex commands and your actual content. Almost all Latex commands follow the exact same structure:

\command[optional arguments]{arguments}

Note the backslash (\) that precedes commands. This is what lets Latex know that everything following the backslash (up until the next space) should be interpreted as being a Latex command, rather than just ordinary content.

Almost all Latex commands take arguments. This is the information that you ‘pass’ to the command to tell it what to do. For example:

This text would appear formatted normally, but \textbf{this text would appear bold}.

The above command would appear in your PDF as:

This text would appear formatted normally, but this text would appear bold.

In the example above, the command \textbf{} tells Latex to bold anything that appears between the two curly-braces {}.

The bf in \textbf{} stands for boldface, a technical term for bolded text. Similarly \textit{} makes text italic.

Latex Document Structure

Explain preamble and document content.

Every Latex document follows the same structure:

Preamble Commands
 - This is where you do things like specify:
    - The document type: e.g. whether it's a book or a journal article, and one or two columns
    - The document title and author(s)
    - List any packages you want to use (more on this later)
----
Document Content
- This is where you actually put the content of your document, and is generally divided into different chapters and/or sections, or in Latex terms 'environments'

In actual Latex, this is what it looks like:

Code:
\documentclass[twocolumn]{article}
\title{My first Latex document}
\author{Sam Kavangah}

\begin{document}
\maketitle
This is the actual body of the document, this text would appear in the PDF.
\end{document}

That above code is a complete and valid Latex document. That is all you need! Latex will take care of sorting out all the default margins for you. It even generates a nice title, author, and date section for you based on the information you provided in the document preamble (i.e. the stuff that came before the begin{document} command).

If you were to paste the above code into Overleaf, you would see the following output PDF:

Screenshot First Document

The text only goes halfway across the page because we specified that this was a twocolumn document in the Latex command:

\documentclass[twocolumn]{article}

This is an example of an optional argument, why is why it appears in []. You could have instead simply written:

\documentclass{article}

and your document would have defaulted to a single column article.

Demonstrate different columns numbers (switch to 1) and document types.
Demonstrate setting date manually, and multiple authors.

Latex Environments

Explain how some commands have opening and closing tags. Demonstrate center

Some commands have both opening and closing commands. These are generally referred to as environments, and you have already seen an example above.

\begin{document}
\end{document}

All content within the opening and closing command will have some sort of styling applied to them. For example, the environment below centers text:

\begin{center}
This text would be center-aligned!
\end{center}
Whitespace: Unlike Microsoft Word, Latex ignores whitespace (extra lines and spaces) in the editor. You instead have to choose from the various Latex commands available to manually tell Latex to add additional whitespace. The \medskip command for example inserts a medium sized spacing between paragraphs.
Demonstrate how whitespace works

You can nest environments within one another, however they must \begin{} and \end{} in the correct order. For example, the Latex code below would generate an error:

\begin{document}
\begin{center}
This text would be center-aligned!
\end{document}
\end{center}

Sections, Abstracts, and Chapters

Usually we don't write our articles as one big block of content...
Explain how we don't use environments for sections.
Abstract is the exception to the rule.
Code:

Usually we don’t write our articles as one big block of content, instead we divide it into different chapters, sections, and subsections. Although it seems logical to use environments for sectioning, we don’t do this because when you’re potentially dealing with sections, subsections, and even subsubsections you can end up with chaotic looking code like this:

\begin{document}
\begin{section}{Section One}
...
\begin{subsection}{Subsection One}
...
\begin{subsubsection}{Subsubsection One}
...
\end{subsubsection}
\end{subsection}
\end{section}
\end{document}

Instead Latex has dedicated commands such as \section{} and \chapter{} to indicate the beginning of a new section, and these have no \end{} tag. For example:

\begin{document}
\section{Introduction}
This appears in the introduction section.
\subsection{Research Questions}
This text would appear in a subsection named '1.1 Research Questions'.
\end{document}
Exception: Abstracts. The abstract section is an exception to the rule, because some Latex class files (which are basically just a list of commands that act as a style template for your documents, more on this soon) apply special formatting to the abstract section. Instead we use \begin{abstract} and \end{abstract}.

We’ll take a look at working with larger documents now instead of articles. Go ahead and create a new blank project named ‘thesis’ and delete the automatically generated contents.

Tell students to create a new blank project called 'Thesis' and to delete the automatically generated content.

Organizing Bigger Documents

Let's create a basic outline for our new thesis project and build on it from here.

Let’s create a basic outline for our new thesis project and build on it from here.

Code:
\documentclass{report}
\title{Sam's Latex Thesis}
\author{Sam Kavanagh}

\begin{document}
\maketitle

\chapter{Introduction}
Welcome to my professional looking Latex thesis.

\chapter{Background}
Look, Latex puts this on a new page for me!

\end{document}
One of the nice things about working with Latex is that you can easily split your content into different files

One of the nice things about working with Latex is that you can easily split your content into different files (for example a different file for each chapter), and then have a single ‘main’ thesis file which combines all these files and outputs a single PDF. This makes life a lot easier when you start dealing with big documents like theses.

Create chapters/, chapters/introduction.tex, chapters/background.tex
Move chapter content into appropriate file

Let’s do that now. Create a new folder in your Latex project named chapters, and within the folder create 2 new files, introduction.tex and background.tex. Next we’ll take the content corresponding to each of the chapters from our existing main.tex file, and place it in the appropriate file. For example, the file background.tex should now look like this:

\chapter{Background}
Look, Latex puts this on a new page for me!

And your projects file structure should now look like this:

Project File Structure

The \input{} Command

Explain how we use \input{} to include the content of our files

In order to tell our main.tex file to grab the content from our new files, we simply use the \input{} command, and pass it the path to our new files. This path is relative to the location of the file that the command is in. For example, if we had a file named methodology.tex within the same folder as our main.tex file we would use the command \input{"methodology"}.

However, because we’re nice and tidy Latex users, we put our chapters into the separate chapters folder, so we instead use the command input{"chapters/introduction"} and input{"chapters/background"}.

The double quotes " are optional in this case, but are recommended because otherwise Latex doesn't play nice if you have spaces in your file names.
You don't need to duplicate all of the preamble in your chapter files. The \input{} command takes all of the content from individual files and uses it to create one big .tex file. So from Latex's point of view nothing has changed even though our commands are now split over 3 files.

Our main.tex file should now look like this:

Code:
\documentclass{report}
\title{Sam's Latex Thesis}
\author{Sam Kavanagh}

\begin{document}
\maketitle

\input{"chapters/introduction"}
\input{"chapters/background"}

\end{document}

Figures

Most of our documents aren't going to be comprised solely of text...
Latex handles placement of figures well, but its different to word and confusing at first
You can use LaTeX to generate figures, complicated, using existing figure instead

Most of our documents aren’t going to be comprised solely of text, but will include various figures (e.g. graphs and images). Latex handles the placement and referencing of figures in text very well (although it might seem a little confusing at first), and it is one of the primary reasons people prefer it over Microsoft Word when dealing with large documents.

There are many Latex packages (more on this later) that are able to produce beautiful professional looking graphs and figures by reading in your data, however these would require a workshop of their own. So for today we are going to assume we already have a figure that we have produced in another program, and we simply wish to include it in our document.

Show gallery
If you are interested in Latex's figure plotting abilities, check out the pgf and TikZ packages. This webpage provides an excellent gallery of what they are capable of, and the corresponding Latex code is included next to all the examples.

Uploading our own figure to Overleaf

I've created a figure for you use
Demonstrate creating a new figures/ folder, downloading + uploading image

I’ve gone ahead and created a simple graph for us to use as an example. Save a copy of the image to your personal computer by clicking here (if the link doesn’t work try this instead). Make sure you save the image somewhere you can find again!

Back in Overleaf, let’s create a new folder to save our figures. figures seems like the logical choice here! Make sure you don’t create this folder inside the chapters folder, to be safe try clicking the main.tex file before clicking the New Folder icon.

After we have our new folder it’s time to upload our existing figure. Click on the folder (so that it becomes highlighted) and then click the Upload button and find the file we just saved.

If it looks like your file hasn’t uploaded, try clicking the little > (expand) icon to the left of the figures folder. After you’re all done your new project structure should look like this:

Project File Structure

The Figure Environment and Packages

We are using figure environment
Before we go further we need to use our firsst package as Latex doesn't work that well with images out of the box

To include a figure in Latex we work with the figure environment.

\begin{figure}
\end{figure}

Before we go any further it’s important to point out that by default Latex doesn’t provide much functionality for working with images (graphics), so it’s about time we start working with our very first package!

Packages are simply additional libraries that provide functionality beyond what Latex can do by default. To use a package in Latex is super easy, we just use the command \usepackage{packagename} in our documents preamble.

Jump back to our main.tex file and insert the following command on the line immediately after the \documentclass{} command (i.e. line 2):

Add \usepackage{graphics} to main.tex | Allows us to use \includegraphics{}
\usepackage{graphicx}

graphicx is a very popular modern package that provides an improved way of working with graphics in Latex, and allows us to use a new command: \includegraphics{}.

Let’s update our background.tex with the following content:

Code background.tex:
Latex has a steeper learning curve than Microsoft Word, but as the document grows it makes your life a lot easier!

\begin{figure}
    \includegraphics{"figures/latex-vs-word"}
\end{figure}
Works, but doesn't scale and puts in on the wrong page

That didn’t work very well! Latex does include the figure just like we asked, however it makes no attempt to scale the image down to fit correctly, and tries to be helpful by putting the image on the next page (but we don’t want that!).

Time to work on improving our figure!

Scaling the figure

Step 1. Let’s get our image down to a size that’s more manageable. The \includegraphics{} command takes many optional arguments, including width, height, and scale and these are always written in the format key=value, for example: \includegraphics[width=300px]{"figures/latex-vs-word"}. In our case scale should do the job. Update the existing command to look like the one below:

Code:
\includegraphics[scale=0.25]{"figures/latex-vs-word"}
But it's still on the wrong page

Image Placement

Much better, however our whole figure is still on the wrong page. Thankfully the \begin{figure} also takes optional arguments, you will often use these to tell the Latex that you want the figure placed at the top, bottom, or simply right here on the page!

Unlike most other normal commands, optional arguments to the \begin{} command come after the non-optional arguments.

Let’s update our figure to tell it that we want the figure placed here.

Explain h, t, b etc
Code:
\begin{figure}[h]

Alignment

We’ve already looked at the center environment, so let’s go ahead and use that now to center our image on the page. Our figure code should now look like this:

Code:
\begin{figure}[h]
    \begin{center}
        \includegraphics[scale=0.25]{"figures/latex-vs-word"}
    \end{center}
\end{figure}

Captions

The last thing our figure needs is a caption, let’s add one now with (unsurprisingly!) the \caption{} command. Add a new line after the \includegraphics{} command, and insert the following:

Code:
\caption{Latex document complexity vs time and effort.}

That’s it! Your finished figure should look something like this:

Screenshot of finished figure

Cross-Referencing our image

After the \end{figure} environment let’s add some text to refer to our snazzy new figure.

Let's add some text to refer to our new figure, add this paragraph below the figure environment
Code:
If you're still unsure about whether you want to use Microsoft Word or Latex, refer to Figure 2.1 for irrefutable evidence of Latex's superiority.
Explain the issue with keeping track of figure numbers
Explain the 2 commands \label and \ref

Typically when we’re writing big documents we add and remove figures as it grows, and keeping track of the numbers of figures becomes a pain. Thankfully Latex provides functionality for referring to other parts of your document using a combination of the \label{} and \ref{} commands.

These two commands work hand-in-hand: We use the \label{} command after any figure, chapter, section etc. to define a label that we can then refer to anywhere in our document using the \ref{} command.

These labels can be called anything we want, but most people like to start the label name with fig:, chap:, sec: etc. to make it easier to keep track of what they’re referring to.

Let’s create a label for our figure.

Code:
\begin{figure}[h]
    \begin{center}
        \includegraphics[scale=0.25]{"figures/latex-vs-word"}
        \caption{Latex document complexity vs time and effort.}
        \label{fig:latexVsWord}
    \end{center}
\end{figure}

Now let’s update the paragraph at the bottom of the page to use the \ref{} command, rather than doing it manually:

Code:
If you're still unsure about whether you want to use Microsoft Word or Latex, refer to Figure \ref{fig:latexVsWord} for irrefutable evidence of Latex's superiority.

That’s it! From the readers point of view nothing has changed, but we can insert new figures before our referenced figure or even move the figure to an entirely new chapter and the reference number would automatically be updated.

The \label{} and \ref{} commands, and the ability to tell Latex exactly where you want a figure to be placed is a huge deal when you’re working with theses. Unlike your poor Word-using friends, rearranging chapters, sections, figures, or breaking up your content into smaller files as you see fit becomes no big deal.

Latex and Word User

Footnotes

In academic writing something we use fairly often is footnotes. In Latex setting up a footnote is as simple as placing the command \footnote{} anywhere you want the marker to appear. Latex will take care of numbering and placing the footnote at the bottom of the page for you.

Let’s add a footnote to our background.tex file:

Code:
\chapter{Background}
Look, Latex puts this on a new page\footnote{This is not the case with the article documentclass.} for me!

Working with Equations

Another reason many people use Latex for writing their documents is its support for rendering mathematical equations.
inline, display

Another reason many people use Latex for writing their documents is its support for rendering mathematical equations.

There are 2 main ways people do this: the inline and display math modes.

Inline Math

Inline math is pretty self-explanatory, it is used when we want to display an equation in the same line as our current sentence. To do so, we use the $ symbol to both open and close the mode.

Let’s add a new section to our introduction.tex:

Code introduction.tex:
\section{Mathematical Motivation for Research}
The happiness of Microsoft Word users as a function over time can be modeled by the function $y=-x+5$ while scientists have demonstrated that the happiness of \LaTeX can be modeled by the function $y=x^2+9001$.
Special Math Characters: There's a lot of characters that get interpreted specially in math mode. In the example above we used the ^ (superscript) command to tell Latex that what comes after that should be a superscript (in our case an exponential). If we needed this to be several characters we would surround it in curly braces {} as with any other command. For example: $y=x^{2+y}+9001$.

Display Math

If instead we want our figures to be numbered and appear on their own line (much like a figure), we can use the equation environment. The way that we write equations remains unchanged from the inline style. Let’s add another equation to the bottom of our introduction.tex:

Code introduction.tex:
\begin{equation}
    f(x_1, x_2) = \pi * (x_1 - x_2)
\end{equation}

Your introduction chapter should now look like this:

Equation environment in our introduction chapter

Comments

One super handy feature of Latex is comments. Comments allow us to make notes to ourselves within our .tex files, that are simply ignored by Latex when building your document. You can use these to make reminders to yourself about what a particular line of Latex does, or to plan sections in advanced - and they will never appear in the PDF!

Commenting in Latex is done with the % character. Any text that appears after the % on a line is ignored. For example:

Code introduction.tex:
\section{Mathematical Motivation for Research}
% In this chapter I'm going to give a quick intro about why Latex is cool, and prove it mathematically
The happiness of Microsoft Word users as a function over time can be modeled by the function $y=-x+5$ while scientists have demonstrated that the happiness of \LaTeX can be modeled by the function $y=x^{2+y}+9001$.

\begin{equation} % I should also consider investigating whether this equation even makes any sense
    f(x_1, x_2) = \pi * (x_1 - x_2)
\end{equation}

Bibliographies and Citations

Arguably the most common reason people like to use Latex.
Done by reference management software called BibTeX that comes bundled with LaTeX.

Arguably the most common reason people like to use Latex is its ability to handle citations and generate References/Bibliography sections.

This is all handled by a reference management software called BibTeX (which comes bundled with Latex).

BibTeX

Explain how BibTeX works.

Bibtex makes it easy to store all of your references in a tidy, consistent way. It does this by storing all your bibliography items in a separate .bib file. You can think of this as a sort of mini-database.

It’s important to remember that this is a separate system to Latex, so the syntax is a little different.

Each entry in the .bib file has a type associated with it, such as book, article, or conference. These all start with the @ symbol, for example @Book.

For each entry we specify:

Let’s create a new file in the main (root) folder references.bib and paste in an example entry:

Create new file references.bib
Code:
@article{kavanagh2018,
  title={Latex is Magical},
  author={Kavanagh, Sam and White, Gandalf and Dumbledore, Albus},
  journal={Themes in Magic and Wizardry Education},
  volume={10},
  pages={85--119},
  year={2018}
}

Inserting the Bibliography Chapter

Latex doesn't know it needs to do anything with it yet, need 2 commands
Explain \bibliographystyle and \bibliography

Just because we’ve created a bibliography (.bibtex) file, Latex doesn’t know yet that it’s supposed to do anything with it.

In order to tell Latex that we want to have a bibliography we use 2 commands:

\bibliographystyle{}

This is where we specify the style of referencing we’re using, e.g. ACM, APA, IEEE etc.

The other command is simply

\bibliography{}

This is where we actually point to the bibtex file we want to use.

Let’s update our main.tex to tell it we want to use our new bibliography file using these 2 new commands:

Code:
...
\input{"chapters/introduction"}
\input{"chapters/background"}

\bibliographystyle{acm}
\bibliography{references}

\end{document}

You should now see a 4th page added to our thesis document with the heading Bibliography.

If you’re wondering why there’s nothing listed under the heading, it’s because we haven’t cited our bibtex entry anywhere in the document yet! Let’s do that now.

Citations

Explain how nothing appears until we \cite, and how it is similar to \ref

Previously we used the \ref{} command to refer to a label we defined elsewhere in the document. Citing works almost exactly the same way, except we use the \cite{} command to refer to the label (key) we defined for our entry in the .bib file.

Let’s add a new paragraph to the bottom of our introduction.tex file:

Code introduction.tex:
Existing research has demonstrated that a basic understanding of Latex allows its users to perform impressive feats of high level magic \cite{kavanagh2018}.

That’s it! In the outputted PDF Latex will replace the \cite{} with a citation corresponding to the style we specified in the \bibliographystyle{} command. Because we’re using the acm style, your Introduction chapter should now look like this:

And even better, your References section should have been updated now that you cited something:

Demonstrate getting a BibTeX entry from Google Scholar.

Our thesis is looking pretty awesome now, but before we’re done let’s add a couple more things to make it look even more professional.

Table of Contents and Figure List

Although it doesn’t make much sense for a document of this size, most thesis include both a Table of Contents and a List of Figures.

Setting all this up in Latex is so simple that I’m not even going to explain the commands!

Update our main.tex file with 2 new commands:

Code:
...
\begin{document}
\maketitle
\tableofcontents % <- Creates a table of contents
\listoffigures % <- Creates a list of figures
...

Easy peasy! These lists will continue to update automatically as we add to our document.

Well done!!!

If your department doesn't require you to use the UoA thesis template, then congratulations, that's it!

The project you just made looks professional, and is an excellent starting point to build upon for a real thesis!

Even if you're not required to use the UoA thesis template, I recommend you follow on until the end of the workshop as you'll also learn how to use Latex class files to apply predefined styles to your whole document.

The UoA Thesis Template

This produces a thesis template compatible with the School of Graduate Studies style guide (2016).
Explain how its a hefty zip file with a big PDF explaining exactly how to use it

This produces a thesis template compatible with the School of Graduate Studies style guide (2016).

You can download it here.

The download includes quite a lot of files, including a rather hefty documentation PDF which explains how to install and use the template on different operating systems, and even includes a basic Latex tutorial.

Unless your department actually requires you to use this, you don’t have to. However, even if you aren’t required to use it, you might find that you like the look of the document it generates.

Using the Template in Overleaf

Get the students to download the zip, and extract aucklandthesis/aucklandthesis.cls
Explain what a class file does
Get the students to upload the file to the root folder of their project

Once you’ve downloaded the .zip file, extract its contents somewhere that you can find again.

In order to use the template we need to use a Latex class file. In the folder you just extracted, within the aucklandthesis sub-folder, you will find a file named aucklandthesis.cls. Upload this file to the root folder of our Overleaf project.

Explain the 3 steps required to get the template working:
  1. To tell Latex that we want to use this .cls file, all we have to do is change the \documentclass{} to aucklandthesis.
  2. The template also defines 3 new commands \degreesought{}, \degreediscipline{}, and \degreecompletionyear{} which are used to format the thesis title page.
  3. I also recommend changing the \bibliographystyle{} as the template out of the box doesn’t play so well with the acm style (it requires a little more fiddling, check out the template documentation if you’re interested).

These changes are noted by the comments (%) below:

Code:
\documentclass{aucklandthesis} % <- The new documentclass
\usepackage{graphicx}

\title{Sam's Latex Thesis}
\author{Sam Kavanagh}

\begin{document}

\degreesought{Doctor of Philosophy} % <- These 3 commands are used to format the title page
\degreediscipline{Computer Science} % <- These 3 commands are used to format the title page
\degreecompletionyear{2018} % <- These 3 commands are used to format the title page

\maketitle
\tableofcontents
\listoffigures

\input{"chapters/introduction"}
\input{"chapters/background"}

\bibliographystyle{apalike} % <- The ACM style doesn't play well with the template
\bibliography{references}

\end{document}

That’s all you need to get up and running with a basic version of the thesis template. You should see the fonts and general appearance of much of the document has changed and looks very snazzy.

Handy Tools

Finished Project Code

\documentclass{aucklandthesis} % <- The new documentclass
\usepackage{graphicx}

\title{Sam's Latex Thesis}
\author{Sam Kavanagh}

\begin{document}

\degreesought{Doctor of Philosophy} % <- These 3 commands are used to format the title page
\degreediscipline{Computer Science} % <- These 3 commands are used to format the title page
\degreecompletionyear{2018} % <- These 3 commands are used to format the title page

\maketitle
\tableofcontents
\listoffigures

\input{"chapters/introduction"}
\input{"chapters/background"}

\bibliographystyle{apalike} % <- ACM doesn't work well with the template
\bibliography{references}

\end{document}
    
\chapter{Background}
Look, Latex puts this on a new page\footnote{This is not the case with the article documentclass.} for me!

Latex has a steeper learning curve than Microsoft Word, but as the document grows it makes your life a lot easier!

\begin{figure}[h]
    \begin{center}
        \includegraphics[scale=0.25]{"figures/latex-vs-word"}
        \caption{Latex document complexity vs time and effort.}
        \label{fig:latexVsWord}
    \end{center}
\end{figure}

If you're still unsure about whether you want to use Microsoft Word or Latex, refer to Figure \ref{fig:latexVsWord} for irrefutable evidence of Latex's superiority.
  
\chapter{Introduction}
Welcome to my professional looking Latex thesis.

\section{Mathematical Motivation for Research}
The happiness of Microsoft Word users as a function over time can be modeled by the function $y=-x+5$ while scientists have demonstrated that the happiness of \LaTeX can be modeled by the function $y=x^{2+y}+9001$.

\begin{equation}
    f(x_1, x_2) = \pi * (x_1 - x_2)
\end{equation}

Existing research has demonstrated that a basic understanding of Latex allows its users to perform impressive feats of high level magic \cite{kavanagh2018}.
  
@article{kavanagh2018,
  title={Latex is Magical},
  author={Kavanagh, Sam and White, Gandalf and Dumbledore, Albus},
  journal={Themes in Magic and Wizardry Education},
  volume={10},
  pages={85--119},
  year={2018}
}
  

That’s it, Well done!

Hopefully you’ve seen the light, and realize the potential power of Latex once you get the hang of it.

If not… Well, I tried. Microsoft Word is still a thing I guess.