-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmoderncvstylecustom.sty
151 lines (128 loc) · 5.48 KB
/
moderncvstylecustom.sty
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
%% start of file `moderncvstylecustom.sty'.
%% adapted from `moderncvstylecasual.sty'.
%% Copyright 2006-2015 Xavier Danaux ([email protected]).
%% Copyright 2019 Sean Leather ([email protected]).
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License version 1.3c,
% available at http://www.latex-project.org/lppl/.
%-------------------------------------------------------------------------------
% identification
%-------------------------------------------------------------------------------
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{moderncvstylecustom}[2019/06/10 v1.0.0 custom curriculum vitae style]
% head section alignment options: "left" (default) or "right"
\@initializecommand{\moderncvstyleheadoptions}{}
\DeclareOption{left} {\edef\moderncvstyleheadoptions{\moderncvstyleheadoptions,left}}
\DeclareOption{right}{\edef\moderncvstyleheadoptions{\moderncvstyleheadoptions,right}}
\DeclareOption*{}% avoid choking on unknown options
\ExecuteOptions{right}
\ProcessOptions*\relax% \ProcessOptions* processes the options in the order provided (i.e., with the later ones possibly overriding the former ones), while \ProcessOptions processes them in the order of the package
%-------------------------------------------------------------------------------
% fonts & icons
%-------------------------------------------------------------------------------
% Latin Modern fonts
%\ifxetexorluatex
% \setmainfont{Latin Modern Roman}
% \setsansfont{Latin Modern Sans}
% \setmathfont{Latin Modern Math}
%\else
% \IfFileExists{lmodern.sty}%
% {\RequirePackage{lmodern}}%
% {}
%\fi
% moderncvstylecustom.sty:
\RequirePackage{fontspec}
\setmainfont{GaramondPremrPro}
\setmonofont[Scale=MatchLowercase]{Fira Code Light}
% symbols
\moderncvicons{awesome}
%-------------------------------------------------------------------------------
% header, body & footer
%-------------------------------------------------------------------------------
\moderncvhead[\moderncvstyleheadoptions]{2}
\moderncvbody{1}
\moderncvfoot{1}
% moderncvstylecustom.sty:
% - https://tex.stackexchange.com/a/172866/16670
\RequirePackage{etoolbox}
\patchcmd{\makecvhead}{\color{color2!50}\@firstname}{\color{color1}\@firstname}{}{}
\patchcmd{\makecvhead}{\color{color2}\@lastname}{\color{color1}\@lastname}{}{}
% moderncvstylecustom.sty:
% - https://tex.stackexchange.com/a/253116/16670
\RenewDocumentCommand{\subsection}{sm}{%
\par\addvspace{2ex}%
\phantomsection{}% reset the anchor for hyperrefs
\addcontentsline{toc}{subsection}{#2}%
\cvitem[0ex]{}{\strut\subsectionstyle{#2}}%
\par\nobreak\addvspace{.5ex}\@afterheading}% to avoid a pagebreak after the heading
% moderncvstylecustom.sty:
% - https://tex.stackexchange.com/a/458690/16670
% - https://tex.stackexchange.com/a/49841/16670
\renewcommand*\namefont{\fontspec{GaramondPremrPro-MedDisp}\fontsize{50}{60}\selectfont}
\renewcommand*\titlefont{\fontspec{Fira Sans Condensed Light Italic}\fontsize{18}{22}\selectfont}
\renewcommand*\sectionfont{\fontspec{Garamond Premier Pro}\fontsize{20}{24}\selectfont}
\renewcommand*\subsectionfont{\fontspec{GaramondPremrPro-Med}\fontsize{14}{16}\selectfont}
\renewcommand*\addressfont{\fontspec{Fira Sans Condensed Light Italic}\selectfont}
\renewcommand*{\namestyle}[1]{{#1}}
% moderncvstylecustom.sty:
\newcommand\professionentry[6]{%
\cventry{{\fontspec{Fira Sans Compressed Book}#1}}%
{{\fontspec{Fira Sans Compressed Medium}#2}}%
{{\fontspec{Fira Sans Compressed Book Italic}#3}}%
{{\fontspec{Fira Sans Compressed Light}#4}}%
{#5}%
{#6}}
% moderncvstylecustom.sty:
\newcommand\educationentry[5]{%
\cventry{{\fontspec{Fira Sans Compressed Book}#1}}%
{{\fontspec{Fira Sans Compressed Medium}#2}}%
{{\fontspec{Fira Sans Compressed Book Italic}#3}}%
{{\fontspec{Fira Sans Compressed Light}#4}}%
{}%
{#5}}
\newcommand\educationentrygpa[6]{%
\cventry{{\fontspec{Fira Sans Compressed Book}#1}}%
{{\fontspec{Fira Sans Compressed Medium}#2}}%
{{\fontspec{Fira Sans Compressed Book Italic}#3}}%
{{\fontspec{Fira Sans Compressed Light}#4}}%
{{\fontspec{Fira Sans Compressed Light Italic}#5}}%
{#6}}
% moderncvstylecustom.sty:
\newcommand\teachingentry[4]{%
\cventry{}%
{{\fontspec{Fira Sans Compressed Medium}#1}}%
{{\fontspec{Fira Sans Compressed Book Italic}#2}}%
{{\fontspec{Fira Sans Compressed Light}#3}}%
{}%
{#4}}
% moderncvstylecustom.sty:
\newcommand\teachingasstentry[4]{%
\cventry{}%
{{\fontspec{Fira Sans Compressed Medium}#1}}%
{{\fontspec{Fira Sans Compressed Book Italic}#2}}%
{{\fontspec{Fira Sans Compressed Light}#3}}%
{}%
{#4}}
% moderncvstylecustom.sty:
\newcommand\talksentry[6]{%
\cventry{{\fontspec{Fira Sans Compressed Book}#1}}%
{{\fontspec{Fira Sans Compressed Medium}#2}}%
{{\fontspec{Fira Sans Compressed Book Italic}#3}}%
{{\fontspec{Fira Sans Compressed Light}#4}}%
{#5}%
{#6}}
% moderncvstylecustom.sty:
\newcommand*\ccvitem[3][.25em]{%
\cvitem[#1]{{\fontspec{Fira Sans Compressed Book}#2}}%
{#3}}
% moderncvstylecustom.sty:
% Use Semibold for opening and closing
\patchcmd{\makeletterhead}{\@opening}{{\fontspec{GaramondPremrPro-Smbd}\@opening}}{}{}
\patchcmd{\makeletterclosing}{\@closing}{{\fontspec{GaramondPremrPro-Smbd}\@closing}}{}{}
\patchcmd{\makeletterclosing}{\bfseries}{\fontspec{GaramondPremrPro-Smbd}}{}{}
% moderncvstylecustom.sty:
% Remove the name from the letter footer.
\patchcmd{\makeletterfoot}{\bfseries\upshape\@firstname~\@lastname}{}{}{}
\endinput
%% end of file `moderncvstylecustom.sty'.