How to register my own packages or classes in a separate drive to TeX Live installation?

OK. At request I sum up my comments as an answer:

I don't have a full TeX Live but I have a skeleton (for LuaTeX). I have added various texmf trees (e.g. from MiKTeX) from various drives to texmf.cnf and it works fine. The syntax I used is

 TEXMFLOCAL = I:/TeX-Roots/microtype,I:/TeX-Roots/UFlocaltexmf,...

(commas between the roots, no slashes at the end, no comma at the end, the ... stand for more pathes).

The variable TEXMFLOCAL is then used later on in my (complete) texmf.cnf like this:

TEXMF = {!!$TEXMFMAIN,!!$TEXMFLOCAL, ...}

Normally TEXMF should already have this definition in the global texmf.cnf so it shouldn't be necessary to reset it in the local texmf.cnf. kpathsea reads all texmf.cnf. Settings in earlier (local) ones wins.

You should check if you didn't loose the texmf trees from the original TEXMFLOCAL definition (perhaps it did contains something before).

Check the list of pathes/texmf.cnf with kpsewhich -show-path=cnf or (according mpg) kpsewhich -a texmf.cnf.

If you have a MiKTeX installation, check that you are not using its texhash (try texhash --version).


With a default TeXLive installation you have a directory c:\texlive\texmf-local. There you can save your own files. This local directory has the same subdirectories as the default main one. LaTeX files should be saved in texmf-local\tex\latex\.... After saving your files run as command texhash to update the data base.

you can run from the command line kpsewhich -expand-var '$TEXMFHOME', then you see the default home directory. You can change this variable for your needs. You have three trees: $TEXMF, $TEXMFLOCAL, and $TEXMFHOME.


You can easily add package directories which reside outside the c:/texlive directory. Just append them, separated by ;, to the TEXMFLOCAL variable in the configuration file c:/texlive/texmf.cnf of your installation and run the texhash command. This will add all files found to the file name data base.

EDIT: Here is my texmf.cnf:

% (Public domain.)
% This texmf.cnf file should contain only your personal changes from the
% original texmf.cnf (for example, as chosen in the installer).
%
% That is, if you need to make changes to texmf.cnf, put your custom
% settings in this file, which is .../texlive/YYYY/texmf.cnf, rather than
% the distributed file (which is .../texlive/YYYY/texmf/web2c/texmf.cnf).
% And include *only* your changed values, not a copy of the whole thing!
%
TEXMFLOCAL = $SELFAUTOPARENT/texmf-local;/home/grahn/texpkgs
TEXMFHOME = $TEXMFLOCAL
TEXMFVAR = $TEXMFSYSVAR
TEXMFCONFIG = $TEXMFSYSCONFIG
ASYMPTOTE_HOME = $TEXMFCONFIG/asymptote
TEXINPUTS=.//;
main_memory = 30000000

As far as I know, this file was installed during TeXLive installation (I was using the --portable option). The additions I did are the TEXINPUTS and main_memory lines and the additional directory in TEXMFLOCAL for illustration. Always use / in paths (even for Windows). TEXINPUTS=.//; lets TeX search for files in subdirectories of the current one.