forked from hijiangtao/resume
-
Notifications
You must be signed in to change notification settings - Fork 0
/
resume.cls
121 lines (109 loc) · 3.37 KB
/
resume.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
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{resume}[2015/05/25 An elegant Résumé class]
\LoadClass[11pt]{article}
% disable indent globally
\setlength{\parindent}{0pt}
% some general improvements, defines the XeTeX logo
\RequirePackage{xltxtra}
% use xifthen
\RequirePackage{xifthen}
% use fontawesome
\RequirePackage{fontawesome}
% use xcolor for customizing color
\RequirePackage[usenames,dvipsnames]{xcolor}
% loading fonts
\RequirePackage{fontspec}
% Main document font
\setmainfont[
Path = fonts/Main/ ,
Extension = .otf ,
UprightFont = *-regular ,
BoldFont = *-bold ,
ItalicFont = *-italic ,
BoldItalicFont = *-bolditalic ,
SmallCapsFont = Fontin-SmallCaps
]{texgyretermes}
\RequirePackage[
a4paper,
left=0.7in,
right=0.7in,
top=0.50in,
bottom=0.5in,
nohead
]{geometry}
\RequirePackage{titlesec}
\RequirePackage{enumitem}
\setlist{noitemsep} % removes spacing from items but leaves space around the whole list
%\setlist{nosep} % removes all vertical spacing within and around the list
\setlist[itemize]{topsep=0.25em, leftmargin=1.5pc}
\setlist[enumerate]{topsep=0.25em, leftmargin=1.5pc}
\RequirePackage[super]{nth}
\titleformat{\section} % Customise the \section command
{\Large\scshape\raggedright} % Make the \section headers large (\Large),
% small capitals (\scshape) and left aligned (\raggedright)
{}{0em} % Can be used to give a prefix to all sections, like 'Section ...'
{} % Can be used to insert code before the heading
[\titlerule] % Inserts a horizontal line after the heading
\titlespacing*{\section}{0cm}{*1}{*1}
\titleformat{\subsection}
{\large\raggedright}
{}{0em}
{}
\titlespacing*{\subsection}{0cm}{*1}{*0.5}
\newcommand{\datedsection}[2]{%
\section[#1]{#1 \hfill #2}%
}
\newcommand{\datedsubsection}[2]{%
\subsection[#1]{#1 \hfill #2}%
}
\newcommand{\datedline}[2]{%
{\par #1 \hfill #2 \par}%
}
\newcommand{\name}[1]{
\centerline{\huge\scshape{#1}}
\vspace{1.2ex}
}
\newcommand{\contactInfo}[4]{
\centerline{\sffamily\large{\ {#1} \textperiodcentered\ \ {#2}}
\ifthenelse{\isempty{#3}}%
{ } % if {#3} is empty
{\textperiodcentered\ \ {#3} } % homepage, no space before \text...
\ifthenelse{\isempty{#4}}%
{ } % if {#3} is empty
{\textperiodcentered\ \ {#4} }
}
\vspace{0.7ex}
}
\newcommand{\role}[2]{
{\par \textit{#1} ~ #2 \par}
\vspace{0.5ex}
}
\newcommand{\tableInfo}[4]{
\begin{tabular}{@{}l@{}}
\huge\scshape #1 \\[0.5ex]% 姓名
\large\sffamily #2 \\ % 博客
\end{tabular}
\hfill
\begin{tabular}{r@{}}
\large\sffamily Tel: #3 \\[1.5ex] % 电话
\large\sffamily E-mail: #4 \\ % 邮箱s
\end{tabular}
}
\newcommand{\rightInfo}[5]{
\begin{flushright}
\begin{tabular}{@{}r}
\Huge\scshape #1 \\[1.2ex]% 姓名
\faHome\ \large\sffamily #4 | \faGithub\ \large\sffamily #5 \\[0.8ex]% 主页和github
\faPhone\ \large\sffamily #2 | \faEnvelope\ \large\sffamily #3 \\[0.8ex] % 电话和邮箱
\end{tabular}
\end{flushright}
}
\newcommand{\leftInfo}[5]{
\begin{flushleft}
\begin{tabular}{@{}l}
\Huge\scshape #1 \\[0.8ex]% 姓名
\faHome\ \large\sffamily #4 | \faGithub\ \large\sffamily #5 \\[0.8ex]% 主页和github
\faPhone\ \large\sffamily #2 | \faEnvelope\ \large\sffamily #3 \\[0.8ex] % 电话和邮箱
\end{tabular}
\end{flushleft}
}