[Tex/LaTex] komascript scrlttr2: how to put recipient’s address on the right

scrlttr2

I need to put the recipient's address on the right of the letter.

I'm using scrlttr2 class and I know that it is very flexible, but I can't find a way to do that.

Best Answer

The horizontal position of the the address field is determined by the pseudolength toaddrhpos. A value of toaddrhpos greater than 0 means the distance from the left border, a value lower than 0 means the distance from the right border.

So you could use something like

\makeatletter
\@setplength{toaddrhpos}{-1cm}
\makeatother

or

\makeatletter
\@setplength[-]{toaddrhpos}{\useplength{toaddrhpos}}
\makeatother

enter image description here

Code:

\documentclass{scrlttr2}
%%% only to show the fields, do not use in your real document
\LoadLetterOption{visualize}
\showfields{address,head}
%%%
\makeatletter
\@setplength[-]{toaddrhpos}{\useplength{toaddrhpos}}
\makeatother
\usepackage{blindtext}% for dummy text
\begin{document}
\begin{letter}{Max Mustermann\\Musterstr.12\\12345 Musterhausen}
\opening{Hello}
\blindtext
\end{letter}
\end{document}

Other pseudolengths related to the address field are toaddrvpos, toaddrwidth and toaddrheight.

And you can use \addtokomafont{addressee}{\raggedleft} to right align the address in the address field:

enter image description here

Code:

\documentclass[backaddress=false,fromalign=right]{scrlttr2}
%%% only to show the fields, do not use in your real document
\LoadLetterOption{visualize}
\showfields{address,head}
%%%
\makeatletter
\@setplength[-]{toaddrhpos}{\useplength{toaddrhpos}}
\makeatother
\addtokomafont{addressee}{\raggedleft}

\setkomavar{fromname}{Kombi Karle}
\setkomavar{fromaddress}{Kaiserstr.\\Karlsruhe}
\usepackage{blindtext}% for dummy text
\begin{document}
\begin{letter}{Max Mustermann\\Musterstr.12\\12345 Musterhausen}
\opening{Hello}
\blindtext
\end{letter}
\end{document}

But there are also some Letter Class Option files included in the KOMA-Script Distribution having the recipient's address on the right.

Use \LoadLetterOption{SN} (Swiss letters with address field on the right side) in the preambel to get:

enter image description here

Or \LoadLetterOption{NF} (French letters):

enter image description here