I've been playing with the scrlttr2
class.
See example script below. I'm having some trouble with vertical positioning.
I've got a line at the top of my LaTeX files which add some version control accounting information to the output. See Embedding Mercurial version control information in a TeX document for the details.
For the purpose of this exercise, I just stuck in a string. I have a couple of questions.
-
It is possible to customize the extended letterhead in
scrlttr2
? I
thought it should be possible to add that accounting information
as part of the letterhead using the custom variablefirsthead
. But
I was unable to find any actual examples of the use offirsthead
.
The problem with my current setup is that placing that line using
eso-pic
overlaps the letterhead, so I have to move the letterhead
down. I do this usingfirstheadvpos
, but it would be better not to
have to do that. -
Also, moving the letterhead down starts to run into the
toaddress
.
How can I adjust the space between the letterhead and the
toaddress
? I would have expected the letterhead and the
toaddress
to automatically keep some relative space between
each other, but that doesn't seem to happen.
Here is the code.
\documentclass[12pt,foldmarks=true,foldmarks=blmtP,fromalign=center,
fromphone,fromemail,version=last, backaddress=false]{scrlttr2}
\usepackage{eso-pic,picture}
\AddToShipoutPictureBG*{
\AtPageUpperLeft{
\put(\oddsidemargin+1in+0.5\textwidth,-1.5cm){%
\makebox[0pt][c]{\textbf{ex.tex}
c1cf35eef2c30d69fd2c41171434f4f1acd32c0d 2015-03-15 20:17 +0530}}
}
}
\usepackage{fouriernc}
\begin{document}
\setkomavar{fromname}{Someone Else}
\setkomavar{fromaddress}{Some Other Bldg.\\ Some Road\\ Some City}
\setkomavar{fromphone}{22019466}
\setkomavar{fromemail}{faheem@faheem.info}
%\setkomavar{firsthead}[foo]{}
\makeatletter\@setplength{firstheadvpos}{1.7cm}\makeatother
\def\today{13th March, 2015}
\begin{letter}{
\vspace{0.5cm}
Someone\\ Some Org\\ Some Place\\ Some Road\\ Some City\\
Subject: Some subject}
\opening{Someone,}
\closing{Yours Sincerely,}
\end{letter}
\end{document}
Best Answer
AFAIK there is no way to add this information at the top of the default
first head
. Using the optionfromalign=Center
and the variablefirsthead
you can define your own header.Maybe you are looking for something like that
There is no relative space between
firsthead
andtoaddress
. The vertical position oftoaddress
is determined by the pseudolengthtoaddrvpos
absolutely. But there should be a minimum distance, so you get a warning that your first head is too high. That means the first head is too close to the address field.The space for the first head can be enlarged using
Then
-5pt
will be added to the pseudolengthfirstheadvpos
So the distance between the upper edge of the paper and the upper edge of the first head is decreased by 5pt. That means the margin above of the first head gets 5pt smaller.Another possibility is adding
5pt
totoaddrvpos
bySo the address field moves 5pt down and is no longer at the best place for a german window envelope.
The pseudolengths and the related commands are explained in the KOMA-Script documentation, chapter »Additional Information about the Letter Class scrlttr2 and the Letter Package scrletter«. There is also a figure showing the pseudolengths.
Code:
Of course you can customize the
firsthead
andfirstfoot
. As an exampleBut may be you only want to add the information above the first head without changing the letter layout. Then you can load the package
scrlayer
and add a layer to the pagestyleempty
Code: