Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Newbie here, just inherited a large (250+ page) doc written in LaTeX after the previous author left the company. Is there an easy way to determine all the LaTeX packages installed on my system? I'm using Ubuntu 12.10 as a workstation and I installed texlive-full and a couple other packages when I was initially trying out LaTeX.

I got a list of the packages that the project uses from the .tex file, so I know which packages I need. But it seems like there are multiple places on my system where packages were installed, so I'm having problems figuring out if the necessary packages are all there. Is it possible to get a full list of all LaTeX packages installed? Or even a list of all locations where the packages are stored would be enough. It seems like there are packages installed in multiple locations across my system, so I can't just simply look under the texmf folder.

Before I start installing the additional packages from CTAN, I'd really like to make sure I'm not duplicating any of them...

Apologies for what I'm sure is a silly question, but I looked and looked online for an answer and wasn't able to dig up anything. Your help is greatly appreciated in maintaining my sanity here. :)

Thanks, -Colin

share|improve this question
4  
Welcome to the site! Doesn't sound like a silly question to me :) How about something like cd / and then find -name "*.sty" It's generally best to use the in-built package manager to install packages, rather than doing it manually, as demonstrated in (for example) How do I update my TeX distribution? –  cmhughes Jul 22 '13 at 20:48
1  
Thanks for the quick response! I saw references to using 'tlmgr' to manage the packages, but it looks like the default Ubuntu apt-get install of Texlive doesn't include tlmgr. Would it be best to uninstall the Ubuntu TexLive install and then install TexLive directly from the source? If that would allow me to use tlmgr to take care of the packages, that would probably be worth it. –  Colin Torretta Jul 22 '13 at 21:11
1  
yes, that's what I would do: How to install "vanilla" TeXLive on Debian or Ubuntu? –  cmhughes Jul 23 '13 at 8:14
    
Is simply running pdflatex filename a bad idea? –  Jim Hefferon Jul 23 '13 at 10:33

2 Answers 2

up vote 8 down vote accepted

You can find all locations that TeX will search for files using

kpsepath tex

The format is a bit weird: items are separated by colons, directories that should be searched using a ls-R index file start with !!, directories to be searched recursively end with //. To clean it up, we can process the output a bit:

kpsepath tex | tr ':' '\n' | perl -ne 'm-^(!!)?(/.*?)(//)?$- && print "$2\n"'

For each of those paths, you can find out which installed packages have put files under those paths using dlocate:

dlocate --package-only /path

(if you don't have dlocate, install it and make sure to run sudo update-dlocatedb). Putting it all together and eliminating duplicate package names from the output:

kpsepath tex | tr ':' '\n' | perl -ne 'm-^(!!)?(/.*?)(//)?$- && print "$2\n"' | while read path; do dlocate --package-only $path ; done | sort -u

For example, on my system, that prints:

asymptote
cm-super-minimal
context
dblatex
feynmf
gnuplot-x11
latex-beamer
latex-cjk-common
latex-make
latex-xcolor
latex2html
lgrind
lilypond-data
lmodern
pgf
preview-latex-style
tex-common
tex-gyre
tex4ht-common
texinfo
texlive-base
texlive-bibtex-extra
texlive-extra-utils
texlive-font-utils
texlive-fonts-extra
texlive-fonts-recommended
texlive-generic-recommended
texlive-lang-other
texlive-latex-base
texlive-latex-extra
texlive-latex-recommended
texlive-luatex
texlive-math-extra
texlive-metapost
texlive-pictures
texlive-pstricks
texlive-science
texlive-xetex
texpower
tipa

There's some stuff there that I wouldn't have expected, like gnuplot-x11, but dpkg -L shows that it includes a gnuplot-lua-tikz.sty. Who knew?!

share|improve this answer
1  
+1. But this doesn't actually tell you which individual packages are installed since all those texlive- packages include several (or many) individual packages. –  jon Jul 22 '13 at 22:05
    
True. It shows you which "Ubuntu packages" were installed, which may themselves contain many "LaTeX packages". If you want the latter, you can see the full contents of each "Ubuntu package" with "dpkg -L packagename". –  Jim Paris Jul 22 '13 at 22:06

I am very reluctant to install anything that is not in official packages from a Linux distribution, but LaTeX and R are the exceptions that confirm my rule.

As Ubuntu packages for LaTeX could be outdated, the list of Ubuntu packages is not the list of LaTeX packages, and not all TeX Live stuff are available from .deb packages (notably tlmgr), I think that the best way to control what is already installed is:

  1. Uninstall all the .deb packages related with LaTeX.
  2. Install the recent TeX Live 2013 followings instructions from www.tug.org.
  3. Then, you can obtain easily the list with: tlmgr list | more and detailed information for specific packages (for example: tlmgr info xcolor)

I do not think that obtain that list justifies the download of some gigabytes and change the installation, but it is a good excuse to have tlmgr so you can update and install all the latest TeX Live packages that you will need.

share|improve this answer
1  
The TeX Live repository of Ubuntu is pretty decent, I tend to install everything tex-full to avoid problems later. If for some reason it is older than what you expect (typical pgfplots) there are Launchpad versions that are more updated. I never had to deal with the tlmgr. –  alfC Jul 23 '13 at 1:22
    
@alfC Despite the name, texlive-full is not the full TeX Live, is metapackage to install about 150 Ubuntu packages, roughly 1.2Gb, surely a decent collection more that enough for many users, but this is far from the really full TeX Live 2013, with a ISO around 2.4Gb. –  Fran Jul 23 '13 at 12:22
    
The sizes in HD will be about twice those of .deb packages or the ISO image. In my HD the apt-get install texlive-full will take 2312 MB of space but /usr/local/texlive/2013 have 3764 MB. –  Fran Jul 23 '13 at 16:52
    
@alfC, In my short experience I never found something missing in texlive-full that is not on TeX live. The only problem I had was with versions, up to Ubuntu 12.04, TeXLive was 2009, bit outdated. Now the situation improved a lot. –  alfC Jul 23 '13 at 17:14
1  
@giordano mostly off-topic ;-) –  Fran Jul 23 '13 at 17:49

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.