Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question
    
geometry sets its own \textwidth, so the reset is to the value set initially by geometry. –  egreg Jan 12 '12 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. –  Ian Thompson Jan 12 '12 at 23:02

2 Answers 2

up vote 7 down vote accepted

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
share|improve this answer

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.

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.