4

How can I position a fullwidth logo in the top left corner of my scrlttr2 document? The following code leaves a small but noticable gap.

\documentclass[12pt,ngerman]{scrlttr2}
\usepackage{babel}
\setkomavar{fromname}{Just me}

\makeatletter
\@setplength{firstheadhpos}{0mm}
\@setplength{firstheadvpos}{0mm}
\makeatother

\firsthead{
\rule{\paperwidth}{3cm}
}

\begin{document}
\begin{letter}{John Doe \\ Berlin}
\opening{Dear John,}

\closing{Mit freundlichen Scherzen,}

\end{letter}
\end{document}

scrlttr2

6

The problem is that

\firsthead{
\rule{\paperwidth}{3cm}
}

adds horizontal space if you don't avoid it putting a % after \firsthead{, so you would have to write

\firsthead{%
\rule{\paperwidth}{3cm}
}

Moreover, the use of \firsthead is deprecated. You should use the following syntax instead:

\setkomavar{firsthead}{%
\rule{\paperwidth}{3cm}%
}

Complete MWE

\documentclass[12pt,ngerman]{scrlttr2}
\usepackage{babel}
\setkomavar{fromname}{Just me}

\makeatletter
\@setplength{firstheadhpos}{0mm}
\@setplength{firstheadvpos}{0mm}
\makeatother

\setkomavar{firsthead}{%
\rule{\paperwidth}{3cm}%
}

\begin{document}
\begin{letter}{John Doe \\ Berlin}
\opening{Dear John,}

\closing{Mit freundlichen Scherzen,}

\end{letter}
\end{document} 

Output:

enter image description here

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.