# Move the recipient's address to match the opening of the envelope

I have got following Swiss-like letter layout, and I want to be able to move the recipient paragraph in order to match the opening of my envelope. And I want to have the place and date slipped horizontally to be aligned with the recipient's paragraph.

I have tried quite a few things, but since I am new to LaTex, I still don't understand most of its tricks. For instance, I don't understand why, in following code, things like my name and the date are defined with \setkomavar before the \begin{document}, but the recipient's paragraph is defined inside latter document section...

How can I reach my needs ?

\documentclass[
SN,% lco file for swiss letters (SN 010 130))
refline=dateleft,
firstfoot=false,
enlargefirstpage,
foldmarks=false,
parskip=half-
]{scrlttr2}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage[french]{babel}

\setkomavar{fromname}{John Doe}
\setkomavar{fromaddress}{My Street \\ My City \\ Suisse}
% adapter ces deux lignes :
\setkomavar{date}{Vevey, \today}
\setkomavar{subject}{Titre de la lettre}
\setkomafont{title}{\bfseries\normalsize\raggedright}

\makeatletter
\makeatother

\renewcommand\raggedsignature{\raggedright}

\usepackage{blindtext}% dummy text
\begin{document}
\begin{letter}{Compagny\\Contact person\\Street\\City}
\opening{Dear Mr. Forexample,}
\blindtext

\blindtext
\closing{Meilleures pensées}
%\encl{enclosures} % pièces jointes
%\cc{other recipients}
\end{letter}
\end{document}


To visualize the positions of the address field and the reference line you can use

% visualize positions of address and refline


With the MWE in the question you will get

SN.lco sets the pseudolengths for the address field to

\@setplength{toaddrvpos}{%
45mm}
-8mm}
90mm}
45mm}


So the address field is 45mm from top and 8mm from left paper border. To shift the address field you can use

\@addtoplength{toaddrhpos}{<horizontal shift>}


and maybe

\@addtoplength{reflinevpos}{<vertical shift>}


with the same <vertical shift>.

To align the date with the address field, you have to change the pseudolength for the reference line:

\@setplength{refwidth}{\useplength{toaddrwidth}}
\@setplength{refhpos}{\paperwidth}


Example:

\documentclass[
SN,% lco file for swiss letters (SN 010 130))
refline=dateleft,
firstfoot=false,
enlargefirstpage,
foldmarks=false,
parskip=half-
]{scrlttr2}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage[french]{babel}

\setkomavar{fromname}{John Doe}
\setkomavar{fromaddress}{My Street \\ My City \\ Suisse}
% adapter ces deux lignes :
\setkomavar{date}{Vevey, \today}
\setkomavar{subject}{Titre de la lettre}
\setkomafont{title}{\bfseries\normalsize\raggedright}

% visualize positions of address and refline

\makeatletter

% align refline with address horizentally
\@setplength{refhpos}{\paperwidth}
%
\makeatother

\renewcommand\raggedsignature{\raggedright}

\usepackage{blindtext}% dummy text
\begin{document}
\begin{letter}{Compagny\\Contact person\\Street\\City}
\opening{Dear Mr. Forexample,}
\blindtext

\blindtext
\closing{Meilleures pensées}
\end{letter}
\end{document}


Result:

KOMA-Script version 3.26 (current version is 3.25) will introduce commands \setplength and \addtoplength to replace \@setplength and \@addtoplength in the document code.

Additional remark: You can set the KOMA-Script variables like date, subject for a single letter locally. Then you have to use \setkomavar{subject}{<subject of the letter>} between\begin{letter}and\opening`.