-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathCASmthesis.cls
347 lines (345 loc) · 11.8 KB
/
CASmthesis.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
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
%%
%% This is file `CASthesis.cls',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% CASthesis.dtx (with options: `cls')
%%
%% This is a generated file.
%%
%% Copyright 2004-2006
%% CTEX.ORG and any individual authors listed elsewhere in this file.
%%
%% This file was generated from file(s) of the CASthesis package project.
%% ----------------------------------------------------------------------
%%
%% It may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.2
%% 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.2 or later is part of all distributions of LaTeX
%% version 1999/12/01 or later.
%%
%% This file may only be distributed together with a copy of original
%% source files. You may however distribute original source files
%% without such generated files. Copying of this file is authorized
%% only if either:
%% (1) you make absolutely no changes to your copy, including name; OR
%% (2) if you do make changes, you first rename it to some other name.
%%
%% To produce the documentation run the original source files ending
%% with `.dtx' through LaTeX.
%%
%% \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 \~}
%%
\NeedsTeXFormat{LaTeX2e}[1995/12/01]
\ProvidesClass{CASmthesis}
[2011/04/06 v0.2 CASmthesis
document class]
\newif\ifCAST@typeinfo \CAST@typeinfotrue
\DeclareOption{notypeinfo}{\CAST@typeinfofalse}
\newif\ifCAST@dvips \CAST@dvipsfalse
\DeclareOption{dvips}{\CAST@dvipstrue}
\DeclareOption{dvipdfm}{\CAST@dvipsfalse}
\DeclareOption{pdftex}{\CAST@dvipsfalse}
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{ctexbook}}
\ProcessOptions
\LoadClass[cs4size,a4paper,fancyhdr,fntef]{ctexbook}[2005/11/25]
\RequirePackage{indentfirst}
%% check pdfTeX mode
\RequirePackage{ifpdf,ifxetex}
%% math packages
\RequirePackage{amsmath,amsthm,amsfonts,amssymb,bm}
%% graphics packages
\RequirePackage{graphicx}
%% sort and compress citations
\RequirePackage[sort&compress,numbers]{natbib}
%% packages and settings depend on PDF mode
\ifxetex
\RequirePackage[xetex]{hyperref}
\DeclareGraphicsExtensions{.pdf,.png,.jpg}
\else
\ifpdf % We're running pdfTeX in PDF mode
\RequirePackage[pdftex]{hyperref}
\DeclareGraphicsExtensions{.pdf,.png,.jpg}
\else % We're not running pdfTeX, or running pdfTeX in DVI mode
\ifCAST@dvips
\RequirePackage[dvips]{hyperref}
\RequirePackage{psfrag}
\AtBeginDvi{\special{pdf:tounicode GBK-EUC-UCS2}} % GBK -> Unicode
\else
\RequirePackage[dvipdfm]{hyperref}
\fi
\DeclareGraphicsExtensions{.eps,.ps}
\fi
\fi
\hypersetup{CJKbookmarks,%
bookmarksnumbered,%
colorlinks,%
linkcolor=blue,%
citecolor=blue,%
plainpages=false,%
pdfstartview=FitH}
\AtEndOfPackage{\makeatletter\input{CASmthesis.cfg}\makeatother}
\oddsidemargin 0.93 true cm
\if@twoside
\evensidemargin 0.33 true cm
\else
\evensidemargin 0.93 true cm
\fi
\textheight 23.6 true cm
\textwidth 14.66 true cm
\headheight 15pt
\parskip 0.5ex plus 0.25ex minus 0.25ex
\setlength{\marginparwidth}{2cm}
\setlength{\voffset}{ -1.55 cm}
\def\cleardoublepage{\clearpage\if@twoside \ifodd\c@page\else
\thispagestyle{empty}%
\hbox{}\newpage\if@twocolumn\hbox{}\newpage\fi\fi\fi}
\renewcommand{\floatpagefraction}{0.80}
%\bibliographystyle{plain}
\expandafter\def\csname CTEX@spaceChar\endcsname{\hspace{1em}}
\newcommand\CASTspace{\protect\CTEX@spaceChar\protect\CTEX@spaceChar}
\def\CAST@getfileinfo#1 #2 #3\relax#4\relax{%
\def\CASTfiledate{#1}%
\def\CASTfileversion{#2}%
\def\CASTfileinfo{#3}}%
\expandafter\ifx\csname ver@CASmthesis.cls\endcsname\relax
\edef\reserved@a{\csname ver@ctextemp_CASmthesis.cls\endcsname}
\else
\edef\reserved@a{\csname ver@CASmthesis.cls\endcsname}
\fi
\expandafter\CAST@getfileinfo\reserved@a\relax? ? \relax\relax
\def\CAST@underline[#1]#2{%
\CJKunderline{\hbox to #1{\hfill#2\hfill}}}
\def\CASTunderline{\@ifnextchar[\CAST@underline\CJKunderline}
\newcommand\classification[1]{\def\CAST@value@classification{#1}}
\newcommand\confidential[1]{\def\CAST@value@confidential{#1}}
\newcommand\UDC[1]{\def\CAST@value@UDC{#1}}
\newcommand\serialnumber[1]{\def\CAST@value@serialnumber{#1}}
\newcommand\school[1]{\def\CAST@value@school{#1}}
\newcommand\degree[1]{\def\CAST@value@degree{#1}}
\renewcommand\title[2][\CAST@value@title]{%
\def\CAST@value@title{#2}
\def\CAST@value@titlemark{\MakeUppercase{#1}}}
\renewcommand\author[1]{\def\CAST@value@author{#1}}
\newcommand\advisor[1]{\def\CAST@value@advisor{#1}}
\newcommand\advisorinstitute[1]{\def\CAST@value@advisorinstitute{#1}}
\newcommand\major[1]{\def\CAST@value@major{#1}}
\newcommand\submitdate[1]{\def\CAST@value@submitdate{#1}}
\newcommand\degreedate[1]{\def\CAST@value@degreedate{#1}}
\newcommand\defenddate[1]{\def\CAST@value@defenddate{#1}}
\newcommand\institute[1]{\def\CAST@value@institute{#1}}
\newcommand\chairman[1]{\def\CAST@value@chairman{#1}}
\newcommand\englishtitle[1]{\def\CAST@value@englishtitle{#1}}
\newcommand\englishauthor[1]{\def\CAST@value@englishauthor{#1}}
\newcommand\englishadvisor[1]{\def\CAST@value@englishadvisor{#1}}
\newcommand\englishinstitute[1]{\def\CAST@value@englishinstitute{#1}}
\newcommand\englishdate[1]{\def\CAST@value@englishdate{#1}}
\newcommand\englishdegree[1]{\def\CAST@value@englishdegree{#1}}
\newcommand\englishmajor[1]{\def\CAST@value@englishmajor{#1}}
\newcommand\makeenglishtitle{%
\cleardoublepage
\thispagestyle{empty}
\begin{center}
\vspace*{20pt}
\sf\zihao{-1} \CAST@value@englishtitle
\vskip \stretch{1}
\bf\zihao{4} \CAST@value@englishauthor
\vskip \stretch{1}
\normalfont\zihao{4} \CAST@label@englishadvisor
\vskip 3pt
\normalfont\zihao{4} \CAST@value@englishadvisor
\vskip \stretch{2}
\normalfont\normalsize \CAST@value@englishinstitute
\vskip 30pt
\normalfont\normalsize \CAST@value@englishdate
\vskip 20pt
\it\normalsize \CAST@label@englishstatement
\end{center}
\clearpage
\if@twoside
\thispagestyle{empty}
\cleardoublepage
\fi
}
\fancypagestyle{plain}{%
\fancyhf{}%
\renewcommand{\headrulewidth}{0pt}%
\renewcommand{\footrulewidth}{0pt}%
}
\pagestyle{fancy}
\fancyhf{}
\fancyhead[RE]{\small \CAST@value@titlemark}
\fancyhead[LO]{\small \leftmark}
\fancyhead[LE,RO]{\small ~\thepage~}
\newenvironment{abstract}
{\Nchapter{\CAST@label@abstract}}
{}
\newcommand\keywords[1]{%
\vspace{2ex}\noindent{\heiti \CAST@label@keywords} #1}
\newenvironment{englishabstract}
{\Nchapter{\CAST@label@englishabstract}}
{}
\newcommand\englishkeywords[1]{%
\vspace{2ex}\noindent{\bf \CAST@label@englishkeywords} #1}
\renewcommand\tableofcontents{%
\if@twocolumn
\@restonecoltrue\onecolumn
\else
\@restonecolfalse
\fi
\Nchapter{\contentsname}%
\@mkboth{\MakeUppercase\contentsname}{\MakeUppercase\contentsname}%
\@starttoc{toc}%
\if@restonecol\twocolumn\fi
}
\addtocontents{toc}{\let\string\CTEX@spaceChar\relax}
\newcommand\Nchapter[1]{%
\if@mainmatter%
\@mainmatterfalse%
\chapter{#1}%
\@mainmattertrue%
\else
\chapter{#1}%
\fi}
\def\@dottedtocline#1#2#3#4#5{%
\ifnum #1>\c@tocdepth \else
\vskip \z@ \@plus.2\p@
{\leftskip #2\relax \rightskip \@tocrmarg \parfillskip -\rightskip
\parindent #2\relax\@afterindenttrue
\interlinepenalty\@M
\leavevmode
\@tempdima #3\relax
\advance\leftskip \@tempdima \null\nobreak\hskip -\leftskip
{#4}\nobreak
\leaders\hbox{$\m@th\mkern 1.5mu\cdot\mkern 1.5mu$}\hfill
\nobreak
\hb@xt@\@pnumwidth{\hfil\normalfont \normalcolor #5}%
\par}%
\fi}
\renewcommand*\l@part[2]{%
\ifnum \c@tocdepth >-2\relax
\addpenalty{-\@highpenalty}%
\addvspace{2.25em \@plus\p@}%
\setlength\@tempdima{3em}%
\begingroup
\parindent \z@ \rightskip \@pnumwidth
\parfillskip -\@pnumwidth
{\leavevmode
\large \bfseries #1
\leaders\hbox{$\m@th\mkern 1.5mu\cdot\mkern 1.5mu$}
\hfil \hb@xt@\@pnumwidth{\hss #2}}\par
\nobreak
\global\@nobreaktrue
\everypar{\global\@nobreakfalse\everypar{}}%
\endgroup
\fi}
\renewcommand*\l@chapter[2]{%
\ifnum \c@tocdepth >\m@ne
\addpenalty{-\@highpenalty}%
\vskip 1.0em \@plus\p@
\setlength\@tempdima{1.5em}%
\begingroup
\parindent \z@ \rightskip \@pnumwidth
\parfillskip -\@pnumwidth
\leavevmode \bfseries
\advance\leftskip\@tempdima
\hskip -\leftskip
#1\nobreak
\leaders\hbox{$\m@th\mkern 1.5mu\cdot\mkern 1.5mu$}
\hfil \nobreak\hb@xt@\@pnumwidth{\hss #2}\par
\penalty\@highpenalty
\endgroup
\fi}
\renewenvironment{thebibliography}[1]
{\Nchapter{\bibname}%
\@mkboth{\MakeUppercase\bibname}{\MakeUppercase\bibname}%
\list{\@biblabel{\@arabic\c@enumiv}}%
{\settowidth\labelwidth{\@biblabel{#1}}%
\leftmargin\labelwidth
\advance\leftmargin\labelsep
\@openbib@code
\usecounter{enumiv}%
\let\p@enumiv\@empty
\renewcommand\theenumiv{\@arabic\c@enumiv}}%
\sloppy
\clubpenalty4000
\@clubpenalty \clubpenalty
\widowpenalty4000%
\sfcode`\.\@m}
{\def\@noitemerr
{\@latex@warning{Empty `thebibliography' environment}}%
\endlist}
\newenvironment{publications}[1]
{\Nchapter{\CAST@label@publications}%
\@mkboth{\MakeUppercase\CAST@label@publications}
{\MakeUppercase\CAST@label@publications}%
\begingroup\zihao{5}\linespread{1}\selectfont
\list{\@biblabel{\@arabic\c@enumiv}}%
{\settowidth\labelwidth{\@biblabel{#1}}%
\leftmargin\labelwidth
\advance\leftmargin\labelsep
\@openbib@code
\usecounter{enumiv}%
\let\p@enumiv\@empty
\renewcommand\theenumiv{\@arabic\c@enumiv}}%
\sloppy
\clubpenalty4000
\@clubpenalty \clubpenalty
\widowpenalty4000%
\sfcode`\.\@m}
{\def\@noitemerr
{\@latex@warning{Empty `publications' environment}}%
\endlist
\endgroup
\cleardoublepage}
\newenvironment{resume}
{\Nchapter{\CAST@label@resume}}
{}
\newenvironment{resumesection}[1]
{{\noindent\normalfont\bfseries #1}
\list{}{\labelwidth\z@
\leftmargin 2\ccwd}
\item\relax}
{\endlist}
\newenvironment{resumelist}[1]
{{\noindent\normalfont\bfseries #1}
\list{}{\labelwidth\z@
\leftmargin 4\ccwd
\itemindent -2\ccwd
\listparindent\itemindent}
\item\relax}
{\endlist}
\renewenvironment{thanks}
{\Nchapter{\CAST@label@thanks}}
{}
\setcounter{secnumdepth}{4}
\newtheoremstyle{break}% name
{}% Space above, empty = `usual value'
{}% Space below
{\itshape}% Body font
{}% Indent amount (empty = no indent, \parindent = para indent)
{\bfseries}% Thm head font
{.}% Punctuation after thm head
{\newline}% Space after thm head: \newline = linebreak
{}% Thm head spec
\endinput
%%
%% End of file `CASmthesis.cls'.