[Tex/LaTex] Different textwidths on first and following pages with scrlttr2

marginsscrlttr2

Is it possible to have diverging values for \textwidth on the first page and all other pages.

On the first page I would like to set the width of the text to 12cm, on the following pages to 16cm.

\documentclass[ngerman,12pt]{scrlttr2}
\usepackage{babel,blindtext}

\setlength{\textwidth}{12cm}

\setkomavar{fromname}{Just me}
\setkomavar{fromaddress}{Just some place}

\begin{document}
\begin{letter}{Some one \\ Some Place}
\opening{fsdfsdafs}

\blindtext[5]

\closing{Best wishes}
\end{letter}
\end{document}

Best Answer

The basic technique is like this:

enter image description here

\documentclass[ngerman,12pt]{scrlttr2}
\usepackage{babel,blindtext}

\setlength{\textwidth}{16cm}

\setkomavar{fromname}{Just me}
\setkomavar{fromaddress}{Just some place}

\def\pshape#1{%
\parshape #1 \pshapexiicm{#1} 0pt 16cm }

\def\pshapexiicm#1{%
 \ifnum#1>1 0pt 12cm \expandafter
  \pshapexiicm\expandafter{\the\numexpr#1-1\expandafter\relax\expandafter}\fi}

\begin{document}



\begin{letter}{Some one \\ Some Place}
\opening{fsdfsdafs}

\pshape{26}
aaa\blindtext[5]

\closing{Best wishes}
\end{letter}
\end{document}

To make it more general you need to trap paragraph breaks and restart the new paragraph with a \parshape that has a reduced number of short lines, depending on how many lines you just did. (code could be stolen from the wrapfig package for that:-)

If however you have stretch parskip or anything else complicated on the page working out exactly how many short lines you need can be challenging.