# How to put sender address to the right on top of date in scrlttr2

I am using scrlttr2 instead of the default letter for the various extra features it offers, but I want the fromaddress to be on top of the date and not in the page header. So I want it to look just like the default letter puts it.

Is there any way I could remove the sender address from the header and put it on the date (with just one line of space)?

I have this preamble so far:

\documentclass[paper=a4,parskip=full]{scrlttr2}
\usepackage[english]{babel}
\usepackage[latin1]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}

\renewcommand*{\raggedsignature}{\raggedright}


This puts the from address in the header on the right and not aligned with the date. I want it to be lower (just over the date) and aligned with the date.

-

You have made a reasonable start. scrlettr2 divides the page up in to various regions. At the top is a header region. Below that on the left is a region for the address the letter is to be sent to. At about the same level on the right-hand side is a region called location.

The option you choose fromalign=right moves the from address to the right, but keeps it in the header area. Instead the option fromalign=locationright, wiil move it down in to the location region.

Now by default the date appears in the reference line, a box placed below all these addresses. The date can be removed from that position, via the option refline=nodate. It can then be placed in the location region, by setting the koma variable location to the value of the koma variable date:

\setkomavar{location}{\usekomavar{date}}


Putting this together we get:

\documentclass[paper=a4,parskip=full]{scrlttr2}
\usepackage[english]{babel}

\renewcommand*{\raggedsignature}{\raggedright}

\setkomavar{fromname}{John Public}
54321 Public-Village}
\setkomavar{location}{\usekomavar{date}}

\begin{document}

\opening{Dear Sir,}
A short text that constitutes the body of the letter.
\closing{Yours sincerely}
\end{letter}

\end{document}


Should you wish to have more space before the date you can change the definition you give to location. For example,

\setkomavar{location}{\vspace{\baselineskip}\usekomavar{date}}


produces a blank line before the date:

-
Thanks that makes it look much better. The only remaining issue however is that the location with the fromaddress and the date is not aligned properly with the body text of the letter. It goes out like 1cm more or something to the right further than the letter's body which looks really awkward. Any idea how to make them aligned? – jbx Mar 25 '13 at 22:35
The questions of aligning the margins is addressed in tex.stackexchange.com/q/50594/15925 . Note however, by default the recepient address is meant to be positioned within the window of an envolope. – Andrew Swann Mar 27 '13 at 16:02
I already did see that, but I have no refline=wide in my case, but it is still making things wide. I don't want it to be positioned within the window of an envelope, its not going to be posted, its just a formal document in the form of a letter (like a reference letter). – jbx Mar 27 '13 at 16:50
You need the code in that answer adjusting toaddrhpos, i.e. \makeatletter \@setplength{toaddrhpos}{\dimexpr 1in +\oddsidemargin\relax} \makeatother in your preamble. – Andrew Swann Mar 27 '13 at 16:55
Erm, I have no toaddress in my letter. Its the from address I have to move (on the right). I tried using the same code but with fromaddrhpos, nothing happened. :( – jbx Mar 27 '13 at 16:57