Lately I just found the scrlttr2 class for my letters, as it has the SN
option that gets all I need, in less than 5-10 seconds. But if I would like to use it to make my CV cover letter, I need one particular option, to be able to draw a color background for my heading.
The thing is I played with the pirates engineer template (https://www.overleaf.com/latex/templates/pirate-engineer-template/sqfvydxkztqj), getting a decent CV, and I would like to find a way to keep the letter as profesional as it is, with my little personal touch.
So how can I draw the same kind of colored stripe with white colored text using the from *
macros/variable already present?
I tried adding TikZ packages and drawing some tabular or parbox, but it just shift my letter on the second page, while the first gets a shifted (by firstheadvpos
and firstheadhpos
) colorfilled rectangle, seemingly at the place of the heading, maybe going over the right margin (as I used minimum width=\paperwidth
in the TikZ setup).
MWE:
%\LoadLetterOption{SN} %% Lettere in stile svizzero
\usepackage{mwe}
\usepackage{geometry}
\usepackage[italian]{babel}
\usepackage{hyperref}
\usepackage{xcolor}
\definecolor{Green4}{HTML}{059108}
\usepackage{calc}
%% advanced drawing
\usepackage{tikz}
\usepackage{tikz-3dplot}
\usepackage{smartdiagram}
\usepackage{float}
\usepackage{array}
\usetikzlibrary{decorations.text}
\usetikzlibrary{fadings}
\usetikzlibrary{calc}
\usetikzlibrary{shapes.misc,positioning}
\usetikzlibrary{arrows}
\usetikzlibrary{arrows.meta}
\usetikzlibrary{backgrounds}
\usetikzlibrary{shadings}
\usetikzlibrary{calendar}
\usetikzlibrary{er}
\usetikzlibrary{patterns}
\usetikzlibrary{shapes}
\usetikzlibrary{shapes.geometric}
\usetikzlibrary{decorations}
\usetikzlibrary{topaths}
\renewcommand{\familydefault}{\sfdefault}
\date{\today}
\KOMAoptions{
paper=a4,
fromemail=true,
foldmarks=true,
fromphone=true,
firsthead=true,
% backaddress=false,
}
%% Opzioni personali
\setkomavar{fromname}{First LAST}
\setkomavar{fromaddress}{my Street\\ZIP myCity}
\setkomavar{fromemail}[]{\href{mailto:[email protected]}{[email protected]}}
\setkomavar{fromphone}[]{+41 (0)7x abc de fg}
\setkomavar{place}{myLivingRoom}
\setkomavar{signature}{f. LAST}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%
%%%% Oggetto della missiva
%%%%
\setkomavar{subject}{Job something}
%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\firsthead{
\tikz{%
\node[rectangle, fill=Green4, anchor=north, minimum width=\paperwidth, minimum height=3.5cm](header) at (current page.north){};%
\node[draw=none, align=left](name) at (header) {%
{\color{white}\usekomavar{fromname}\\ \usekomavar{fromaddress}}%
};%
\node[draw=none, align=right](contacts) at (header) {\color{red}\usekomavar{fromphone}\\ \usekomavar{fromemail}};%
}\vspace{-7mm}%
}
\begin{document}
% If you want headings on subsequent pages,
% remove the ``%'' on the next line:
% \pagestyle{headings}
\begin{letter}{\textbf{COmpany Hiring}\\companyStreet\\ZipCode Town}
\opening{Dear Madam, Dear Sir,}
\closing{Best Regards,}
%enclosure listing
\vfill
\encl{CV}
\end{letter}
\end{document}
\setkomavar{firsthead}{…}
about setting the header of the first page and\usekomavar{fromname}
etc. about using variables. See also the detailed examples for corporate identities with letters in the KOMA-Script wiki for examples on using pseudo lengths and variables.firsthead
can be found in section “4.10.2. Letterhead”, currently page 202f. But in your example you are not using variablefirshead
but command\firsthead
. This command is not described in the manual because it is deprecated. Using it results in a corresponding warning message.