-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcvclass.cls
More file actions
220 lines (179 loc) · 6.88 KB
/
cvclass.cls
File metadata and controls
220 lines (179 loc) · 6.88 KB
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
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Copyright (c) 2021-2026 Kuan-Yu Chang
%
% This file may be distributed and/or modified
%
% 1. under the LaTeX Project Public License and/or
% 2. under the GNU Public License.
%
% The latest version of this file can be found at:
% https://github.com/KuanYuChang/curriculum_vitae
%
% Overleaf Settings
% Compiler: XeLaTeX
% Tex Live version: 2022
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{cvclass}[2026/01/25 v1.13 Curriculum Vitae class]
\LoadClass[10pt,a4paper]{article}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Required Packages
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\RequirePackage[T1]{fontenc}
\RequirePackage{microtype}
\RequirePackage{textcomp}
\RequirePackage{geometry}
\RequirePackage{fancyhdr}
\RequirePackage{lastpage}
\RequirePackage{titlesec}
\RequirePackage[parfill]{parskip}
\RequirePackage{graphicx}
\RequirePackage{hyperref}
\RequirePackage{enumitem}
\RequirePackage{tabularx}
\RequirePackage{multirow}
\RequirePackage{multicol}
\RequirePackage[style=ieee,maxbibnames=99,dashed=false,defernumbers=true]{biblatex}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Typesetting Document
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Margins
\geometry{left=0.75in,top=0.6in,right=0.75in,bottom=0.8in}
%% Paragraphs
\setlength{\parindent}{0pt}
\setlength{\parskip}{1em}
%% Section title
\titleformat{\section}
{\fontfamily{ptm}\selectfont\Large\scshape\bfseries}
{}{0em}{}[{\vspace{-2pt}\titlerule[.8pt]}]
%% Page headers and footers
\pagestyle{fancyplain}
\fancyhf{} % remove everything
\renewcommand{\headrulewidth}{0pt} % remove lines as well
\renewcommand{\footrulewidth}{0.5pt}
\lfoot{\small {\em This \@lasttitle{} was last updated on \@lastupdate.}
\ifx\@latestver\empty\else
\href{\@latestver}{[Latest version]}\fi}
\rfoot{\small Page \thepage{} of \pageref*{LastPage}}
%% List of items
\setlist[itemize]{leftmargin=1.5em,noitemsep}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Personal Information
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Variables (set to empty by default)
\let \@name \relax \def\@name{}
\let \@jobtitle \relax \def\@jobtitle{}
\let \@address \relax \def\@address{}
\let \@phone \relax \def\@phone{}
\let \@email \relax \def\@email{}
\let \@lasttitle \relax \def\@lasttitle{curriculum vitae}
\let \@latestver \relax \def\@latestver{}
\let \@lastupdate \relax \def\@lastupdate{\today}
\def \name#1{\def\@name{#1}}
\def \jobtitle#1{\def\@jobtitle{#1}}
\def \address#1{\def\@address{#1}}
\def \phone#1{\def\@phone{#1}}
\def \email#1{\def\@email{#1}}
\def \lasttitle#1{\def\@lasttitle{#1}}
\def \latestver#1{\def\@latestver{#1}}
\def \lastupdate#1{\def\@lastupdate{#1}}
%% Formatting
\newcommand{\formatphone}[1]{\textbf{Phone:} \texttt{#1}}
\newcommand{\formatemail}[1]{\textbf{Email:} \href{mailto:#1}{\texttt{#1}}}
\newcommand{\makeinfo}{
\ifx\@name\empty\else
{\Huge \bfseries \scshape \@name} \bigskip \bigskip \bigskip \\
\fi \ifx\@jobtitle\empty\else
{\LARGE \bfseries \scshape \@jobtitle} \bigskip \bigskip \\
\fi \ifx\@address\empty\else
{\bfseries \@address} \bigskip \\
\fi \ifx\@phone\empty\else
\formatphone{\@phone} \\
\fi \ifx\@email\empty\else
\formatemail{\@email}
\fi}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Experiences
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\experience}[7]{
\begin{tabularx}{\linewidth}{Xr}
\textbf{#1} & \multirow{4}{*}{\includegraphics[#5]{#6}} \\
\textit{#2} \\ \textit{#3} \\ #4
\end{tabularx} #7}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Education
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\education}[5]{
\begin{tabularx}{\linewidth}{Xr}
\textbf{#1} &
\multirow{3}{*}{\includegraphics[#3]{#4}} \\ \\
\textit{\underline{#2}} \\ \\
\begin{minipage}[t]{\linewidth} #5 \end{minipage}
\end{tabularx}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Publications
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Bibliography source
\addbibresource{publications.bib}
%% List all items
%% Reference:
%% http://www.hansenlab.org/cv_bibliography_tex
\newcommand{\makepublications}{
\nocite{*}
\defbibnote{annote}{(* denotes the communication author)}
\setlength\bibitemsep{0.5\baselineskip}
\printbibliography[title=Publications,prenote=annote]}
%% Author annotation
%% Reference:
%% https://tex.stackexchange.com/a/561064
\renewcommand*{\mkbibcompletename}[1]{%
\ifitemannotation{hl}{\textbf{\underline{#1}}}{%
\ifitemannotation{comm}{#1\textbf{*}}{%
\ifitemannotation{hlcomm}{\textbf{\underline{#1}*}}{#1}}}}
%% Customized fields (map to usera, userb, etc.)
\DeclareSourcemap{
\maps[datatype=bibtex]{
\map{\step[fieldsource=hindex] \step[fieldset=usera,origfieldval]}
\map{\step[fieldsource=accrate] \step[fieldset=userb,origfieldval]}
\map{\step[fieldsource=accmeta] \step[fieldset=userc,origfieldval]}
\map{\step[fieldsource=pdf] \step[fieldset=userd,origfieldval]}
\map{\step[fieldsource=video] \step[fieldset=usere,origfieldval]}
\map{\step[fieldsource=demo] \step[fieldset=userf,origfieldval]}}}
%% Formatting customized fields
\newcommand{\hindexformat}[1]{[H-index: \textbf{#1}]}
\newcommand{\accrateformat}[1]{[Acceptance Rate: \textbf{#1}]}
\newcommand{\accmetaformat}[1]{[#1]}
\newcommand{\pdfformat}[1]{\href{#1}{[pdf]}}
\newcommand{\videoformat}[1]{\href{#1}{[video]}}
\newcommand{\demoformat}[1]{\href{#1}{[demo]}}
\DeclareFieldFormat{usera}{\hindexformat{#1}}
\DeclareFieldFormat{userb}{\accrateformat{#1}}
\DeclareFieldFormat{userc}{\accmetaformat{#1}}
\DeclareFieldFormat{userd}{\pdfformat{#1}}
\DeclareFieldFormat{usere}{\videoformat{#1}}
\DeclareFieldFormat{userf}{\demoformat{#1}}
%% Place customized fields at the end of an item
\AtEveryBibitem{%
\csappto{blx@bbx@\thefield{entrytype}}{%
\iffieldundef{usera}{}{\space\printfield{usera}}%
\iffieldundef{userb}{}{\space\printfield{userb}}%
\iffieldundef{userc}{}{\space\printfield{userc}}%
\iffieldundef{userd}{}{\space\printfield{userd}}%
\iffieldundef{usere}{}{\space\printfield{usere}}%
\iffieldundef{userf}{}{\space\printfield{userf}}}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% References
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newenvironment{references}{
\section{References}
\vspace{1em}
\multicolsep0pt
\begin{multicols}{2}}{
\end{multicols}}
\newcommand{\reference}[4]{
\begin{tabular}{l}
\textbf{#1} \\
\textit{#2} \\
\formatphone{#3} \\
\formatemail{#4} \\ \\
\end{tabular}}