LaTeX - The Alternative to Word Processors
What is LaTeX?
LaTeX is an engine based on tex which allows for electronic document prepration in a much different way compared to traditional word processors, such as Microsoft Word.
Unlike the other word processors, LaTeX uses plain text to create documents as opposed to proprietary files you do not really see, while it may seem odd just using flat text files, it makes editing in the long term more efficient.
Does anybody actually use LaTeX?
Of course! Most, if not all academic research pieces are written in LaTeX. LaTeX lends particularly well to academics due to the ability to write mathematical equations simply and the incredible reference handling capabilities. If you’re a student, you will know all too well the struggle of inserting maths equations in word documents, hoping somebody online has written it for you, then screenshotting it - not with LaTeX though, you can write the equations yourself!
One of the best things about LaTeX is the formatting - it is all done for you. As formatting is completed for you, the burden is off the author in formatting the document they can simply just write the document.
Getting Started
The main website for LaTeX is:
https://www.latex-project.org/about/
Here’s where you can download LaTeX:
- GNU/Linux:
- Debian Based
$ apt install texlive-full
- Arch Based
$ pacman -S texlive-most texlive-lang
- More information available here.
- Debian Based
- Windows: Here
- Mac OS: Here
Following those areas should get you a functioning LaTeX engine on your machine, and you will be ready to start making documents!
If you want to save the hassle of installing LaTeX onto your machine, an online editor is: Overleaf, which will allow you to compile LaTeX documents without installing it on your machine. There are also a large variety of templates here to give an idea of what LaTeX is capable of. Overleaf is recommended to begin your LaTeX journey as it is very simple to use.
The Basics
The most basic file you can create that LaTeX can create as follows:
\documentclass{article}
\begin{document}
Hello World!
\end{document}
LaTeX is not just a simple as writing down words in a plaintext, you need some extra “syntax” that will enable the LaTeX processor to understand how to process the document. The above text just states we want to create an article, with the text “Hello World!”.
If you compile this using your interfaces compile button, or in Linux you can use:
$ pdflatex tutorial.tex
A very basic document will be produced just with the “Hello World!” text.
\documentclass{article}
\title{Why You Should Learn LaTeX}
\author{Harry Domanski}
\date{August 2022}
\begin{document}
\maketitle
LaTeX is great!
\end{document}
The title, author and date are data that can set before the document begins. Once the document begins, you can use \maketitle to make the title page appear in the document. The “LaTeX is great!” will appear under the title page. This is the basic premise you need to create more complicated documents in LaTeX.
Just having unformatted text here is not particularly useful either, you would want some headings in the document too. You can do this using a different syntax as well.
\subsection{This is a sub section}
Some subsection text.
\subsubsection{This is a subsub section}
Some subsubsection text.
\subsubsubsection{This is a subsubsub section}
Some subsubsubsection text.
The above shows a subsection inserted, which would display the title “This is a sub heading”. You can add this anywhere between where the document begins and ends to create a subsection, and the text below it will belong to that subsection. You can make as many sections as you would like throughout a document, allowing for a well organised document to be produced. To further section these down, you can add “subsubsections” and “subsubsubsections”. You can use sections to automatically generate table of contents and clearly separate your work out.
If you do not like how the numbers appear in the sections, you can add an *
at the end of the \subsection
, like this:
\subsection*{Unnumbered subsection}
Note: Table of contents generation may impact the table of contents generation feature.
Academic Writing
LaTeX is the standard tool used in academic writing, any scientific article you have previously encountered, be it with columns or a large number of mathematical equations, was most likely written in LaTeX, but why?
The wide variety in formatting options makes LaTeX the most appealing to people in academics and with it being in plain text it can allow for easy collaboration between multiple authors.
Compared with something like Microsoft Word, LaTeX offers a much simpler
approach to producing documents. Documents saved in Word are hard to
collaborate in due to how the .docx
format is saved on a machine. Moreover,
using Word requires a large amount of fine tuning, if one user wants to insert
an image it may impact the entire document, LaTeX avoids this in its approach.
Referencing
Creating bibliographies and referencing is also made very simple in LaTeX, you
will have to look into a tool called biber
for referencing in LaTeX. When you
need to reference a piece of work, you will have a separate file with your
references contained within it, the file name ending in a .bib
. The biber
tools expects references to be in the following format:
@article{reference_name},
title={Title of Resource},
author={Name of Author},
year={2018}
}
The above will achieve a very basic reference containing the title, author and
year of publish. Once you have saved that, in your main LaTeX document you can
use either \textcite{reference_name}
and \cite{reference_name}
to use that
reference. Text cite is used if you want to include the authors name, and just
cite is used to obtain the reference number. The references will automatically
be numbered and placed at the bottom of the document.
Most compilers will automatically handle the referencing for you, but in Linux you may need an extra step, namely:
$ pdflatex file.tex
$ biber file
$ pdflatex file.tex
Notice how the biber
command does not contain the .tex
extension, which is
an important distinction in this case. Once these commands are run, you should
achieve a document with references automatically numbered for you. You never
have to worry about manually typing out each individual reference again or
using citation generations, LaTeX can do it all for you. Specifications of the
references can also be set, e.g. how should LaTeX number the references; should
it be Harvard or IEEE; how should they be ordered? It is highly customisable.
Why should I bother with LaTeX? I’m perfectly happy with Word
- It makes annoying tasks in Word simple. Inserting an image does not involve a battle with the surrounding text to get it in the perfect area, LaTeX will insert the image for you in an appropriate place.
- Bibliographies are made automatically for you as you cite them in your text, so you don’t have to worry about writing references in a consistent format.
- Formatting is done for you, you don’t have to decide text size, where the text should indent to, LaTeX will handle all of that for you. You can of course fine tune if you so desire.
While there is a steeper learning curve and it may not be initially intuitive, you will save time in the long run.
You have to be unproductive to become incredibly productive in this instance. It is worth the effort.