3

I would like to change the margin with the beginning of the second page simply by using a KOMA-script option: mpinclude=true. It works, if I write at the end of the text on page 1 this line:

\KOMAoptions{mpinclude=true}\recalctypearea{}

But the drawback is a pagebreak exactly where I put this line.

So I'd like to postpone the command to the end of the page. I found the package everyshi, which offers the command \AtNextShipout.

The following MWE does not work, the margin does not change on the second page, but I get the words [current]last as first line of the second page.

Any ideas?

\documentclass{scrartcl}

\usepackage{everyshi}
\usepackage{blindtext}

\begin{document}
Here is some text.
\AtNextShipout{\KOMAoptions{mpinclude=true}\recalctypearea{}}

\blinddocument
\end{document}

This MWE is rather short. My file as well uses the packages scrletter and some *.lco customisation.

Keks Dose
  • 30,892
  • But you are aware that it won't work if you have a paragraph that is split at the end of page 1? – Ulrike Fischer Apr 27 '18 at 14:35
  • @UlrikeFischer Öh, no?! Why not? Can't I add a \par into the argument of \AtNextShipout? Or something like this? Or ist there something like \AtEndOfLastParagraphFullyOnPage? But if no good solution, then let's forget about it and I add the \AtNextShipoutafter finishing the article. – Keks Dose Apr 27 '18 at 14:38
  • Well a paragraph is built first and a page split is done later. So the paragraph will always have the line width of the first page. – Ulrike Fischer Apr 27 '18 at 14:44
  • @UlrikeFischer If you have an idea for a solution that worked, if the pagebreak isn't in the middle of a paragraph, => great. If the pagebreak is inside, then maybe the last lines on the first page may run shorter or on the next page longer, I can manually correct it. – Keks Dose Apr 27 '18 at 14:47
  • See https://tex.stackexchange.com/questions/79737/change-textwidth-after-first-page-in-scrlttr2/79827#79827 – Ulrike Fischer Apr 27 '18 at 15:01
  • @UlrikeFischer I'll read that and report whether it works or not. Thank you! – Keks Dose Apr 27 '18 at 15:04
  • @KeksDose Can we close the question as a duplicate of Ulrikes link? See also section »C.2. Satzspiegeländerungen zwischen zwei Seiten« in the KOMA-Script book (6th edition; section D2 in 5th edition). – esdd May 10 '18 at 14:11
  • 1
    @esdd Yes to closing. Question asked to early, will ask again after switching to LuaTeX, whenever that will be. I'll read the new version of Appendix C in the book asap. Thank you! – Keks Dose May 11 '18 at 07:53

0 Answers0