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

How can I access the paper dimension that are in use when compiling a document? In other words, I am looking for a command that returns the width and height of the paper used (so that the returned parameters would change if the paper size is changed).

share|improve this question
You should just use the geometry package to set these dimensions. I guess it's not entire clear what you want to achieve. – Werner Mar 24 '13 at 19:04
\paperheight and \paperwidth – David Carlisle Mar 24 '13 at 19:06
@Werner: I want to access the paper dimensions so that I can use the ratio between them when setting new margins with the geometry package. I want to set margins based on the rule to keep the text-block width-to-height ratio equal to that in the paper (while also setting the left and right margins equal, and the bottom margin to half of the top margin). – hjb981 Mar 24 '13 at 20:59
up vote 4 down vote accepted







enter image description here

changing the paper height in the documents body doesn't change the text height

share|improve this answer
Where does \paperheight/\paperwidth come from? – morbusg Mar 24 '13 at 19:24
defined in latex.ltx and set by the documentclass – Herbert Mar 24 '13 at 19:27

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.