Add nice header and proper rendering to contemporary letter (#233)

* apply icon colors to tikz icons

* add contemporary colored header to letter

* update changelog
This commit is contained in:
Mark E Fuller 2025-02-22 23:31:28 +02:00 committed by GitHub
commit 9bb975402b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 66 additions and 28 deletions

View file

@ -8,6 +8,9 @@ version next
- Fix spacing between first and last name again (#220) - Fix spacing between first and last name again (#220)
- Make header details flush against sides for casual, classic, and contemporary - Make header details flush against sides for casual, classic, and contemporary
styles (#229) styles (#229)
- Fix tikz icon color in contemporary style (#224)
- Add contemporary CV header style to cover letter, which also makes icons
visible (#186)
version 2.4.1 (18 Jul 2024) version 2.4.1 (18 Jul 2024)
- Fix commons/colors.tex not found in package (#194) - Fix commons/colors.tex not found in package (#194)

View file

@ -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}%
% optional detailed information
\if@details% \if@details%
\raggedleft% \def\phonesdetails{}%
\addressfont\textcolor{color2}{% \collectionloop{phones}{% the key holds the phone type (=symbol command prefix), the item holds the number
{\bfseries\upshape\@firstname~\@lastname}\@firstdetailselementfalse% \protected@edef\phonesdetails{\phonesdetails\protect\makenewline\csname\collectionloopkey phonesymbol\endcsname\collectionloopitem}}%
% optional detailed information \savebox{\makeletterdetailsbox}{%
\addressfont\color{headtext}%
\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%

View file

@ -18,6 +18,24 @@
%------------------------------------------------------------------------------- %-------------------------------------------------------------------------------
\RequirePackage{tikz} \RequirePackage{tikz}
\RequirePackage{etoolbox} \RequirePackage{etoolbox}
\RequirePackage{xcolor}
%-------------------------------------------------------------------------------
% set colors
%-------------------------------------------------------------------------------
\usepackage{moderncvcolors}
\providecolor{linkedin}{named}{default-socialicon-color}
\providecolor{twitter}{named}{default-socialicon-color}
\providecolor{github}{named}{default-socialicon-color}
\providecolor{gitlab}{named}{default-socialicon-color}
\providecolor{skype}{named}{default-socialicon-color}
\providecolor{googlescholar}{named}{default-socialicon-color}
\providecolor{matrix}{named}{default-socialicon-color}
\providecolor{signal}{named}{default-socialicon-color}
\providecolor{codeberg}{named}{default-socialicon-color}
\providecolor{simplex}{named}{default-socialicon-color}
\providecolor{threema}{named}{default-socialicon-color}
%------------------------------------------------------------------------------- %-------------------------------------------------------------------------------
@ -29,7 +47,7 @@
\protect\raisebox{-0.165em}{ \protect\raisebox{-0.165em}{
\protect\begin{tikzpicture}[x=0.08em, y=0.08em, xscale=0.25, yscale=-0.25, inner sep=0pt, outer sep=0pt] \protect\begin{tikzpicture}[x=0.08em, y=0.08em, xscale=0.25, yscale=-0.25, inner sep=0pt, outer sep=0pt]
\protect\begin{scope}[cm={{0.60,0.0,0.0,0.60,(346.39,123.07)}}] \protect\begin{scope}[cm={{0.60,0.0,0.0,0.60,(346.39,123.07)}}]
\protect\path[fill=color2] \protect\path[fill=linkedin]
(381,202) -- (434,202) .. controls (439,202) and (442,205) .. (381,202) -- (434,202) .. controls (439,202) and (442,205) ..
(442,210) -- (442,264) .. controls (442,268) and (439,272) .. (442,210) -- (442,264) .. controls (442,268) and (439,272) ..
(434,272) -- (381,272) .. controls (376,272) and (372,268) .. (434,272) -- (381,272) .. controls (376,272) and (372,268) ..
@ -74,7 +92,7 @@
\renewcommand*{\twittersocialsymbol} { \renewcommand*{\twittersocialsymbol} {
\protect\raisebox{0em}{% \protect\raisebox{0em}{%
\protect\begin{tikzpicture}[x=0.08em, y=0.08em, xscale=0.005, yscale=-0.005, inner sep=0pt, outer sep=0pt] \protect\begin{tikzpicture}[x=0.08em, y=0.08em, xscale=0.005, yscale=-0.005, inner sep=0pt, outer sep=0pt]
\protect\path[fill=color2] \protect\path[fill=twitter]
(2000, 192) .. controls (1926, 225) and (1847, 247) .. (2000, 192) .. controls (1926, 225) and (1847, 247) ..
(1764, 257) .. controls (1849, 206) and (1914, 126) .. (1764, 257) .. controls (1849, 206) and (1914, 126) ..
(1945, 30) .. controls (1865, 77) and (1778, 111) .. (1945, 30) .. controls (1865, 77) and (1778, 111) ..
@ -106,7 +124,7 @@
\protect\raisebox{-0.15em} { \protect\raisebox{-0.15em} {
\protect\begin{tikzpicture}[x=0.08em, y=0.08em, xscale=0.25, yscale=-0.25, inner sep=0pt, outer sep=0pt] \protect\begin{tikzpicture}[x=0.08em, y=0.08em, xscale=0.25, yscale=-0.25, inner sep=0pt, outer sep=0pt]
\protect\begin{scope}[shift={(507,387)}] \protect\begin{scope}[shift={(507,387)}]
\protect\path[fill=color2] \protect\path[fill=github]
(117, 60) .. controls (117, 71) and (108, 81) .. (117, 60) .. controls (117, 71) and (108, 81) ..
( 96, 81) .. controls ( 85, 81) and ( 75, 71) .. ( 96, 81) .. controls ( 85, 81) and ( 75, 71) ..
( 75, 60) .. controls ( 75, 48) and ( 85, 39) .. ( 75, 60) .. controls ( 75, 48) and ( 85, 39) ..
@ -118,7 +136,7 @@
( 75, 60) .. controls ( 75, 48) and ( 85, 39) .. ( 75, 60) .. controls ( 75, 48) and ( 85, 39) ..
( 96, 39) .. controls (108, 39) and (117, 48) .. ( 96, 39) .. controls (108, 39) and (117, 48) ..
(117, 60) -- cycle; (117, 60) -- cycle;
\protect\path[fill=color2, nonzero rule] \protect\path[fill=github, nonzero rule]
(103, 45) .. controls (103, 45) and (101, 46) .. (103, 45) .. controls (103, 45) and (101, 46) ..
(101, 47) -- (100, 47) -- (101, 47) -- (100, 47) --
( 99, 47) .. controls ( 99, 47) and ( 98, 47) .. ( 99, 47) .. controls ( 99, 47) and ( 98, 47) ..
@ -217,7 +235,7 @@
\protect\raisebox{-0.12em}{ \protect\raisebox{-0.12em}{
\protect\begin{tikzpicture}[x=0.11em, y=0.11em, xscale=0.015, yscale=-0.015, inner sep=0pt, outer sep=0pt] \protect\begin{tikzpicture}[x=0.11em, y=0.11em, xscale=0.015, yscale=-0.015, inner sep=0pt, outer sep=0pt]
\protect\begin{scope}[shift={(507,387)}] \protect\begin{scope}[shift={(507,387)}]
\protect\path[fill=color2,line width=0.057pt] \protect\path[fill=gitlab,line width=0.057pt]
(105.2000,24.9000) .. controls (102.1000,16.0000) and (89.5000,16.0000) .. (105.2000,24.9000) .. controls (102.1000,16.0000) and (89.5000,16.0000) ..
(86.3000,24.9000) -- (29.8000,199.7000) -- (161.7000,199.7000) .. controls (86.3000,24.9000) -- (29.8000,199.7000) -- (161.7000,199.7000) .. controls
(161.7000,199.7000) and (105.2000,24.9000) .. (105.2000,24.9000) -- cycle (161.7000,199.7000) and (105.2000,24.9000) .. (105.2000,24.9000) -- cycle
@ -238,7 +256,7 @@
\protect\raisebox{-0.15em}{ \protect\raisebox{-0.15em}{
\protect\begin{tikzpicture}[y=0.08em, x=0.08em, xscale=0.020, yscale=-0.020, inner sep=0pt, outer sep=0pt] \protect\begin{tikzpicture}[y=0.08em, x=0.08em, xscale=0.020, yscale=-0.020, inner sep=0pt, outer sep=0pt]
\protect\begin{scope}[shift={(507,387)}] \protect\begin{scope}[shift={(507,387)}]
\protect\path[fill=color2,even odd rule] \protect\path[fill=skype,even odd rule]
(487.6550,288.9690) .. controls (489.0610,278.5690) and (489.8700,267.9960) .. (487.6550,288.9690) .. controls (489.0610,278.5690) and (489.8700,267.9960) ..
(489.8700,257.2330) .. controls (489.8700,128.0770) and (384.5990,23.3610) .. (489.8700,257.2330) .. controls (489.8700,128.0770) and (384.5990,23.3610) ..
(254.7670,23.3610) .. controls (241.8630,23.3610) and (229.2120,24.4210) .. (254.7670,23.3610) .. controls (241.8630,23.3610) and (229.2120,24.4210) ..
@ -274,7 +292,7 @@
\protect\raisebox{-0.12em}{ \protect\raisebox{-0.12em}{
\protect\begin{tikzpicture}[y=2.0pt, x=2.0pt, yscale=-0.1, xscale=0.1, inner sep=0pt, outer sep=0pt] \protect\begin{tikzpicture}[y=2.0pt, x=2.0pt, yscale=-0.1, xscale=0.1, inner sep=0pt, outer sep=0pt]
\protect\begin{scope}[shift={(507,387)}] \protect\begin{scope}[shift={(507,387)}]
\protect\path[fill=color2] (25.0000,2.0000) .. controls (12.3095,2.0000) and (2.0000,12.3095) \protect\path[fill=googlescholar] (25.0000,2.0000) .. controls (12.3095,2.0000) and (2.0000,12.3095)
.. (2.0000,25.0000) .. controls (2.0000,37.6905) and (12.3095,48.0000) .. .. (2.0000,25.0000) .. controls (2.0000,37.6905) and (12.3095,48.0000) ..
(25.0000,48.0000) .. controls (37.6905,48.0000) and (48.0000,37.6905) .. (25.0000,48.0000) .. controls (37.6905,48.0000) and (48.0000,37.6905) ..
(48.0000,25.0000) .. controls (48.0000,12.3095) and (37.6905,2.0000) .. (48.0000,25.0000) .. controls (48.0000,12.3095) and (37.6905,2.0000) ..
@ -327,7 +345,7 @@
\protect\raisebox{-0.12em}{ \protect\raisebox{-0.12em}{
\protect\begin{tikzpicture}[y=1.8pt, x=1.8pt, yscale=-0.15, xscale=0.15, inner sep=0pt, outer sep=0pt] \protect\begin{tikzpicture}[y=1.8pt, x=1.8pt, yscale=-0.15, xscale=0.15, inner sep=0pt, outer sep=0pt]
\protect\begin{scope}[shift={(507,387)}] \protect\begin{scope}[shift={(507,387)}]
\protect\path[fill=color2] \protect\path[fill=matrix]
(0.9360,0.7320) .. controls (0.9360,10.9053) and (0.9360,21.0787) .. (0.9360,0.7320) .. controls (0.9360,10.9053) and (0.9360,21.0787) ..
(0.9360,31.2520) .. controls (1.6673,31.2520) and (2.3987,31.2520) .. (0.9360,31.2520) .. controls (1.6673,31.2520) and (2.3987,31.2520) ..
(3.1300,31.2520) .. controls (3.3452,32.0075) and (2.8778,32.0803) .. (3.1300,31.2520) .. controls (3.3452,32.0075) and (2.8778,32.0803) ..
@ -374,7 +392,7 @@
\protect\raisebox{-0.12em}{ \protect\raisebox{-0.12em}{
\protect\begin{tikzpicture}[y=0.1pt, x=0.1pt, yscale=-0.13, xscale=0.13, inner sep=0pt, outer sep=0pt] \protect\begin{tikzpicture}[y=0.1pt, x=0.1pt, yscale=-0.13, xscale=0.13, inner sep=0pt, outer sep=0pt]
\protect\begin{scope}[shift={(507,387)}] \protect\begin{scope}[shift={(507,387)}]
\protect\path[fill=color2] \protect\path[fill=signal]
(430.1000,180.9000) -- (437.8000,211.9000) .. controls (407.6000,219.3000) (430.1000,180.9000) -- (437.8000,211.9000) .. controls (407.6000,219.3000)
and (378.7000,231.3000) .. (352.1000,247.3000) -- (335.7000,220.0000) .. and (378.7000,231.3000) .. (352.1000,247.3000) -- (335.7000,220.0000) ..
controls (365.0000,202.3000) and (396.9000,189.1000) .. (430.1000,180.9000) -- controls (365.0000,202.3000) and (396.9000,189.1000) .. (430.1000,180.9000) --
@ -449,7 +467,7 @@
(11258.5852,-1839.4433)arc(66.699:32.084:23.067) -- (11258.5852,-1839.4433)arc(66.699:32.084:23.067) --
(11250.0698,-1872.8557)arc(329.460:269.346:0.201313 and 0.150) -- cycle; (11250.0698,-1872.8557)arc(329.460:269.346:0.201313 and 0.150) -- cycle;
\protect\path[scale=0.265, fill=color2, line width=0.426pt] \protect\path[scale=0.265, fill=codeberg, line width=0.426pt]
(11249.3743,-1883.6959)arc(269.785:180.000:23.067)arc(180.001:147.920:23.067) (11249.3743,-1883.6959)arc(269.785:180.000:23.067)arc(180.001:147.920:23.067)
-- (11249.1480,-1873.2412)arc(209.929:330.071:0.360097 and 0.269) -- -- (11249.1480,-1873.2412)arc(209.929:330.071:0.360097 and 0.269) --
(11269.0053,-1848.3766)arc(32.082:-0.002:23.067)arc(360.000:270.000:23.067)arc(270.108:269.892:23.067) (11269.0053,-1848.3766)arc(32.082:-0.002:23.067)arc(360.000:270.000:23.067)arc(270.108:269.892:23.067)
@ -464,11 +482,11 @@
\protect\raisebox{-0.12em}{ \protect\raisebox{-0.12em}{
\protect\begin{tikzpicture}[y=0.8pt, x=0.8pt, yscale=-1.0, xscale=1.0, inner sep=0pt, outer sep=0pt] \protect\begin{tikzpicture}[y=0.8pt, x=0.8pt, yscale=-1.0, xscale=1.0, inner sep=0pt, outer sep=0pt]
\protect\begin{scope}[shift={(507,387)}, rotate=45] \protect\begin{scope}[shift={(507,387)}, rotate=45]
\protect\path[fill=default-socialicon-color!80, scale=0.065] \protect\path[fill=simplex!80, scale=0.065]
(0,0) rectangle +(100,20) (0,0) rectangle +(100,20)
(40,-60) rectangle +(20,120); (40,-60) rectangle +(20,120);
\protect\path[fill=default-socialicon-color, scale=0.065] \protect\path[fill=simplex, scale=0.065]
(0,-60) rectangle +(160,20) (0,-60) rectangle +(160,20)
(40,-100) rectangle +(20,60) (40,-100) rectangle +(20,60)
(100,-100) rectangle +(20,160) (100,-100) rectangle +(20,160)
@ -483,7 +501,7 @@
\protect\raisebox{-0.12em}{ \protect\raisebox{-0.12em}{
\protect\begin{tikzpicture}[y=0.8pt, x=0.8pt, yscale=-1.0, xscale=1.0, inner sep=0pt, outer sep=0pt] \protect\begin{tikzpicture}[y=0.8pt, x=0.8pt, yscale=-1.0, xscale=1.0, inner sep=0pt, outer sep=0pt]
\protect\begin{scope}[shift={(507,387)}] \protect\begin{scope}[shift={(507,387)}]
\protect\path[fill=default-socialicon-color, scale=0.015] \protect\path[fill=threema, scale=0.015]
% speech bubble % speech bubble
(137,25) ellipse (400 and 350) (137,25) ellipse (400 and 350)
% lock shackle % lock shackle
@ -494,10 +512,10 @@
% lock body % lock body
(0, 0) rectangle +(274, 196); (0, 0) rectangle +(274, 196);
% triangle % triangle
\protect\path[fill=default-socialicon-color, scale=0.015] \protect\path[fill=threema, scale=0.015]
(-200,213) -- +(-41,168) -- +(157,120) -- cycle; (-200,213) -- +(-41,168) -- +(157,120) -- cycle;
% three dots % three dots
\protect\path[fill=default-socialicon-color, scale=0.015] \protect\path[fill=threema, scale=0.015]
(-94,553) circle (68) (-94,553) circle (68)
(144,553) circle (68) (144,553) circle (68)
(390,553) circle (68); (390,553) circle (68);