TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using TeXLive in Linux and want to learn and experiment. How can I list available document classes in my installation?

share|improve this question
Welcome to TeX.SX! Usually, we don't put a greeting or a “thank you” in our posts. While this might seem strange at first, it is not a sign of lack of politeness, but rather part of our trying to keep everything very concise. Accepting and upvoting answers is the preferred way here to say “thank you” to users who helped you. – Holene May 19 '13 at 7:26
OK, good to know! – user30898 May 19 '13 at 7:32
You can do this by a simple script which finds all files in the installation path with the extension .cls – Marco Daniel May 19 '13 at 7:33
OK, so there is no built-in command for this? – user30898 May 19 '13 at 7:41
up vote 4 down vote accepted

TeX Live maintains some text files where all packages/classes etc. are listed. The files are called ls-R and there's one for each main tree. In order to find all installed document classes in your main path you can do the following command:

grep "\.cls" `kpsewhich --var-value TEXMFDIST`/ls-R > $HOME/allcls.txt

After this process you have a file allcls.txt in you home directory with all existent document classes.

share|improve this answer
The location may not be correct. For example, on my Mac kpsewhich --var-value TEXMFMAIN gives /usr/local/texlive/2012/texmf, but you want /usr/local/texlive/2012/texmf-dist. – Joseph Wright May 19 '13 at 8:10
Fine, I got it. Thanks. – user30898 May 19 '13 at 8:13
find `kpsewhich --var-value TEXMFDIST` -name *.cls

and if you have also a local tree:

find `kpsewhich --var-value TEXMFLOCAL` -name *.cls
share|improve this answer
This is slow ;-) – Marco Daniel May 19 '13 at 8:14

Your Answer


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