Search LaTeX documentation with Alfred

alfredlatexpdfspotlight

I'm using Alfred v2 on Mavericks. I would like to use it to quickly locate documentation of LaTeX packages (PDF files). I have TeXLive 2014 installed in /usr/local/texlive/2014. I added /usr/local/texlive/2014/texmf-dist/doc/latex to Alfred's search scope, but I'm not having any success. I tried searching using open and the backtick (file search) to no avail. I tried rebuilding the OSX metadata, but not joy there either. The locate command-line utility quickly finds the files in question, e.g.:

$ locate thmtools.pdf
/usr/local/texlive/2014/texmf-dist/doc/latex/thmtools/thmtools.pdf

I should add that Spotlight can't find the files either. Is it a matter of permissions?

$ ll /usr/local/texlive/
total 0
drwxr-xr-x  20 root  wheel   680B Sep 21 11:51 2014

Thanks for any hint!

Best Answer

(1) Ready Alfred to accept a terminal command. Per this support document, the standard method is to type > and then the terminal command. Similarly, in LaunchBar the action is built into the basic index, too, and one can initiate it with term or similar.

(2) Type texdoc PackageName where PackageName is the LaTeX package you're looking for the documentation for. For example: texdoc enumitem or texdoc thmtools.

It'll open the documentation PDF. That's it!

Note that of course you can also do this from the command line directly if you open a terminal window.