% This is a simple LaTeX file which illustrates the basics needed to create a
% document.

% The % symbol is used for comments in LaTeX files.


% There are a number of document classes supported by LaTeX. The article
% class is a simple one. This document is an article with 12 point font.
\documentclass[12pt]{article}

\title{LaTeX Example}
\date{2021-01-28}
\author{Nathan Sommer}

% By default the margins are pretty wide. This sets the margins to be 1 inch
% all around
\usepackage[left=1in,right=1in,top=1in,bottom=1in]{geometry}
% This package gives us extra math stuff
\usepackage{amsmath}
% This package allows for clickable links
\usepackage{hyperref}

\begin{document}

% This uses the title, author, and date defined at the top of the document
% to make a title
\maketitle

Hello, world! This is a LaTeX document.

Paragraphs are separated by blank lines. Backslashes are used to indicate
commands. Curly brackets and square brackets are used for input and parameters
to commands. Commands are used to set up options, and also to do formatting
stuff like \textbf{bold text} and \emph{italicized text}.

\section{Hey look, a section!}

Sections are automatically numbered.

\subsection{Whoa, a subsection!}

Sections can have subsections and subsubsections.

\section{Math}

LaTeX's math mode is one of the main reasons it is popular. Math stuff can be
used within text by enclosing it in dollar signs, like $n^2$ and $n_0$. Greek
symbols have commands, like $\Theta(n^3)$. You can also do things like sums
with $\sum_{x=1}^{n}x$.

Using a backslash and a square bracket puts the math in displayed mode, which
is centered and potentially larger, like this:

\[\sum_{x=1}^{n}x\]

Equations can be numbered this way. You can also do things like recurrences
with different cases:

\begin{equation}
  n! = \begin{cases}
    1 & \text{if } n = 1 \\
    n \times (n - 1)! & \text{otherwise}
  \end{cases}
\end{equation}

There is lots you can do with math mode, and there is extensive documentation
about math mode on numerous site, including Overleaf:
\url{https://www.overleaf.com/learn/latex/Mathematical_expressions}

\section{Code}

A verbatim section can be used for monospace font:

\begin{verbatim}
def python_function():
    print('Wow, what a function!')
\end{verbatim}

There's also inline monospace support \texttt{like this}.

\section{Lists}

There are a couple ways to do lists. Numbered:

\begin{enumerate}
\item One
\item Two
  \begin{enumerate}
  \item Nested list
  \item Whee!
  \end{enumerate}
\item Three
\end{enumerate}

Unnumbered:

\begin{itemize}
\item Who
\item Needs
\item Numbers
\end{itemize}

\section{And So Much More!}

It's imposible to cover all the features in one example. As with programming,
writing in LaTeX often involves a fair amount of Googling.

\end{document}