User Tools

Site Tools


osxspotlighttex

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

osxspotlighttex [2008/02/12 14:08] (current)
kleiner created
Line 1: Line 1:
 +====== Configuring Spotlight to index TeX files ======
 +If you've found yourself unable to search for text contained inside .tex files through OS X spotlight, here is a solution:
 +
 +Go [[http://​www.spookyhill.net/​norms-computing/​latex-for-academics/​|here]] and download the TeX mdimporter ([[http://​www.spookyhill.net/​wp-content/​files/​TeX.mdimporter.tgz|direct download link]]) An mdimporter is a plugin that tells Spotlight how to index a specific file type.
 +
 +To install the mdimporter, extract the archive into the directory ''​~/​Library/​Spotlight'':​
 +  $ mkdir ~/​Library/​Spotlight ​  # (if the directory doesn'​t exist yet)
 +  $ tar xvfz TeX.mdimporter.tgz -C ~/​Library/​Spotlight
 +Now you have to let OS X know about the new mdimporter. To do so, open a terminal window and enter:
 +  $ mdimport -r ~/​Library/​Spotlight/​TeX.mdimporter
 +To make sure everything is indexed, you may want to restart your computer. Also, to tell spotlight explicitly to add all ''​.tex''​ files in a directory (and its subdirectories),​ you can use the following command:
 +  $ find <​directory where tex files reside> -name '​*.tex'​ | xargs -n1 mdimport
 +Example:
 +  $ find /​Users/​marius/​Work -name '​*.tex'​ | xargs -n1 mdimport
  
osxspotlighttex.txt ยท Last modified: 2008/02/12 14:08 by kleiner