In Linux Last updated:
Share on:
Cloudways offers managed cloud hosting for any size business to host a website or complex web applications.

LaTeX, a powerful document preparation system, has been a go-to choice for researchers, academics, and professionals for decades.

Its ability to typeset complex mathematical equations and produce high-quality documents with ease makes it an indispensable tool for anyone who requires precise formatting and publishing capabilities. If you’re a Ubuntu user, installing LaTeX can be straightforward, provided you have the necessary knowledge and tools.

Let’s go through the complete guide on the installation of LaTeX on Ubuntu, exploring the benefits and features of this remarkable system along the way.

Whether you’re a seasoned LaTeX user or a newcomer looking to streamline your document preparation process, this guide will provide the technical know-how to get started. So let’s dive in and discover the world of LaTeX on Ubuntu.

Importance of Installing LaTeX On Ubuntu

LaTeX on Ubuntu offers a variety of benefits. When dealing with complex mathematical equations or scientific formulas, conventional word processors often struggle to produce accurate and readable output.

LaTeX, on the other hand, is designed specifically for this purpose, and its advanced typesetting capabilities ensure that even the most complex equations are rendered beautifully. 

Additionally, because LaTeX is a text-based system, it allows for easy version control and collaboration among multiple authors, making it an ideal tool for projects that require the input of multiple contributors.

By utilizing LaTeX on Ubuntu, individuals and teams can easily streamline their document preparation process and produce professional-quality output.

Step-by-Step Installation Guide

Here is a complete step-by-step guide on how to install LaTeX on Ubuntu for efficient document preparation:

Step 1: Open the Terminal

After opening the terminal, use the “Ctrl+Alt+T” shortcut on your keyboard. This command is used to launch a new terminal window so you can work further. 

Step 2: Update the Package List

To update the package list, you need to run a command in the terminal. That command is mentioned below: 

sudo apt-get update

Step 3: Install LaTeX

Next, install LaTeX by running the following command:

sudo apt-get install texlive-full

This command will install the complete version of LaTeX, including all necessary packages and dependencies.

Step 4: Verify the Installation

After the installation, you need to verify the recently installed LaTex. Following are the steps to verify the installation: 

latex --version

This command will display the version of LaTeX installed on your system.

Step 5: Test the Installation

To test the installation, create a new LaTeX document by running the following command:

touch test.tex

This command will create a new file named “test.tex” in your current directory.

Step 6: Edit the Document

Open the file using your favorite text editor and add the following LaTeX code:

Hello, world!

Save the file and close the editor.

Step 7: Compile the Document

To compile the document, run the following command:

pdflatex test.tex

This command will generate a PDF file named “test.pdf” in your current directory.

Step 8: View the Document

To view the PDF file, run the following command:

evince test.pdf

This command will launch the Evince PDF viewer and display the “Hello, world!” message.

And there you have it! You’ve successfully installed LaTeX on Ubuntu and created a basic LaTeX document. Now you can begin exploring the many powerful features and capabilities of this remarkable system. 

Testing Installation of LaTex on Ubuntu 

Testing the successful installation of LaTeX on Ubuntu is essential to ensure that the system is fully functional and ready to use. Here is how you can test the installation with a real example:

Step 1: Create a New LaTeX Document

You just need to open any text editor. Now the next thing you need to do is to create a new file named “test.tex”. Add the following LaTeX code to the file:

Here is an example of a simple equation:
    E = mc^2

This code will generate a document with a simple equation (E=mc²).

Step 2: Compile the Document

Now the next step is to compile the document. Open the terminal and navigate throughout the directory. Now find a spot where you can see the “test.tex” file saved and run the following command:

pdflatex test.tex

This command will compile the LaTeX code and generate a PDF file named “test.pdf”.

Step 3: View the Document

To view the PDF file, run the following command:

evince test.pdf

This command will launch the Evince PDF viewer and display the “test.pdf” file.

Step 4: Verify the Equation

Scroll down to the equation in the PDF file and verify that it appears correctly. The equation should look like this:

E = mc^2

If the equation appears correctly in the PDF file, then the installation of LaTeX on Ubuntu was successful, and you can begin using the system to create and typeset professional-quality documents.

Uninstalling LaTeX from Ubuntu

If you ever need to uninstall LaTeX from your Ubuntu system, you can do so using the following steps:

Step 1: Open the Terminal

The first step is to get to your terminal. Try to open it up with the command mentioned earlier in this post. The command is “Ctrl + Alt + T”. Also, you can search “Terminal” in the Applications menu.

Step 2: Uninstall LaTeX Packages

Next, you’ll need to remove the LaTeX packages from your system. Writing the following command in the terminal will help you achieve it:

sudo apt-get remove texlive-*

This command will remove all the packages related to LaTeX from your system.

Step 3: Remove LaTeX Configuration Files

After removing the LaTeX packages, you’ll need to remove the configuration files that were created during the installation. To achieve this, you need to use a specific command as below in the terminal:

sudo apt-get remove --purge texlive-*

This command will remove the LaTeX configuration files from your system.

Step 4: Remove LaTeX Directories

Lastly, you’ll need to remove any LaTeX directories that were created during the installation. A command mentioned below can help you remove LaTeX directories:

sudo rm -rf /usr/share/texmf/

This command will remove the LaTeX directories from your system. That’s it! LaTeX has been completely uninstalled from your Ubuntu system.

Final Words

LaTeX is a powerful typesetting system widely used in academia, scientific research, and publishing. It allows you to create professional-looking documents with complex mathematical equations, tables, and figures.

Installing LaTeX on Ubuntu is a straightforward process that can be completed in simple steps. Once installed, LaTeX is easy to operate, and you can create beautiful documents with ease. So, if you’re looking to create professional-looking documents, be sure to give LaTeX a try!

Next, check out how to install Ubuntu on Windows 10 using Hyper-V.

Share on:
  • Pankaj Rai
    A writer with 5+ years of experience. My profound experience and strong IT background push me to craft technical write ups that make readers fall in love. Blockchain, Web 3.0, AI, ML, and Cryptography are a few niches to name, that I cover. Simplifying…

Thanks to our Sponsors

More great readings on Linux

Power Your Business

Some of the tools and services to help your business grow.
  • The text-to-speech tool that uses AI to generate realistic human-like voices.

    Try Murf AI
  • Web scraping, residential proxy, proxy manager, web unlocker, search engine crawler, and all you need to collect web data.

    Try Brightdata
  • is an all-in-one work OS to help you manage projects, tasks, work, sales, CRM, operations, workflows, and more.

    Try Monday
  • Intruder is an online vulnerability scanner that finds cyber security weaknesses in your infrastructure, to avoid costly data breaches.

    Try Intruder