# [OS X TeX] question about the geometry package

Morten Høgholm morten.hoegholm at gmail.com
Fri Oct 21 09:51:45 EDT 2005

On Tue, 18 Oct 2005 09:28:42 -0500, Herbert Schulz
<herbs at wideopenwest.com> wrote:

> Include the driver in the optional argument: e.g.,
>
> \usepackage[dvips,a5paper]{geometry}
>
> and it seems to work. I wonder if the geometry package is using the
> correct test for pdf or dvi production.

It isn't but that's not the reason for why this isn't working.

Geometry actually doesn't set the dvips driver itself even though it could
easily do so. One has to either edit the geometry.cfg file so that it
executes the dvips option or do it in the package options as you did. When
looking at the package I noticed two places where it uses the presence of
a pdftex primitive to determine pdfmode. One is this one:

\def\Gm at checkdrivers{%
\ifx\pdfpagewidth\@undefined\else
\ifnum\pdfoutput=\@ne
\Gm at setdriver{pdftex}%
\fi
\fi
...}

So this isn't the best way to check for pdftex but at least it's not
entirely wrong since it also tests for the value of \pdfoutput. Similarly
later in the package:

\Gm at checkdrivers
\ifx\Gm at driver\Gm at pdftex
\ifx\pdfpagewidth\@undefined
\Gm at warning{pdftex' option is invalid in this environment}%
\else
\setlength\pdfpagewidth{\Gm at orgw}%
\setlength\pdfpageheight{\Gm at orgh}%
...

I'll contact the author to a) encourage him to use ifpdf and b) make
geometry choose dvips if not running pdftex in pdf mode:

\def\Gm at checkdrivers{%
\ifpdf
\Gm at setdriver{pdftex}%
\else
\Gm at setdriver{dvips}%
\fi
% other drivers detected here.
...}
--
Morten
------------------------- Info --------------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
& FAQ: http://latex.yauh.de/faq/
TeX FAQ: http://www.tex.ac.uk/faq
List Archive: http://tug.org/pipermail/macostex-archives/

`