[OS X TeX] Is this geometry behavior correct?

Jonathan Kew jonathan_kew at sil.org
Fri Apr 6 16:49:45 CEST 2007


On 6 Apr 2007, at 2:31 pm, Peter Dyballa wrote:

>
> Am 06.04.2007 um 09:32 schrieb Bruno Voisin:
>
>> So it seems the XeLaTeX-tailored geometry.cfg is read in all cases.
>
> Yes, that's true, at least for TeX Live 2007. And this *is* a bug!  
> And the bug sits in /usr/local/texlive/2007/texmf/web2c/texmf.cnf  
> quite a few times:
>
> 	TEXINPUTS.latex         = .;$TEXMF/tex/{latex,generic,}//
>
> 	% Earlier entries override later ones, so put this last.
> 	TEXINPUTS               = .;$TEXMF/tex/{$progname,generic,}//
>
> The last comma adds nothing to the path as established until then,  
> so it allows to search in $TEXMF/tex/// – too general!

This is *not* a bug, it is by design. It is sometimes useful to input  
macro files that were designed for and distributed with a different  
package, even intended for a different format; this paths are  
intended to allow this, while ensuring that if a format or engine has  
its own specialized variant of a file, that will be found first.

Apparently the geometry package as distributed with TL didn't include  
a cfg file, but relied solely on the built-in engine detection. For  
xelatex, I added a cfg file, which includes a test so that it won't  
disrupt things for other engines if they happen to find it (due to  
not having an alternative cfg at all).

The basic problem is that for a "normal" TeX engine, running in DVI  
output mode (ie not pdftex in pdf mode), there is no way for the  
engine or the document to know what DVI driver or viewer you intend  
to use (dvips, dvipdfm, xdvi, dvipng, etc etc). So any default the  
package or generic cfg file chooses is likely to be wrong for some  
users, some of the time.

> And there are even more such issues. This is the same situation as  
> in gwTeX, actually – with one difference:
>
> 	/usr/local/gwTeX/texmf.texlive/tex/latex/geometry/geometry.cfg
>
> is found first. This file is in the systematic gwTeX tree, so it  
> gets deleted upon update, and hopefully restored, too. In TeX Live  
> 2007 no such file seems to exist,

*That* might be a bug in TL, or it might be a deliberate choice. I  
wonder where Gerben's file came from, if it's not in TL.

> so the XeTeX version of geometry.cfg is found first. We could try  
> an imitation:
>
> 	sudo mkdir -p /usr/local/texlive/texmf-local/tex/kpsewhich
> 	sudo cat /usr/local/texlive/2007/texmf-dist/doc/latex/geometry/ 
> geometry.cfg | sed -e 's;^%%\(\\ExecuteOptions{\)a4paper,\(dvips}\); 
> \1letter,\2;' > /usr/local/texlive/texmf-local/tex/kpsewhich/ 
> geometry.cfg
> 	sudo texhash
>
> The last but one command offers the option to set a default paper  
> for dvips, or leave it away, Then the cryptic "\1letter,\2" should  
> simply be "\1\2". Those who want to record ISO A4 paper would need  
> to substitute the word "letter" with a4paper, or change the whole  
> command to:
>
> 	sudo cat /usr/local/texlive/2007/texmf-dist/doc/latex/geometry/ 
> geometry.cfg | grep ExecuteOptions | sed -e 's;^%%\(\\ExecuteOptions 
> \);\1;' > /usr/local/texlive/texmf-local/tex/kpsewhich/geometry.cfg
>
> Works!

For tex + dvips, yes. Does it work for tex + other DVI drivers?

The point about the cfg file is that it's for configuration, and may  
need to be adapted to suit individual circumstances -- not everyone's  
configuration can be handled automatically by the same setup.

>
> Could this also be an alternative to the Mac TeX setup for default  
> paper size?
>
>
> Explanation of the sudo commands:
>
> 	1.) Create the missing directory /usr/local/texlive/texmf-local/ 
> tex/kpsewhich

BTW, it doesn't make any sense to put this in a "kpsewhich" subdir.  
You probably want it under .../tex/latex/...

JK

> 	2.) Create an enabled geometry.cfg file in it
> 	3.) Renew the ls-R hash files
>
> --
> Greetings
>
>   Pete
>
> “One cannot live by television, video games, top ten CDs, and dumb  
> movies alone”
>       (Amiri Baraka 1999)
>
>
>
> ------------------------- 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/
>
>


------------------------- 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 macostex-archives mailing list