[tex-k] kpathsea behavior

Alexander SHEN ashen@cmi.univ-mrs.fr
Mon, 12 Aug 2002 14:15:39 +0200 (MEST)

Dear experts,

sorry for bothering you with a (maybe trivial) question, but I
spent some time reading kpathsea.pdf without much success.

Here is the problem.
Using TexLive7, i can look for tex.pool file saying
   kpsewhich --format=texpool tex.pool
and kpsewhich finds it in /usr/local/TeX/TL7/texmf/web2c/tex.pool,
which is normal. Debugging with --debug 8 says that
 Search path for texpool files (from texmf..cnf) is normal (long
 list of directories)
 before expansion = $TEXFORMATS
 texmf.cnf path = $TEXFORMATS

But I cannot find this file anymore after I add a new directory
in the path for searching format files saying

setenv TEXFORMATS ~/newfmt:

However, I can still find standard formats (like latex.fmt) in
standard directories: debugging says that search path is taken
from TEXFORMATS environment variable, before expansion it is
.../newfmt: and texmf.cnf path is .:$TEXMF/web2c.

But - and that is rather strange to me - I cannot find tex.pool
after that. Debugging says that search path
  = /export/home/invites/ashen/newfmt:
        (^^^ this is just ~/newfmt)
  before expansion = $TEXFORMATS
  texmf.cnf path = $TEXFORMATS.

The file texmf.cnf says


It seems that in this case the colon at the end of the search path
is not replaced by the less-priority search path.

My question: is this behavior of kpathsea normal or there is
some error? If it is normal, it is possible to add some directory
to the search path for format files not destroying path for pool
files? (Not changing texmf.cnf, I mean).

Of course, there are many workarounds (e.g., I can just replace
: at the end by the list of actual directories), but I thought
this strange behavior may be considered as a bug in kpathsea,
texmf.cnf or just as a gap in documentation.

Thanks in advance,

alexander shen (permanent address: shen@mccme.ru)