3

I want what the following code does, but with no page break when \newgeometry or \restoregeometry are issued. Is that possible?

\documentclass[english]{article}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage{geometry}
\geometry{verbose,tmargin=2cm,bmargin=2cm,lmargin=2cm,rmargin=2cm}

\usepackage{lipsum}
\usepackage{babel}

\begin{document}
\lipsum[1-20]

\newgeometry{verbose,tmargin=8cm,bmargin=2cm,lmargin=2cm,rmargin=2cm}

\lipsum[1-20]

\restoregeometry

\lipsum[1-20]
\end{document}
PaulS
  • 461
  • 6
    You can't. The flowfram package will allow you to break a page into different sized chunks, but you have to set up the whole page in the preamble. What you can do is overlap the left and right margins, or preempt the top margin with afterpage. – John Kormylo Jun 05 '19 at 19:02
  • you can almost always avoid \newgeometry alltogether, you can change the margins just with the standard quote environment or a copy that changes the margins by a different amount/ – David Carlisle Jun 05 '19 at 19:08
  • 1
    Thanks! I have just replaced \restoregeometry with \afterpage{\restoregeometry}, and the geometry is no restored! – PaulS Jun 05 '19 at 19:13
  • @JohnKormylo I weep if anyone suggests using afterpage in a real document:-) – David Carlisle Jun 05 '19 at 19:13
  • you have not stated what is the actual effect that you want to achieve., just a 6cm space at the top of page 2? – David Carlisle Jun 05 '19 at 19:14
  • @David I have a long enumerate spanning several pages, which I want to have a larger top margin (say 4cm) after the second page on. – PaulS Jun 05 '19 at 19:17
  • 1
    so specify the page dimension for the general pages and put \vspace*{-4cm} before the list. – David Carlisle Jun 05 '19 at 19:21
  • \restoregeometry must use local rather than global assignments. Sorry, never mind. – John Kormylo Jun 05 '19 at 19:27
  • @DavidCarlisle - And I thought https://tex.stackexchange.com/questions/477188/removing-the-space-in-the-page-before-appendix/477197?r=SearchResults&s=2|24.2599#477197 was one of my best ideas ever. – John Kormylo Jun 05 '19 at 19:31
  • @JohnKormylo :-) – David Carlisle Jun 05 '19 at 19:34
  • @David Thanks! Your solution works fine! – PaulS Jun 05 '19 at 19:40
  • it's a solution for the case in the comments but not for the harder case in your example that has three sections, initial, middle with large top margin and end, the vspace* version only really works in the case where you just want a different margin on the first page – David Carlisle Jun 05 '19 at 19:43
  • @David True. It must be a hard problem, as I, before asking my question here, searched the web exhaustively and found no solution for many similar questions. – PaulS Jun 05 '19 at 20:07
  • It's a hard problem in general but almost all actual use cases have simple solutions, so the motivation to tackle the general case is rather small.... – David Carlisle Jun 05 '19 at 20:12
  • @David Can your solution be adapted to accommodate 2 enumerate lists with different top margins for each enumerate list? That is, 8cm of top margin for the first enumerate list and 5cm of top margin for the second enumerate list. – PaulS Jun 09 '19 at 12:55

0 Answers0