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
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:
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.
The location of the "private tree" is normally, with MacTeX,
to which the (pseudo)variable
(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.cnfso the first to be read in when a TeX program is launched; the system is set up so that no variable is clobbered when other
texmf.cnffiles 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 set
I tested it and files are found in both locations (precedence to
~/private/texmf). You don't need to run
mktexlsrafter adding files to the private tree or trees. However, you have to properly create a structure in the tree; a file such as
wonderfulpackage.stycan 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/texmfit will not be found by LaTeX.