Translation(s): Deutsch - English - Fran├žais - Italiano

(!) ?Discussion

This page describes how to set up a LaTeX distribution on Debian.


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:

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


Basic usage

First, make sure the texlive-binaries package is installed.

  1. Create or edit an input file file.tex

  2. Running LaTeX
     latex file.tex

    will create a .dvi file which can be opened using xdvi.

  3. You can also produce a PDF directly using:
     pdflatex file.tex


LaTeX files are plain text files and thus can be edited with any text editor, like nano, vim or emacs. There are also GUI editors, which make editing and compiling the document more user friendly.


texdoc makeindex
texdoc graphicx

See also