# So you can create your first document using LaTeX, the layout language par excellence

0

Wikipedia defines LaTeX as a ‘text composition system’which makes it easy to create high-quality typographical documents. Technically we could not qualify it as a language: really ‘just’ a huge set of ‘high-level’ macros for the much more complex TeX language.

LaTeX is used for two main reasons: its already mentioned typographical quality, and the facilities that give to correctly represent formulas of all kinds, which makes it a highly valued tool in academic environments; in fact, it is behind most of the world’s technical books, academic articles, and theses.

LaTeX code of mathematical formulas, and their corresponding output in the generated document.

Besides, LaTeX greatly facilitates the introduction of bibliographic citations; we can introduce one using an identifier chosen by us (\cite{ManualWindowsVista}, for example) and then, at compile time, automatically extract all necessary information from a .bib file in which we have previously compiled the books to cite.

As a negative aspect, the steep learning curve of LaTeX should be highlighted.: getting a complex document requires knowing many more commands and arguments than those exposed so far. But even being an advanced user, it never hurts to have a good manual nearby.

One of the most unexpected aspects of LaTeX is that includes elements of a proper programming language, such as loops and conditionals. What can a conditional statement be used for when laying out a document? Well, for example, to automatically insert a blank page after each page that contains a chapter title.

exist various software packages that will provide us with the ability to compile LaTeX documents: for example, MikTex on Windows, or TeX-Live (cross-platform). The former includes a basic graphical editor (TeXworks), however there are multiple independent open source publishers that we can use, highlighting the multiplatform LyX and TexStudio. In the image that heads this article we can see LaTeX Base, un editor online freemium of this language.

The programmer career in 2017 and in the future (with Javier Santana)

## Some preliminary notions

• All the commands of LaTeX begin with a backslash: ‘\’.

• Los arguments of these commands are indicated between keys: ‘{}’.

• Los comments start with a percentage symbol: ‘%’, everything to its right will be ignored by the compiler.

• Even if we write multiple blanks or line breaks in a row, the compiler will interpret them as one.

• Most LaTeX editors will generate a PDF document when filling it out:

Result of compiling the example document in TeXworks from MikTeX, on Windows.

## General structure of a document

This is the code used in the image at the top of this article. Try to reproduce it in your editor:

% Declaración de documento

\documentclass[a4paper,12pt]{article}

% Preamble

% The next three lines are just metadata, although we can use them later in the document

\title{My first document}

\date{2022-05-21}

\author{Genbeta}

% The next two lines specify packages of non-standard functions that, in this case, allow the document to properly handle texts in Spanish

\usepackage[spanish]{babel}

\usepackage[utf8]{inputenc}

% Start of the document itself

\begin{document}

% Here begins the body of the article

\maketitle

\section{Hello world!}

Energy is equal to mass multiplied by the square of the speed of light:

% Mathematical formulas are written between 4 dollar signs (two before, and two behind)

$$E=mc^2$$

% This is how a list with two items is entered

\begin{itemize}

\item First item in the list

\item Second element of the list

\end{itemize}

% End of the document

\end{document}

Do not be scared: LaTeX also allows you to insert images, columns, margins, text boxes and all that (otherwise, it would not work for layout), but let’s learn to walk before running

Kim recently joined the team, and she writes for the Headline column of the website. She has done major in English, and a having a diploma in Journalism.