Super User is a question and answer site for computer enthusiasts and power users. 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

Having TeXLive installed on my Mac, I frequently need to consult documentation for some of the packages. It seems silly to Google this when I have the PDFs all on my HDD in /usr/local/texlive/2011/texmf-dist/doc , so I want to be able to use Spotlight to search for them. However, I can't get Spotlight to cooperate. I tried

mdimport /usr/local/texlive/2011/texmf-dist/doc

which then does some work, but afterwards doesn't display any results in Spotlight. I've also added the folder in Alfred's search scope to no avail. Any ideas?

share|improve this question
up vote 2 down vote accepted

Files in /usr/ are scanned by Spotlight but just not included in the normal search results.

AFAIK there's no way to include files treated as system files in the Spotlight menu. But you can include them in Finder:

or create a search filter for searching for system files in Alfred:

or use mdfind:

mdfind -onlyin /usr/local/texlive/2011/texmf-dist/doc "search phrase"
share|improve this answer
That works. Thanks! – Teake Nutma Jul 1 '12 at 15:14

I know this is not a real solution, but I would move the /usr/local/texlive/2011/texmf-dist/doc directory to /Users/yourusername/Documents/TeXLiveDocs.

share|improve this answer
That would do the trick, but I'd rather keep my TeXLive distribution intact and avoid duplicate files. – Teake Nutma Jul 1 '12 at 13:32
could it be sufficient to create a symlink to the directory somewhere else and let spotlight index the linked "directory"?? – MostlyHarmless Jan 8 '15 at 3:00

Try the -f (folder flag) when invoking mdimport:

$ mdimport -f /usr/local/texlive/2011/texmf-dist/doc
share|improve this answer
Afaik that flag is for 10.4 and below, and has been deprecated in Leopard and above. – Teake Nutma Jul 1 '12 at 15:12
As per man mdimport: NOTES The -f switch is obsolete in Leopard and beyond.. – Daniel Beck Jul 14 '12 at 15:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .