I've been trying to generate a list of all packages that can be accessed using the \usepackage command in LaTeX & others (so it can be autocompleted by my text editor). Specifically, I've been using the command tlmgr list --only-installed and parsing the output. However, I've noticed that several (key) packages are missing from the output. For example, tikz, graphicx, lmodern and some others are not present.

At first, I used the answer given here to manually add the missing packages to the list. However, I noticed that tikz was also missing from the output. Now I have no idea which packages may be omitted, even though they are installed. To make things worse, it seems there are several "packages" that are not actually meant to be used as packages. David Carlisle's answer to the linked question explains that tlmgr treats packages differently to LaTeX, which only makes things harder.

Is there a tlmgr terminal command that will print a list of all packages that can be \usepackage'd in a .tex file (pdftex, luatex, xetex, etc. differences are not important)?

If not, is there any way at all to do this? The goal is to make it cross platform too, so a solution should be adaptable to Linux, macOS, and Windows. I have not tried MikTeX yet, but it needs to work with a standard TeX Live installation.

Finally, short of that solution, is there an exhaustive list of packages that are omitted?

  • You could search all folders known to TeX for *.sty files and sort this list. – Skillmon Jan 14 '18 at 22:43
  • Do you get an error from tlmgr list --only-installed? I do. – cfr Jan 15 '18 at 3:18
  • @cfr No, no error. I think I set permissions up leniently when I installed, so that could be it. – Benjamin Gray Jan 15 '18 at 3:19
  • Are you using Windows? – cfr Jan 15 '18 at 3:19
  • No, macOS. But it works on Windows too. – Benjamin Gray Jan 15 '18 at 3:21
tlmgr search --file '.*\.sty'

Note that this will find files installed with tlmgr. I assume, from your question, that it is these you are interested in. Obviously, other .sty files may be available locally, in addition to those installed with tlmgr, but, equally obviously, tlmgr knows nothing about those.

  • This still doesn't find the missing packages. The biggest problem with the tlmgr search was that I didn't know which were missing. I've resorted to recursively searching /usr/local/texlive/2017/texmf-dist/tex/latex (I'll add local package support a different way), but it would be nice if the output came with a small summary of the package's purpose, like the tlmgr list --only-installed does. – Benjamin Gray Jan 15 '18 at 2:03
  • @BenjaminGray What does it not find? You wanted to find everything you can use \usepackage{} with i.e. .sty files. Which .sty file installed by TL does it not find? – cfr Jan 15 '18 at 2:59
  • Sorry, I didn't see them as part of a file path. They are there. – Benjamin Gray Jan 15 '18 at 3:02
  • @BenjaminGray I ran a comparison with find. The command I gave finds everything find finds. In addition, it finds some other files which I guess it classifies as of type .sty, even though they do not have this extension. (It seems to find anything with a .sty in it, even if it is not the extension.) – cfr Jan 15 '18 at 3:10
  • Also, your question didn't say anything about a 'small summary of the package's purpose'. It doesn't really make sense to ask for that for each .sty file, because some of them have no stand-alone purpose. For example, a package in the install-sense may contain several .sty files (if any). I start to think this is an XY problem. I guess I'm no longer clear what you're trying to do at all. – cfr Jan 15 '18 at 3:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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