Placement of logo and putting text on it in scrlttr2
I'm not sure I understand your question. Coding a new letterhead isn't that easy. Maybe we can ignore the idea of a "firsthead" (firsthead=off
) and put the elements on the page manually.
\documentclass[firsthead=off]{scrlttr2}
\usepackage{graphicx}
\usepackage{lipsum, picture, calc, booktabs}
% header picture on first page
\newlength{\xlength}
\newlength{\ylength}
\setlength{\xlength}{20mm}
\setlength{\ylength}{-40mm}
\usepackage{eso-pic}
\AddToShipoutPictureBG*{%
\AtPageUpperLeft{%
\put(\xlength, \ylength){
\includegraphics[width=\textwidth + 20mm,height=1in]{example-image-a}}
\put(\xlength,.5\ylength){
\scriptsize\textbf{~This is my logo}
}
\put(\xlength,\ylength+2\baselineskip){%
\begin{tabular}{ll}\toprule
Even a & tabular\\
may & follow!\\\bottomrule
\end{tabular}
}
}
}
\addtoplength{firstheadvpos}{-.3\ylength}
\addtoplength{locvpos}{5cm}
\setkomavar{fromname}{Aaron Berentsen}
\setkomavar{fromaddress}{Ceestreet 1\\Deetown}
\setkomavar{fromphone}{+12345678}
\setkomavar{fromfax}{+12345679}
\setkomavar{fromemail}{[email protected]}
\setkomavar{location}{%
\scriptsize
\begin{tabular}{ll}
\usekomavar*{fromphone}&\usekomavar{fromphone}\\
\usekomavar*{fromfax}&\usekomavar{fromfax}\\
\usekomavar*{fromemail}&\usekomavar{fromemail}\\[1em]
\end{tabular}
}
% sender
% date
\setkomavar{date}{\today}
% subject
\setkomavar{subject}{Subject}
\begin{document}
\begin{letter}{Addressee}
\opening{Dear Addresse,}
\lipsum[1]
\closing{Best wishes,}
\end{letter}
\end{document}
Not sure I fully understand the issue, but you can use \stackinset
to overlay text on the image.
\documentclass{scrlttr2}
\usepackage{graphicx}
\usepackage{lipsum,stackengine}
% header picture on first page
\usepackage{eso-pic}
\AddToShipoutPictureBG*{%
\AtPageUpperLeft{%
\raisebox{-\height}{%
\hspace*{1in}%
\stackinset{r}{.8in}{c}{0in}{\parbox{1in}{\scriptsize
\usekomavar*{fromphone}\usekomavar{fromphone}\\
\usekomavar*{fromfax}\usekomavar{fromfax}\\
\usekomavar*{fromemail}\usekomavar{fromemail}}}{%
\stackinset{l}{1in}{c}{0in}{\parbox{1in}{\scriptsize\bfseries
THIS\\IS\\MY\\LOGO}}{%
\includegraphics[width=\textwidth,height=1in]{example-image-a}%
}}%
}%
}%
}
\setkomavar{firsthead}{}
% sender
\setkomavar{fromname}{Aaron Berentsen}
\setkomavar{fromaddress}{Ceestreet 1\\Deetown}
\setkomavar{fromphone}{+12345678}
\setkomavar{fromfax}{+12345679}
\setkomavar{fromemail}{[email protected]}
% date
\setkomavar{date}{\today}
% subject
\setkomavar{subject}{Subject}
\begin{document}
\begin{letter}{Addressee}
\opening{Dear Addresse,}
\lipsum[1]
\closing{Best wishes,}
\end{letter}
\end{document}
I would use package scrlayer
and define a new page style that positions the picture at the desired place using pseudolengths:
\usepackage{scrlayer}
\DeclareNewLayer[
background,
voffset=\useplength{firstheadvpos},
hoffset=\useplength{toaddrhpos},
width=\useplength{firstheadwidth},
contents={\includegraphics[width=\layerwidth,height=1in]{example-image-a}}
]{firstheadpicture}
\DeclareNewPageStyleByLayers{firstpage}{firstheadpicture}
The first letter page uses page style empty
by default. I would patch \opening
to overwrite this default page style:
\usepackage{xpatch}
\xapptocmd\opening{\thispagestyle{firstpage}}{}{\PatchFailed}
fromemail
etc. should go to the location field:
\setkomavar{location}{\scriptsize
\usekomavar*{fromphone}\usekomavar{fromphone}\\
\usekomavar*{fromfax}\usekomavar{fromfax}\\
\usekomavar*{fromemail}\usekomavar{fromemail}
}
\setplength[.2]{locwidth}{\useplength{firstheadwidth}}% <- change the width of location to the desired value
Example:
\documentclass{scrlttr2}
%% to show the position of first head and location:
%\LoadLetterOption{visualize}
%\showfields{head,location}
\usepackage{graphicx}
\usepackage{lipsum}% only for dummy text
% picture in the background of first head
\usepackage{scrlayer}
\DeclareNewLayer[
background,
voffset=\useplength{firstheadvpos},
hoffset=\useplength{toaddrhpos},
width=\useplength{firstheadwidth},
contents={\includegraphics[width=\layerwidth,height=1in]{example-image-a}}
]{firstheadpicture}
\DeclareNewPageStyleByLayers{firstpage}{firstheadpicture}
\usepackage{xpatch}
\xapptocmd\opening{\thispagestyle{firstpage}}{}{\PatchFailed}
% first head
\setkomavar{firsthead}{%
\vskip .5cm%
\noindent\hspace*{3cm}%
\parbox{3cm}{\scriptsize\bfseries
THIS\\[.2em]
IS\\[.2em]
MY\\[.2em]
LOGO
}
}
% location
\setkomavar{location}{\scriptsize
\usekomavar*{fromphone}\usekomavar{fromphone}\\
\usekomavar*{fromfax}\usekomavar{fromfax}\\
\usekomavar*{fromemail}\usekomavar{fromemail}
}
\setplength[.2]{locwidth}{\useplength{firstheadwidth}}% <- change the width of location to the desired value
% sender
\setkomavar{fromname}{Aaron Berentsen}
\setkomavar{fromaddress}{Ceestreet 1\\Deetown}
\setkomavar{fromphone}{+12345678}
\setkomavar{fromfax}{+12345679}
\setkomavar{fromemail}{[email protected]}
% date
%\setkomavar{date}{\today}% default
\begin{document}
\begin{letter}{Addressee}
\setkomavar{subject}{Subject}% maybe you write more than one letter with different subjects in this document
\opening{Dear Addresse,}
\lipsum
\closing{Best wishes,}
\end{letter}
\end{document}
You could use
\LoadLetterOption{visualize}
\showfields{head,location}% address, foot and refline are also possible
in the preamble to show the position of head
and location
.