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
Job done!
Dear Hannah,
your routine still works great. Thanks for posting it!
Best wishes from Germany
/Benedikt
Thank you for this post, Hannah! It was the only one on the first Googe results page that actually worked for me.
Best regards from Chubut, Argentina.
Luciano.
Thank you so much. This is going in the bookmarks.
Thank you for the tip Hannah – I’m just starting out with Latex, so this was a real time saver! Just to be cautious, I chown’d my Tex dirs so that I didn’t need sudo.
<3 Thanks!
As Andy, this goes to my bookmarks.
Worked like a charm :-) Thank you so much