16

There is a blank line between the back address and the address? How can I remove it?

\documentclass{scrlttr2} 
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{ngerman,    ae}
\usepackage[babel,german=quotes]{csquotes} % Deutsche Gänsefüßchen

\KOMAoptions{backaddress=true} 

\setkomavar{fromname}{<Name back address>}      
\setkomavar{fromaddress}{<street back address>\\ <town back address>}

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

The document class scrlttr2 doesn't use normal length adjusting there contents. Instead it uses pseudolengths. The most important length are described in scrguien or the German version scrguide. Both documentations have a great picture which are showing the pseudolengths. To explain my solution here the picture:

enter image description here

In your case you must change the height toaddrheight because the complete return address and adress are putted in one vertical box with the specific height. The distance is done be \vfil. So to reduce the distance between return address and adress you must reduce the pseudolength toaddrheight. Related to the documentation this is done by:

\makeatletter
\setlength{\@tempskipa}{-2cm}%
\@addtoplength{toaddrheight}{\@tempskipa}
\makeatother

If I add this lines to your example I get the following result:

enter image description here

Here the example:

\documentclass[ngerman]{scrlttr2} 
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{babel}
%\usepackage{ngerman,    ae}%veraltet
\usepackage[babel,german=quotes]{csquotes} % Deutsche Gänsefüßchen

\KOMAoptions{backaddress=true} 

\setkomavar{fromname}{<Name back address>}      
\setkomavar{fromaddress}{<street back address>\\ <town back address>}
\makeatletter
\setlength{\@tempskipa}{-2cm}%
\@addtoplength{toaddrheight}{\@tempskipa}
\makeatother
\begin{document}
 \begin{letter}{name\\ street\\ town}       
  \opening{Hello}
  some text
  \end{letter}
\end{document}

Note The packages ngerman and ae are obsolete. Use babel with the specific language ngerman.

The difficult setting of such lengths are basing on the simple statement: Normally a user doesn't need to change any length.

  • 1
    Note that nowadays, changing the length would be done that way \addtoplength[-]{toaddrheight}{2cm} without the requirement to change @ behaviour or to define a temporary variable. – Archange Apr 9 at 15:03
6

Since KOMA-Script Version 3.17 you can use:

\KOMAoptions{addrfield=topaligned}

enter image description here

Code:

\documentclass{scrlttr2}
\KOMAoptions{addrfield=topaligned}

\setkomavar{fromname}{Name back address}      
\setkomavar{fromaddress}{street back address\\ town back address}
\begin{document}
 \begin{letter}{name\\ street\\ town}       
  \opening{Hello}
  some text
  \end{letter}
\end{document}

Update regarding the comments:

If there should be a bit more space below the backaddress, you can use \setkomavar{specialmail}{\mbox{}} as suggested by Rasmus in a comment below. Then the result would be

enter image description here

If this space should be enlarged, you can use \setkomavar{specialmail}{\strut}. To change the size of the strut, change the settings of the font element specialmail, eg: \addtokomafont{specialmail}{\Huge}. Alternativly an invisible rule can be used,eg: \setkomavar{specialmail}{\rule{0pt}{5mm}}

  • 2
    If one wants a bit more space between the backaddress and the 'proper' address, one can use \setkomavar{specialmail}{\mbox{}} – Rasmus Feb 6 '17 at 12:07
  • @Rasmus That’s great. Any way to expand that vertical space even further? It seems the “specialmail” is either empty and invisible or has a fixed height which cannot be changed. – caw Feb 8 at 18:08
  • 1
    @caw See my updated answer. – esdd Feb 9 at 19:00
  • @esdd Thanks a lot, that works perfectly. Any reason why \rule{0mm}{25mm} works while \vspace{25mm} does not? – caw Feb 10 at 22:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.