Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

How can I align the body of the following letter with the adressfield. More precisely the text generated by

\setkomavar{subject}{\bfseries Subject}

\opening{Dear Mr. XY,}
\lipsum[6]       
\closing{Best regards}

should be alignet with the text generated by \begin{letter}{Mr. XY\\\TeX-Street \\ \LaTeX-City}

\documentclass[papaer=a4,refline=wide,enlargefirstpage=on]{scrlttr2}
\usepackage{ngerman}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}   
\usepackage{url}
\usepackage{lipsum}

\begin{document}
\LoadLetterOption{DIN}
\pagestyle{plain}

\begin{letter}{Mr. XY\\\TeX-Street \\ \LaTeX-City}

\setkomavar{subject}{\bfseries Subject}

\opening{Dear Mr. XY,}
\lipsum[6]   
\closing{Best regards}

\end{letter}   
\end{document}

enter image description here

Edit: Since there are no answers up to now I add this to the question and don't post a new one:

Is is also possible to align the right side of the body text with the right side of the date?

Edit2: From the answers up to now I see that I should clarify a point: I don't want to move the adressfield. Instead I want to enlarge the width of the body, such that it is alignet with the addressfield and with the date.

share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

Remove the refline=wide to align the date, and change toaddrhpos to align the address (it will no longer be at the correct place for a DIN-window) or as alternative change \oddsidemargin.

\documentclass[paper=a4,enlargefirstpage=on]{scrlttr2}
\usepackage{ngerman}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{url}
\usepackage{lipsum}
\LoadLetterOption{DIN}
\makeatletter
\@setplength{toaddrhpos}{%
  \dimexpr 1in +\oddsidemargin\relax}
%\oddsidemargin=\dimexpr\useplength{toaddrhpos}-1in\relax  
\makeatother  
\begin{document}

\pagestyle{plain}

\begin{letter}{Mr. XY\\\TeX-Street \\ \LaTeX-City}

\setkomavar{subject}{\bfseries Subject}

\opening{Dear Mr. XY,}
\lipsum[6]
\closing{Best regards}

\end{letter}
\end{document}
share|improve this answer
    
Thanks, that's it. Why does one need the 1in, seems to be adjusted manually... –  student Apr 3 '12 at 15:21
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.