generated from fky2015/resume-ng
-
Notifications
You must be signed in to change notification settings - Fork 0
/
resume.cls
173 lines (148 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
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
\RequirePackage{expl3,l3keys2e}
\ProvidesExplClass{resume}
{2022-12-26}{0.1.0}{Another Resume Class by Feng Kaiyu}
% Keep Quiet
\PassOptionsToPackage{quiet}{xeCJK}
\ProcessOptions\relax
\LoadClass[zihao=5,autoindent=0.5em]{ctexart}
% Define paper size.
\RequirePackage{geometry}
% Remove the default header and footer.
\RequirePackage{fancyhdr}
% Redefine list style.
\RequirePackage{enumitem}
% Align all footnotes in a row.
\RequirePackage[para]{footmisc}
\RequirePackage[colorlinks=false,hidelinks,]{hyperref}
% For the usage of `\CJKunderline`.
\RequirePackage{xeCJKfntef}
% Provide colors.
\RequirePackage{xcolor}
% Clean pagestyle.
\pagestyle{empty}
% Adopt A4 style but with smaller margins.
\geometry{a4paper,margin=1cm, bottom=0.5cm}
%%% Global Variables %%%
% Store all contacts info.
\seq_new:N \g__resume_contacts_seq
% Store title name.
\tl_new:N \g__resume_title_name_tl
%%% Global Settings %%%
% No page number.
\pagenumbering{gobble}
% Set the style of section title.
\ctexset{
section = {
nameformat = {},
number = {},
format = \noindent \zihao{4} \heiti \__resume_section_title_format:n,
indent = -1em,
afterskip = 0.5em,
beforeskip = 0.2em,
},
}
% Set the style of list.
\setlist{
labelsep=2pt,
labelwidth=5pt,
leftmargin=1.3em,
itemsep=0em,
parsep=0.20em,
topsep=0em,
}
% Set the line spacing.
\linespread{1.15}
% New counter for bookmarks.
\newcounter{resumebookmark}
%%% User Commands %%%
% Predefined commands.
\cs_new:Npn \__resume_append_concat:n #1
{
\seq_put_right:Nn \g__resume_contacts_seq {#1}
}
% Predefined commands.
\cs_new:Npn \__resume_section_title_format:n #1
{#1 \vspace{3pt} \hrule}
% Add a contant info.
\NewDocumentCommand{\ResumeContact}{m}
{
\__resume_append_concat:n {#1}
}
% Add multiple contant info.
% ```
% \ResumeContacts{ itemA, itemB, itemC }
% ```
\NewDocumentCommand{\ResumeContacts}{m}
{
\seq_set_from_clist:Nn \l__input_seq:N {#1}
\seq_map_inline:Nn \l__input_seq:N
{
\__resume_append_concat:n {##1}
}
}
% Add your resume title, which generally is your name.
\NewDocumentCommand{\ResumeName}{m}
{
\tl_set:Nn \g__resume_title_name_tl {#1}
}
% Render the title.
\NewDocumentCommand{\ResumeTitle}{}
{
\begin{center}
\zihao{-2} \heiti \g__resume_title_name_tl
\end{center}
% Reduce the space.
\vspace{-1.4em}
\begin{center}
\seq_use:Nnnn \g__resume_contacts_seq {~|~} {~|~} {~|~}
\end{center}
}
% Render the section title.
% #1(optional): This content will be used as the bookmark in PDF.
% #2: The title of the section.
% #3(optional): The additional information of the section.
% #4(optional): The right-aligned content, which normally will be the date range.
\NewDocumentCommand{\ResumeItem}{omoo}
{
{
\zihao{-4}
\par
\noindent
{
\heiti
#2
\IfValueTF{#1}
{
\pdfbookmark[2]{#1}{subsec:\arabic{resumebookmark}}
}
{
\pdfbookmark[2]{#2}{subsec:\arabic{resumebookmark}}
}
\stepcounter{resumebookmark}
}
\IfValueT{#3}{
\tl_if_empty:nF {#3} {
\ |
\textit{
#3
}
}
}
\hfill
\IfValueT{#4}{
#4
}
\par
}
}
% Gray out the content.
\NewDocumentCommand{\GrayText}{m}
{
\textcolor{gray}{#1}
}
% Render content with a hyperlink, marked with underline.
\NewDocumentCommand{\ResumeUrl}{mm}
{
\href{#1}{\CJKunderline{#2}}
}
\endinput