[tex-live] texdoc.tlu (was: TeX Live Installer -- pregeneration of formats)

Reinhard Kotucha reinhard.kotucha at web.de
Sun Jun 8 21:13:45 CEST 2008

Frank Küster writes:
 > Reinhard Kotucha <reinhard.kotucha at web.de> wrote:
 > > There is only one texmf.cnf file for all platforms, including
 > > Windows.  You cannot set TEXDOC_RMFILE in texmf.cnf any more.  
 > Why not?

Because it has to expand to differnt values on different platforms.

 > > My proposal:
 > >
 > >   * Set reasonable defaults for Unix and Windows in your script.
 > >
 > >   * Look for a config file in $TEXMFHOME.
 > Here you've got a point indeed: I do read texmf.cnf for site-wide
 > configuration, but there is no possibility at the moment to change the
 > behaviour on a per-user basis.
 > Now the question is: Should we use one (user) configuration file for
 > each texlua script which understands configuration settings?  

 > Or should there be one central file, similar to a user-specific
 > texmf.cnf?  Personally, I prefer a per-script configuration file,
 > but it might be tedious if some changes need to be repeated over
 > and over.

A config file for each script/program is fine.  It's quite usual in
TeX Live (fmtutil.cnf, udmap.cfg,...).  For texdoc this makes most sense
because I suppose it's the only config file most people have to create
and it gives you more freedom when writing a parser.  For instance, a
line in the config file could look like

   texdoc_viewer_dvi = xdvi %s


   texdoc_viewer_dvi = "xdvi %s"

but you have much less freedom if you share your config files with
other programs.

 > And where should such a file be looked for?  What about
 > $TEXMFHOME/scripts/config/ - the site-wide ones could then go to
 > $TEXMFSYSCONFIG/scripts/, err, shouldn't the user-specific path be
 > rather $TEXMFCONFIG/scripts/?

TEXMFCONFIG expands to ~/.texlive2008/texmf-config.  The stuff you put
there will be lost next year.  A better alternative for files created
by users is TEXMFHOME.  This survives the next installation and is the
equivalent to TEXMFLOCAL.

IMO the best place is TEXMFHOME/texdoc/texdoc.cnf.  The directory
"scripts" should contain the scripts themselves (like texmf/scripts).
Don't know whether TEXMFHOME/texdoc.cnf is appropriate.  It's better
to ask Karl.

A site-wide config file doesn't make much sense, except in a
single-platform environment.  In this case the admin can put it into

 > > It's quite late for significant changes in TeX Live 2008 but I'm very
 > > interested in the texlua version of texdoc.  Unless I misunderstand
 > > the code in the repository I fear that it doesn't work.
 > It should work, since texmf.cnf is just needed for local customization.

What "local" means depends on how you install TL.  If you install it
on a server and mount it on different clients, then all the clients
share the same texmf.cnf file.  You can set the env var TEXMFCNF on
clients but this is always a source of trouble and not recommended.

When using os.execute(), please be careful that file names are
properly quoted, they could contain spaces.  And on Windows TL will be
installed in standard directories now by default, "C:/Program Files",
and TEXMFHOME expands to "C:/documents and settings/<user>".

Another alternative is os.spawn(), a function provided by Taco.  It
does the same as os.execute() but avoids the shell and takes an
argument list (lua table) instead of a string.  This is much more
convenient, but there are some oddities on Windows, as usual.  Though
you pass arguments as a list, you have still to quote file names
containing spaces.  Please look at


Look at the function fixwin() and how it is used at the bottom of the
script.  The advantage of this approach over os.execute() is that you
don't have to care about proper quoting and it had been tested already
on Unix and Windows.


Reinhard Kotucha			              Phone: +49-511-3373112
Marschnerstr. 25
D-30167 Hannover	                      mailto:reinhard.kotucha at web.de
Microsoft isn't the answer. Microsoft is the question, and the answer is NO.

More information about the tex-live mailing list