2

is there a way to let pdflatex automatically change the margin by changing from page1 to 2? I thought about something like: ifpagenum>1: \newgeometry.

\documentclass{scrartcl}
\usepackage[left=2.5cm, right=2cm, top=10cm, bottom=2cm]{geometry}
\usepackage{lipsum}

% set option to automatically change to
% \newgeometry{left=2.5cm, right=2cm, top=2cm, bottom=2cm}
% after page 1.

\begin{document}
\lipsum[1-10]
\end{document}
  • you can only do that at a forced page break not after an automatic page break that happens mid-paragraph. – David Carlisle Mar 31 '17 at 18:54
  • There is no way to do that after an automatic page break? I thought about manipulating the "refstepcounter" of "pagenumber" and let it first check "pagenum>1" then echo "\newgeometry"... But I don't know how to do that. How can I manually "refstepcounter -> pagercounter"? Or how to redefine, so? – Shalec Mar 31 '17 at 19:00
  • If the first page would be a cover, or maybe a titleage, there would be an option for that. – Johannes_B Mar 31 '17 at 19:06
  • no, the whole paragraph is set (to a specified line width) before page breaking is even considered. So the lines of (at least) one paragraph have already been set and can't be re-set to the new page width. that is why you need to \clearpage to typeset all pending content, then change the margins, then start again. – David Carlisle Mar 31 '17 at 19:08
  • oh but I just looked at your commented out code, you do not want to change the textwidth at all, so why do you need to change the page geometry at all? it seems like you are just asking for 8cm space on the first page???? that is easy just \vspace*{8cm} ???? – David Carlisle Mar 31 '17 at 19:17
1

It is hard (more or less impossibly hard in classical TeX) to change the text width after an automatic page break, so your implied general question has no good answer.

But the example implied by the code is a much simpler case, you do not seem to want to change the margins at all just have 8cm of space on the first page, so

\documentclass{scrartcl}
\usepackage[left=2.5cm, right=2cm, top=2cm, bottom=2cm]{geometry}
\usepackage{lipsum}


\begin{document}
\vspace*{8cm}
\lipsum[1-10]
\end{document}

enter image description here

| improve this answer | |
  • That could be a hack.. – Shalec Mar 31 '17 at 19:44
  • An elegant way to avoid my geometry-issue. Thank you for that input! – Shalec Mar 31 '17 at 19:46

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.