[Tex/LaTex] Positioning the address in a Letter

addresseslettersmarginspositioning

I need to place the right-side address differently in my .tex file but I can not figure out how to do. What I would like is to have the last line from the right-placed address at the same line as the first line of left-placed address. How is that possible ?

Here is my snippet code :

% !TeX encoding = utf8

\documentclass[a4paper]{letter}
\usepackage[lmargin=20mm, rmargin=20mm]{geometry}

\begin{document}
\begin{letter}{
            Nom\\
            Adresse 1\\
            Adresse 2\\
            Ville\\
            Pays\\
            Code Postal\\
            \vspace{0.5cm}
            Date}

\address{
            Nom\\
            Adresse 1\\
            Adresse 2\\
            Ville\\
            Pays\\
            Code Postal\\}

\date{}

\opening{Opening}

\closing{\mbox{}}

\end{letter}
\end{document}

When I compile that, I have two different address blocks (one on the left, and one on the right), but I would like to pull down the right one by playing with its position.

Any ideas how can I do that ?

Thank you.

Best Answer

There is no parameter for changing that vertical space, so the only way is to redefine the \opening command; the place to act upon is marked by <-----.

\documentclass[a4paper]{letter}
\usepackage[lmargin=20mm, rmargin=20mm]{geometry}
\usepackage{lipsum}

\makeatletter
\renewcommand*{\opening}[1]{\ifx\@empty\fromaddress
  \thispagestyle{firstpage}%
    {\raggedleft\@date\par}%
  \else  % home address
    \thispagestyle{empty}%
    {\raggedleft\begin{tabular}{l@{}}\ignorespaces
      \fromaddress \\*[2\parskip]%
      \@date \end{tabular}\par}%
  \fi
  \vspace{-5\parskip}% <------- was 2\parskip
  {\raggedright \toname \\ \toaddress \par}%
  \vspace{2\parskip}%
  #1\par\nobreak}
\makeatother

% the following definitions are just for showing the spaces
\protected\def\rightrule{\leavevmode\rlap{\vrule width \textwidth height 0.1pt depth 0.1pt}}
\protected\def\leftrule{\leavevmode\llap{\vrule width \textwidth height 0.1pt depth 0.1pt}}

\begin{document}
\begin{letter}{
            \rightrule Nom\\
            Adresse 1\\
            Adresse 2\\
            Ville\\
            Pays\\
            Code Postal\\
            \vspace{0.5cm}
            Date}

\address{
            Nom\\
            Adresse 1\\
            Adresse 2\\
            Ville\\
            Pays\\
            \leftrule Code Postal\\}

\date{}

\opening{Opening}

\lipsum

\closing{\mbox{}}

\end{letter}
\end{document}

The two commands \rightrule and \leftrule are just for showing the relative positions and aren't necessary for a normal job.

enter image description here

You may try scrlettr2 or lettre.

Related Question