LaTeX in Linux

Introduction

What is Latex?

LaTeX – A document preparation system

LaTeX is a high-quality typesetting system; it includes features designed for the production of technical and scientific documentation. LaTeX is the de facto standard for the communication and publication of scientific documents. LaTeX is available as free software.

Definition from latex-project.org

That is OK, but why do we need anything else than Microsoft Word? Microsoft Word is a text editor and we have “What you see is what you get”. This is very simple for quick formatting, but for larger documents, it can be a bit painful, or this is maybe just me. Personally, another minus for Word is that you are writing a plan document and for me, that can be boring. On the other hand, with Latex, you are programming, using Latex syntax to format your document. Formating is done later, buy “compiling” Latex text code and in such a way that is specified by text commands in the latex file.

I read a good comparison between Word and Latex on the next link https://www.lode.de/blog/comparing-word-vs-latex/ and the benefits of LaTeX are summarized in the next image.

With increasing in document size and complexity with Latex can offer us the easier way to typeset and format our document.

Download LaTeX and Hello World example

After this short introduction to LaTex, let’s continue with the topic of this blog, Installing Latex on your Linux machine. For this blog, I’m using Ubuntu 20.04 64bit. So, let’s start.

Open the terminal and type:

sudo apt update
sudo apt install texlive-latex-extra

and now we have a basic LaTex setup. Let’s create as Hello, World example. Open your preferred text editor and type:

\documentclass{article}
\begin{document}
Hello, world from \LaTeX 
\end{document}

Save the file as HelloWorld.tex and open the terminal in the same directory and type:

pdflatex HelloWorld.tex

The last command will compile your tex code and PDF file will be generated and it should look something like this.

And that is it. You have our first latex document. You can do everything like this but, as for any code development tasks we want to install some IDE to make our life easier. So let’s check some LaTeX IDEs for Linux.

LaTeX IDEs for Linux

TexMaker

Texmaker is a free, modern, and cross-platform LaTeX editor for Linux, macOS, and Windows systems that integrates many tools needed to develop documents with LaTeX, in just one application. Includes unicode support, spell checking, auto-completion, code folding, and a built-in pdf viewer with synctex support and continuous view mode. It is easy to use and to configure.

Check out TexMaker at https://www.xm1math.net/texmaker/

You can download this LaTeX IDE directly from site https://www.xm1math.net/texmaker/download.html or open your terminal and type:

sudo apt install texmaker 

Open HelloWorld.tex with TexMaker and let’s take a look around. We have a lot of built-in functionality that is already included in TexMaker so we can easily develop and organize our document.

TexStudio

Is very similar to TexMaker and you can check TexStudio on https://www.texstudio.org/.

TeXstudio is an integrated writing environment for creating LaTeX documents. Our goal is to make writing LaTeX as easy and comfortable as possible. Therefore TeXstudio has numerous features like syntax-highlighting, integrated viewer, reference checking and various assistants. For more details see the features.TeXstudio is open source and is available for all major operating systems.

https://www.texstudio.org/

To download this LaTeX IDE on Ubuntu TexStudio web site or open your terminal and type:

sudo apt install texstudio

Open TexStudio and open existing HelloWorld.tex.

As shown in the images above, we have a lot of LaTeX functions already build in TexStudio. This will help and speed us up loot in developing our document.

LaTeX regular use

I can not remember when is the last time when I created a LaTeX document from scratch. This is because with LaTeX it’s very easy to use templates and there is a lot of them available for free on the net. There is a lot of templates for CV, Assignments, Presentations, Thesis… Good sites to find a template that suits your need are:

In this example, let’s try a master thesis template from MIT. Go to http://web.mit.edu/thesis/tex/ and download the template form Overleaf. Extract tar file, open main.tex with your favorite LaTeX IDE and compile. And now you have a beautiful formatted document template and you don’t have to spend your time formation document so you will have more time doing what actually matters researching or developing.

But did you noticed something? After the first compile run your document will look something like this:

There is no Table of Contents and List of Figures!!! But isn’t LaTeX good with referencing and linking content inside a document?

Yes, LaTeX is very good at this, but for this task, it needs two compile runs. You just need to compile your LaTeX document one more time and everything will be linked.

Final words

LaTeX gives you an easy way out for Microsoft Word formatting nightmare, and with good IDE it can speed you up when writing project documentation or master thesis. Also, for me, it much more interesting when writing documentation in LaTeX, because it remains me of coding, which is more fun than writing the Word document.

Did you like this post? Did you started with LaTeX in Linux and do you maybe have some other steps for the first-time LaTeX users? Please comment down below and see you in the next post.

Leave a Comment