-
Notifications
You must be signed in to change notification settings - Fork 0
/
simplecv.sty
186 lines (155 loc) · 5.91 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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
\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
\usepackage{graphicx} % Importing graphics
\usepackage[export]{adjustbox} % Aligning margins
% % 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}}
% Dummy environment
\newenvironment*{dummyenv}{}{}
% Inline heading
\newcommand{\headinginline}[2]{
\begin{minipage}[t]{0.60\textwidth}
\vspace*{\fill}
\Huge \textcolor{black}{#1}
\end{minipage}
\begin{minipage}[t]{0.39\textwidth}
\begin{flushright}
#2
\end{flushright}
\end{minipage}
}
% Photo heading
\newcommand{\headingphoto}[3]{
\begin{minipage}[t]{0.60\textwidth}
\begin{dummyenv}
\vspace*{\fill}
\Huge \textcolor{color-title}{#1}
\end{dummyenv}
\vspace{5mm}\\
#2
\end{minipage}
\begin{minipage}[t]{0.35\textwidth}
\begin{flushright}
\includegraphics[width=.5\linewidth,valign=t]{#3}
\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}]
\titleformat{\section}{
\raggedright\LARGE\color{color-title}}{}{0em}{}[\color{color-title}\titlerule
\vspace{-\smallskipamount}]
% Footer
%\fancyhead[C]{\color{color-detail} 234}
%\fancyfoot[C]{\color{color-detail} Chen-Zhu Xie\ \textendash\ CV}
%\fancyfoot[C]{\color{color-detail} Chenzhu Xie $|$ 谢尘竹}
%\fancyfoot[C]{\color{color-detail} Chenzhu Xie}
%\fancyhead[C]{\color{color-detail} Chenzhu Xie}
\fancyhead[C]{\color{color-detail} \href{https://github.com/ChenZhu-Xie/CV_xcz}{Curriculum Vitae}}
\def\mydate{\leavevmode\hbox{\the\year-\twodigits\month-\twodigits\day}}
\def\twodigits#1{\ifnum#1<10 0\fi\the#1}
%\fancyfoot[L]{\color{color-detail} Last updated: \mydate}
%\fancyfoot[L]{\color{color-detail} CV\_\mydate}
%\fancyfoot[L]{\color{color-detail} CV $|$ \mydate}
%\fancyhead[L]{\color{color-detail} CV $|$ \mydate}
%\fancyhead[L]{\rule[-2ex]{0pt}{2ex} \color{color-detail} CV $|$ \mydate}
%\fancyhead[L]{\vspace*{5mm} \color{color-detail} CV $|$ \mydate}
%\fancyhead[L]{\color{color-detail} CV $|$ \mydate \newline}
%\fancyhead[L]{\color{color-detail} CV $|$ \mydate \vskip 1cm}
%{\vspace*{1mm} \fancyhead[L]{\color{color-detail} CV $|$ \mydate}}
%\fancyhead[L]{\color{color-detail} CV $|$ \mydate}
\fancyhead[L]{\color{color-detail} Chenzhu Xie}
%\fancyfoot[R]{\color{color-detail} Page \thepage \hspace{1pt} of \hspace{0.4pt} \pageref{LastPage}}
%\fancyfoot[R]{\color{color-detail} Page \thepage$/$\pageref{LastPage}}
%\fancyhead[R]{\color{color-detail} Page \thepage$/$\pageref{LastPage}}
\fancyhead[R]{\color{color-detail} \mydate}
\fancyfoot[R]{\color{color-detail} Page \thepage$/$\pageref{LastPage}}
\fancypagestyle{noheader}{%
\fancyhead{}%
}
% 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}%
}