This page describes how to set up a LaTeX distribution on Debian.
Installation
There are two LaTeX distributions available for Debian: TeX Live and teTeX. The latter is no longer supported, so it is recommended to install TeX Live. Depending on how many features you need, you can choose one of the following packages to install:
texlive-full (a metapackage which pulls in all the relevant texlive packages).
There are also several add-on macro packages available:
If you want to add support for your language (other than english) in TeX Live, search for texlive-lang and install your language.
For all texlive packages, see texlive or run
aptitude search ~n^texlive
Custom packages
If you want to install a custom TeX package that is not already in Debian's repositories, take a look at CTAN's web site or TeX Catalogue Online. Download the package and extract it with tar -xvf foo.tar.gz. Enter the directory, if you see foo.ins, run it trough LaTeX
latex foo.ins
This generates foo.sty. Now you have to copy it to the system LaTeX tree or your personal tree. After installation, you can use the new package by inserting \usepackage{foo} in the beginning of the document.
User install
This method creates a personal texmf tree to your home folder. The files are installed only to the original user.
Create the directory structure:
mkdir -p ~/texmf/tex/latex/foo
It's a good idea to create separate subdirectories in latex for different custom packages. Copy the newly generated foo.tex to your tree. After this, update the LaTeX package cache with
texhash ~/texmf
System install
This method installs the package in the LaTeX system tree. The new package is available to all users.
Create a new directory as root
mkdir /usr/share/texmf/tex/latex/foo
Copy the new LaTeX package foo.tex to the new folder, and update the LaTeX package cache
texhash
Basic usage
First, make sure the texlive-binaries package is installed.
Create or edit an input file file.tex
- Running LaTeX
latex file.tex
will create a .dvi file which can be opened using xdvi.
- You can also produce a PDF directly using:
pdflatex file.tex
Editors
LaTeX files are plain text files and thus can be edited with any text editor, like nano, vim or emacs. In addition text editors such as Visual Studio Code can edit LaTeX files using extensions such as LaTex Workshop. There are also GUI editors, which make editing and compiling the document more user friendly.
Documentation
- Documentation is available through specific packages, e.g.:
Documentation for specific latex package or commands is then accessible using DebianManPages:texdoc or DebianManPages:texdoctk programs, e.g.:
texdoc makeindex texdoc graphicx