-
Notifications
You must be signed in to change notification settings - Fork 0
/
flypcv.cls
184 lines (144 loc) · 5.47 KB
/
flypcv.cls
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
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{flypcv}
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}}
\ProcessOptions\relax
\LoadClass[10pt]{article}
\makeatletter
% default font
\renewcommand{\familydefault}{\sfdefault}
% ------------------------------------------------------------------------------
% hyperlinks
% ------------------------------------------------------------------------------
\RequirePackage[colorlinks, urlcolor=blue, linkcolor=black]{hyperref}
% ------------------------------------------------------------------------------
% conditionals
% ------------------------------------------------------------------------------
\RequirePackage{xifthen}
% thisifthat - expand #1 if #2 is not empty
\newcommand{\thisifthat}[2]{%%
\ifthenelse{\isempty{#2}}{}{#1}%%
}
% ------------------------------------------------------------------------------
% geometry, footer
% ------------------------------------------------------------------------------
% remove parindent, parskip
\setlength{\parindent}{0pt}
\setlength{\parskip}{0pt}
% set vertical lengths (space above said object)
\newlength{\secvspace}
\newlength{\headvspace}
\setlength{\secvspace}{0pt}
\setlength{\headvspace}{3.5pt}
% set margin, footer geometry
\RequirePackage{geometry}
\setlength{\footskip}{0.2in}
\geometry{margin=0.7in}
% configure footer
\RequirePackage{fancyhdr, lastpage}
\pagestyle{fancyplain}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
\fancyhf{}
\fancyfoot[R]{\scriptsize \thepage\ \textit{of}\ \pageref{LastPage}}
\fancyfoot[L]{\itshape\scriptsize curriculum vitae}
% ------------------------------------------------------------------------------
% title
% ------------------------------------------------------------------------------
% supported header parameters
% \author, \title, \location, \email, \phone
\author{Name}
\title{title}
\newcommand{\@location}{New York City, NY, USA}
\newcommand{\@email}{[email protected]}
\newcommand{\@phone}{123/456-7890}
\newcommand{\location}[1]{\renewcommand{\@location}{#1}}
\newcommand{\contact}[1]{\renewcommand{\@contact}{#1}}
\newcommand{\email}[1]{\renewcommand{\@email}{#1}}
\newcommand{\phone}[1]{\renewcommand{\@phone}{#1}}
% title geometry
\newlength{\titleheight}
\setlength{\titleheight}{0.5in}
% use \maketitle to place the title within document
\renewcommand{\maketitle}{
\begin{minipage}[t][\titleheight][c]{0.5\textwidth}
\flushleft{{\Huge\bfseries
\@author
}}
\vspace{-5pt}\flushleft{{\itshape
\@title
}}
\end{minipage}
\begin{minipage}[t][\titleheight][c]{0.5\textwidth}
\flushright{
\@location\\
\href{mailto:\@email}{\@email} | \@phone
}
\end{minipage}
}
% ------------------------------------------------------------------------------
% section definition
% ------------------------------------------------------------------------------
\RequirePackage{titlesec}
% section geometry
\newlength{\sectionsep}
\setlength{\sectionsep}{8pt}
% format section
\titleformat{\section}
{\vspace{\secvspace}\Large\bfseries\uppercase}
{}
{\sectionsep}
{}[\titlerule]
% ------------------------------------------------------------------------------
% ------------------------------------------------------------------------------
% cv features
% ------------------------------------------------------------------------------
% the blurb
% ------------------------------------------------------------------------------
% blurb - a simple, ital par for brief descriptions below main items or as
% standalones
\newcommand{\blurb}[1]{\par{\itshape#1}}
% ------------------------------------------------------------------------------
% cvitem
% ------------------------------------------------------------------------------
% generic line item with item, delim, info, and metadata.
% default metaformat (given default since that column looks weird if not uniform)
\newcommand{\@defaultmetaformat}{\rmfamily}
\newcommand{\defaultmetaformat}[1]{\renewcommand{\@defaultmetaformat}{#1}}
% \cvitem{item}{info}{meta}{delim}{infopunct}
\newcommand{\cvitem}[5]{%%
\par%%
#1%%
\thisifthat{#4}{#2}#2\thisifthat{#5}{#2}%%
\thisifthat{\hfill}{#3}%%
{\@defaultmetaformat#3}%%
}
% ------------------------------------------------------------------------------
% custom cvitem
% ------------------------------------------------------------------------------
% format a custom cvitem
% \newcvitem{name}{itemformat}{infoformat}{delim}{infopunct}{vspace}
\newcommand{\newcvitem}[6]{%%
\expandafter\newcommand\csname#1\endcsname[3]{%%
\vspace{#6}%%
\cvitem{{#2##1}}{{#3##2}}{##3}%%
{\thisifthat{#4}{##2}}{\thisifthat{#5}{##2}}%%
}
}
% ------------------------------------------------------------------------------
% define cvitems
% ------------------------------------------------------------------------------
% headcvitem - for items that act as headers / major items
\newcvitem{headcvitem}{\bfseries}{}{ | }{}{\headvspace}
% detailcvitem - for detail items under headcvitems
\newcvitem{detailcvitem}{}{\itshape}{:\ }{}{0pt}
% collectcvitem - for a brief one-line list of items with emphasised header
\newcvitem{collectcvitem}{\bfseries}{}{\ }{}{\headvspace}
% blurbcvitem - cvitem with blurb in-line (not actually a true cvitem)
\newcommand{\blurbcvitem}[2]{%%
\vspace{\headvspace}\par%%
{\bfseries#1}\ {\small\itshape#2}%%
}
% referencecvitem
\newcvitem{referencecvitem}{\rmfamily}{\itshape}{,\ }{}{\headvspace}
% ------------------------------------------------------------------------------
\makeatother