[Tex/LaTex] scrlttr2 Change vertical space between sender address and email/phone

koma-scriptlettersscrlttr2

Is it possible to control the vertical space between different elements in the sender-block of scrlttr2, i.e. increase the space between the address (street + town) and the following elements (email+phone+url+…)?

\documentclass[
    fromphone=on,
    fromemail=on]{scrlttr2} 

\setkomavar{fromname}{name}      
\setkomavar{fromaddress}{street\\ town}
// CONTROL SPACE BETWEEN THESE ELEMENTS
\setkomavar{fromphone}{phone}
\setkomavar{fromemail}{mail}

\begin{document}
 \begin{letter}{name\\ street\\ town}       
  \opening{Hello}
  some text
  \end{letter}
\end{document}

Best Answer

You can do this by patching the internals of KOMA-script. You can place text as well, if you are feeling adventurous (i even used colour). But please, be sensible and don't do this.

Please be careful, too much space, and the phone number is printed in the receiver line.

\documentclass[
    fromphone=on,
fromemail=on]{scrlttr2} 

\setkomavar{fromname}{name}      
\setkomavar{fromaddress}{street\\ town}
\setkomavar{fromphone}{phone}
\setkomavar{fromemail}{mail}
\usepackage{xcolor}
\usepackage{etoolbox}
%\tracingpatches%for debugging
\makeatletter
\patchcmd{\@gen@firsthead}{\if@phone\\}{\if@phone\\[\baselineskip]}{}{}
\patchcmd{\@gen@firsthead}{\if@email\\}{\if@email\\\textcolor{blue}{You can place text}}{}{}
\makeatother

\begin{document}
\begin{letter}{name\\ street\\ town}       
    \opening{Hello}
    some text
\end{letter}
\end{document}

tobiasdietzScrlttr2

The OP Tobias Dietz made me aware (and provided an alternative solution), that the above solution does not work, if one chooses another alignment since etoolbox only replaces the first occurence of the replacement text. Package regexpatch by our respected member egreg comes to help.
To replace every occurence, use the starred variant of xpatchcmd:

\usepackage{regexpatch}
\makeatletter
%\tracingxpatches% for debugging
\xpatchcmd*{\@gen@firsthead}{\if@phone\\}{\if@phone\\[\baselineskip]}{}{}
\xpatchcmd*{\@gen@firsthead}{\if@email\\}{\if@email\\\textcolor{blue}{You can place text}}{}{}
\makeatother