LaTeX in Ubuntu
Installation

Install LaTex on Ubuntu

Sagar Sharma
Sagar Sharma

Table of Contents

LaTex is a document markup language that is mainly used to write scientific papers (involving complex symbols).

And in this tutorial, I will walk you through how you can install LaTex on Ubuntu.

Also, I will be sharing free resources to learn LaTex in the end!

Ubuntu 18.04 Review of New Features
Ubuntu 18.04 Review of New Features

How to install LaTex on Ubuntu

In the default repository of Ubuntu, you will find multiple LaTex packages available from which the most common ones are:

Package Name Size
texlive-base 160 MB
texlive-latex-recommended 203 MB
texlive 269 MB
texlive-latex-extra 464 MB
texlive-full 5903 MB

Where the texlive-base package is the base install and will include the essential elements only.

So I would recommend going with texlive or texlive-latex-extra if you are just getting started.

Sure, if you have plenty of free space, you can go with texlive-full package and you'll have everything including multiple languages.

Now, let's get started with the installation.

You can use any of the shown packages with the apt install command. I'm going with texlive-latex-extra so I will be using:

sudo apt install texlive-latex-extra texlive-extra-utils

Here, the texlive-extra-utils package will be useful for converting your LaTex files into PDFs.

Once you are done with the installation, let's put the installation to the test.

I will show how you can convert your LaTex to PDF.

Using LaTeX in command line

Here, I will be using the nano text editor but if you want, you can choose from one of the best LaTex editors for Linux.

nano sample.tex

And enter the following:

\documentclass{article}
\usepackage{hyperref}
\begin{document}
So what is the most annoying thing in Ubuntu (if we ignore snaps)?\LaTeX

\url{https://https://learnubuntu.com/}
\end{document}
create sample LaTex file in Ubuntu terminal

Save changes and exit from the nano text editor.

Now, you can use the pdflatex command to convert your file to PDF:

pdflatex sample.tex

Once done, you can use any of your preferred PDF viewers.

Here, I will be using Evince PDF viewer that comes pre-installed in Ubuntu:

evince sample.pdf
use Evince PDF viewer in Ubuntu

Working as expected!

But you would be better with a proper GUI-based editor. Here are some recommendations.

9 Best LaTeX Editors For Linux
Brief: Once you get over the learning curve, there’s nothing like LaTeX. Here are the best LaTeX editors for Linux and other systems. What is LaTeX? LaTeX is a document preparation system. Unlike in a plain text editor, you can’t just write plain text using LaTeX editors. Here,

Want to Learn LaTex? Here are some free resources

If you are a beginner and want to kick-start the LaTex journey, you can refer to Overleaf's 30 min brief guide:

Learn LaTeX in 30 minutes
An online LaTeX editor that’s easy to use. No installation, real-time collaboration, version control, hundreds of LaTeX templates, and more.

Similarly, you can refer to LaTex's official learning guide:

Learn LaTeX online for free in beginner friendly lessons | learnlatex.org

I hope you will find them helpful.

And if you have any doubts, let me know in the comments.



Sagar Sharma

Sagar Sharma

A software engineer who loves to tinker with hardware till it gets crashed. While reviving my crashed system, you can find me reading literature, manga, or watering my plants.