TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

The geometry package provides a simple way to set layout parameters. For example,


will give me a document with 1 inch margins on each side. In particular, it computes the LaTeX parameters like \textwidth, \oddsidemargin, \textheight, and \topmargin, among others. Is it possible to retrieve the 'friendlier' values like left, right, top, and bottom?

Of course, one can compute the values using something like \dimexpr \topmargin + \headheight + \headsep + 1in \relax. There's also the further complication that the includehead and includefoot options influence the setting of the parameters.

share|improve this question
up vote 4 down vote accepted

The values are stored in pt in commands like \Gm@lmargin, \Gm@tmargin etc. If you are interested in the unit you actually used in the options you could also patch \Gm@defbylen which is (as far as I can see) used by most options and then set the values with \geometry:

  \expandafter\edef\csname myGm#1\endcsname{#2}%new
  \expandafter\xdef\csname Gm@#1\endcsname{\the\@tempdima}\endgroup}%



\makeatletter\Gm@lmargin \myGmlmargin

share|improve this answer

Your Answer


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.