I am looking for an automated mechanism to change the effective \textwidth at the first pagebreak of a letter in scrpage2. I've tried \afterpage and \nextpage (ideally they would be set within \firsthead), both without success. I do not want to use the geometry package because firstly, IMO scrlttr2 should work with a change of KOMAoptions and friends and secondly, it does not seem to work anyways if used within scrlttr2 and the KOMA layout. Ideas and suggestions are very welcome.
Here's a MNWE. Page 2 and following should have a wider text block than the first page — but doesn't.
\documentclass{scrlttr2}%
\usepackage[english]{babel}
\usepackage{lipsum,afterpage}%
\setlength{\textwidth}{125mm}%
\nexthead{%
\global\areaset{170mm}{\textheight}%
\global\KOMAoptions{DIV=areaset}%
\global\recalctypearea%
}
\afterpage{%
\global\areaset{170mm}{\textheight}%
\global\KOMAoptions{DIV=areaset}%
\global\recalctypearea%
}
\begin{document}
\begin{letter}{Receipient}
\opening{Dear receipient,}
\lipsum[1-6]
\closing{Yours}
\end{letter}
\end{document}
And BTW, I genuinely think that this is not covered by Change \textwidth and \textheight in mid-document and related questions and instead somehow relates to the internals of the KOMA classes.
\ejector\clearpageas first commands into the\nextheadand\afterpagearguments, it still doesn't work. And despite an increased argument to\lipsum, the modified\textwidthdoes not even show at later pages. – bjoseru Oct 30 '12 at 16:52\globalwith a single primitive assignment if you go\global\areasetyou just make a single assignment at the start of the expansion of areaset global. As far as I can see this will be the assignment of\reserved@din the middle of\@ifnextcharlooking for an optional argument. No length assignments will be global. – David Carlisle Oct 30 '12 at 18:00adjustwidthenvironment from thechangepagepackage? – cmhughes Oct 30 '12 at 22:09changepagepackage. This does almost what I want:\afterpage{% \pagebreak \global\setlength{\textwidth}{17cm}% \global\setlength{\columnwidth}{\textwidth}% \global\setlength{\hsize}{\columnwidth}% \global\setlength{\linewidth}{\hsize}}%Except that the\pagebreak(or\ejector\clearpage) does not do what I want it to do. As you say, the pagebreak has already taken place.\firstfootdoes not seem to work either. – bjoseru Oct 31 '12 at 09:16\textwidthat exactly the page break and not after the end of the first (broken across pagebreak) paragraph on page 2. But as I understand you, this won't be possible without additional machinery like luatex. Pity. However I think that your reply, while a negative answer, deserves the status answer. – bjoseru Oct 31 '12 at 09:28changepagepackage, inspection of its\ch@ngetextmacro was indeed helpful. +1 – bjoseru Oct 31 '12 at 09:30\parshapethat sets up a non-rectangular paragraph with n lines of one textwidth and then the remaining lines at the second textwidth. This is really pushing the limits of what is possible in TeX. If you allow yourself a manual forced break you can force the page break change the size and re-start the paragraph with\noindentso it is a continuation not a new para. It is so much easier:-) – David Carlisle Oct 31 '12 at 09:48