[XeTeX] XeTeX 0.994 for Mac OS X

Bruno Voisin bvoisin at mac.com
Wed Jun 7 00:16:34 CEST 2006


Le 6 juin 06 à 23:59, Jonathan Kew a écrit :

> On 6 Jun 2006, at 6:25 pm, Ralf Stubner wrote:
>
>>> - pdfTeX-style \pdfpageheight and \pdfpagewidth parameters to  
>>> control
>>> page size
>>
>> This causes a problem with geometry.sty (2002/07/08 v3.2 Page
>> Geometry)
>> which checks for a running pdftex via
>>
>>   \ifx\pdfpagewidth\@undefined\else
>>     \ifnum\pdfoutput=\@ne
>>       \Gm at setdriver{pdftex}%
>>     \fi
>>   \fi
>
> Hmm... is that the current "standard" way to test for pdfTeX? If so,
> that could disrupt quite a few packages. (You can tell I'm not much
> of a LaTeX user!)

The "standard" way is to use the package ifpdf, namely /usr/local/ 
teTeX/share/texmf.tetex/tex/latex/oberdiek/ifpdf.sty. Specifically:

> % Function:  This package looks for pdfTeX in pdf mode and
> %            implements and sets the switch \ifpdf.
> %            The detection is based on \pdfoutput and
> %            the package will not change this value.
> %            It works with plain or LaTeX formats.
> %
> % Use:       LaTeX: \usepackage{ifpdf}
> %            plain: \input ifpdf.sty
> %            The package provides the switch \ifpdf:
> %              \ifpdf
> %                ... do things, if pdfTeX is running in pdf mode ...
> %              \else
> %                ... other TeX or pdfTeX in dvi mode ...
> %              \fi
> %            The package can also be used to set global
> %            documentclass options:
> %              \RequirePackage{ifpdf}
> %              \ifpdf
> %                \documentclass[pdftex,...]{...}
> %              \else
> %                \documentclass[...]{...}
> %              \fi

The package takes a lot of precautions to make sure that its  
detection of pdfTeX works with all of the pdfTeX versions.

Unfortunately, a lot of packages out there are less strict and  
implement their own less efficient detection mechanisms. These are  
generally the same packages that don't use separate driver files  
(such as xetex.def for graphics.sty), and that implement instead  
their own switches inside the .sty file itself, based on the  
assumption that you're either using dvips or pdfTeX, or sometimes VTeX.

Bruno Voisin


More information about the XeTeX mailing list