forked from robjhyndman/CV
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcv.sty
154 lines (129 loc) · 5.03 KB
/
cv.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
%% Curriculum Vitae style file
%% Rob J Hyndman. Last updated 6 September 2016
%% This file may be modified, copied and redistributed without any further permission.
%% However, if you modify it, please add a note indicating it is a modification of the original.
%% The original file is available at http://robjhyndman.com/research/cv.sty
\usepackage{paralist,ragged2e,datetime}
\usepackage[hyphens]{url}
\usepackage{fancyhdr,enumitem,color,pifont}
\usepackage[a4paper,text={17.5cm,25.5cm},centering]{geometry}
\usepackage[compact,small,sf,bf]{titlesec}
\usepackage{kpfonts,dsfont}
\usepackage{array}
% Define ragged right columns within tables
\newcolumntype{P}[1]{>{\raggedright\arraybackslash}p{#1}}
% Color of headings
\def\headcolor{\color[rgb]{0.6,0,0}}
\RaggedRight
\sloppy
% Header and footer
\pagestyle{fancy}
\lhead{\sf\textcolor[gray]{0.4}{Curriculum Vitae: \@name}}
\rhead{\sf\textcolor[gray]{0.4}{\thepage}}
\cfoot{}
\def\headrule{{\color[gray]{0.4}\hrule\@height\headrulewidth\@width\headwidth \vskip-\headrulewidth}}
% Date format
\newdateformat{rjh}{\monthname~\THEYEAR}
\rjh
% Header box
\def\name#1{\def\@name{#1}}
\def\info#1{\def\@info{#1}}
\newcommand{\shadebox}[3][.9]{\fcolorbox[gray]{0}{#1}{\parbox{#2}{#3}}}
\def\maketitle{
\thispagestyle{plain}
\vspace*{-1.4cm}
\shadebox[0.9]{17.2cm}{\sf\headcolor\hfil
\hbox to 17cm{\begin{tabular}{P{7.4cm}}
\\[-0.3cm]
\LARGE\textbf{\@name}\\[0.3cm]
\Large\textbf{Curriculum Vitae}\\[0.6cm]
\normalsize\today
\end{tabular}
\hfill\hbox{\fontsize{9}{12}\sf
\begin{tabular}{@{}rP{7.5cm}@{}}
\@info
\end{tabular}}}\hfil
}
\vspace*{0.2cm}}
% Section headings
\titlelabel{}
\titlespacing{\section}{0pt}{2ex}{1ex}
\titleformat*{\section}{\headcolor\large\sf\bfseries}
\titlespacing{\subsection}{0pt}{1ex}{0.5ex}
% Miscellaneous dimensions
\setlength{\parskip}{0ex}
\setlength{\parindent}{0em}
\setlength{\headheight}{15pt}
\setlength{\tabcolsep}{0.15cm}
\clubpenalty = 10000
\widowpenalty = 10000
\setlist{itemsep=1pt}
\setdescription{labelwidth=1.2cm,leftmargin=1.5cm,labelindent=1.5cm,font=\rm}
% Bibliography formatting
\usepackage[sorting=ynt,citestyle=authoryear,bibstyle=authoryear-comp,defernumbers=true,maxnames=20,giveninits=true, bibencoding=utf8, terseinits=true, uniquename=init,dashed=false,doi=false,isbn=false,natbib=true,backend=biber]{biblatex}
\DeclareFieldFormat{url}{\url{#1}}
\DeclareFieldFormat[article]{pages}{#1}
\DeclareFieldFormat[inproceedings]{pages}{\lowercase{pp.}#1}
\DeclareFieldFormat[incollection]{pages}{\lowercase{pp.}#1}
\DeclareFieldFormat[article]{volume}{\mkbibbold{#1}}
\DeclareFieldFormat[article]{number}{\mkbibparens{#1}}
\DeclareFieldFormat[article]{title}{\MakeCapital{#1}}
\DeclareFieldFormat[article]{url}{}
\DeclareFieldFormat[inproceedings]{title}{#1}
\DeclareFieldFormat{shorthandwidth}{#1}
\DeclareFieldFormat{extradate}{}
% No dot before number of articles
\usepackage{xpatch}
\xpatchbibmacro{volume+number+eid}{\setunit*{\adddot}}{}{}{}
% Remove In: for an article.
\renewbibmacro{in:}{%
\ifentrytype{article}{}{%
\printtext{\bibstring{in}\intitlepunct}}}
%\makeatletter
%\DeclareDelimFormat[cbx@textcite]{nameyeardelim}{\addspace}
%\makeatother
% Bibliography categories
\def\makebibcategory#1#2{\DeclareBibliographyCategory{#1}\defbibheading{#1}{\section*{#2}}}
\makebibcategory{books}{Books}
\makebibcategory{papers}{Refereed research papers}
\makebibcategory{chapters}{Book chapters}
\makebibcategory{conferences}{Papers in refereed conference proceedings}
\makebibcategory{techreports}{Unpublished working papers}
\makebibcategory{bookreviews}{Book reviews}
\makebibcategory{editorials}{Editorials}
\makebibcategory{phd}{PhD thesis}
\makebibcategory{subpapers}{Submitted papers}
\makebibcategory{curpapers}{Current projects}
\makebibcategory{software}{Software (R packages)}
\setlength{\bibitemsep}{2.3pt}
\setlength{\bibhang}{.9cm}
%\renewcommand{\bibfont}{\fontsize{12}{14}}
\renewcommand*{\bibitem}{\addtocounter{papers}{1}\item \mbox{}\hskip-0.9cm\hbox to 0.9cm{\hfill\arabic{papers}.~\,}}
\defbibenvironment{bibliography}
{\list{}
{\setlength{\leftmargin}{\bibhang}%
\setlength{\itemsep}{\bibitemsep}%
\setlength{\parsep}{\bibparsep}}}
{\endlist}
{\bibitem}
\newenvironment{publications}{\section{\LARGE Publications}\label{papersstart}\vspace*{0.2cm}
\titlespacing{\section}{0pt}{1.5ex}{1ex}\itemsep=0.00cm
}{\label{papersend}\addtocounter{sumpapers}{-1}\refstepcounter{sumpapers}\label{sumpapers}}
\def\printbib#1{\printbibliography[category=#1,heading=#1]\lastref{sumpapers}}
\renewcommand{\bibfont}{\normalfont\fontsize{10}{12.4}\rmfamily}
% Counters for keeping track of papers
\newcounter{papers}\setcounter{papers}{0}
\newcounter{sumpapers}\setcounter{sumpapers}{0}
\def\lastref#1{\addtocounter{#1}{\value{papers}}\setcounter{papers}{0}}
% Add all papers in the bib file.
\nocite{*}
% Make nicer bullets
\renewcommand{\labelitemi}{\ding{228}}
\DeclareSortingScheme{ty}{
\sort{
\field{title}
}
\sort{
\field{year}
}
}