6 minutes read

Have you ever needed to write math on your computer? Are you tired of your heavy and slow word processor? If you've ever worked with a document with dozens of images, references, and formulas, you've probably experienced chaos.

LaTeX to the rescue! With it, you can write editorial-quality scientific papers in an automated way and at the same time have great control over the final result. Without a doubt, it is the best option to write mathematics and learning it will bring you benefits both in the short and long term.

What is LaTeX?

First of all, LaTeX is a tool for creating professional-looking documents. Common word processors have a graphical user interface (GUI) where you work with both the content and its final appearance, meaning that as the project grows, everything begins to feel heavy. For its part, in LaTeX the document is a simple text file with the extension .tex (like those used as a script in any programming language) which combines the content with LaTeX commands that take care of the final appearance. These commands are processed by an engine responsible for producing the final result.

So when you write LaTeX you only care about the text and you don't have to load a heavy GUI. While it does have a learning curve, in the long run it takes less time and effort to create large, complex documents.

LaTeX's most famous quality is its amazing facility for writing mathematical expressions, from the simplest to the most complex. Virtually all of the math on the web and in various print books looks so neat and clean because it was written in LaTeX. In fact, all the authors at this platform use LaTeX to create the mathematical expressions you see in the topics 😉.

Tonelli`s Theorem in LaTeX

Why you should use it

From the first moment you start writing with LaTeX you will have a lot of advantages.

  • Editorial quality: you will hardly have to configure anything.
  • Great automatization: LaTeX takes care of specifying the page number, the next digit in the numbered list, the figure or table number, or the size of all titles! What's more: you won't even have to create the table of contents manually anymore or format your bibliographical references.
  • Various types of documents: this versatile tool helps you write what you need, from assignments and letters to theses and entire books! You can even create presentations very easily and efficiently.
  • Math: when you work with mathematics you need to write a lot of expressions with a lot of very specific symbols and adjust them to fit on the line, reference previous equations, and display equations that can be very long: when you use LaTeX all this will be easier than you imagine and you'll end up producing flawless-looking work.
  • Friendly community: there is a large LaTeX community that will accompany you during your learning. This means that you will always be able to seek help on any detail, you will have access to a lot of professional templates, you will be able to find specialized guides on various topics and you will be able to learn many tips that will save you time and contribute to creating excellent documents.

Basic structure

All the general settings of your document are written at the beginning in a space called the preamble. The minimum you need to specify here is the document type using the \documentclass command where you can indicate that you want to create a single article:

\documentclass{article}

This is enough to form the preamble. However, something very common is to indicate the name of the author and the title of the document, simply add:

\title{My first LaTeX document}
\author{Your Name}

It is time to write the content of the document. In LaTeX all the information is contained in various environments, which are file spaces whose text fulfills a specific function. The start and end of each environment are delimited by the \begin{<environment>} and \end{<environment>} commands. The body of the document follows the preamble and belongs to the document environment:

\begin{document}
    This is the beginning of my document
\end{document}

It is not necessary to indent the text, but it is very useful to distinguish the hierarchy level. To add the title and author name just add \maketitle:

\begin{document}
    \maketitle
    This is the beginning of my document
\end{document}

Writing math

When you write a mathematical expression you can do it within a paragraph thanks to the inline mode. To use it you just have to enclose the expression between dollar $ signs:

Newton's second law is written as $F = m a$

Result: Newton's second law is written as F=maF = m a

Sometimes an equation is so important that it deserves a space just for it. To achieve this you just have to write it in an equation environment (also called display mode):

Newton's second law is written as:
\begin{equation}
    F = m a
\end{equation}

Result: Newton's second law is written as:F=maF = ma

"Subscripts and superscripts can be created using _ and ^.

$x_1$ and $x_^2$

Result: x1x_1 and x2x^2

You can also write Greek letters like α\alpha by using a backslash before their name \alpha. The more complicated symbols have their own commands, and you'll be able to learn about them later, but they're as easy to use as the above:

$\int_X f \ d \mu$

Result: Xf dμ\int_X f \ d \mu

If you want to delve deeper into LaTeX, we recommend consulting the Overleaf documentation.

Conclusion

  • LaTeX is a tool for creating editorial-quality scientific documents.
  • It works through commands. Thanks to this, writing becomes easier and you focus only on the content.
  • A LaTeX file has the ending .tex and requires a preamble indicating its configuration, such as the document type using \documentclass{article}.
  • Each block of text in LaTeX is inside an environment, which has a specific function such as representing a table, an image, or an equation. The boundaries of each environment are marked with the \begin{<environment>} and \end{<environment>} commands.
  • The body of the document is included in the document environment.
  • You can write mathematics inside a paragraph with the notation $ ... $. To put an expression centered on its own line you use the equation environment.
  • In mathematical expressions, you can use subscripts with _ and superscripts with ^.
16 learners liked this piece of theory. 0 didn't like it. What about you?
Report a typo