Install Tex Live 2012
The default LaTeX version (the one you find in the repository) for Ubuntu 12.04 LTS is Tex Live 2009. For most purposes, the Tex Live 2009 version is fine, and I would suggest using the repository version to make your life easier. However, I want to use the latest elements of pgf and pgfplots for creating graphics and plots, so I need a current Tex Live install. Previously I have done this manually, but it seems there is now an “official backport” of Tex Live 2012 —
NOTE — this all assumes that you have NOT already added the LaTeX version from the repository. If you have, you will have to do slightly different commands. Again, see here.
Using the information for the links above, we first add the ppa, then update and install (as always, enter each line separately):
sudo apt-add-repository ppa:texlive-backports/ppa sudo apt-get update sudo apt-get install texlive
I needed to install the fonts-extra, not found in the ppa — reflected, in may case, by LaTeX not finding bbm.sty.
sudo apt-get install texlive-fonts-extra
Unfortunately, this is not a full distrbution and many packages are not included. I will add details for adding specific packages here. In general, the install process is pretty simple.
The pgfplots website is here, and provides a download link. This provides a zip archive, in my case: pgfplots_1.6.1.tds.zip
Using ideas from the pgfplots manual, and this nice blog entry, we do the following:
- Create a directory in the LaTeX search path:
mkdir -p ~/texmf/tex/latex
- Unzip the contents of the package, downloaded above, in this directory.
- The pgfplots manual suggests that you run texhash at this point:
Adding other packages is the same as above, except there is no need to create the ~/texmf/tex/latex directory. Just find the package, place the unzipped folder in ~/texmf/tex/latex, and run
sudo texhash, as above.