Categories: Ubuntu

How to Install LaTeX on Ubuntu 22.04

LaTeX is a document preparation tool that allows academic writers to prepare a well-organized document. This tool is mostly used by the researcher for research paper writing as it includes built-in tools that automatically format the document text and figure. The users can add tables, flow charts, diagrams and much more through available LaTeX codes. After the compilation of the LaTeX code, it generates a PDF file, which can then be viewed in any PDF viewer on the system.

You can install LaTeX on Ubuntu 22.04 from this article’s guidelines.

How to Install LaTeX on Ubuntu 22.04

To install LaTeX on Ubuntu 22.04, follow the below-given steps:

Step 1: Update Ubuntu Repository

First update Ubuntu repository from the following command:

$ sudo apt update && sudo apt upgrade

 

Step 2: Install LaTex on Ubuntu

The Ubuntu repository includes multiple LaTeX packages, which can be installed from the apt command. These packages include texlive-base, texlive-latex-recommended, texlive, texlive-latex-extra and texlive-full. However, it’s better to go with texlive-latex-extra, which is useful for most advanced users. If you have enough space in your system, you can go with textlive-full.

Here I am installing texlive-latex-extra from the following command:

$ sudo apt install texlive-latex-extra -y

 

Step 3: Confirm LaTeX Installation

After completing the LaTeX installation, you can run the following command to confirm its version.

$ latex –version

 

Use Latex on Ubuntu

To learn how to use LaTeX on Ubuntu, let’s first create a sample file with the .tex extension (the default extension for LaTeX). You can use any text editor you want to create a tex file. Here, I am going with nano editor:

$ nano sample.tex

 

Inside the file, add the following Latex code:

documentclass{article}
usepackage{hyperref}
begin{document}
<Message>LaTeX

url{<UR>}
end{document}

 

Save the file using “CTRL+X”, add “Y” and press enter to exit.

To compile the LaTeX file, you have to run the following command:

$ pdflatex sample.tex

 

The above command generates a PDF file inside the folder where the tex file is placed.

Once the file is compiled, you can view it in the PDF Viewer on Ubuntu using the following command:

$ evince sample.pdf

 

In this way, you can prepare your document with LaTeX on the Ubuntu system.

Remove LaTeX from Ubuntu

The Ubuntu users can remove LaTeX from Ubuntu system through the following command:

$ sudo apt remove texlive-latex-extra -y

 

Conclusion

LaTeX is a scientific writing tool used for writing research papers. The Ubuntu repository includes several packages of LaTeX, which can be installed by any user on the system. However, the above-mentioned guide follows the installation of texlive-latex-extra on Ubuntu system from the “apt install” command. The users can also find a detailed guide on how to use LaTeX from the above-mentioned guidelines.

Ubuntu Server Admin

Recent Posts

Predict, compare, and reduce costs with our S3 cost calculator

Previously I have written about how useful public cloud storage can be when starting a…

23 hours ago

One Thread to Poll Them All: How a Single Pipe Made WaterDrop 50% Faster

This is Part 2 of the "Karafka to Async Journey" series. Part 1 covered WaterDrop's…

1 day ago

A year of documentation-driven development

For many software teams, documentation is written after features are built and design decisions have…

2 days ago

Announcing FIPS 140-3 for Ubuntu Core22

With the release of the FIPS 140-3 certified cryptographic modules for Ubuntu 22.04 LTS, Canonical…

3 days ago

The foundations of software: open source libraries and their maintainers

Open source libraries are repositories of code that developers can use and, depending on the…

6 days ago

From inspiration to impact: design students from Regent’s University London explore open design for their dissertation projects

Last year, we had the opportunity to speak at Regent’s UX Conference (Regent’s University London’s…

7 days ago