I set my \textwidth and \textheight in the preamble and would like to change both for some pages. How can this be done? E.g., the following example for \textwidth appears to work for the page number, but not for the text:

\textwidth=5cm \textheight=5cm
A \hfill B
\eject \textwidth=10cm
A \hfill B

Output (true to scale):


You can use \newgeometry and \restoregeometry from the geometry package:



  • 1
    That's great - thanks. I had given up on the geometry package after it frustrated me in this question: tex.stackexchange.com/questions/6834/… – st12 Mar 14 '11 at 22:11
  • 4
    Is there a way to change the text column width mid-page? – cjm Apr 26 '16 at 4:21
  • 1
    Tried this and the text width works fine but the page numbering is no longer centered. Is there a way to fix that? I'm using \fancyfoot[C]{\thepage} from the fancyhdr package. – Kajsa Feb 16 '19 at 17:08

To change textwidth locally for a defined scope you may use \begin{minipage}{WIDTH}.

  • 6
    Welcome, minipages cannot be broken, so the content might overflow the page at the bottom. – Johannes_B Sep 18 '16 at 11:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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