tags:

views:

2742

answers:

4

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.

A: 

This page on LaTeX packages says you'll need to install the .sty file in the LaTeX installation directory (my installation of Ubuntu seems to be /usr/share/texmf-texlive/tex/latex/), or you need to have a copy of the .sty file in each file containing LaTeX source -- i.e. in your tex/documents folder, at the very least.

Mark Rushakoff
+2  A: 

You can put style files in ~/texmf/tex/ and standard LaTeX distributions should find them. If you prefer to install them system-wide, you can put them in the corresponding texmf/tex folder within your LaTeX installation (the location of this installation on OS X varies depending on which LaTeX distribution you used).

You can use tlmgr conf at the command line to list all of the distribution configuration information. The TEXMFHOME variable gives the path to your texmf tree.

Barry Wark
`~/Library/texmf/tex/latex/` is the place to put it in MacTeX.
Will Robertson
Thanks, Will. The inconsistency in texmf, especially on the Mac, is a bummer. The ~/texmf/... works for Unix-y installations (like from Fink or MacPorts), so thanks for adding info about MacTeX.
Barry Wark
Wasn't there some command that tells you the location?
Yes, `tlmgr conf`. I'll edit the answer to include that info.
Barry Wark
+3  A: 

Or you can just put the style file in the same directory as your document instead of in "support." now... if you're on OS X, you should probably be using texlive 2008. If you are using texlive 2008, pop open a terminal and type:

sudo tlmgr install todonotes

replace "todonotes" with the package name you want to install.

Mica
And the nicest way to install TeXLive 2008 on Mac OS X is MacTeX: https://www.tug.org/mactex/ MacTeX includes the TeX Live Utility, which is a native Mac OS X graphical interface for tlmgr.
las3rjock
or if you have perl/tk installed, in the terminal type: sudo tlmgr --gui
Mica
+1  A: 

As said before just put the custom .sty into ~/texmf/tex or in /usr/share/texmf-texlive/tex/ but don’t forget to run mktexlsr or texhash to update the local package database of LaTeX. Otherwise LaTeX won’t find it at all, unless it is in the same directory of the processed file.

Frakturfreak