[OS X TeX] Is this geometry behavior correct?

Bruno Voisin bvoisin at mac.com
Sun Apr 8 07:20:42 EDT 2007


Le 7 avr. 07 à 10:54, Jonathan Kew a écrit :

> Yes, I know. And if you run something like
>
>   kpsewhich --show-path tex
>
> you'll see "kpsewhich" subdirs among the paths. I guess that's why  
> you decided to put geometry.cfg into such a dir. However, that's  
> wrong, because when you actually run latex (rather than kpsewhich)  
> those dirs will *not* be searched with the priority that kpsewhich  
> showed; the current program name (latex) will be used instead.
>
> To use kpsewhich properly, you should give it the --progname option  
> to ensure that you're seeing the same paths as would be used by the  
> real program you're interested in; for example,
>
>   kpsewhich --progname latex --show-path tex
>
> Then you'll see no 'kpsewhich' subdirs in the paths; instead,  
> you'll see 'latex' ones. *Those* paths are the ones you can use to  
> make sensible decisions about where to put files for latex to find  
> them.

Thanks for the correction.

Here I plead guilty. I was confused, when reading kpathsea.pdf, about  
the options --progname and --engine. Earlier in this thread I tried  
the latter, but the results felt a bit odd (no different search paths  
for latex and xelatex, and this strange kpsewhich subdirectory I  
never heard about earlier):

> Le 6 avr. 07 à 09:32, Bruno Voisin a écrit :
>
>> I'm not sure the following is correct invocation of kpsewhich, but  
>> with "kpsewhich --engine=latex --show-path=tex" here's what I get  
>> (slightly reformatted) with TeXLive-2007:
>>
>> .
>> ~/.texlive2007/texmf-config/tex/kpsewhich//
>> ~/.texlive2007/texmf-var/tex/kpsewhich//
>> ~/Library/texmf/tex/kpsewhich//
>> !!/usr/local/texlive/2007/texmf-config/tex/kpsewhich//
>> !!/usr/local/texlive/2007/texmf-var/tex/kpsewhich//
>> !!/usr/local/texlive/2007/texmf/tex/kpsewhich//
>> !!/usr/local/texlive/2007/../texmf-local/tex/kpsewhich//
>> !!/usr/local/texlive/2007/texmf-dist/tex/kpsewhich//
>> ~/.texlive2007/texmf-config/tex/generic//
>> ~/.texlive2007/texmf-var/tex/generic//
>> ~/Library/texmf/tex/generic//
>> !!/usr/local/texlive/2007/texmf-config/tex/generic//
>> !!/usr/local/texlive/2007/texmf-var/tex/generic//
>> !!/usr/local/texlive/2007/texmf/tex/generic//
>> !!/usr/local/texlive/2007/../texmf-local/tex/generic//
>> !!/usr/local/texlive/2007/texmf-dist/tex/generic//
>> ~/.texlive2007/texmf-config/tex///
>> ~/.texlive2007/texmf-var/tex///
>> ~/Library/texmf/tex///
>> !!/usr/local/texlive/2007/texmf-config/tex///
>> !!/usr/local/texlive/2007/texmf-var/tex///
>> !!/usr/local/texlive/2007/texmf/tex///
>> !!/usr/local/texlive/2007/../texmf-local/tex///
>> !!/usr/local/texlive/2007/texmf-dist/tex///
>>
>> and with gwTeX:
>>
>> .
>> ~/Library/texmf/tex/kpsewhich//
>> !!/usr/local/gwTeX/texmf.local/tex/kpsewhich//
>> !!/usr/local/gwTeX/texmf.pkgs/tex/kpsewhich//
>> !!/usr/local/gwTeX/texmf.gwtex/tex/kpsewhich//
>> !!/usr/local/gwTeX/texmf.texlive/tex/kpsewhich//
>> !!/usr/local/gwTeX/texmf/tex/kpsewhich//
>> ~/Library/texmf/tex/generic//
>> !!/usr/local/gwTeX/texmf.local/tex/generic//
>> !!/usr/local/gwTeX/texmf.pkgs/tex/generic//
>> !!/usr/local/gwTeX/texmf.gwtex/tex/generic//
>> !!/usr/local/gwTeX/texmf.texlive/tex/generic//
>> !!/usr/local/gwTeX/texmf/tex/generic//
>> ~/Library/texmf/tex///
>> !!/usr/local/gwTeX/texmf.local/tex///
>> !!/usr/local/gwTeX/texmf.pkgs/tex///
>> !!/usr/local/gwTeX/texmf.gwtex/tex///
>> !!/usr/local/gwTeX/texmf.texlive/tex///
>> !!/usr/local/gwTeX/texmf/tex///
>>
>> I don't really understand the logic behind the ordering with which  
>> the various texmf trees are searched in the TeXLive case, but from  
>> the above it seems that, among these trees:
>>
>> - tex/kpsewhich is searched first
>>
>> - tex/generic second
>>
>> - tex third
>>
>> and that the existence of latex and xelatex subdirectories within  
>> the tex directory is of no importance whatsoever. I'm surprised,  
>> as I thought this used to be different.

Now with --progname the results make more sense. Taking TeXLive-2007  
for example (with output reformatted for clarity):

$ texdist --texdist=TeXLive-2007 "kpsewhich --progname=latex --show- 
path=tex"
.
~/.texlive2007/texmf-config/tex/latex//
~/.texlive2007/texmf-var/tex/latex//
~/Library/texmf/tex/latex//
!!/usr/local/texlive/2007/texmf-config/tex/latex//
!!/usr/local/texlive/2007/texmf-var/tex/latex//
!!/usr/local/texlive/2007/texmf/tex/latex//
!!/usr/local/texlive/2007/../texmf-local/tex/latex//
!!/usr/local/texlive/2007/texmf-dist/tex/latex//
~/.texlive2007/texmf-config/tex/generic//
~/.texlive2007/texmf-var/tex/generic//
~/Library/texmf/tex/generic//
!!/usr/local/texlive/2007/texmf-config/tex/generic//
!!/usr/local/texlive/2007/texmf-var/tex/generic//
!!/usr/local/texlive/2007/texmf/tex/generic//
!!/usr/local/texlive/2007/../texmf-local/tex/generic//
!!/usr/local/texlive/2007/texmf-dist/tex/generic//
~/.texlive2007/texmf-config/tex///
~/.texlive2007/texmf-var/tex///
~/Library/texmf/tex///
!!/usr/local/texlive/2007/texmf-config/tex///
!!/usr/local/texlive/2007/texmf-var/tex///
!!/usr/local/texlive/2007/texmf/tex///
!!/usr/local/texlive/2007/../texmf-local/tex///
!!/usr/local/texlive/2007/texmf-dist/tex///

$ texdist --texdist=TeXLive-2007 "kpsewhich --progname=xelatex --show- 
path=tex"
.
~/.texlive2007/texmf-config/tex/xelatex//
~/.texlive2007/texmf-var/tex/xelatex//
~/Library/texmf/tex/xelatex//
!!/usr/local/texlive/2007/texmf-config/tex/xelatex//
!!/usr/local/texlive/2007/texmf-var/tex/xelatex//
!!/usr/local/texlive/2007/texmf/tex/xelatex//
!!/usr/local/texlive/2007/../texmf-local/tex/xelatex//
!!/usr/local/texlive/2007/texmf-dist/tex/xelatex//
~/.texlive2007/texmf-config/tex/latex//
~/.texlive2007/texmf-var/tex/latex//
~/Library/texmf/tex/latex//
!!/usr/local/texlive/2007/texmf-config/tex/latex//
!!/usr/local/texlive/2007/texmf-var/tex/latex//
!!/usr/local/texlive/2007/texmf/tex/latex//
!!/usr/local/texlive/2007/../texmf-local/tex/latex//
!!/usr/local/texlive/2007/texmf-dist/tex/latex//
~/.texlive2007/texmf-config/tex/generic//
~/.texlive2007/texmf-var/tex/generic//
~/Library/texmf/tex/generic//
!!/usr/local/texlive/2007/texmf-config/tex/generic//
!!/usr/local/texlive/2007/texmf-var/tex/generic//
!!/usr/local/texlive/2007/texmf/tex/generic//
!!/usr/local/texlive/2007/../texmf-local/tex/generic//
!!/usr/local/texlive/2007/texmf-dist/tex/generic//
~/.texlive2007/texmf-config/tex///
~/.texlive2007/texmf-var/tex///
~/Library/texmf/tex///
!!/usr/local/texlive/2007/texmf-config/tex///
!!/usr/local/texlive/2007/texmf-var/tex///
!!/usr/local/texlive/2007/texmf/tex///
!!/usr/local/texlive/2007/../texmf-local/tex///
!!/usr/local/texlive/2007/texmf-dist/tex///

Thus it seems that, in TeXLive-2007, when XeLaTeX is run:

- The directories searched are, by decreasing order of precedence:

	current directory
	tex/xelatex/
	tex/latex/
	tex/generic/
	tex/

- For each directory the texmf trees searched are, by decreasing  
order of precedence:

	~/.texlive2007/texmf-config/
	~/.texlive2007/texmf-var/
	~/Library/texmf/
	/usr/local/texlive/2007/texmf-config/
	/usr/local/texlive/2007/texmf-var/
	/usr/local/texlive/2007/texmf/
	/usr/local/texlive/2007/../texmf-local/
	/usr/local/texlive/2007/texmf-dist/

When LaTeX is run things are identical, *except* that the tex/ 
xelatex/ directory is not searched.

In gwTeX things are a bit different. gwTeX seems more compatible with  
older setups, as it allows for the existence of a xetex/ directory  
alongside the tex/ directory. For XeLaTeX:

- The directories searched are, by decreasing order of precedence:

	current directory
	xetex/xelatex/
	tex/xelatex/
	xetex/latex/
	tex/latex/
	xetex/generic/
	tex/generic/
	xetex/
	tex/

- For each directory the texmf trees searched are, by decreasing  
order of precedence:

	~/Library/texmf/
	/usr/local/gwTeX/texmf.local/
	/usr/local/gwTeX/texmf.pkgs/
	/usr/local/gwTeX/texmf.gwtex/
	/usr/local/gwTeX/texmf.texlive/
	/usr/local/gwTeX/texmf/tex/

For LaTeX things are identical, *except* that the tex/xelatex/ and  
xetex/ directories are not searched.

That said, I'm still not at ease with the search order of the texmf  
trees in TeXLive-2007, which feels overly complicated. In particular,  
one thing seems error-prone:

- On one hand /usr/local/texlive/2007/texmf-config/ and /usr/local/ 
texlive/2007/texmf/ are searched *after* ~/.texlive2007/texmf-config/  
and ~/Library/texmf/, but *before* /usr/local/texlive/texmf-local/.

- On the other hand /usr/local/texlive/2007/texmf-config/ and /usr/ 
local/texlive/2007/texmf/ do contain important configuration files,  
that the user might decide to modify to set up her needs:

	/usr/local/texlive/2007/texmf-config/tex/generic/config/ 
pdftexconfig.tex
	/usr/local/texlive/2007/texmf/tex/latex/config/color.cfg
	/usr/local/texlive/2007/texmf/tex/latex/config/graphics.cfg
	/usr/local/texlive/2007/texmf/tex/latex/config/hyperref.cfg

Thus the above seems to mean the user must put updated configuration  
files inside ~/.texlive2007/texmf-config/ or ~/Library/texmf/, but  
*not* inside /usr/local/texlive/texmf-local/, for them to be taken  
into account in all cases.

This seems wrong in two respects:

- System-wide local customizations put inside /usr/local/texlive/ 
texmf-local/ are supposed to be taken into account, unless a user  
decides to supersede them explicitly by putting stuff inside  
~/.texlive2007/texmf-config/ or ~/Library/texmf/.

- The above seems to make it impossible to set up system-wide local  
customizations, given /usr/local/texlive/texmf-local/ cannot be used  
safely for them.

I hope I misunderstood something.

Bruno Voisin
------------------------- Helpful Info -------------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
TeX FAQ: http://www.tex.ac.uk/faq
List Archive: http://tug.org/pipermail/macostex-archives/
List Reminders & Etiquette: http://www.esm.psu.edu/mac-tex/list/





More information about the MacOSX-TeX mailing list