In scrlttr2
, I wish to align the address with the body of the letter. I tried this:
\@setplength{toaddrhpos}{\oddsidemargin}
But it moves the address almost to the left edge of the paper.
How can I achieve the alignment that I desire?
Example:
h.lco
\ProvidesFile{h.lco}[2012/07/25]
\@setplength{toaddrhpos}{\oddsidemargin}
\endinput
letter.tex
\documentclass[h]{scrlttr2}
\usepackage[english]{babel}
\begin{document}
\begin{letter}{Name\\Address\\City}
\opening{Dear Madam or Sir:}
Hello.
\closing{Very truly yours,}
\end{letter}
\end{document}
Best Answer
Markus Kohm, the author if KOMAscript, has included a
nowindow
-lco in the samples to his book (see Beispiele aus der 4. Auflage des KOMA-Script-Buches). The sources for the file is:Copy this source to a text editor and save it as
nowindow.lco
in your tex search path (yourtexmf-local
), or to the same directory as your letter. Remember to update the tex file database (runtexhash
or whatever command on your system, for example ‘Refresh FNDB’ from the Settings in MiKTeX.)A MWE for the use of
nowindow.lco
:EDIT: PSH asks why you have to add 1in to the
\toaddrhpos
. This is explained by Markus Kohn in this reply at Komascript’s home page. An approximate translation from German:(German natives, feel free to improve the translation.)