-
Notifications
You must be signed in to change notification settings - Fork 36
/
resumecls.dtx
388 lines (384 loc) · 10.4 KB
/
resumecls.dtx
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
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
% \iffalse meta-comment
%
% resumecls.dtx
% Copyright (C) 2012-2020 by huxuan <[email protected]>
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
% The latest version of this license is in
% http://www.latex-project.org/lppl.txt
% and version 1.3 or later is part of all distributions of LaTeX
% version 2005/12/01 or later.
%
% This work has the LPPL maintenance status `maintained'.
%
% The Current Maintainer of this work is huxuan <[email protected]>.
%
% This work consists of the files resumecls.dtx and resumecls.ins
% and the derived file resumecls.cls.
%
% \fi
% \iffalse
%<*driver>
\ProvidesFile{\jobname.dtx}
%</driver>
%<class>\NeedsTeXFormat{LaTeX2e}
%<class>\ProvidesClass{resumecls}
%<*class>
[2020/04/20 v0.4.1 Minor fix with enhanced examples]
%</class>
%
%<*driver>
\documentclass{ltxdoc}
\usepackage{color}
\definecolor{dkgreen}{rgb}{0,0.6,0}
\definecolor{gray}{rgb}{0.5,0.5,0.5}
\definecolor{mauve}{rgb}{0.58,0,0.82}
\usepackage[xetex,unicode,colorlinks]{hyperref}
\usepackage{listings}
\lstset{
backgroundcolor=\color{white},
basicstyle=\ttfamily,
columns=flexible,
breakatwhitespace=false,
breaklines=true,
captionpos=b,
frame=single,
numbers=left,
numbersep=5pt,
showspaces=false,
showstringspaces=false,
showtabs=false,
stepnumber=1,
rulecolor=\color{black},
tabsize=2,
texcl=true,
title=\lstname,
escapeinside={(*}{*)},
extendedchars=false,
mathescape=true,
xleftmargin=3em,
xrightmargin=3em,
numberstyle=\color{gray},
keywordstyle=\color{blue},
commentstyle=\color{dkgreen},
stringstyle=\color{mauve},
language={[LaTeX]TeX},
morekeywords={setmainfont,setCJKmainfont},
}
\EnableCrossrefs
\CodelineIndex
\RecordChanges
%\OnlyDescription
\begin{document}
\DocInput{\jobname.dtx}
\end{document}
%</driver>
% \fi
%
% \CheckSum{123}
%
% \CharacterTable
% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
% Digits \0\1\2\3\4\5\6\7\8\9
% Exclamation \! Double quote \" Hash (number) \#
% Dollar \$ Percent \% Ampersand \&
% Acute accent \' Left paren \( Right paren \)
% Asterisk \* Plus \+ Comma \,
% Minus \- Point \. Solidus \/
% Colon \: Semicolon \; Less than \<
% Equals \= Greater than \> Question mark \?
% Commercial at \@ Left bracket \[ Backslash \\
% Right bracket \] Circumflex \^ Underscore \_
% Grave accent \` Left brace \{ Vertical bar \|
% Right brace \} Tilde \~}
%
% \changes{v0.1}{2012/12/19}{Initial version with dtx}
% \changes{v0.1.1}{2012/12/19}{Minor bug fix}
% \changes{v0.1.2}{2012/12/19}{Customization part in documentation}
% \changes{v0.1.3}{2012/12/19}{Add reference settings}
% \changes{v0.1.4}{2012/12/20}{Use bfseries for better English support}
% \changes{v0.2}{2013/03/07}{First try to upload to CTAN}
% \changes{v0.2.1}{2013/03/17}{Celebrate for being included in CTAN}
% \changes{v0.3}{2013/06/17}{Long time no see, resumecls}
% \changes{v0.3.1}{2015/09/20}{Compatible with TeXLive 2015 now}
% \changes{v0.3.2}{2015/09/21}{Welcome, contributors}
% \changes{v0.4.0}{2020/04/16}{Hello 2020}
% \changes{v0.4.1}{2020/04/20}{Minor fix with enhanced examples}
%
% \GetFileInfo{\jobname.dtx}
%
% \DoNotIndex{\\,\begin,\bfseries,\bibliographystyle,\bibsep,\colorbox}
% \DoNotIndex{\CurrentOption,\DeclareOption,\def,\definecolor,\else,\end}
% \DoNotIndex{\fancyfoot,\fancyhf,\fi,\footnotesize,\footrulewidth}
% \DoNotIndex{\headrulewidth,\heiti,\href,\hspace,\hypersetup,\ifrclscolor}
% \DoNotIndex{\LoadClass,\maketitle,\newcommand,\newif,\pagestyle,\parbox}
% \DoNotIndex{\PassOptionsToClass,\ProcessOptions,\rclsaddress,\rclscolorfalse}
% \DoNotIndex{\rclscolortrue,\rclshomepage,\rclsleftfooter,\rclsmail}
% \DoNotIndex{\rclsmobile,\rclsname,\rclsorganization,\rclsrightfooter}
% \DoNotIndex{\rightfooter,\refname,\relax,\renewcommand,\RequirePackage}
% \DoNotIndex{\setlength,\textwidth,\url,\zihao}
% \DoNotIndex{}
%
% \def\resumecls{\textsf{resumecls}\ }
%
% \title{The \resumecls package\thanks{This document
% corresponds to \resumecls\fileversion,
% dated~\filedate.}}
% \author{huxuan \\ \texttt{[email protected]}}
% \date{\filedate}
%
% \maketitle
%
% \begin{abstract}
% \resumecls is a document class to typeset a resume or cv both in English and
% Chinese with more ease and flexibility.
% \end{abstract}
%
% \section{Introduction}
%
% There do exist many resume document classes already. But from my experience,
% most of them are a little bit complicated or lack of flexibility.
%
% \resumecls make all contents consists of heading/entry based on tabularx.
% You can easily design the style and some recommended patterns are also listed
% in the example.
%
% What's more, \resumecls has CTeX intergated which means it support Chinese
% natively. The example tex files for both English and Chinese are almost the
% same except for the actual content. You can just focus on the content and
% have your resume both in English and Chinese with no more work.
%
% \section{Usage}
%
% \DescribeMacro{\heading}
% The heading part for each section.
%
% \DescribeMacro{\entry}
% All entry-like contents except for the heading.
%
% \DescribeMacro{\name}
% Your Name.
%
% \DescribeMacro{\organization}
% Your unit, shcool or organization.
%
% \DescribeMacro{\address}
% Your address and possibily with zip code.
%
% \DescribeMacro{\mobile}
% Your phone number.
%
% \DescribeMacro{\mail}
% Your email address.
%
% \DescribeMacro{\homepage}
% Your homepage.
%
% \DescribeMacro{\leftfooter}
% The content you want to put at left footer. Feel free to leave it empty.
%
% \DescribeMacro{\rightrfooter}
% The content you want to put at right footer. Feel free to leave it empty.
%
% \StopEventually{\PrintChanges\PrintIndex}
%
% \section{Implementation}
%
% \subsection{Options}
% \begin{macrocode}
\newif\ifrclscolor\rclscolorfalse
\DeclareOption{color}{\rclscolortrue}
% \end{macrocode}
%
% \subsection{Import article class}
% \begin{macrocode}
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{ctexart}}
\ProcessOptions\relax
\LoadClass[a4paper,12pt]{ctexart}
% \end{macrocode}
%
% \subsection{Import packages}
% \begin{macrocode}
\RequirePackage[top=.5in,bottom=.5in,left=.5in,right=.5in]{geometry}
\RequirePackage[xetex,unicode]{hyperref}
\RequirePackage{tabularx}
\RequirePackage{color}
\RequirePackage{fancyhdr}
% \end{macrocode}
%
% \subsection{Color Settings}
%
% \subsubsection{Background color for heading}
% \begin{macrocode}
\definecolor{heading}{gray}{0.85}
% \end{macrocode}
%
% \subsubsection{Color for hyperlink}
% \begin{macrocode}
\ifrclscolor
\hypersetup{colorlinks}
\else
\hypersetup{hidelinks}
\fi
% \end{macrocode}
%
% \subsection{Reference Settings}
%
% \begin{macrocode}
\RequirePackage[sort&compress]{natbib}
\bibliographystyle{unsrt}
\setlength{\bibsep}{0pt}
% \end{macrocode}
%
% \subsection{Content Variable}
%
% \begin{macro}{\name}
% \begin{macrocode}
\def\rclsname{}
\newcommand\name[1]{\def\rclsname{#1}}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\organization}
% \begin{macrocode}
\def\rclsorganization{}
\newcommand\organization[1]{\def\rclsorganization{#1}}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\address}
% \begin{macrocode}
\def\rclsaddress{}
\newcommand\address[1]{\def\rclsaddress{#1}}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\mobile}
% \begin{macrocode}
\def\rclsmobile{}
\newcommand\mobile[1]{\def\rclsmobile{#1}}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\mail}
% \begin{macrocode}
\def\rclsmail{}
\newcommand\mail[1]{\def\rclsmail{#1}}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\homepage}
% \begin{macrocode}
\def\rclshomepage{}
\newcommand\homepage[1]{\def\rclshomepage{#1}}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\leftfooter}
% \begin{macrocode}
\def\rclsleftfooter{}
\newcommand\leftfooter[1]{\def\rclsleftfooter{#1}}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\rightfooter}
% \begin{macrocode}
\def\rclsrightfooter{}
\newcommand\rightfooter[1]{\def\rclsrightfooter{#1}}
% \end{macrocode}
% \end{macro}
%
% \subsection{Custom commands}
%
% \begin{macro}{\heading}
% \begin{macrocode}
\newcommand{\heading}[1]{%
\colorbox{heading}{%
\parbox{.98\textwidth}{%
\bfseries\zihao{4}#1
}
} \\
}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\entry}
% \begin{macrocode}
\newcommand{\entry}[3]{%
\begin{tabularx}{\textwidth}{@{\hspace{#1}}#2}
#3
\end{tabularx}
}
% \end{macrocode}
% \end{macro}
%
% \subsection{Style settings}
%
% \subsubsection{Redefine maketitle}
% \begin{macrocode}
\renewcommand{\maketitle}{%
\entry{0em}{Xr}{%
\bfseries\zihao{4}\rclsname & \rclsmobile \\
\rclsorganization & \href{mailto:\rclsmail}{\rclsmail} \\
\rclsaddress & \url{\rclshomepage} \\
}
}
% \end{macrocode}
%
% \subsubsection{Header and footer settings}
% \begin{macrocode}
\pagestyle{fancy}
\fancyhf{}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
\fancyfoot[L]{\footnotesize \rclsleftfooter}
\fancyfoot[R]{\footnotesize \rclsrightfooter}
% \end{macrocode}
%
% \subsubsection{Empty refname}
%
% \begin{macrocode}
\renewcommand{\refname}{}
% \end{macrocode}
%
% \subsection{Customization}
%
% \subsubsection{Font settings}
%
% Since we use Xe\LaTeX{} and CTeX, everything should be fine with no extra
% configuration. But if you dedicated to, you can change the font as you like
% only if Xe\LaTeX{} or CTeX supported.
%
% \subsubsection{Multiple pages}
%
% Since the document generated from \resumecls is just a bunch of tables, it is
% prettey straightfoward to enclose the contents in multiple table environments
% and use |\clearpage| to split them into multiple pages. A minimal example
% looks like the following:
%
% \iffalse
%<*lst>
% \fi
\begin{lstlisting}
\begin{table}
Contents for Page 1
\end{table}
\clearpage
\begin{table}
Contents for Page 2
\end{table}
\end{lstlisting}
% \iffalse
%</lst>
% \fi
%
% \section{Contributors}
%
% Please refer to
% \href{https://github.com/huxuan/resumecls/graphs/contributors}{Contributors}.
%
% \Finale
\endinput