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
|
% \iffalse meta-comment
%
% resumecls.dtx
% Copyright 2012-2013 by huxuan <i@huxuan.org>
%
% 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 <i@huxuan.org>.
%
% This work consists of the files resumecls.dtx and resumecls.ins
% and the derived file resumecls.cls.
%
% \fi
% \iffalse
%<cls>\NeedsTeXFormat{LaTeX2e}[2011/06/27]
%<cls>\ProvidesClass{resumecls}
%<cls>[2013/03/07 v0.2 First try to upload to CTAN]
%
%<*driver>
\documentclass{ltxdoc}
\usepackage[adobefonts]{ctex}
\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=\zihao{5}\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{139}
%
% \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}
%
% \GetFileInfo{\jobname.dtx}
%
% \DoNotIndex{\\,\begin,\colorbox,\CTEXoptions,\CurrentOptionn,\def}
% \DoNotIndex{\definecolor,\else,\end,\fancyfoot,\fancyhf,\fi,\footnotesize}
% \DoNotIndex{\footrulewidth,\headrulewidth,\heiti,\href,\hspace,\hypersetup}
% \DoNotIndex{\ifrcls@color,\ifrcls@en,\ifrcls@zh,\LoadClass,\maketitle}
% \DoNotIndex{\newcommand,\newif,\pagestyle,\parbox,\PassOptionsToClass}
% \DoNotIndex{\ProcessOptions,\refname,\relax,\renewcommand,\RequirePackage}
% \DoNotIndex{\textwidth,\today,\url,\zihao}
% \DoNotIndex{}
%
% \def\resumecls{\textsf{resumecls}\ }
%
% \title{The \resumecls package\thanks{This document
% corresponds to \resumecls~\fileversion,
% dated~\filedate.}}
% \author{huxuan \\ \texttt{i@huxuan.org}}
%
% \maketitle
%
% \begin{abstract}
% \resumecls is a latex cls to create a resume or cv more easily.
% Especially it supports Chinese as well as English at the same time.
% \end{abstract}
%
% \section{Introduction}
%
% There do exist many resume cls files already. But from my experience,
% most of them are too complicated or lack of flexibility.
%
% \resumecls make all contents consists of heading/entry based on tabularx.
% You can easily design the style and many recommended ones are also listed
% in example files.
%
% What's more, \resumecls already has ctex package imported which make it
% support Chinese natively. The example-zh.tex and example-en.tex is almost
% the same (in \LaTeX{} Code, not the content). You need no more work
% to make your resume both in English and Chinese.
%
% \section{Usage}
%
% \DescribeMacro{\heading}
% The heading part for each section.
%
% \DescribeMacro{\entry}
% All contents except for heading.
%
% \DescribeMacro{\name}
% Your Name.
%
% \DescribeMacro{\organization}
% Your unit, shcool or organization.
%
% \DescribeMacro{\address}
% Your address and zip code.
%
% \DescribeMacro{\mobile}
% Your phone number.
%
% \DescribeMacro{\mail}
% Your mail address.
%
% \DescribeMacro{\homepage}
% Your homepage.
%
% \DescribeMacro{\resumeurl}
% The url for the resume.
% It will locate at the right of footer.
% If you don't want it, just leave it blank.
%
% \StopEventually{\PrintChanges\PrintIndex}
%
% \section{Implementation}
%
% \subsection{Options}
% \begin{macrocode}
\newif\ifrcls@zh\rcls@zhtrue
\newif\ifrcls@en\rcls@enfalse
\newif\ifrcls@color\rcls@colorfalse
\DeclareOption{zh}{\rcls@zhtrue\rcls@enfalse}
\DeclareOption{en}{\rcls@entrue\rcls@zhfalse}
\DeclareOption{color}{\rcls@colortrue}
% \end{macrocode}
%
% \subsection{Import article class}
% \begin{macrocode}
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}}
\ProcessOptions\relax
\LoadClass[a4paper,12pt]{article}
% \end{macrocode}
%
% \subsection{Import packages}
% \begin{macrocode}
\RequirePackage[top=.5in,bottom=.5in,left=.5in,right=.5in]{geometry}
\RequirePackage[xetex,unicode]{hyperref}
\RequirePackage[noindent,adobefonts]{ctex}
\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}
\ifrcls@color
\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\rcls@name{}
\newcommand\name[1]{\def\rcls@name{#1}}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\organization}
% \begin{macrocode}
\def\rcls@organization{}
\newcommand\organization[1]{\def\rcls@organization{#1}}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\address}
% \begin{macrocode}
\def\rcls@address{}
\newcommand\address[1]{\def\rcls@address{#1}}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\mobile}
% \begin{macrocode}
\def\rcls@mobile{}
\newcommand\mobile[1]{\def\rcls@mobile{#1}}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\mail}
% \begin{macrocode}
\def\rcls@mail{}
\newcommand\mail[1]{\def\rcls@mail{#1}}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\homepage}
% \begin{macrocode}
\def\rcls@homepage{}
\newcommand\homepage[1]{\def\rcls@homepage{#1}}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\resumeurl}
% \begin{macrocode}
\def\rcls@resumeurl{}
\newcommand\resumeurl[1]{\def\rcls@resumeurl{#1}}
% \end{macrocode}
% \end{macro}
%
% \subsection{Custom commands}
%
% \begin{macro}{\heading}
% \begin{macrocode}
\newcommand{\heading}[1]{
\colorbox{heading}{
\parbox{.96\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}\rcls@name & \rcls@mobile \\
\rcls@organization & \href{mailto:\rcls@mail}{\rcls@mail} \\
\rcls@address & \url{\rcls@homepage} \\
}
}
% \end{macrocode}
%
% \subsubsection{Header and footer settings}
% \begin{macrocode}
\pagestyle{fancy}
\fancyhf{}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
\ifrcls@zh
\CTEXoptions[today=small]
\fancyfoot[L]{\footnotesize 最后更新:\today}
\else
\CTEXoptions[today=old]
\fancyfoot[L]{\footnotesize Last Modified: \today}
\fi
\fancyfoot[R]{\footnotesize \url{\rcls@resumeurl}}
% \end{macrocode}
%
% \subsubsection{Empty refname}
%
% \begin{macrocode}
\renewcommand{\refname}{}
% \end{macrocode}
%
% \subsection{Customization}
%
% \subsubsection{Font settings}
%
% Cause we recommend use Xe\LaTeX{} to compile, so you can easily setting
% the font to whatever you like only if it exists on you computer.
% Just add something like following code before |\begin{document}|.
%
% \iffalse
%<*lst>
% \fi
\begin{lstlisting}
\setmainfont{Times New Roman}
\setCJKmainfont[BoldFont=(*黑体*)]{(*宋体*)}
\end{lstlisting}
% \iffalse
%</lst>
% \fi
%
% \subsubsection{Multiple pages}
%
% Currently, \resumecls doesn't support multiple pages very well. Before
% showing the method for customization I want you relize that only one page
% for resume is enough. \resumecls use |\begin{table}| and |\end{table}| to
% enclose all contents so that the whole resume will be limited in one page.
% But if you really want to have multiple pages, you can set multiple table
% environments in your tex fhile and judge the place for new page yourself.
% the code within document environment for two pages resume will looks like:
%
% \iffalse
%<*lst>
% \fi
\begin{lstlisting}
\begin{table}
Contents for Page 1
\end{table}
\newpage
\begin{table}
Contents for Page 2
\end{table}
\end{lstlisting}
% \iffalse
%</lst>
% \fi
%
% \Finale
\endinput
|