Home Page

Tips page

University Page


Debian & Linux

Some works

About me

Del.icio.us Bookmarks

BOINC Combined Statistics

Site Statistics

Contact me sending an e-mail (antispam defense activated)


hacker emblem



View Sandro Tosi's profile on LinkedIn

This is my Google PageRank

LaTeX Configuration on Debian

LaTeX Configuration on Debian

 Sandro Tosi, 08 December 2005

Using LaTeX typesetting system is a great experience, until you crash against one of many walls of its configuration. I'll try to put here some tips about LaTeX configuration on a Debian system.

Add a new package

Standard LaTeX distributions contains many packages, but not everyone! So, sometimes you'll find in need to install a new packages, maybe downloaded from Internet. Many, many packages are available in CTAN, where you can search the packet you need.

Ok, you've downloaded the addon, but how to install it? Let's take the example of listings, a package to include formatted source code (syntax highlight etc.). Once downloaded and uncompressed, we got this:

$ ls -l
total 1356
-rw-rw-r--  1 morph morph 605114 2004-09-07 13:00 listings-1.3.dtx
-rw-rw-r--  1 morph morph  12232 2004-09-07 13:31 listings-1.3.ind
-rw-rw-r--  1 morph morph   1151 2004-09-07 12:28 listings-1.3.ins
-rw-rw-r--  1 morph morph 489351 2004-09-07 13:29 listings-1.3.pdf
-rw-rw-r--  1 morph morph 241645 2004-09-07 12:28 lstdrvrs-1.3.dtx
-rw-rw-r--  1 morph morph  13578 2004-10-17 10:17 lstpatch.sty
-rw-rw-r--  1 morph morph    553 2004-09-07 13:22 README

We see no .sty file, the compiled version of a packages, so we have to compile it by ourselves (if your new package comes already compiled, you can jump this part):

$ latex listings-1.3.ins

at the end of this command, the script kindly advice us that:

* You probably need to move all created `.sty' and `.cfg'
* files into a directory searched by TeX.
* And don't forget to refresh your filename database
* if your TeX distribution uses such a database.

and so we are going to do.

Now we need a directory where copy our generated files; there are two choices: a user local directory or a system-wide one. Every tex system has a system directory for new files:

# grep -i '^texmflocal' /usr/share/texmf/web2c/texmf.cnf
TEXMFLOCAL = /usr/local/share/texmf

for a user own directory, you can do:

$ mkdir ~/texmf
$ export HOMETEXMF=".:~/texmf"

Note that both this directory must respect the same tree structure of the standard one: so the packages for TeX must go into <texmf>/tex and the ones for LaTeX must go into <texmf>/tex/latex . Usually, under those directories, another one is created with the name of the package, to maintain all things in order.

Copied the files the last step is refresh the LaTeX archive (run as root):

# texhash

and new you are able to use this brand new package.

Some more informations are available here and here (more in general under the section Installing (La)TeX files of TeX Frequently Asked Questions).