I use this class definition in the preamble of my document:
\documentclass[template,
backaddress=off,
foldmarks=false,
enlargefirstpage,
pagenumber=off,
parskip=half
]{scrlttr2}
I set the header with logo on the left and information on the right like this:
\firsthead{
\parbox[b]{\textwidth}{\raggedleft{
\rlap{\usekomavar{fromlogo}}
\addfontfeature{LetterSpace=20.0}\fontsize{12}{17}\selectfont\scshape \usekomavar{fromname}\\[3mm]
\fontsize{11}{11}\selectfont\scshape \usekomavar{position} \\ \usekomavar{department}
}%
}%
}%
Yet the logo and return address are not aligned. In any other class I could use the fancyhdr package to specify left and right head like this:
\usepackage{fancyhdr}
\setlength{\headheight}{1cm}
\setlength{\headwidth}{\textwidth}
\fancyhead[L]{ % left
\addfontfeature{LetterSpace=20.0}\fontsize{12}{17}\selectfont\scshape
\usekomavar{fromname}\\[3mm]
\fontsize{11}{11}\selectfont\scshape \usekomavar{position} \\
\usekomavar{department}
}
\fancyhead[R]{ % right
\includegraphics[width=4cm]{kuleuven_zwart.eps}
}
\pagestyle{fancy}
yet this won't work for the letter class. How can I achieve something similar?
Template code:
\ProvidesFile{template.lco}
\usepackage{graphicx}
\usepackage{fontspec}
\usepackage{marvosym}
\usepackage{eso-pic}
\usepackage{geometry}
\geometry{a4paper, textwidth=17cm, textheight=22cm, marginparsep=16cm, marginparwidth=1cm}
\newkomavar{department}
\newkomavar{position}
\setkomavar{fromlogo}{\includegraphics[width=4cm]{kuleuven_zwart.eps}}
% === FORMATTING STUFF
\@setplength{backaddrheight}{0cm}
% shift the page body on the left to make room for data and logo
\setlength{\oddsidemargin}{\useplength{toaddrhpos}}
\addtolength{\oddsidemargin}{-1in}
\l@addto@macro{\@typearea@end}{
\setlength{\oddsidemargin}{\useplength{toaddrhpos}}
\addtolength{\oddsidemargin}{-1in}
}%
%set the font size and leading
\renewcommand{\normalsize}{\fontsize{10.0}{17}\selectfont}
% === HEADER DEFINITION
\firsthead{
\parbox[b]{\textwidth}{\raggedleft{
\rlap{\usekomavar{fromlogo}}
\addfontfeature{LetterSpace=20.0}\fontsize{12}{17}\selectfont\scshape \usekomavar{fromname}\\[5mm]
\fontsize{11}{11}\selectfont\scshape \usekomavar{position} \\ \usekomavar{department}
}%
}%
}%
\endinput
Document:
\documentclass[template,
backaddress=off,
foldmarks=false,
pagenumber=off,
]{scrlttr2}
\usepackage{lipsum}
\setkomavar{fromname}{this}
\setkomavar{position}{is not}
\setkomavar{department}{aligned}
\begin{document}
\begin{letter}{%
Yeti\\%
from Himalayah\\%
}
\opening{Dear,}
\lipsum
\closing{Regards,}
\end{letter}
\end{document}
