[XeTeX] xelatex and geometry
Ulrike Fischer
news2 at nililand.de
Wed Mar 26 12:19:21 CET 2008
Am Wed, 26 Mar 2008 10:47:15 +0000 schrieb Jonathan Kew:
>> I'm used to call geometry almost always with the option dvips:
>>
>> \usepackage[dvips,...]{geometry}
>>
>> This works fine with latex + dvips, and it also works with pdflatex as
>> \Gm at checkdrivers corrects the driver.
>>
>> It would also work with xelatex if geometry.cfg for XeLaTeX (JK
>> 2006-06-07) wouldn't contain a \let\Gm at checkdrivers\relax and so the
>> \specials for dvips are not set.
>
> Surely the "right" thing to do (short of changing geometry.sty itself
> to eliminate the issue below) is *not* to give the [dvips] option
> unless you're actually using dvips! By giving that option when you're
> actually using pdflatex or xelatex, you are misleading the system.
No not really. Geometry is quite clever and resets the driver to pdftex
if it realize.
So \usepackage[<dvidriver>]{geometry} is a short and convenient way for
\ifpdf
\usepackage{geometry}
\else
\usepackage[<dvidriver>]{geometry}
\fi
which is tiresome and redundant as geometry can find out if pdflatex is
running itself.
And so -- if possible -- I would like to avoid to have to write
\ifxetex
\usepackage{geometry}
\else
\usepackage[<dvidriver>]{geometry}
\fi
>
>>
>> So I would suggest to use
>>
>> \@ifundefined{XeTeXversion}{}{%
>> \def\pdfoutput{1}%
>> }
>
> That would almost certainly lead to breakage when other packages try
> to check for pdfTeX-specific functionality by looking at \pdfoutput.
Yes you are right. That is a bit dangerous. So what if you simply delete
the pdfoutput test from checkdrivers:
\@ifundefined{XeTeXversion}{}{%
\def\Gm at checkdrivers{%
\ifx\pdfpagewidth\@undefined\else
%\ifnum\pdfoutput=\@ne
\Gm at setdriver{pdftex}%
%\fi
\fi
\ifx\VTeXversion\@undefined\else
\ifnum\OpMode=\@ne
\Gm at setdriver{vtex}%
\else
\ifnum\OpMode=\tw@
\Gm at setdriver{vtex}%
\fi
\fi
\fi
\ifx\Gm at driver\Gm at dvips
\Gm at specialtrue
\else
\ifx\Gm at driver\Gm at dvipdfm
\Gm at specialtrue
\fi
\fi}}
\endinput
--
Ulrike Fischer
More information about the XeTeX
mailing list