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.

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
3  
\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

1 Answer 1

up vote 4 down vote accepted
\documentclass{article}
\begin{document}

\the\paperheight

\the\paperwidth

\the\textheight

\the\textwidth

\paperheight=111pt
\the\paperheight

\end{document} 

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
2  
defined in latex.ltx and set by the documentclass –  Herbert Mar 24 '13 at 19:27

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.