0

I have written a package and placed it in the same directory as e.g. latex.ltx. However, TeXShop just won't load it, or rather, XeLaTeX and pdfTeX called through TeXShop won't. If I, however, on the file not found error, type:

/usr/local/texlive/2013/texmf-dist/tex/latex/base/mworx.sty

on the Console, the file is found and loaded. And that path is the same as to size10.clo, the first file I see loaded. Why exactly is XeLaTeX doing what appears to be looking for the file only in the .tex file's directory?

MickG
  • 5,426

1 Answers1

3

You shouldn't put new packages into the texmf-dist tree; they'll potentially be overwritten by distribution updates. (Or more likely will just be forgotten when your upgrade to MacTeX2015 or whatever.)

Since you're on a Mac, the appropriate place to add (LaTeX) package files is

~/Library/texmf/tex/latex/

The reason why putting the file into texmf-dist in seemingly the correct place didn't result in TeX being able to find the file is because kpathsea, which TeX uses to find files, does not search folders dynamically for performance reasons.

The configuration file texmf.cnf, however, makes special consideration for the "home" texmf tree linked above — since this tree will (usually) be quite small, there is little performance penalty to searching the disk when attempting to find files there.

There is also another "allocated" location to put files into your TeX distribution:

/usr/local/texlive/texmf-local

If you put files here, which will be found by all users of the computer (as opposed to the ~/Library/texmf tree), it's necessary to inform kpathsea to update its database of files using the Terminal command:

sudo texhash