Adding a new package to a latex install on linux
January 5, 2012 - Geekiness
Each time I reinstall linux or change machines, I find myself having to add a bunch of latex packages and style files. I quite often forget exactly how to do this, so here’s a quick guide to installing latex packages for anyone else struggling with the details and also for my future self, next time I upgrade.
- Get the package that you want from the Comprehensive Tex Archive Network CTAN http://ctan.org/; for example, if you want the remarkably useful package multibib (allows multiple bibliographies in one document) go here http://ctan.org/tex-archive/macros/latex/contrib/multibib.
- Download and unzip the zip file containing the entire package
- Run latex on the .ins file, which should create a file called .sty
hannah@pear $ latex multibib.ins
- Make a directory for it to go in in your texmf tree
hannah@pear $ sudo mkdir /usr/share/texmf/tex/latex/multibib
- Put it in that directory
hannah@pear $ sudo cp multibib.sty /usr/share/texmf/tex/latex/multibib
- Run texhash to tell LaTeX to update itself so it finds the new package
hannah@pear $ sudo texhash