Skip to main content

Section A.1 Introduction to

The overwhelming majority of mathematics articles and texts are typeset using [7], a document preparation system developed specifically for producing scientific and technical documents. As students in the mathematics programs you are expected to know how to use . The availability of free, online editors like Overleaf provides a low barrier to entry.

In the primary focus is on the content and not the format of your document. So you will be working on a plaintext file, typing commands that tell what to do when your document is compiled (similar to programming).

In , the following code generates the text below. Can you guess what the commands mean by looking at the output?

Code:

Let's prove that 
\[ \sum_{i=1}^n i = \dfrac{n(n+1)}{2}\]
using mathematical induction.

The base case for $n = 1$ is clearly true,
since $1 = \frac{1(2)}{2}$.

Now assume that the claim is true for $n = k$;
that is,
\[ \sum_{i=1}^k i = 1 + 2 + \cdots + k = \dfrac{k(k+1)}{2}.\]
	

Output:

Let's prove that

\begin{equation*} \sum_{i=1}^n i = \dfrac{n(n+1)}{2} \end{equation*}

using mathematical induction.

The base case for \(n = 1\) is clearly true, since \(1 = \frac{1(2)}{2}\text{.}\)

Now assume that the claim is true for \(n = k\text{;}\) that is,

\begin{equation*} \sum_{i=1}^k i = 1 + 2 + \cdots + k = \dfrac{k(k+1)}{2}\text{.} \end{equation*}

Try this out yourself! Go to https://overleaf.com and create an account. Then start a new blank project, give it the name First Project, and copy and paste the code above, just below the \section{introduction} line.

Press CTRL + Enter to compile the document. The output should appear on the right.

Overleaf document.
Figure A.1.2. Overleaf document
Output document.
Figure A.1.3. Compiled output

You may have noticed that there is some extra text that tells what kind of document you are preparing (article), what the title is (First Project), author's name, and so on. Everything above the \begin{document} line is said to be the preamble of the document—here you will usually issue commands to about global formatting options, packages you want installed, and so on.

In fact if you look at your First Project document, in line 14 there is an error message, denoted by the red X. Hover your cursor over it to see the message: Undefined control sequence. The issue here is that the command \dfrac{ }{ } that we used to generate

\begin{equation*} \dfrac{n(n+1)}{2} \end{equation*}

is not in by default. So the fractions don't actually appear in the output.

To remedy this we need to tell to load the amsmath package so we have access to all its commands, including \dfrac{ }{ }. Just add the line \usepackage{amsmath} to the preamble. It can be anywhere, but it is generally good practice to place all \usepackage commands together, so type it in line 3. Now compile again by pressing CTRL + Enter and the error message should disappear. The output on the right should be correct as well.

Most mathematics documents start by loading the packages

  • amsmath for general mathematical features
  • amsthm for theorem-like environments
  • amssymb for even more symbols

so you can just load all of them at the beginning of each document you create.

You also probably noticed that placing dollar signs $ $ around text renders that text as mathematics. Placing \[ \] around text (or double dollar signs $$ $$)renders that as display mathematics, centered in its own line. Have a look at this website for a list of commonly-used math symbols and try using Overleaf to typeset a number of results from these notes or another math textbook. Have fun and explore! This is where your journey begins.

Next Steps and Resources.

This video is a very nice introduction to by David Richeson and I highly recommend you take the time to watch it (35 minutes).

Here are some other helpful resources:

  • David Richeson also has a PDF quick guide to available on his website.
  • Overleaf also has an introductory guide.
  • Detexify for searching commands for symbols.
  • TeXworks, if you would like to install on your computer. (optional! only if you really want to...)