adding latex packages 

Newsgroups:  gmane.linux.debian.user
Date:        Sun, 06 Mar 2005 20:57:55 GMT
> I would like to use more LaTeX packages downloaded from CTAN which are
> not available as debian packages. What is the correct way to install
> them on debian? For example I have seen some packages installed in

I can't say what THE correct way is, but I can tell you what works for me. I have the following lines in my ~/.bashrc file:

# see http://www.ctan.org/installationadvice/
export BSTINPUTS="${HOME}/.local/texmf//:$BSTINPUTS"
export TEXINPUTS="${HOME}/.local/texmf//:$TEXINPUTS"

Then I follow the conventions for the subdirectories there:

/home/adam $ tree .local/texmf/tex/latex/
..local/texmf/tex/latex/
|-- covington
|   |-- covington.sty
|   `-- covington.tex
|-- gb4e
|   |-- cgloss4e.sty
|   |-- gb4e-doc.tex
|   `-- gb4e.sty
|-- harvard
|   `-- harvard.sty
`-- qtree
    `-- qtree.sty

This way my customizations are in my home directory rather than mixed in with the stuff that comes from the Debian packages, and they are easy to back up as well as to copy to another machine.

I also use this on a machine at work on which I do not have root access and which has some out-of-date LaTeX packages. The order of my BSTINPUTS and TEXINPUTS paths means that LaTeX will find my custom file rather than one in /usr/share/texmf/… with the same name.

Adam Funk

adding latex packages 

> I would like to use more LaTeX packages downloaded from CTAN [...]

Don't put them in /usr/share/texmf, because texmf "owns" that directory— anything you put there could be removed or overwritten as you install or update your TeX packages. Here's what to do:

  • Edit /etc/texmf/texmf.d/05TeXMF.cnf, to make sure TEXMFLOCAL includes /usr/local/share/texmf.

    $ grep local/share /etc/texmf/texmf.d/05TeXMF.cnf
    TEXMFLOCAL = /usr/local/share/texmf
  • If you modified anything in /etc/texmf/texmf.d, then run update-texmf to regenerate /etc/texmf/texmf.cnf.
  • Now put your local TeX customizations into /usr/local/share/texmf.
  • Any time you change the contents of /usr/local/share/texmf, run texhash to update the filename database (ls-R).

The above is for system-wide customizations. Individual users who have private (TDS-compliant) texmf trees that they wish to use can either just put them in $HOME/texmf, in which case they'll be found automatically; or else set the environment variable HOMETEXMF to point to them. HOMETEXMF contains a :-separated list of texmf trees. No trailing // or : is needed. It can also include the syntax

Andrew Schulman

adding latex packages 

> I just throw the .sty files into /usr/local/share/texmf/tex/latex/misc and
> run texhash as root.

The "correct way" is to put the files required by each package and/or class in its own directory. The memoir class, for example, is supposed to go in

/usr/local/share/texmf/tex/latex/memoir

However, just because it's the "correct way" doesn't mean one must do it that way.

> Seems to work; others have suggested editing config
> files, but believe they are already set up correctly by the debs.

They are. The TeTeX configuration file already has entries for /usr/local/share and ~/share/. The only requirement seem to be running texhash afterward.

It's also possible to configure a private TeX configuration: the TeX FAQ has the details on all these methods.

Jules Dubois