-
Notifications
You must be signed in to change notification settings - Fork 0
/
simplecv.sty
128 lines (107 loc) · 3.82 KB
/
simplecv.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
\ProvidesPackage{simplecv}
% Packages
\usepackage[cm]{fullpage} % Margins
\usepackage[hidelinks]{hyperref} % Hyperlinks
\usepackage{titlesec} % Title formatting
\usepackage{subfiles} % File importing
\usepackage{multicol} % Multiple columns
\usepackage[usenames,dvipsnames]{xcolor} % Coloring
\usepackage{enumitem} % List customization
\usepackage{lastpage} % Page numbering
\usepackage{fancyhdr} % Footers
\usepackage[russian,english]{babel} % Language styles
% % Chinese
% \usepackage{xeCJK}
% \setCJKmainfont{BabelStone Han}
% % Cyrillic/Russian
% \usepackage{hyphenat}
% \babelfont{rm}{Droid Sans}
% Styling
\pagestyle{fancy}
\fancyhf{}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
\urlstyle{same}
\raggedbottom
\raggedright
\setlength{\tabcolsep}{0in}
% Quotes
\usepackage[autostyle,english=american]{csquotes}
\MakeOuterQuote{"}
% Hyperlinks
% \newcommand{\link}[2]{\href{#1}{\underline{\smash{#2}}}}
\newcommand{\link}[2]{\href{#1}{#2}}
% Define colors
\definecolor{color-text}{gray}{0.10} % light black
\definecolor{color-detail}{gray}{0.40} % dark gray
\colorlet{color-title}{\theme} % black
% Set text color
\makeatletter
\newcommand{\globalcolor}[1]{\color{#1}\global\let\default@color\current@color}
\makeatother
\AtBeginDocument{\globalcolor{color-text}}
% Shorthand
\newcommand{\github}[1]{\href{https://github.com/#1/}{github.com/#1}}
\newcommand{\email}[1]{\href{mailto:#1}{#1}}
\newcommand{\website}[1]{\href{https://#1/}{#1}}
\newcommand{\linkedin}[1]{\href{https://www.linkedin.com/in/#1/}{#1}}
% Inline heading
\newcommand{\headinginline}[2]{
\begin{minipage}[t]{0.60\textwidth}
\fontfamily{put} \selectfont
\vspace*{\fill}
\Huge \textcolor{color-title}{#1}
\end{minipage}
\begin{minipage}[t]{0.35\textwidth}
\begin{flushright}
#2
\end{flushright}
\end{minipage}
}
% Two-columns
\newcommand{\sidebyside}[2]{
\begin{multicols}{2}
#1 \columnbreak
#2 \end{multicols}
}
% Section titles
\titleformat{\section}{
\scshape\raggedright\Large\color{color-title}}{}{0em}{}[\color{color-title}\titlerule
\vspace{-\smallskipamount}]
% Footer
\fancyfoot[R]{Page \thepage \hspace{1pt} of \pageref{LastPage}}
% Lists
\newcommand{\outerlist}[1]{
\begin{itemize}[leftmargin=*] #1 \end{itemize}}
\newcommand{\denseouterlist}[1]{
\begin{itemize}[leftmargin=*,itemsep=0pt] #1 \end{itemize}}
\newcommand{\innerlist}[1]{
\begin{itemize}[topsep=0pt] #1 \end{itemize}}
\newcommand{\orderedouterlist}[1]{
\begin{enumerate}[leftmargin=*] #1 \end{enumerate}}
% List items
\newcommand{\entry}[1]{\item\small{#1}}
\newcommand{\entryextra}[1]{\textcolor{color-detail}{\entry{#1}}}
\newcommand{\entrylabeled}[2][]{\item[#1]\small{#2}}
\newcommand{\entrymid}[4][]{
\item[#1] \small{#2} \hfill \small{#3}
\vspace{-\smallskipamount} \item[]\small{\textit{#4}}}
\newcommand{\entrybig}[5][]{\item[#1]
\begin{tabular*}{0.97\textwidth}{l@{\extracolsep{\fill}}r}
#2 & #3 \\ {\small#4} & {\small #5} \\ \end{tabular*}}
% Fill year
\newcommand{\fillyear}[1]{\phantom{#1}}
% Make author name bold: https://tex.stackexchange.com/a/327046
\newcommand*{\boldname}[3]{%
\def\lastname{#1}%
\def\firstname{#2}%
\def\firstinit{#3}}
\boldname{}{}{}
\renewcommand{\mkbibnamegiven}[1]{%
\ifboolexpr{ ( test {\ifdefequal{\firstname}{\namepartgiven}} or test {\ifdefequal{\firstinit}{\namepartgiven}} ) and test {\ifdefequal{\lastname}{\namepartfamily}} }
{\mkbibbold{#1}}{#1}%
}
\renewcommand{\mkbibnamefamily}[1]{%
\ifboolexpr{ ( test {\ifdefequal{\firstname}{\namepartgiven}} or test {\ifdefequal{\firstinit}{\namepartgiven}} ) and test {\ifdefequal{\lastname}{\namepartfamily}} }
{\mkbibbold{#1}}{#1}%
}