Search /usr/local/texlive directory with Spotlight

4

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?

Teake Nutma

Posted 2012-07-01T10:51:52.267

Reputation: 143

Answers

2

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"

Lri

Posted 2012-07-01T10:51:52.267

Reputation: 34 501

1

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.

mattinsalto

Posted 2012-07-01T10:51:52.267

Reputation: 111

could it be sufficient to create a symlink to the directory somewhere else and let spotlight index the linked "directory"?? – MostlyHarmless – 2015-01-08T03:00:41.377

1That would do the trick, but I'd rather keep my TeXLive distribution intact and avoid duplicate files. – Teake Nutma – 2012-07-01T13:32:09.070

0

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

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

mattinsalto

Posted 2012-07-01T10:51:52.267

Reputation: 111

1Afaik that flag is for 10.4 and below, and has been deprecated in Leopard and above. – Teake Nutma – 2012-07-01T15:12:44.677

As per man mdimport: NOTES The -f switch is obsolete in Leopard and beyond.. – Daniel Beck – 2012-07-14T15:49:42.763