[Tex/LaTex] How to put sender address to the right on top of date in scrlttr2

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}

\KOMAoptions{foldmarks=off,backaddress=false,fromalign=right}

\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.

Best Answer

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:

Sample output

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

\KOMAoptions{foldmarks=off,backaddress=false,fromalign=locationright,refline=nodate}

\renewcommand*{\raggedsignature}{\raggedright}

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

\begin{document}

\begin{letter}{Addressee\\Road\\Town\\County}
\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:

Blank line before date