I'm venturing into writing my own packages, but LaTeX is not finding them.
I working on a iMac OS X, but I don't want to use TEXMFHOME=~/Library/texmf
. I would like to put my packages in a different directory: for the sake of this post let's call it ~/private/texmf
.
My TEXINPUTS
is set as TEXINPUTS=.:~/private/texmf//:
and works perfectly well for standard .tex
files. But when I place a new .sty
file in these directories, LaTeX complains that they can't be found.
I've tried numerous things. The two most notable are:
- Setting
TEXMFHOME=~/private/texmf:~Library/texmf
- Setting
TEXMFHOME=~/private/texmf
Both times, I've entered ~/private/texmf
and run sudo texhash
to update everything (I've never had to do this before). I've moved to the directory in which my packages are located ~/private/texmf/tex/latex/packages/
and called texhash
again. All to no avail.
I've search the web and this site for clues about what to do:
-
Where do I place my own .sty files, to make them available to all my .tex files?
-
How to access style files in texlive-publishers from Kile
What's mentioned above is what seemed to be suggested at various different sites. Nothing's working.
Help.
Best Answer
The location of the "private tree" is normally, with MacTeX,
to which the (pseudo)variable
TEXMFHOME
points:(I only masked my real user name on this machine). If you try
you'll get on your screen something like
The last line doesn't belong to the file, it just shows its location. This file is the top level
texmf.cnf
so the first to be read in when a TeX program is launched; the system is set up so that no variable is clobbered when othertexmf.cnf
files are input.Thus what you have to do is simply editing that file
(use whatever editor you prefer instead of
nano
); for instance, you might want to setI tested it and files are found in both locations (precedence to
~/private/texmf
). You don't need to runtexhash
ormktexlsr
after adding files to the private tree or trees. However, you have to properly create a structure in the tree; a file such aswonderfulpackage.sty
can be found by LaTeX only if it's stored as(the last subdivision, that is, the directory
wonderfulpackage
) is optional, but its usage is recommended for later maintenance. If you put the file just at~/private/texmf
it will not be found by LaTeX.