aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--wmletterhead.cls31
1 files changed, 31 insertions, 0 deletions
diff --git a/wmletterhead.cls b/wmletterhead.cls
index ef23549..ebb66e7 100644
--- a/wmletterhead.cls
+++ b/wmletterhead.cls
@@ -110,6 +110,13 @@
\renewcommand{\headrulewidth}{0pt}%
\fancyfoot[C]{\thepage}%
}
+
+\newcommand{\wmaddress}{
+ {\raggedleft\begin{tabular}{l@{}}\ignorespaces
+ \fromaddress \\*[2\parskip]%
+ \@date \end{tabular}}%
+}
+
\fancypagestyle{firstpage}{% looks like this has no effect for the letter class
\wmheader{}%
}
@@ -118,6 +125,30 @@
}
\fancypagestyle{empty}{% some how this is the very first page style
\wmheader{}%
+ \settoheight{\headheight}{\hbox{\wmaddress}}%
+ \newlength{\wmaddresswidth}
+ \settowidth{\wmaddresswidth}{\hbox{\wmaddress}}%
+ \newlength{\wmaddresshpos}
+ \setlength{\wmaddresshpos}{\paperwidth}
+ \addtolength{\wmaddresshpos}{-\wmrightmargin}
+ \addtolength{\wmaddresshpos}{-\wmaddresswidth}
+ \fancyhead[R]{%
+ \begin{textblock*}{\wmaddresswidth}(\wmaddresshpos{},\wmlogovpos{})%
+ \wmaddress{}%
+ \end{textblock*}%
+ }%
}
\pagestyle{plain}% important! if switched to fancy pages 2, 3, ... do not have logo
+% -------------------------------------------------------------------
+% Now let redefine opening so address goes to the right of logo
+\renewcommand*{\opening}[1]{\ifx\@empty\fromaddress
+ \thispagestyle{firstpage}%
+ {\raggedleft\@date\par}%
+ \else % home address
+ \thispagestyle{empty}%
+ \fi
+ {\raggedright \toname \\ \toaddress \par}%
+ \vspace{2\parskip}%
+ #1\par\nobreak}
+% -------------------------------------------------------------------