[tex-live] [FEATURE REQUEST] support for additional user texmf trees

Zdenek Wagner zdenek.wagner at gmail.com
Wed Feb 22 15:19:55 CET 2012

2012/2/22 Vladimir Lomov <lomov.vl at gmail.com>:
> Hello,
> some time ago I asked question about how to add support for additional user
> texmf trees. I found how to accomplish such task. This is what I did:
I do this without the need of having any patch. The comments in the
root texmf.cnf say that this file should contain only differences from
the texmf/web2c/texmf.cnf. This is my place. I copy the definitions of
TEXMF and TEXMFDBS. Afterwards I insert my texmf trees in the order
which I like. I have a copy of this file in a special subdirectory of
texmf-local that is not recognized by TeX Live. When a new TL version
arrives, I just copy the file. The definition relies on symbolic names
defined elsewhere in texmf.cnf so that TEXMF and TEXMFDBS rarely
changes. And as an additional sugar, I have it in my private svn
repository, I have separate directory for each of my computers (I do
not install everything on all computers) and I have a script that
copies automatically the correct local texmf.cnf to an active TL
directory according to hostname.

> 1. took sources (rsync from svn)
> 2. made changes in files texk/kpathsea/{cnf-to-pathis.awk,texmf.cnf}
> (patch is attached)
> 3. compiled (cd XXX/Build/source; TL_WORKDIR=$HOST-build ./Build)
> == Testing ==
> 1. Open new terminal, do
> $ export
> PATH=$HOME/tmp/tex-live/Build/source/inst/bin/x86_64-unknown-linux-gnu:$PATH
> 2. Create $HOME/private/texmf/ tree and put there mtpro2 files.
> 3. Create $HOME/texmf.cnf with following content:
> <file>
> TEXMFHOME=$HOME/texmf;$HOME/private/texmf
> TEXMFUSER=$HOME/tmp/test
> </file>
> The last entry is just for test purpose.
> 4. Checking that files in additional texmf tree can be found, checking that
> variables defined in $HOME/texmf.cnf are known
> $ which kpsewhich
> $HOME/tmp/tex-live/Build/source/inst/bin/x86_64-unknown-linux-gnu/kpsewhich
> $ $(which kpsewhich) mtpro2.sty
> $HOME/private/texmf/tex/latex/mtpro2/mtpro2.sty
> $ $(which kpsexpand) '$TEXMFHOME'
> $HOME/texmf:$HOME/private/texmf
> $ $(which kpsexpand) '$TEXMFUSER'
> $HOME/tmp/test
> (Of course all $HOME in output has form /home/USER but it is
> irrelevant here).
> == Use case ==
> (All below is IMHO)
> Sometimes I need to check/test some package(s) or need to work on
> paper/article that requires some specific class distributed in separate
> package etc, so there is no package suitable for TeX Live.
> Examples are numerous, e.g. testing font package mtpro2, preparing
> article for a journal that requires to use journal class.
> In either case I don't want to mess either $HOME/texmf or $TEXMFLOCAL
> (assume I right to run sudo), so I just create a temporary directory with
> correct texmf tree.
> After that I can adjust TEXMFHOME variable to include such directories
> and work with that packages.
> ---
> WBR, Vladimir Lomov
> --
> Some husbands are living proof that a woman can take a joke.

Zdeněk Wagner

More information about the tex-live mailing list