16

Page 11 of the geometry package manual says that the reset option

sets back the layout dimensions and switches to the settings before geometry is loaded.

On page 30 there is a slightly different description:

The [reset] option cancels all the options specified before reset, except pass.

However, the following code

\documentclass{article}
\showthe\textwidth
\usepackage[textwidth=50pt,reset]{geometry}
\showthe\textwidth

produces the output

> 345.0pt.
l.2 \showthe\textwidth

> 430.00462pt.
l.4 \showthe\textwidth

So, \textwidth doesn't return to the value it had before geometry was loaded. What am I doing wrong?

2
  • geometry sets its own \textwidth, so the reset is to the value set initially by geometry.
    – egreg
    Commented Jan 12, 2012 at 22:52
  • 4
    @egreg --- In which case either page 11 of the manual is incorrect, or it's a bug and the package doesn't do what the author intended. I'll email him. Commented Jan 12, 2012 at 23:02

2 Answers 2

8

In addition to some other flags, geometry stores the page configuration upon package load in the macro \Gm@restore@org. For the standard article document class (your minimal example) this contains:

\csname paperwidth\endcsname =614.295pt\relax
\csname paperheight\endcsname =794.96999pt\relax
\csname textwidth\endcsname =345.0pt\relax
\csname textheight\endcsname =550.0pt\relax
\csname evensidemargin\endcsname =62.0pt\relax
\csname oddsidemargin\endcsname =62.0pt\relax
\csname topmargin\endcsname =16.0pt\relax
\csname headheight\endcsname =12.0pt\relax
\csname headsep\endcsname =25.0pt\relax
\csname topskip\endcsname =10.0pt\relax
\csname footskip\endcsname =30.0pt\relax
\csname baselineskip\endcsname =12.0pt\relax
\csname marginparwidth\endcsname =65.0pt\relax
\csname marginparsep\endcsname =11.0pt\relax
\csname columnsep\endcsname =10.0pt\relax
\csname hoffset\endcsname =0.0pt\relax
\csname voffset\endcsname =0.0pt\relax
\csname Gm@layouthoffset\endcsname =0.0pt\relax
\csname Gm@layoutvoffset\endcsname =0.0pt\relax
\@twocolumnfalse
\@twosidefalse
\@mparswitchfalse
\@reversemarginfalse

This is overwritten at the start of the document to

\csname paperwidth\endcsname =614.295pt\relax
\csname paperheight\endcsname =794.96999pt\relax
\csname textwidth\endcsname =430.00462pt\relax
\csname textheight\endcsname =556.47656pt\relax
\csname evensidemargin\endcsname =19.8752pt\relax
\csname oddsidemargin\endcsname =19.8752pt\relax
\csname topmargin\endcsname =-13.87262pt\relax
\csname headheight\endcsname =12.0pt\relax
\csname headsep\endcsname =25.0pt\relax
\csname topskip\endcsname =10.0pt\relax
\csname footskip\endcsname =30.0pt\relax
\csname baselineskip\endcsname =12.0pt\relax
\csname marginparwidth\endcsname =65.0pt\relax
\csname marginparsep\endcsname =11.0pt\relax
\csname columnsep\endcsname =10.0pt\relax
\csname hoffset\endcsname =0.0pt\relax
\csname voffset\endcsname =0.0pt\relax
\csname Gm@layouthoffset\endcsname =0.0pt\relax
\csname Gm@layoutvoffset\endcsname =0.0pt\relax
\@twocolumnfalse
\@twosidefalse
\@mparswitchfalse
\@reversemarginfalse

To restore the page and text dimensions to what it was before geometry was called, you can make an explicit call to \Gm@restore@org before \begin{document}:

\usepackage[...]{geometry}% http://ctan.org/pkg/geometry
\makeatletter
\Gm@restore@org
\makeatother
12

One has to remember that geometry sets its own parameters for page formatting, unless it's called with the pass option.

However, also

\usepackage[pass]{geometry}
\geometry{reset}

will set \textwidth to 430.00462pt, which is the default value set by geometry for letter paper. The documentation seems not to be very clear about this: it should say that reset cancels all options set in the meantime, including pass.

3
  • The pass option completely disables most features of the geometry package. Try putting \showthe\textwidth after \geometry{textwidth=50pt}. Commented Jan 14, 2012 at 14:06
  • @IanThompson I've put headheight in the example.
    – egreg
    Commented Jan 14, 2012 at 14:15
  • If I do \showthe\headheight after the second line, I don't get 50pt. Commented Jan 14, 2012 at 14:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .