2

I have an overfull vbox in the header of a letter which I would like to suppress. Following mwe:

\documentclass{scrartcl}
\usepackage{scrletter}
%\vfuzz=15pt
\KOMAoptions{
  fromalign = right,
  fromemail = true,
  frommobilephone = true,
  fromphone = true,
  fromurl = true,
  backaddress = underlined,
}
\begin{document}
\setkomavar{fromname}{ich}
\setkomavar{fromaddress}{irgendwo\\mehrzeilig\\stadt}
\begin{letter}{Vorname Nachname\\Position\\Firma\\Strasse}

\opening{Hallo,}
\end{letter}
\end{document}

The from address and the to address overlap a bit, thus I get an overfull vbox (and additionally a scrletter warning about it). I know I can suppress the compiler notice about the overfull vbox with vfuzz like in line 3. But I still have the scrletter warning.

Is there an vfuzz-equivalent in koma script?

I know I could simply ignore the message, the output is the same, but I don't want to miss other maybe more important warnings later on because of that.

thanks for helping!

EDIT: the answer below from esdd works, but if possible I would prefer a solution without patching koma-script macros due to the danger esdd mentioned.

2 Answers 2

1

Instead of patching an internal command like in my other answer you can rebuild the header of the first page using the variable firsthead:

\documentclass{scrartcl}
\usepackage{scrletter}

\setkomavar{firsthead}{%
  \parbox[t][2\baselineskip][t]{\useplength{firstheadwidth}}{%
    \raggedleft\usekomafont{fromaddress}
    {\usekomafont{fromname}\usekomavar{fromname}}\\
    \usekomavar{fromaddress}%
    \ifkomavarempty{fromphone}{}
      {\\\usekomavar*{fromphone}\usekomavar{fromphone}}
    \ifkomavarempty{frommobilephone}{}
      {\\\usekomavar*{frommobilephone}\usekomavar{frommobilephone}}%
    \ifkomavarempty{fromemail}{}
      {\\\usekomavar*{fromemail}\usekomavar{fromemail}}%
    \ifkomavarempty{fromurl}{}
      {\\\usekomavar*{fromurl}\usekomavar{fromurl}}%
  }%
}

\begin{document}
\setkomavar{fromname}{ich}
\setkomavar{fromaddress}{irgendwo\\mehrzeilig\\stadt}
\setkomavar{fromphone}{1234}
\setkomavar{frommobilephone}{5678}
\setkomavar{fromemail}{[email protected]}
\setkomavar{fromurl}{wir.xxx}

\begin{letter}{Vorname Nachname\\Position\\Firma\\Strasse}

\opening{Hallo,}
\end{letter}
\end{document}

Result:

enter image description here


But you could also change the layout of the letter page. Maybe you reduce informations in the head and put them in the foot using variable firstfoot. Or you can place the from-information in the location field changing option fromalign=right to

fromalign=locationright

enter image description here

Or you can change the fontsize using

\addtokomafont{fromname}{\footnotesize}
\addtokomafont{fromaddress}{\footnotesize}

enter image description here

1
  • fromalign=locationright is the best solution for me. I originally changed firstheadvpos anyway, so now I just changed the locvpos and it looks the same, without warnings and without much patching/redefining. thanks a lot for the help.
    – El Cattivo
    Nov 23, 2018 at 13:31
2

Disclaimer: It is not recommended to patch internal KOMA-Script commands. Such patches can break in the future.

With current KOMA-Script versions you can avoid the warnings regarding the height of your first head using

\usepackage{xpatch}
\makeatletter
% warning: patching an internal KOMA-Script command is not recommended- it could break in the future
\xpatchcmd{\@savevbox}
  {\addtolength{\@tempdimb}{\dp0}}
  {%
    \addtolength{\@tempdimb}{\dp0}%
    \ifstr{#5}{firstheadvpos}
      {\addtolength{\@tempdimb}{-15pt}}% <- adjust the length to your needs
      {}%
  }
  {}{\PatchFailed}
\makeatother

Example:

\documentclass{scrartcl}
\usepackage{scrletter}

\usepackage{xpatch}
\makeatletter
% warning: patching an internal KOMA-Script command is not recommended- it could break in the future
\xpatchcmd{\@savevbox}
  {\addtolength{\@tempdimb}{\dp0}}
  {%
    \addtolength{\@tempdimb}{\dp0}%
    \ifstr{#5}{firstheadvpos}
      {\addtolength{\@tempdimb}{-15pt}}% <- adjust the length to your needs
      {}%
  }
  {}{\PatchFailed}
\makeatother

\KOMAoptions{
  fromalign = right,
  fromemail = true,
  frommobilephone = true,
  fromphone = true,
  fromurl = true,
  backaddress = underlined,
}
\begin{document}

\setkomavar{fromname}{ich}
\setkomavar{fromaddress}{irgendwo\\mehrzeilig\\stadt}
\begin{letter}{Vorname Nachname\\Position\\Firma\\Strasse}

\opening{Hallo,}
\end{letter}
\end{document}
1
  • Thanks a lot. It works for me, but I am aware of the danger with patching koma-script macros. Maybe I rather live without it or I end up breaking more than it helps.
    – El Cattivo
    Nov 23, 2018 at 10:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .