-
Notifications
You must be signed in to change notification settings - Fork 933
/
ucasthesis.cls
741 lines (669 loc) · 26.1 KB
/
ucasthesis.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
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
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
%---------------------------------------------------------------------------%
%- -%
%- Document Class -%
%- -%
%---------------------------------------------------------------------------%
%- Copyright (C) Huangrui Mo <huangrui.mo@gmail.com>
%- This is free software: you can redistribute it and/or modify it
%- under the terms of the GNU General Public License as published by
%- the Free Software Foundation, either version 3 of the License, or
%- (at your option) any later version.
%---------------------------------------------------------------------------%
%->> Identification
%---------------------------------------------------------------------------%
\NeedsTeXFormat{LaTeX2e}%
\newcommand*\@iflatexlater{\@ifl@t@r\fmtversion}%
\@iflatexlater{2017/01/01}{}{%
\ClassError{ucasthesis}{TeXLive/MikTex >= 2017 is required ...}{}%
}
\ProvidesClass{ucasthesis}[2014/10/01 v1.0 LaTeX document class]%
%---------------------------------------------------------------------------%
%->> Declare options
%---------------------------------------------------------------------------%
%-
%-> Layout
%-
\DeclareOption{oneside}{%
\PassOptionsToClass{oneside}{ctexbook}%
}
\DeclareOption{twoside}{%
\PassOptionsToClass{twoside}{ctexbook}%
}
\newif\ifucas@print \ucas@printfalse
\DeclareOption{print}{%
\PassOptionsToClass{twoside}{ctexbook}%
\ucas@printtrue%
}
%-
%-> Language
%-
\newif\ifucas@plain \ucas@plainfalse
\DeclareOption{scheme=plain}{% enable plain writing style
\PassOptionsToClass{scheme=plain}{ctexbook}%
\ucas@plaintrue%
}
%-
%-> Draft version info
%-
\newif\ifucas@versioninfo \ucas@versioninfofalse
\DeclareOption{draftversion}{%
\ucas@versioninfotrue%
}
%-
%-> Handle non-implemented options
%-
\DeclareOption*{%
\PassOptionsToClass{\CurrentOption}{ctexbook}%
}
%-
%-> Terminates all options processing
%-
\ProcessOptions\relax%
%---------------------------------------------------------------------------%
%->> Load class information
%---------------------------------------------------------------------------%
\LoadClass[UTF8,a4paper,zihao=-4]{ctexbook}%
\@ifclasslater{ctexbook}{2017/01/01}{}{%
\ClassError{ucasthesis}{ctex >= 2017/01/01 is required ...}{}%
}
%---------------------------------------------------------------------------%
%->> Required packages
%---------------------------------------------------------------------------%
\RequirePackage{ifxetex}% LaTeX engine detection
\RequirePackage{etoolbox}% a toolbox of programming facilities
\newcommand{\ucasifstreq}{\expandafter\ifstrequal\expandafter}% expansion control
\newcommand{\ucasifstrbk}{\expandafter\ifblank\expandafter}% expansion control
\RequirePackage{expl3}% LaTeX3 programming environment
\ExplSyntaxOn
\newcommand{\ucaslntotab}[2][1pt]{% convert lines into table lines
\seq_set_split:NnV \l_tmpa_seq {\\} {#2}
\clist_set_from_seq:NN \l_tmpa_clist \l_tmpa_seq
\clist_clear:N \l_tmpb_clist
\clist_map_inline:Nn \l_tmpa_clist
{%
\clist_put_right:Nn \l_tmpb_clist
{ \ulenhance[#1]{\ulextend{##1}} }
}
%\clist_show:N\l_tmpb_clist% show the content of comma list
\clist_use:Nn \l_tmpb_clist { \\ & }
}
\ExplSyntaxOff
%---------------------------------------------------------------------------%
%->> Load class configuration
%---------------------------------------------------------------------------%
\AtEndOfPackage{% class cfg loaded after package to make preamble commands take effect
\makeatletter
\InputIfFileExists{Style/ucasthesis.cfg}{}{}
\makeatother
}
%---------------------------------------------------------------------------%
%->> Page layout
%---------------------------------------------------------------------------%
%- use \topmargin insead of \voffset to shift the complete text vertically
%- use \<odd|even>sidemargin insead of \hoffset to shift text horizontally
%- part one -- horizontal widths
%- left side width + textwidth + right side width = paperwidth
%- binding side width + textwidth + nonbinding side width = paperwidth
%- binding side width of [odd, even] page = [left, right] side width
%- left side width of [odd, even] page = 1.0in (fixed) + hoffset + [odd, even]sidemargin
%- assuming A4 paper (210mm x 297mm)
\setlength{\textwidth}{146.6mm}% set required text width first
\setlength{\hoffset}{0mm}% set horizontal offset
\ifucas@print% if print layout enabled
\setlength{\oddsidemargin}{12.6mm}% binding side margin
\setlength{\evensidemargin}{0mm}% ensure uniform binding side width for printing
\else
\setlength{\oddsidemargin}{6.3mm}% left side margin
\setlength{\evensidemargin}{6.3mm}% ensure uniform left side width for EThesis
\fi
\setlength{\marginparwidth}{35pt}% width of margin notes
\setlength{\marginparsep}{10pt}% width of space between body text and margin notes
%- part two -- vertical heights
%- top height + textheight + bottom height = paperheight
%- top height = 1.0in (fixed) + voffset + topmargin + headheight + headsep
\setlength{\textheight}{246.2mm}% set required text height first
\setlength{\voffset}{0mm}% set vertical offset
\setlength{\topmargin}{-10.4mm}% vertical margin above header
\setlength{\headheight}{12pt}% header height
\setlength{\headsep}{17.5pt}% vertical margin between header and body text
\setlength{\footskip}{10.4mm}% vertical margin between footer and body text
%- specifies the amount of space between paragraphs.
\setlength{\parskip}{0.5ex plus 0.25ex minus 0.25ex}
%- line spacing
\linespread{1.6}% line space setting
\raggedbottom% prevent adding vertical white space in strange places
%- default pagestyle is page number at bottom without headers and footers
\pagestyle{plain}
%---------------------------------------------------------------------------%
%->> Style control commands
%---------------------------------------------------------------------------%
%- redefine cleardoublepage to have page style argument
\renewcommand{\cleardoublepage}[1][plain]{%
\clearpage\if@twoside\ifodd\c@page\else%
\thispagestyle{#1}%
\hbox{}\newpage\if@twocolumn\hbox{}\newpage\fi\fi\fi%
}
%- underline
\ifxetex%
%\RequirePackage{ulem}% loaded by xeCJKfntef
\else%
\RequirePackage{ulem}%
\fi
\newcommand{\ulunify}[1]{\uline{#1}}% unified name
\newcommand{\ulenhance}[2][1pt]{% enhanced underline
\def\ULthickness{#1}% set thickness
\setlength{\ULdepth}{0.3em}% set depth
\expandafter\ulunify\expandafter{#2}% linebreak fix
}
\newcommand{\ulhshift}{-4em}% horizontal shift on underline
\newcommand{\ulextend}[2][350pt]{% extend underline length
\hbox to #1{\hfill\hspace*{\ulhshift}#2\hfill}}
%---------------------------------------------------------------------------%
%->> Titlepage
%---------------------------------------------------------------------------%
%-
%-> Chinese item commands
%-
\def\ucas@value@ch@confidential{}
\newcommand{\confidential}[1]{\def\ucas@value@ch@confidential{#1}}
\def\ucas@value@ch@orderid{}
\newcommand{\orderid}[1]{\def\ucas@value@ch@orderid{#1}}
\def\ucas@value@ch@classid{}
\newcommand{\classid}[1]{\def\ucas@value@ch@classid{#1}}
\def\ucas@value@ch@udc{}
\newcommand{\udc}[1]{\def\ucas@value@ch@udc{#1}}
\def\ucas@value@ch@schoollogo{}
\newcommand{\schoollogo}[2][]{\def\ucas@value@ch@schoollogo{\ucasifstrbk{#1}{\zihao{-2}\bfseries\sffamily #2}{\includegraphics[#1]{#2}}}}
\def\ucas@value@ch@title{}
\def\ucas@value@ch@titlemark{}
\renewcommand{\title}[2][\ucas@value@ch@title]{%
\def\ucas@value@ch@title{#2}
%\def\ucas@value@ch@titlemark{\MakeUppercase{#1}}}
\def\ucas@value@ch@titlemark{#1}}
\def\ucas@value@ch@author{}
\renewcommand{\author}[1]{\def\ucas@value@ch@author{#1}}
\def\ucas@value@ch@advisor{}
\newcommand{\advisor}[1]{\long\def\ucas@value@ch@advisor{#1}}
\def\ucas@value@ch@advisors{}
\newcommand{\advisors}[1]{\long\def\ucas@value@ch@advisors{#1}}
\def\ucas@value@ch@degree{}
\newcommand{\degree}[1]{\def\ucas@value@ch@degree{#1}}
\def\ucas@value@ch@degreetype{}
\newcommand{\degreetype}[1]{\def\ucas@value@ch@degreetype{#1}}
\def\ucas@value@ch@subject{}
\newcommand{\subject}[1]{\def\ucas@value@ch@subject{#1}}
\def\ucas@value@ch@major{}
\newcommand{\major}[1]{\def\ucas@value@ch@major{#1}}
\def\ucas@value@ch@institute{}
\newcommand{\institute}[1]{\long\def\ucas@value@ch@institute{#1}}
\def\ucas@value@ch@school{}
\newcommand{\school}[1]{\def\ucas@value@ch@school{#1}}
\def\ucas@value@ch@orginization{}
\newcommand{\orginization}[1]{\def\ucas@value@ch@orginization{#1}}
\def\ucas@value@ch@completedate{}
\newcommand{\completedate}[1]{\def\ucas@value@ch@completedate{#1}}
\def\ucas@value@ch@submitdate{}
\newcommand{\submitdate}[1]{\def\ucas@value@ch@submitdate{#1}}
\def\ucas@value@ch@studydatefrom{}
\newcommand{\studydatefrom}[1]{\def\ucas@value@ch@studydatefrom{#1}}
\def\ucas@value@ch@studydateto{}
\newcommand{\studydateto}[1]{\def\ucas@value@ch@studydateto{#1}}
\def\ucas@value@ch@date{}
\renewcommand{\date}[1]{\def\ucas@value@ch@date{#1}}
%-
%-> English item commands
%-
\def\ucas@value@en@title{}
\def\ucas@value@en@titlemark{}
\newcommand{\TITLE}[2][\ucas@value@en@title]{%
\def\ucas@value@en@title{#2}
%\def\ucas@value@en@titlemark{\MakeUppercase{#1}}}
\def\ucas@value@en@titlemark{#1}}
\def\ucas@value@en@author{}
\newcommand{\AUTHOR}[1]{\def\ucas@value@en@author{#1}}
\def\ucas@value@en@advisor{}
\newcommand{\ADVISOR}[1]{\def\ucas@value@en@advisor{#1}}
\def\ucas@value@en@degree{}
\newcommand{\DEGREE}[1]{\edef\ucas@value@en@degree{\zap@space#1 \@empty}}% expand and remove space
\def\ucas@value@en@degreetype{}
\newcommand{\DEGREETYPE}[1]{\def\ucas@value@en@degreetype{#1}}
\def\ucas@value@en@thesistype{}
\newcommand{\THESISTYPE}[1]{\def\ucas@value@en@thesistype{#1}}
\def\ucas@value@en@major{}
\newcommand{\MAJOR}[1]{\def\ucas@value@en@major{#1}}
\def\ucas@value@en@institute{}
\newcommand{\INSTITUTE}[1]{\def\ucas@value@en@institute{#1}}
\def\ucas@value@en@school{}
\newcommand{\SCHOOL}[1]{\def\ucas@value@en@school{#1}}
\def\ucas@value@en@date{}
\newcommand{\DATE}[1]{\def\ucas@value@en@date{#1}}
%-
%-> Detect and adjust items
%-
\AtEndPreamble{%
\ucasifstreq{\ucas@value@en@degree}{Bachelor}{%
\def\ucas@label@ch@thesis{\ucas@label@ch@thesis@bac}%
\def\ucas@label@ch@author{\ucas@label@ch@author@bac}%
\def\ucas@label@ch@major{\ucas@label@ch@major@bac}%
\def\ucas@label@ch@institute{\ucas@label@ch@institute@bac}%
\def\ucas@value@en@thesistype{\ucas@value@en@thesistype@bac}%
\def\maketitle{\maketitle@xpdc}
\def\MAKETITLE{\MAKETITLE@xpdc}
}{%
\ucasifstreq{\ucas@value@en@degree}{Master}{%
\def\ucas@label@ch@thesis{\ucas@label@ch@thesis@mas}%
\def\ucas@label@ch@author{\ucas@label@ch@author@mas}%
\def\ucas@label@ch@major{\ucas@label@ch@major@mas}%
\def\ucas@label@ch@institute{\ucas@label@ch@institute@mas}%
\def\ucas@value@en@thesistype{\ucas@value@en@thesistype@mas}%
\def\maketitle{\maketitle@xpdc}
\def\MAKETITLE{\MAKETITLE@xpdc}
}{%
\ucasifstreq{\ucas@value@en@degree}{Doctor}{%
\def\ucas@label@ch@thesis{\ucas@label@ch@thesis@doc}%
\def\ucas@label@ch@author{\ucas@label@ch@author@doc}%
\def\ucas@label@ch@major{\ucas@label@ch@major@doc}%
\def\ucas@label@ch@institute{\ucas@label@ch@institute@doc}%
\def\ucas@value@en@thesistype{\ucas@value@en@thesistype@doc}%
\def\maketitle{\maketitle@xpdc}
\def\MAKETITLE{\MAKETITLE@xpdc}
}{%
\ucasifstreq{\ucas@value@en@degree}{Postdoctor}{%
\def\ucas@label@ch@thesis{\ucas@label@ch@thesis@pdc}%
\def\ucas@label@ch@author{\ucas@label@ch@author@pdc}%
\def\ucas@label@ch@major{\ucas@label@ch@major@pdc}%
\def\ucas@label@ch@institute{\ucas@label@ch@institute@pdc}%
\def\ucas@value@en@thesistype{\ucas@value@en@thesistype@pdc}%
\def\maketitle{\maketitle@pdc}
\def\MAKETITLE{\MAKETITLE@pdc}
}{%
\ClassWarning{ucasthesis}{Invalid value of '\string\DEGREE', please check the spelling}%
}}}}%
}
%-
%-> Define Chinese style
%-
\newcommand{\maketitle@xpdc}{%
\cleardoublepage
\thispagestyle{empty}
\begin{center}
\linespread{1.6}
\zihao{4}\bfseries
\hfill{} \ucasifstrbk{\ucas@value@ch@confidential}{}{\ucas@label@ch@confidential \ulenhance{\ulextend[50pt]{\hspace*{-\ulhshift}\zihao{5}\ucas@value@ch@confidential}}}
\vspace*{\stretch{4}}
{\ucas@value@ch@schoollogo}
\vspace*{\stretch{2}}
{\zihao{1}\bfseries\sffamily {\ucas@label@ch@thesis}}
\vspace*{\stretch{3}}
{\zihao{-3}\bfseries\sffamily \ulenhance[1.5pt]{\ucas@value@ch@title}}
\vspace*{\stretch{3}}
\def\tabcolsep{1pt}
\def\arraystretch{1.3}
\begin{tabular}{lc}
\ucas@label@ch@author & \ulenhance[1.2pt]{\ulextend{\ucas@value@ch@author}}\\
\ucas@label@ch@advisor & \ucaslntotab[1.2pt]{\ucas@value@ch@advisor}\\
\ucas@label@ch@degree & \ulenhance[1.2pt]{\ulextend{\ucas@value@ch@degreetype\ucas@value@ch@degree}}\\
\ucas@label@ch@major & \ulenhance[1.2pt]{\ulextend{\ucas@value@ch@major}}\\
\ucas@label@ch@institute & \ucaslntotab[1.2pt]{\ucas@value@ch@institute}\\
\end{tabular}
\vspace*{\stretch{4}}
{\ucas@value@ch@date}
\vspace*{\stretch{4}}
\end{center}
\clearpage
\if@twoside
\thispagestyle{empty}
\ifucas@versioninfo
\vspace*{\stretch{1}}
\begin{footnotesize}
\noindent
Draft Version (\today)
\end{footnotesize}
\fi
\cleardoublepage[empty]
\else
\ifucas@versioninfo
\thispagestyle{empty}
\vspace*{\stretch{1}}
\begin{footnotesize}
\noindent
Draft Version (\today)
\end{footnotesize}
\cleardoublepage[empty]
\fi
\fi
\ifucas@print%
\hypersetup{% set hyperlinks
hidelinks,% remove link color and border
}
\fi
}
\newcommand{\maketitle@pdc}{%
\cleardoublepage
\thispagestyle{empty}
\begin{center}
\vspace*{30pt}
\linespread{2.0}
\zihao{4}\bfseries
\makebox[3.0em][s]{\ucas@label@ch@classid} \ulenhance{\ulextend[6em]{\zihao{5}\ucas@value@ch@classid}} \hfill{} \ucas@label@ch@confidential \ulenhance{\ulextend[6em]{\zihao{5}\ucas@value@ch@confidential}}
\makebox[3.0em][s]{\ucas@label@ch@udc} \ulenhance{\ulextend[6em]{\zihao{5}\ucas@value@ch@udc}} \hfill{} \ucas@label@ch@orderid \ulenhance{\ulextend[6em]{\zihao{5}\ucas@value@ch@orderid}}
\vspace*{\stretch{6}}
{\ziju{1.5}\ucas@value@ch@schoollogo}
\vspace*{\stretch{1}}
{\zihao{-2}\bfseries\sffamily{\ziju{0.5} \ucas@label@ch@thesis}}
\vspace*{\stretch{3}}
{\zihao{-3}\bfseries\sffamily \ulenhance[1.5pt]{\ucas@value@ch@title}}
\vspace*{\stretch{2.5}}
\ucas@value@ch@author
\vspace*{\stretch{2.5}}
\def\tabcolsep{1pt}
\def\arraystretch{1.3}
\begin{tabular}{l@{\quad}c}
\ucas@label@ch@completedate & \ulenhance{\ulextend[200pt]{\ucas@value@ch@completedate}}\\
\ucas@label@ch@submitdate & \ulenhance{\ulextend[200pt]{\ucas@value@ch@submitdate}}\\
\end{tabular}
\vspace*{\stretch{2}}
\ucas@value@ch@institute
\ucas@value@ch@date
\vspace*{\stretch{4}}
\end{center}
\clearpage
\if@twoside
\thispagestyle{empty}
\cleardoublepage[empty]
\fi
\ifucas@print%
\hypersetup{% set hyperlinks
hidelinks,% remove link color and border
}
\fi
}
%-
%-> Define English style
%-
\newcommand{\MAKETITLE@xpdc}{%
\cleardoublepage
\thispagestyle{empty}
\begin{center}
\linespread{1.6}
\zihao{4}\bfseries
\vspace*{50pt}
{\zihao{-3}\bfseries \ulenhance[1.5pt]{\ucas@value@en@title}}
\vspace*{\stretch{3}}
{\ucas@label@en@statement}
{By}
{\ucas@value@en@author}
{\ucas@value@en@advisor}
\vspace*{\stretch{3}}
{\ucas@value@en@institute}
\vspace*{\stretch{1}}
{\ucas@value@en@date}
\vspace*{\stretch{3}}
\end{center}
\clearpage
\if@twoside
\thispagestyle{empty}
\cleardoublepage[empty]
\fi
}
\newcommand{\MAKETITLE@pdc}{%
\cleardoublepage
\thispagestyle{empty}
\begin{center}
\linespread{2.0}
\zihao{4}\bfseries
\vspace*{50pt}
{\zihao{3}\bfseries \ucas@value@ch@title}
\vspace*{\stretch{3}}
{\zihao{-3}\bfseries \ucas@value@en@title}
\vspace*{\stretch{3}}
\def\tabcolsep{1pt}
\def\arraystretch{1.3}
\begin{tabular}{l@{\quad}l}
\makebox[11em][s]{\ucas@label@ch@author} & \ucas@value@ch@author\\
\makebox[11em][s]{\ucas@label@ch@subject} & \ucas@value@ch@subject\\
\makebox[11em][s]{\ucas@label@ch@major} & \ucas@value@ch@major\\
\end{tabular}
\vspace*{\stretch{3}}
\ucas@label@ch@studydatefrom \quad \ucas@value@ch@studydatefrom
\ucas@label@ch@studydateto \quad \ucas@value@ch@studydateto
\vspace*{\stretch{3}}
\ucas@value@ch@orginization
\ucas@value@ch@date
\vspace*{\stretch{3}}
\end{center}
\clearpage
\if@twoside
\thispagestyle{empty}
\cleardoublepage[empty]
\fi
}
%---------------------------------------------------------------------------%
%->> Author's declaration
%---------------------------------------------------------------------------%
\newcommand{\makedeclaration}{%
\cleardoublepage
\thispagestyle{empty}
{
\linespread{1.6}
\zihao{-4}
\vspace*{2ex}
\begin{center}
{\zihao{4}\bfseries\sffamily \ucas@label@ch@declare@creativity}
\end{center}
{\ucas@value@ch@declare@creativity}
\vspace*{3ex}
{\hfill{} {\ucas@label@ch@declare@author \hspace*{14em}}}
{\hfill{} {\ucas@label@ch@declare@date \hspace*{14em}}}
\vspace*{6ex}
\begin{center}
{\zihao{4}\bfseries\sffamily \ucas@label@ch@declare@rights}
\end{center}
{\ucas@value@ch@declare@rights}
{\ucas@value@ch@declare@rule}
\vspace*{3ex}
{\hfill{} {\ucas@label@ch@declare@author \hspace*{10em} \ucas@label@ch@declare@advisor \hspace*{9em}}}
{\hfill{} {\ucas@label@ch@declare@date \hspace*{10em} \ucas@label@ch@declare@date \hspace*{9em}}}
\vspace*{3ex}
}
\clearpage
\if@twoside
\thispagestyle{empty}
\cleardoublepage[empty]
\fi
}
%---------------------------------------------------------------------------%
%->> New environments
%---------------------------------------------------------------------------%
%- define chinese keywords
\newcommand{\keywords}[1]{%
\vspace{\baselineskip}
\noindent {\bfseries \ucas@label@ch@keywords} #1}
%- define engish keywords
\newcommand{\KEYWORDS}[1]{%
\vspace{\baselineskip}
\noindent {\bfseries \ucas@label@en@keywords} #1}
%---------------------------------------------------------------------------%
%->> Structure elements
%---------------------------------------------------------------------------%
\ifucas@plain%
\def\contentsname{\ucas@label@en@tocname}
\def\listfigurename{\ucas@label@en@lsfigname}
\def\listtablename{\ucas@label@en@lstabname}
\def\bibname{\ucas@label@en@bibname}
\def\refname{\ucas@label@en@bibname}
\def\algname{\ucas@label@en@algname}
\def\bibetal{\ucas@label@en@bibetal}
\def\biband{\ucas@label@en@biband}
\def\axiomname{\ucas@label@en@axiomname}
\def\theoremname{\ucas@label@en@theoremname}
\def\lemmaname{\ucas@label@en@lemmaname}
\def\corollaryname{\ucas@label@en@corollaryname}
\def\assertionname{\ucas@label@en@assertionname}
\def\propositionname{\ucas@label@en@propositionname}
\def\conjecturename{\ucas@label@en@conjecturename}
\def\definitionname{\ucas@label@en@definitionname}
\def\examplename{\ucas@label@en@examplename}
\def\remarkname{\ucas@label@en@remarkname}
\def\proofname{\ucas@label@en@proofname}
\def\@title{\ucas@value@en@titlemark}
\def\@author{\ucas@value@en@author}
\else
\def\contentsname{\ucas@label@ch@tocname}
\def\listfigurename{\ucas@label@ch@lsfigname}
\def\listtablename{\ucas@label@ch@lstabname}
\def\algname{\ucas@label@ch@algname}
\def\bibname{\ucas@label@ch@bibname}
\def\refname{\ucas@label@ch@bibname}
\def\bibetal{\ucas@label@ch@bibetal}
\def\biband{\ucas@label@ch@biband}
\def\axiomname{\ucas@label@ch@axiomname}
\def\theoremname{\ucas@label@ch@theoremname}
\def\lemmaname{\ucas@label@ch@lemmaname}
\def\corollaryname{\ucas@label@ch@corollaryname}
\def\assertionname{\ucas@label@ch@assertionname}
\def\propositionname{\ucas@label@ch@propositionname}
\def\conjecturename{\ucas@label@ch@conjecturename}
\def\definitionname{\ucas@label@ch@definitionname}
\def\examplename{\ucas@label@ch@examplename}
\def\remarkname{\ucas@label@ch@remarkname}
\def\proofname{\ucas@label@ch@proofname}
\def\@title{\ucas@value@ch@titlemark}
\def\@author{\ucas@value@ch@author}
\fi
%---------------------------------------------------------------------------%
%->> Structure layout
%---------------------------------------------------------------------------%
%- chapter
\ctexset {
chapter = {
format = \linespread{1.0}\zihao{4}\bfseries\sffamily\centering,
nameformat = {},
titleformat = {},
number = \arabic{chapter},
numberformat = \rmfamily,
aftername = \quad,
beforeskip = {7pt},
afterskip = {18pt},
pagestyle = plain,
}
}
%- section
\ctexset {
section = {
format = \linespread{1.0}\zihao{-4}\sffamily\raggedright,
numberformat = \rmfamily,
aftername = \quad,
beforeskip = {24pt},
afterskip = {6pt},
}
}
%- subsection
\ctexset {
subsection = {
format = \linespread{1.0}\zihao{-4}\sffamily\raggedright,
numberformat = \rmfamily,
aftername = \quad,
beforeskip = {12pt},
afterskip = {6pt},
}
}
%- subsubsection
\ctexset {
subsubsection = {
format = \linespread{1.0}\zihao{-4}\sffamily\raggedright,
numberformat = \rmfamily,
aftername = \quad,
beforeskip = {12pt},
afterskip = {6pt},
}
}
%- appendix
\ctexset {
appendix = {
%numbering = true|false,
%number = \rmfamily\Alph{chapter},
}
}
%---------------------------------------------------------------------------%
%->> Configure table of contents
%---------------------------------------------------------------------------%
%- the table of contents is specified by defining \l@chapter, \l@section, ...
%- most commands are then defined with the \@dottedtocline:
%- \@dottedtocline{⟨level⟩}{⟨indent⟩}{⟨numwidth⟩}{⟨title⟩}{⟨page⟩}
%- ⟨level⟩ an entry is produced only if ⟨level⟩ <= value of the tocdepth counter
%- note, \chapter is level 0, \section is level 1, etc
%- ⟨indent⟩ indentation from the outer left margin of the start of the contents line
%- ⟨numwidth⟩ width of a box in which the section number is to go
%- <title> title
%- <page> page number
%- parameters for spacing and length in toc
\def\@dotsep{1.5mu}% separation between dots in mu units
\def\@pnumwidth{2em}% width of a box in which the page number is put
\def\@tocrmarg{2em}% right margin for multiple line entries, \@tocrmarg ≥ \@pnumwidth
\def\@chaptervspace{1ex}% vertical space between chapter titles
%- redefine dottedtocline from classes.dtx and latex.ltx
\renewcommand*{\@dottedtocline}[5]{% [<level>,<indent>,<numwidth>,<title>,<page>]
\ifnum #1>\c@tocdepth \else
\vskip \z@ \@plus.2\p@
{\leftskip #2\relax \rightskip \@tocrmarg \parfillskip -\rightskip
\parindent #2\relax\@afterindenttrue
\interlinepenalty\@M
\leavevmode \zihao{-4}\sffamily
\@tempdima #3\relax
\advance\leftskip \@tempdima \null\nobreak\hskip -\leftskip
{#4}\nobreak
\leaders\hbox{$\m@th\mkern \@dotsep \cdot\mkern \@dotsep$}\hfill
\nobreak
\hb@xt@\@pnumwidth{\hfil\normalfont \normalcolor #5}%
\par\penalty\@highpenalty}%
\fi
}
%- redefine l@part from book.cls to add dotted toc line
\renewcommand*{\l@part}[2]{% [<title>,<page>]
\ifnum \c@tocdepth >-2\relax
\addpenalty{-\@highpenalty}%
\addvspace{2.25em \@plus\p@}%
\setlength\@tempdima{3em}%
\begingroup
\parindent \z@ \rightskip \@pnumwidth
\parfillskip -\@pnumwidth
{\leavevmode
\zihao{4}\sffamily #1
\leaders\hbox{$\m@th\mkern \@dotsep \cdot\mkern \@dotsep$}% add dotted toc line
\hfil \hb@xt@\@pnumwidth{\hss #2}}\par
\nobreak
\global\@nobreaktrue
\everypar{\global\@nobreakfalse\everypar{}}%
\endgroup
\fi
}
%- redefine l@chapter from book.cls to add dotted toc line
\renewcommand*{\l@chapter}[2]{% [<title>,<page>]
\ifnum \c@tocdepth >\m@ne
\addpenalty{-\@highpenalty}%
\vskip \@chaptervspace \@plus\p@
\setlength\@tempdima{1.5em}%
\begingroup
\parindent \z@ \rightskip \@pnumwidth
\parfillskip -\@pnumwidth
\leavevmode \zihao{4}\sffamily
\advance\leftskip\@tempdima
\hskip -\leftskip
#1\nobreak
\leaders\hbox{$\m@th\mkern \@dotsep \cdot\mkern \@dotsep$}% add dotted toc line
\hfil \nobreak\hb@xt@\@pnumwidth{\hss #2}\par
\penalty\@highpenalty
\endgroup
\fi
}
%- redefine indentation for others
\renewcommand*\l@section{\@dottedtocline{1}{1em}{1.8em}}
\renewcommand*\l@subsection{\@dottedtocline{2}{2em}{2.8em}}
\renewcommand*\l@subsubsection{\@dottedtocline{3}{3em}{3.8em}}
\renewcommand*\l@paragraph{\@dottedtocline{4}{4em}{4.8em}}
\renewcommand*\l@subparagraph{\@dottedtocline{5}{5em}{5.8em}}
\renewcommand*\l@figure{\@dottedtocline{1}{1em}{1.8em}}
\renewcommand*\l@table{\@dottedtocline{1}{1em}{1.8em}}
%---------------------------------------------------------------------------%
\endinput