James A. Rosen
James A. Rosen

Reputation: 65242

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

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.

Upvotes: 60

Views: 109771

Answers (7)

Bose
Bose

Reputation: 1

I tried this one it is works for me:

sudo apt-get install texlive-full.

Upvotes: -6

D.Deriso
D.Deriso

Reputation: 4397

I had this issue using BasicTex 2015 and none of the above solved it, so I wrote up a solution here

In short: sudo tlmgr install preprint will fix it and kpsewhich fullpage.sty will confirm the fix

Upvotes: 2

felix marin
felix marin

Reputation: 586

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 )

Upvotes: 57

Barry Wark
Barry Wark

Reputation: 107754

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.

Upvotes: 12

Frakturfreak
Frakturfreak

Reputation: 81

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.

Upvotes: 4

Mica
Mica

Reputation: 19617

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.

Upvotes: 41

Mark Rushakoff
Mark Rushakoff

Reputation: 258228

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.

Upvotes: 0

Related Questions