mirror of
https://github.com/moderncv/moderncv.git
synced 2026-02-06 10:05:19 +01:00
add contemporary colored header to letter
This commit is contained in:
parent
a3e8fe5937
commit
f2a49498c1
1 changed files with 30 additions and 13 deletions
|
|
@ -183,24 +183,41 @@
|
||||||
\renewcommand*{\makeletterhead}{%
|
\renewcommand*{\makeletterhead}{%
|
||||||
% recompute lengths (in case we are switching from letter to resume, or vice versa)
|
% recompute lengths (in case we are switching from letter to resume, or vice versa)
|
||||||
\recomputeletterlengths%
|
\recomputeletterlengths%
|
||||||
% sender contact info
|
|
||||||
\hfill%
|
\@initializebox{\makeletterdetailsbox}%
|
||||||
\begin{minipage}{.5\textwidth}%
|
\if@details%
|
||||||
% optional detailed information
|
\def\phonesdetails{}%
|
||||||
\if@details%
|
\collectionloop{phones}{% the key holds the phone type (=symbol command prefix), the item holds the number
|
||||||
\raggedleft%
|
\protected@edef\phonesdetails{\phonesdetails\protect\makenewline\csname\collectionloopkey phonesymbol\endcsname\collectionloopitem}}%
|
||||||
\addressfont\textcolor{color2}{%
|
\savebox{\makeletterdetailsbox}{%
|
||||||
{\bfseries\upshape\@firstname~\@lastname}\@firstdetailselementfalse%
|
\addressfont\color{headtext}%
|
||||||
% optional detailed information
|
\if@left\begin{tabular}[b]{@{}r@{}}\fi%
|
||||||
|
\if@right\begin{tabular}[b]{@{}l@{}}\fi%
|
||||||
\ifthenelse{\isundefined{\@addressstreet}}{}{\makenewline\addresssymbol\@addressstreet%
|
\ifthenelse{\isundefined{\@addressstreet}}{}{\makenewline\addresssymbol\@addressstreet%
|
||||||
\ifthenelse{\equal{\@addresscity}{}}{}{\makenewline\@addresscity}% if \addresstreet is defined, \addresscity and addresscountry will always be defined but could be empty
|
\ifthenelse{\equal{\@addresscity}{}}{}{\makenewline\@addresscity}% if \addresstreet is defined, \addresscity and addresscountry will always be defined but could be empty
|
||||||
\ifthenelse{\equal{\@addresscountry}{}}{}{\makenewline\@addresscountry}}%
|
\ifthenelse{\equal{\@addresscountry}{}}{}{\makenewline\@addresscountry}}%
|
||||||
\collectionloop{phones}{% the key holds the phone type (=symbol command prefix), the item holds the number
|
\phonesdetails% needs to be pre-rendered as loops and tabulars seem to conflict
|
||||||
\makenewline\csname\collectionloopkey phonesymbol\endcsname\collectionloopitem}%
|
|
||||||
\ifthenelse{\isundefined{\@email}}{}{\makenewline\emailsymbol\emaillink{\@email}}%
|
\ifthenelse{\isundefined{\@email}}{}{\makenewline\emailsymbol\emaillink{\@email}}%
|
||||||
\ifthenelse{\isundefined{\@homepage}}{}{\makenewline\homepagesymbol\httplink{\@homepage}}%
|
\ifthenelse{\isundefined{\@homepage}}{}{\makenewline\homepagesymbol\httplink{\@homepage}}%
|
||||||
\ifthenelse{\isundefined{\@extrainfo}}{}{\makenewline\@extrainfo}}\fi%
|
\ifthenelse{\isundefined{\@extrainfo}}{}{\makenewline\@extrainfo}%
|
||||||
\end{minipage}\\[1em]
|
\end{tabular}%
|
||||||
|
}\fi%
|
||||||
|
|
||||||
|
% name and title (pre-rendering)
|
||||||
|
\@initializelength{\makeletterdetailswidth}\settowidth{\makeletterdetailswidth}{\usebox{\makeletterdetailsbox}}%
|
||||||
|
|
||||||
|
% rendering
|
||||||
|
\begin{tikzpicture}[remember picture,overlay]
|
||||||
|
\node(letter-head-bg) [top color=headTL,bottom color=headBR,shading angle=45,inner sep=0pt,
|
||||||
|
fit={(current page.north west)(current page.north east)(pic cs:letter-head-end)}] {};
|
||||||
|
|
||||||
|
\end{tikzpicture}%
|
||||||
|
|
||||||
|
\hfill
|
||||||
|
\llap{\usebox{\makeletterdetailsbox}}% \llap is used to suppress
|
||||||
|
\\[.15em]%
|
||||||
|
\tikzmark{letter-head-end}\\[.15em]%
|
||||||
|
|
||||||
% recipient block
|
% recipient block
|
||||||
\begin{minipage}[t]{.5\textwidth}
|
\begin{minipage}[t]{.5\textwidth}
|
||||||
\raggedright%
|
\raggedright%
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue