From 9bb975402b713d53844d368b05a45bfc55a1a8d1 Mon Sep 17 00:00:00 2001 From: Mark E Fuller Date: Sat, 22 Feb 2025 23:31:28 +0200 Subject: [PATCH] Add nice header and proper rendering to contemporary letter (#233) * apply icon colors to tikz icons * add contemporary colored header to letter * update changelog --- CHANGELOG | 3 +++ moderncvheadvii.sty | 43 ++++++++++++++++++++++++++------------ moderncviconstikz.sty | 48 +++++++++++++++++++++++++++++-------------- 3 files changed, 66 insertions(+), 28 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index b2def6e..70666c6 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -8,6 +8,9 @@ version next - Fix spacing between first and last name again (#220) - Make header details flush against sides for casual, classic, and contemporary 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) - Fix commons/colors.tex not found in package (#194) diff --git a/moderncvheadvii.sty b/moderncvheadvii.sty index e42b81f..f1cc09a 100644 --- a/moderncvheadvii.sty +++ b/moderncvheadvii.sty @@ -183,24 +183,41 @@ \renewcommand*{\makeletterhead}{% % recompute lengths (in case we are switching from letter to resume, or vice versa) \recomputeletterlengths% - % sender contact info - \hfill% - \begin{minipage}{.5\textwidth}% - % optional detailed information - \if@details% - \raggedleft% - \addressfont\textcolor{color2}{% - {\bfseries\upshape\@firstname~\@lastname}\@firstdetailselementfalse% - % optional detailed information + + \@initializebox{\makeletterdetailsbox}% + \if@details% + \def\phonesdetails{}% + \collectionloop{phones}{% the key holds the phone type (=symbol command prefix), the item holds the number + \protected@edef\phonesdetails{\phonesdetails\protect\makenewline\csname\collectionloopkey phonesymbol\endcsname\collectionloopitem}}% + \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{\equal{\@addresscity}{}}{}{\makenewline\@addresscity}% if \addresstreet is defined, \addresscity and addresscountry will always be defined but could be empty \ifthenelse{\equal{\@addresscountry}{}}{}{\makenewline\@addresscountry}}% - \collectionloop{phones}{% the key holds the phone type (=symbol command prefix), the item holds the number - \makenewline\csname\collectionloopkey phonesymbol\endcsname\collectionloopitem}% + \phonesdetails% needs to be pre-rendered as loops and tabulars seem to conflict \ifthenelse{\isundefined{\@email}}{}{\makenewline\emailsymbol\emaillink{\@email}}% \ifthenelse{\isundefined{\@homepage}}{}{\makenewline\homepagesymbol\httplink{\@homepage}}% - \ifthenelse{\isundefined{\@extrainfo}}{}{\makenewline\@extrainfo}}\fi% - \end{minipage}\\[1em] + \ifthenelse{\isundefined{\@extrainfo}}{}{\makenewline\@extrainfo}% + \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 \begin{minipage}[t]{.5\textwidth} \raggedright% diff --git a/moderncviconstikz.sty b/moderncviconstikz.sty index 1510354..29355b8 100644 --- a/moderncviconstikz.sty +++ b/moderncviconstikz.sty @@ -18,6 +18,24 @@ %------------------------------------------------------------------------------- \RequirePackage{tikz} \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\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\path[fill=color2] + \protect\path[fill=linkedin] (381,202) -- (434,202) .. controls (439,202) and (442,205) .. (442,210) -- (442,264) .. controls (442,268) and (439,272) .. (434,272) -- (381,272) .. controls (376,272) and (372,268) .. @@ -74,7 +92,7 @@ \renewcommand*{\twittersocialsymbol} { \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\path[fill=color2] + \protect\path[fill=twitter] (2000, 192) .. controls (1926, 225) and (1847, 247) .. (1764, 257) .. controls (1849, 206) and (1914, 126) .. (1945, 30) .. controls (1865, 77) and (1778, 111) .. @@ -106,7 +124,7 @@ \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{scope}[shift={(507,387)}] - \protect\path[fill=color2] + \protect\path[fill=github] (117, 60) .. controls (117, 71) and (108, 81) .. ( 96, 81) .. controls ( 85, 81) and ( 75, 71) .. ( 75, 60) .. controls ( 75, 48) and ( 85, 39) .. @@ -118,7 +136,7 @@ ( 75, 60) .. controls ( 75, 48) and ( 85, 39) .. ( 96, 39) .. controls (108, 39) and (117, 48) .. (117, 60) -- cycle; - \protect\path[fill=color2, nonzero rule] + \protect\path[fill=github, nonzero rule] (103, 45) .. controls (103, 45) and (101, 46) .. (101, 47) -- (100, 47) -- ( 99, 47) .. controls ( 99, 47) and ( 98, 47) .. @@ -217,7 +235,7 @@ \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{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) .. (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 @@ -238,7 +256,7 @@ \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{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) .. (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) .. @@ -274,7 +292,7 @@ \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{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) .. (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) .. @@ -327,7 +345,7 @@ \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{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,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) .. @@ -374,7 +392,7 @@ \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{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) 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) -- @@ -449,7 +467,7 @@ (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; - \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.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) @@ -464,11 +482,11 @@ \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{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) (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) (40,-100) rectangle +(20,60) (100,-100) rectangle +(20,160) @@ -483,7 +501,7 @@ \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{scope}[shift={(507,387)}] - \protect\path[fill=default-socialicon-color, scale=0.015] + \protect\path[fill=threema, scale=0.015] % speech bubble (137,25) ellipse (400 and 350) % lock shackle @@ -494,10 +512,10 @@ % lock body (0, 0) rectangle +(274, 196); % triangle - \protect\path[fill=default-socialicon-color, scale=0.015] + \protect\path[fill=threema, scale=0.015] (-200,213) -- +(-41,168) -- +(157,120) -- cycle; % three dots - \protect\path[fill=default-socialicon-color, scale=0.015] + \protect\path[fill=threema, scale=0.015] (-94,553) circle (68) (144,553) circle (68) (390,553) circle (68);