Text FormattingKOMA-Script, scrlttr2 | Format for Sender Address

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
darose78
Posts: 2
Joined: Sat Apr 21, 2012 10:29 am

KOMA-Script, scrlttr2 | Format for Sender Address

Post by darose78 »

I am new to TeX, but enjoying the learning experience (still on Line 1 Page 1 of the book), so please forgive me for asking a question that may have been asked before.
I am endeavouring to write a letter UK style using the KOMA-Script "scrlttr2" class. This means aligning the from address on the right of the page. After trial and error (mostly the latter) I succeeded. However, no matter how I try I cannot seem to get the vertical position as I wiould wish, namely immediately below the top margin.
Script so far:

Code: Select all

\documentclass[
  standard,
  backaddress=off,
  fromalign=locationleft
]{scrlttr2}
\usepackage[UKenglish]{babel}
\usepackage{changepage}
   
\begin{document}
\makeatletter
\@setplength{backaddrheight}{0pt}
\let\@texttop\relax
\makeatother			

\begin{letter}{
  Donald Duck and Co.\\
  Disneyland\\
  Wherever\\
}

\setkomavar{subject}{Re: Appeal for alimony}
\opening{Dear Donald,}
     
My name is Daisy \ldots\

\closing{Regards}
\end{letter}
\end{document}
I managed to accomplish this using the "letter" class, but not yet with the KOMA-Script "scrlttr2" class, which judging from the enthusiastic way in which has been espoused, offers greater flexibility once mastered.

I have searched as well as I am able, but am unable to resolve this. Any help appreciated. I suspect that when I get to grips with this, I shall have the key to progressing more rapidly.


TIA David
Last edited by localghost on Thu May 03, 2012 11:22 am, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

KOMA-Script, scrlttr2 | Format for Sender Address

Post by localghost »

Your example doesn't contain any data of the sender. So its not clear how you managed to align it on the right side of the page. A very simple example (derived from your code) could look like shown below.

Code: Select all

\documentclass[
  backaddress=off,
  fromalign=right
]{scrlttr2}
\usepackage[UKenglish]{babel}

\setkomavar{fromname}{Daisy Duck}
\setkomavar{fromaddress}{Duckstreet 1\\00000 Ducktown\\ Disneyland}
\setkomavar{fromphone}{+00\,000\,00\,00\,00}
\setkomavar{fromemail}{daisy.duck@disneyland.net}

\makeatletter
\@setplength{backaddrheight}{0pt}
\let\@texttop\relax
\makeatother                   

\begin{document}
  \begin{letter}{
    Donald Duck and Co.\\
    Disneyland\\
    Wherever\\
  }

  \setkomavar{subject}{Re: Appeal for alimony}
  \opening{Dear Donald,}

  My name is Daisy \ldots\

  \closing{Regards}
  \end{letter}
\end{document}
The vertical position of the letter head can be adjusted by the firstheadvpos pseudo length register.

Further adjustments might be necessary with the help of Chapter 6 in the KOMA-Script user guide.


Best regards and welcome to the board
Thorsten
darose78
Posts: 2
Joined: Sat Apr 21, 2012 10:29 am

Re: KOMA-Script, scrlttr2 | Format for Sender Address

Post by darose78 »

Many thanks for your reply. Unfortunately it changed the vertical position to what I envisaged, but changed the justification to 'flush right', whereas I wanted it flush left. Simply put, I wanted it to be approx. .8in below the top edge of the page and approximately 5.5in from the left hand edge of the paper, and to be left justified. I tried tinkering with 'firstheadvpos' with no joy, but perhaps I tried to set it incorrectly.
Since my query coincided with the news of the release of Koma-script 3, perhaps, I should see whether this offers me more control?
Post Reply