Create Beautiful Documents (better than Word)

PolyMaths
4 min readFeb 26, 2023

--

If you’ve ever tried creating a document with maths in Microsoft Word, you’ll know how difficult it is to make the equations do what you want. Even if you succeed, they are not at all pretty! Compare the two:

Word math equations
LaTeX math equations

Not only is the second equation a lot prettier, it was wayyyy easier to write out than the Word equivalent.

So how can you do the same? The program I used is called LaTeX. Although there is a little bit of a learning curve, the good news is that I’m here to help you out, and that once you start using LaTeX, you’ll never want to go back to Word!

Step 0: Understanding typesetting

The key difference between Word and LaTeX is that in Word

what you type is what you see

but in LaTeX,

what you type is what you mean.

These are given the atrocious acronyms WYTIWYS and WYTIWYM, respectively. The key difference is that in LaTeX, once you’ve written what your document, the computer converts it (compiles is the technical term) into the final PDF document. As such, the computer takes care of a lot of the design and formatting of the document, and you can focus on the writing. Of course, you can also customise the document if you’re not satisfied with the default settings.

Step 1: Installation

Go to this link and follow the instructions depending on your operating system. If you’re on Windows, don’t get confused — I would recommend downloading the MiKTeX distribution.

Alternatively, go to Overleaf for a installation-free online editor. The downside is that you can’t use it offline.

The default program to write LaTeX documents is TeXworks and looks like this:

I use a different program called Texstudio because it makes writing a lot easier. Still, it’s not at all a requirement. It looks like this:

The program you use to write LaTeX is called your Integrated Development Environment (IDE).

Step 2: Basic document

Every LaTeX document requires two main features

  1. The first is a declaration of what type of document we are creating. The most common is article but other styles include report, book, slides, letter.

We declare this with

\documentclass{article}

Anything else that we put in this section is part of the preamble.

2. Next, we have the body of the document. We tell LaTeX where our document is in the following way:

\begin{document}

...

\end{document}

Anything between these two commands is part of the document.

Putting these together, we can create our first document:

\documentclass{article}

\begin{document}
Hello world!!
\end{document}

This is the result, shown in Texstudio:

Step 3: Some essential features

There are a some features we usually want to add.

Title: in your preamble (before you start the document), add the command

\title{John Doe}

Then, in your the body of the document add the \maketitle command, as follows:

\documentclass{article}

\title{My document}

\begin{document}
\maketitle
Hello World!
\end{document}

Similar story for author and date. Here is some example code:

Notice the date is added automatically but you can change it in the same way as the title and author.

Finally, how do we add equations for numbered equations, we can use

\begin{equation}
2x+3=2
\end{equation}

or if we want them to be unnumbered then we use

\[
2x+3=2
\]

Let’s put it all together!

Step 4: Advanced features

You are ready to go! I suggest you start right now on your first document. For more advanced features, the most efficient way to learn is searching them up on a case-by-case basis, e.g.

How to add fractions in LaTeX

will quickly yield the result

\frac{numerator}{denominator}

If you want to use code that other people have created, you can import a package. One of the most common is called amsmath and is imported as follows:

\documentclass{article}
\usepackage{amsmath}

% more preamble here %

\begin{document}
...
\end{document}

You are now ready to write your own document.

Welcome to the LaTeX community and good luck!

--

--