[tex-live] Hook in kpathsea for files not found?

Dr. Werner Fink werner at suse.de
Fri Feb 22 12:56:11 CET 2013


On Fri, Feb 22, 2013 at 07:39:17AM +0900, Norbert Preining wrote:
> Hi Werner,
> 
> On Do, 21 Feb 2013, Dr. Werner Fink wrote:
> > as I've been asked from users if it is possible to provide a message for
> > each file not found, I'd like to asked for a feature in the kpathsea library.
> 
> Do you want a hook into kpsewhich where you can plug in some other code,
> or lets say at the end of the tex run a list of missing files?

Yeah, indeed somehow in this direction.
 
> I mean, TeX already tells you if a file is missing, what else is it
> there?

Yes I know, nevertheless many users do not know how to handle this.

> I don't know about SuSE, but in Debian one could use the COntents file for
> the respective archive and search for the file, and provide the correct
> package name.

This job is already done by a perl script generating the rpm spec files
for the binaries packages, the TDS/FHS filesystem + scheme/collection packages,
as well as the round about 6000 noarch packages.  All rpm packages include the
provided as well as required packages generated by scanning texlive.tlpdb.xz.
Beside this also all files and their names will be scanned to generated a list
of provided and required files, e.g. a short example with a small package
texlive-yhmath:

  g231 /suse/werner> rpm -q --provides texlive-yhmath
  tex(OMXyhex.fd)  
  tex(yhcmex10.tfm)  
  tex(yhcmex10.vf)  
  tex(yhmath.map)  
  tex(yhmath.sty)  
  tex(yrcmex10.tfm)  
  texlive-yhmath = 2012.60.svn15878-56.1

  g231 /suse/werner> rpm -q --requires texlive-yhmath
  /bin/sh  
  coreutils  
  grep  
  rpmlib(CompressedFileNames) <= 3.0.4-1
  rpmlib(PayloadFilesHavePrefix) <= 4.0-1
  sed  
  tex(amsmath.sty)  
  texlive >= 2012
  texlive-yhmath-fonts >= 2012
  rpmlib(PayloadIsLzma) <= 4.4.6-1

this list shows provides/requires written as `tex(...)' and the package
resolver can handle this:

  g231 /suse/werner> sudo zypper in 'tex(amsmath.sty)'
  Loading repository data...
  Reading installed packages...
  'tex(amsmath.sty)' not found in package names. Trying capabilities.
  'texlive-amsmath' providing 'tex(amsmath.sty)' is already installed.
  Resolving package dependencies...
  Nothing to do.

> > Such a feature may provide the possibility to show messages how to install a
> > missed package like texlive-colortab or a virtual dependency like
> > `tex(colortab.sty)' and how to install them.  This would be useful for TeXLive
> > upstream as well as for distributions providing TeXLive packages[1,2].
> 
> There is some feature like that, and in principle one *could* implement
> it already, as kpse lib calls mktex* scripts in case a file is not found
> (if configured). THese scripts in turn *could* call tlmgr (on uptream TL)
> or any other package manager to show a warning, or download the file
> on the fly, or ...
> http://tug.org/texinfohtml/kpathsea.html#mktex-scripts
> 
> THe mktextex script is disabled by default, but enabling it cold help.
> 
> Unfortunately, this will not help in all cases, I remember some LaTeX
> \IfFileExists were problematics, but I cannot remember exactely.
> 
> Yeah, so in principle everything can be done with the mktex* scripts.
> 
> Does this help?

Hmmm ... for messages like

  LaTeX Error: File `multirow.sty' not found.
  ! Font U/pzd/m/n/10=pzdr at 10.0pt not loadable: Metric (TFM) file not found

I guess it does not help, does it?  For bash there is a completion extension
which can be used to give the user a hint how to install a missed package for
the command which was not found in path.  Something similar for TeXLive would
be nice to have :)


   Werner

-- 
  "Having a smoking section in a restaurant is like having
          a peeing section in a swimming pool." -- Edward Burr


More information about the tex-live mailing list