3

Starting point should be this simple minimum example with the fromrule below the senders name and the senders personal data aligned to the right hand side:

\documentclass{scrlttr2}

\KOMAoptions { fromalign=right,
               fromrule=aftername }

\usepackage[english, ngerman]{babel}

\begin{document}

    \setkomavar{fromname}    {John Doe (sender)}
    \setkomavar{fromaddress} {25th Doe's Avenue \\ 54321 Springfield}

\begin{letter}  { Maria Lae\\
                  2th Coast Road\\
                  12345 Milltown }

        \opening{Dear Maria,}

            Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam
            nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam
            erat, sed diam voluptua.

        \closing{Sincerely yours}

\end{letter}

\end{document}

Unfortunately, both the fromrule and the set alignment disappear by use of a custom-made firsthead despite of performed activation by setting fromrule=aftername and fromalign=right in the preamble.

The only way to preserve fromrule and alignment is to remove the custom-made firsthead out of the source code.

How can I add the fromrule into a custom firsthead, for example inside this self made exemplary firsthead-code like the following:

\setkomavar{firsthead} {%
             {\usekomafont{fromname}\strut\ignorespaces\usekomavar{fromname}} \\
             {\usekomafont{fromaddress}\strut\ignorespaces\usekomavar{fromaddress}}
            }

Of course, I also could easily add an ordinary line by inserting...

\rule{\textwidth}{.5pt}

... at the final desired position (below the senders name) ...

\setkomavar{firsthead} {%
             {\usekomafont{fromname}\strut\ignorespaces\usekomavar{fromname}} \\
             \rule{\textwidth}{.5pt}
             {\usekomafont{fromaddress}\strut\ignorespaces\usekomavar{fromaddress}}
            }

... , but ordinary lines use completely different spaces and distances to the text than the fromrule. That's the reason why I want to continue to to use the fromrule instead of an ordinary one...

Do you have any ideas? Thank you very much for your help!

4

It is not possible to use the fromrule option together with firsthead. But here is an suggestion how you can get the same line as in your MWE:

\documentclass{scrlttr2}
%\KOMAoptions { fromalign=right,
               %fromrule=aftername }

\setkomavar{firsthead}{%
  \parbox{\textwidth}{
  \raggedleft
  {\usekomafont{fromname}\strut\ignorespaces\usekomavar{fromname}} \\[-.5\baselineskip]
  {\usekomafont{fromrule}\rule{\textwidth}{\useplength{fromrulethickness}}}\\
  {\usekomafont{fromaddress}\strut\ignorespaces\usekomavar{fromaddress}}
  }}

\usepackage[english, ngerman]{babel}

\begin{document}

\setkomavar{fromname}    {John Doe (sender)}
\setkomavar{fromaddress} {25th Doe's Avenue \\ 54321 Springfield}

\begin{letter}{Maria Lae\\
               2th Coast Road\\
               12345 Milltown}

  \opening{Dear Maria,}

  Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam
  nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam
  erat, sed diam voluptua.

  \closing{Sincerely yours}
\end{letter}
\end{document}

enter image description here

  • "It is not possible to use the fromrule option together with firsthead." Okay, I didn't know that for sure... Thank you very much! – Dave May 25 '15 at 10:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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