This tutorial will show the step-by-step installation process of the LaTeX package, editor, and compiler on Debian 10 and Debian 11. We will also show you various tools for editing and compiling LaTeX files and how to convert LaTeX .tex files to PDF. LaTeX is free software and a typing system specialized for technical and scientific documents. It is especially very useful for writing documents including mathematical formulas and equations. It is excessively used by academia and the technological community.
Installing LaTeX in Debian
For installing LaTeX in Debian, you need to follow the following steps in order:
Step 1: Installing LaTeX package:
There are multiple LaTeX packages offered by Debian that the user can install. Some of them are:
- texlive-science
- texlive-pictures
- texlive-metapost
- texlive-xetex
- texlive-luatex
- texlive-games
- texlive-latex-extra
The user can install any package of his choice by running the following command in the terminal. For this particular guide, I am installing the texlive-latex-extra package.
$ sudo apt install texlive-latex-extra
You can simply replace the package-name ‘texlive-latex-extra’ with the name of the LaTeX package you want to install in the above-mentioned command. For clarity, look at the highlighted attached image below.
Once you press hit enter, it will start installing the LaTeX, as shown in the below image:
The process will take some time to complete.
Step 2: Confirm the installation of LaTeX package
Once you have done with installing the laTeX package of your own choice, confirm it by performing the following bullet points:
- Open any available text editor on your PC.
- Write some demo code.
- Save the code with the extension of .tex, for example, “File.tex”.
Look at the below image.
Step 3: Compile a .tex file to PDF through the command
Once you have written the code and saved it as .tex, now compile the file to a PDF by running the pdflatex command in the terminal. If the user has the pdflatex, he first has to install texlive-extra-utils before applying the pdflatex command.
Running the above command will convert the File.tex into File.pdf. Open the home folder and look for the CONVERTED PDF FILE. You will find a pdf file along with the .tex file in the home folder as shown highlighted in the below image.
You can also see the converted file through the following command:
$ evince File.pdf
Look at the attached image below.
Step 4: LaTeX editor and compiler installation:
After getting done with the installation of the LaTeX package, the user can also install LaTeX editor and compiler so that he can easily work on document editing and compiling in LaTeX. There are multiple LaTeX editors and compilers provided by Linux. Such as,
- gedit latex plugin
- LyX latex editor and compiler
- Texmaker latex editor and compiler
- LaTeXila latex editor and compiler and others.
The user can go with any of the choices, hence for this particular guide I am going to install:
- LyX latex editor and compiler.
- LaTeXila latex editor and compiler.
Step 5: Installation of LyX latex editor and compiler
- Open the terminal and write the following command for installing LyX.
$ sudo apt install lyx
Once it gets installed, search the LyX from the search bar and open it. It will display the menu as shown in the below -attached image:
- For creating a file in LyX, follow the following points:
- Go to the top left corner.
- Click on the File field.
- Click on the New field.
A new file will open, write code in the file and save the file with the name of your choice. For this particular guide, I am saving the file as File1. Look at the attached image for further clarity.
After getting done with LyX, we will now explain how to install LaTeXila.
Step 6: Installation of LaTeXila latex editor and compiler
- Open the terminal and write the following command for installing LaTeXila.
$ sudo apt install latexila
Once it gets installed, search the LaTeXila from the search bar and open it. It will display the menu as shown below:
For creating a file in LyX, follow the following points:
- Go to the top left corner.
- Click on the File field.
- Click on the New field.
A new file will open, write code in the file and save the file with the name of your choice. For this particular guide, I am saving the file as Filelate. Look at the attached image for further clarity.
This is how you can create a new file in LaTeXila, edit your files and compile them.