How do I install a LaTeX .sty file on OSX?

James A. Rosen picture James A. Rosen · Sep 7, 2009 · Viewed 95.1k times · Source

I have a LaTeX project set up:

tex/
  - documents/
      - some_file.tex
  - support/
      - todonotes.sty

where some_file.tex uses todonotes:

\usepackage[colorinlistoftodos,textwidth=0.9\marginparwidth]{todonotes}

But I get "LaTeX Error: File `todonotes.sty' not found" when I try to build the PDF in TextMate. How do I tell LaTex or TextMate about my .sty file?

Later

To be specific, I'm using tetex from MacPorts, though given the answers so far, I might try another distribution.

Answer

felix marin picture felix marin · Apr 27, 2011

In Mac OS X (Snow Leopard 10.6.7) put your .sty file in

/usr/local/texlive/2010basic/texmf-dist/tex/latex/base/

Then, run texhash command. Don't forget to stay as a root user (like sudo -s )