Manually installing LaTeX packages under Kubuntu 10.04

Today I wanted to install the algorithms package for LaTeX under Kubuntu to get some neat pseudo code into my thesis. I found an article that explains how to install LaTeX packages manually to a directory in your $HOME for Ubuntu in the documenatation but it didn’t work for me that way under Kubuntu 10.04. I still got the following error message:

! LaTeX Error: File `algorithms.sty' not found.

Another article for Ubuntu describing how to install to a global directory didn’t work either and assumed you had a .sty file already, but combining the two and slightly changing the path finally worked out.

So here’s what I did: I downloaded the package from CTAN, it came as a zip with various files but no INSTALL file and no .sty files were included. As described on that Ubuntu page, you have to run latex on the .ins file to generate the .sty file in that case:

cd ~/downloads/
cd algorithms/
latex algorithms.ins

This will produce two sty files for the algorithms package: algorithm.sty and algorithmic.sty, as explained in the README file for that package. Now that we have these files, we need to create a directory in the proper location and copy the files into it:

sudo mkdir /usr/share/texmf/tex/latex/algorithms/
sudo cp *.sty /usr/share/texmf/tex/latex/algorithms/
sudo mktexlsr

Don’t forget the last command, it tells latex where to find the files! The package should now be ready for use.

Btw, I figured out the path /usr/local/share/texmf/ by running mktexlsr. It tells you all the paths it checks for updated packages it seems. For me it said:
sudo mktexlsr
mktexlsr: Updating /usr/local/share/texmf/ls-R…
mktexlsr: Updating /var/lib/texmf/ls-R-TEXMFMAIN…
mktexlsr: Updating /var/lib/texmf/ls-R-TEXLIVE…
mktexlsr: Updating /var/lib/texmf/ls-R…
mktexlsr: Done.


About dfspspirit

PhD student in bioinformatics, interested in photography, level design, digital image manipulation, architecture and, of course, bioinformatics.
This entry was posted in latex, linux and tagged , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s