forked from ZebinWang/ructhesis
-
Notifications
You must be signed in to change notification settings - Fork 1
/
ructhesis.dtx
745 lines (745 loc) · 24.5 KB
/
ructhesis.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
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
741
742
743
744
745
%\iffalse meta-comment
% Copyright (C) 2003--2015 Zebin Wang
% --------------------------------------------------------------------------
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either
% version 1.3c of this license or (at your option) any later
% version. This version of this license is in
% http://www.latex-project.org/lppl/lppl-1-3c.txt
% and 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 Maintainers of this work is Zebin Wang.
%
% This work consists of the files RUCThesis.dtx and RUCThesis.ins
% and the derived file RUCThesis.cls.
%
% --------------------------------------------------------------------------
%\fi
%\iffalse
%<*driver>
\ProvidesFile{ructhesis.dtx}[2015/12/23 V.1.0.0]
\documentclass[10pt]{ltxdoc}
\usepackage[UTF8]{ctex}
\usepackage{tikz}
\usepackage{listings}
\usepackage{xcolor}
\usepackage{hyperref}
\usetikzlibrary{trees}
\EnableCrossrefs
\CodelineIndex
\RecordChanges
\begin{document}
\DocInput{\jobname.dtx}
\end{document}
%</driver>
%\fi
%
% \DoNotIndex{\begin,\end,\begingroup,\endgroup}
% \DoNotIndex{\ifx,\ifdim,\ifnum,\ifcase,\else,\or,\fi}
% \DoNotIndex{\let,\def,\xdef,\newcommand,\renewcommand}
% \DoNotIndex{\expandafter,\csname,\endcsname,\relax,\protect}
% \DoNotIndex{\Huge,\huge,\LARGE,\Large,\large,\normalsize}
% \DoNotIndex{\small,\footnotesize,\scriptsize,\tiny}
% \DoNotIndex{\normalfont,\bfseries,\slshape,\interlinepenalty}
% \DoNotIndex{\hfil,\par,\hskip,\vskip,\vspace,\quad}
% \DoNotIndex{\centering,\raggedright}
% \DoNotIndex{\c@secnumdepth,\@startsection,\@setfontsize}
% \DoNotIndex{\ ,\@plus,\@minus,\p@,\z@,\@m,\@M,\@ne,\m@ne}
% \DoNotIndex{\@@par,\DeclareOperation,\RequirePackage,\LoadClass}
% \DoNotIndex{\AtBeginDocument,\AtEndDocument,\\,\,}
%
% \IndexPrologue{\section*{索引}%
% \addcontentsline{toc}{section}{索~~~~引}}
% \GlossaryPrologue{\section*{修改记录}%
% \addcontentsline{toc}{section}{修改记录}}
% \title{中国人民大学\LaTeX\ 论文模板}
% \author{王泽斌\\ {\tt [email protected]}}
% \date{2015.12.23}
% \maketitle
% \begin{abstract}\noindent
% RUCThesis文档类旨在建立符合中国人民大学《本科论文指导手册》和《研究生学位论 文及其摘要的撰写和印制要求》的 \LaTeX\ 学位论文模板。
% \end{abstract}
% \vskip2cm
% \def\abstractname{免责声明}
% \begin{abstract}
% \noindent
% \begin{enumerate}
% \item 本模板的发布遵守 \LaTeX{} Project Public License,使用前请认真阅读协议内
% 容。
% \item 任何个人或组织以本模板为基础进行的使用、修改、拓展而产生的一切后果自行承担。
% \end{enumerate}
% \end{abstract}
% \clearpage
% \begin{multicols}{2}[
% \setlength{\columnseprule}{.4pt}
% \setlength{\columnsep}{18pt}]
% \tableofcontents
% \end{multicols}
% \clearpage
% \section{安装}
% \subsection{下载}
% 目前RUCThesis提供如下两种下载方式:
% \href{https://github.com/ZebinWang/ructhesis}{GitHub}、\href{}{CTAN}
% \subsection{文件组成}
%下图为本模板的文件结构。其中\tt chap\rm 为章节目录,\tt figure\rm 为图像文件夹其中名称中有logo字样的为模板必要的图像,\tt ref\rm 为参考文献文件夹。其余所有文件都已标注在图中。
% \begin{figure}[htbp]
% \centering
% \tikzstyle{every node}=[anchor=west]
% \begin{tikzpicture}[%
% grow via three points={one child at (0.5,-0.5) and
% two children at (0.5,-0.5) and (0.5,-1.0)},
% edge from parent path={(\tikzparentnode.south) |- (\tikzchildnode.west)}]
% \node {RUCThesis}
% child { node {chap}
% child { node {chapter1.tex\quad \% 章节文件}}
% child { node {...}}
% child { node {appendix\_{}1.tex\quad \% 附录}}}
% child [missing] {}
% child [missing] {}
% child [missing] {}
% child { node {cover.tex\quad \% 封面文件}}
% child { node {figures}
% child { node {logo.pdf\quad \% 图像}}
% child { node {...}}}
% child [missing] {}
% child [missing] {}
% child { node {format}
% child { node {acknowledge.tex\quad \% 致谢}}
% child { node {authorization.tex\quad \% 授权书影印件}}
% child { node {cabstractpage.tex\quad \% 中文摘要}}
% child { node {eabstractpage.tex\quad \% 英文摘要}}
% child { node {Originality.tex\quad \% 独创性声明}}}
% child [missing] {}
% child [missing] {}
% child [missing] {}
% child [missing] {}
% child [missing] {}
% child { node {main.tex\quad \% 主文件}}
% child { node {ref}
% child { node {ruc.bst\quad \% 参考文献样式}}
% child { node {yourbib.bib\quad \% 参考文献数据库}}}
% child [missing] {}
% child [missing] {}
% child { node {ructhesis.cls\quad \% RUCThesis文档类}}
% child { node {ructhesis.dtx\quad \% RUCThesis源代码}}
% child { node {ructhesis.ins\quad \% RUCThesis安装文件}};
% \end{tikzpicture}
% \caption{RUCThesis文件目录}
% \end{figure}
% \subsection{生成模板}
% 如果对本模板机理不感兴趣的读者可以略过这里。模板源文件是\tt ructhesis.ins\rm 和\tt ructhesis.dtx\rm 文件,在终端中执行如下代码:
%\\ \tt \$ latex ructhesis.ins
%\\\rm 可以得到ructhesis.cls文件,继续执行如下代码:
%\\ \tt \$ xelatex ructhesis.dtx
%\\ \tt \$ makeindex -s gind.ist -o ructhesis.ind ructhesis.idx
%\\ \tt \$ makeindex -s gglo.ist -o ructhesis.gls ructhesis.glo
%\\ \tt \$ xelatex ructhesis.dtx
%\\ \tt \$ xelatex ructhesis.dtx
%\\\rm 可以得到本文档,这里不再赘述。
%\subsection{使用模板}
%如果你的模板文件中已经有\tt ructhesis.cls\rm 文件可以直接略过上一步。
%\StopEventually{\PrintChanges\PrintIndex}
% \section{程序代码}
% \subsection{文档类及选项定义}
% \begin{macrocode}
%<*cls>
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{ructhesis}[2015/12/01 v1.0.0]
\newif\ifruc@bachelor
\newif\ifruc@master
\newif\ifruc@doctor
\newif\ifruc@promaster
\newif\ifruc@shuji
% \end{macrocode}
% \begin{macro}{bachelor}
% \begin{macro}{master}
% \begin{macro}{promaster}
% \begin{macro}{doctor} 本科、硕士、专业硕士、博士选项
% \begin{macrocode}
\DeclareOption{bachelor}{\ruc@bachelortrue}
\DeclareOption{master}{\ruc@mastertrue}
\DeclareOption{promaster}{\ruc@promastertrue}
\DeclareOption{doctor}{\ruc@doctortrue}
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \begin{macro}{shuji} 这个选项只能在\tt cover.tex\rm 中使用,代表封皮是否打印书脊。
% \begin{macrocode}
\DeclareOption{shuji}{\ruc@shujitrue}
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{ctexbook}}
\ProcessOptions\relax
\ifruc@doctor\LoadClass[UTF8,zihao=-4,twoside,openright,fancyhdr]{ctexbook}
\else\LoadClass[UTF8,zihao=-4,oneside,openany,fancyhdr]{ctexbook}\fi
% \end{macrocode}
% \end{macro}
% \subsection{宏}
% \begin{macrocode}
\def\thesiscode#1{\gdef\@thesiscode{#1}}
\def\sign#1{\gdef\@sign{#1}}
\def\esign#1{\gdef\@esign{#1}}
\def\title#1{\gdef\@title{#1}}
\def\subtitle#1{\gdef\@subtitle{#1}}
\def\author#1{\gdef\@author{#1}}
\def\school#1{\gdef\@school{#1}}
\def\field#1{\gdef\@field{#1}}
\def\grade#1{\gdef\@grade{#1}}
\def\studentid#1{\gdef\@studentid{#1}}
\def\advisor#1{\gdef\@advisor{#1}}
\def\score#1{\gdef\@score{#1}}
\def\date#1{\gdef\@date{#1}}
\def\keywords#1{\gdef\@keywords{#1}}
\def\etitle#1{\gdef\@etitle{#1}}
\def\covertitle#1{\gdef\@covertitle{#1}}
\def\keywordzh#1{\gdef\@keywordzh{#1}}
\def\keyworden#1{\gdef\@keyworden{#1}}
\def\doctorsign{博士学位论文}
\def\doctoresign{DOCTORAL DISSERTATION}
\def\mastersign{硕士学位论文}
\def\masteresign{THESIS OF MASTER DEGREE}
\def\promastersign{专业硕士学位论文}
\def\promasteresign{THESIS OF PROFESSION MASTER DEGREE}
\def\bachelorsign{本科毕业论文}
\def\bacheloresign{THESIS OF BACHELOR DEGREE}
\def\cabstractpagesign{摘要}
\def\eabstractpagesign{Abstract}
\def\acknowledgesign{致谢}
\newcommand{\RUCThesis}{{\tt R\kern-.107em\lower.5ex\hbox{U}\kern-.1em CThesis}}
% \end{macrocode}
% \subsection{页面布局}
% \begin{macrocode}
\ifruc@bachelor
\RequirePackage[top=25mm,left=25mm,bottom=25mm,right=20mm,footskip=10mm]{geometry}
\setlength{\topskip}{10mm}
\else
\RequirePackage[top=45mm,left=35mm,bottom=40mm,right=30mm,headsep=20mm]{geometry}
\fi
% \end{macrocode}
% \subsection{PDF}
% \begin{macrocode}
\RequirePackage{hyperref}
\AtBeginDocument{
\hypersetup{
pdftitle={\@title},
pdfauthor={\@author},
pdfsubject={中国人民大学学位论文}}
}
% \end{macrocode}
% \subsection{字体}
% \begin{macrocode}
\setmainfont{TimesNewRomanPSMT}
\setsansfont{ArialMT}
\setmonofont{CourierNewPSMT}
\xeCJKsetup{AutoFakeSlant={true}}
\setCJKmainfont{SimSun}
\setCJKsansfont{SimHei}
\setCJKmonofont{FangSong}
% \end{macrocode}
% \subsection{行距}
% \begin{macro}{\rowspace} 全文行距调整
% \begin{macrocode}
\newcommand{\rowspace}{%
\setlength{\lineskiplimit}{2.625bp}
\setlength{\lineskip}{2.625bp}
\ifruc@bachelor
\linespread{1.25}\selectfont
\else
\linespread{1.35}\selectfont
\fi
}
% \end{macrocode}
% \end{macro}
% \subsection{空白页样式}
% \begin{macro}{\cleardoublepage} 空白页样式设为empty
% \begin{macrocode}
\let\ruc@cleardoublepage\cleardoublepage
\newcommand{\ruc@clearemptydoublepage}{%
\clearpage{\pagestyle{empty}\ruc@cleardoublepage}}
\let\cleardoublepage\ruc@clearemptydoublepage
% \end{macrocode}
% \end{macro}
% \subsection{页眉页脚}
% \noindent 这里之所以定义了这么多,完全是为了处理本科的要求......
% \begin{macrocode}
\pagestyle{fancy}
\fancyhf{}
\lhead{}
\rhead{}
\ifruc@bachelor
\chead{\includegraphics[width=4.13cm,height=0.8452cm]{figures/logo.pdf}}
\fancyfoot[CO,CE]{ 第 \thepage 页}
\else
\chead{\zihao{5}\@title}
\if@twoside
\fancyfoot[RO,LE]{\thepage}
\else
\fancyfoot[RO,RE]{\thepage}
\fi
\fi
\fancypagestyle{headings}{
\fancyhf{}
\lhead{}
\rhead{}
\ifruc@bachelor
\chead{\includegraphics[width=4.13cm,height=0.8452cm]{figures/logo.pdf}}
\fancyfoot[CO,CE]{\thepage}
\else
\chead{}\renewcommand*{\headrulewidth}{0bp}
\if@twoside
\fancyfoot[RO,LE]{\thepage}
\else
\fancyfoot[RO,RE]{\thepage}
\fi
\fi}
\fancypagestyle{myheadings}{
\fancyhf{}
\lhead{}
\rhead{}
\chead{\includegraphics[width=4.13cm,height=0.8452cm]{figures/logo.pdf}}
\fancyfoot[LO,LE]{}
\fancyfoot[RO,RE]{}
\fancyfoot[CO,CE]{}}
\fancypagestyle{plain}{
\fancyhf{}
\lhead{}
\rhead{}
\ifruc@bachelor
\chead{}\renewcommand*{\headrulewidth}{0pt}
\fancyfoot[CO,CE]{ 第 \thepage 页}
\else
\chead{}
\renewcommand*{\headrulewidth}{0pt}
\if@twoside
\fancyfoot[RO,LE]{\thepage}
\else
\fancyfoot[RO,RE]{\thepage}
\fi
\fi}
% \end{macrocode}
% \subsection{扉页}
% \begin{macro}{\maketitle} 插入扉页
% \begin{macrocode}
\RequirePackage{graphicx}
\newif\if@subtitle
\ifruc@bachelor
\renewcommand{\maketitle}{
\newgeometry{top=25mm,left=25mm,bottom=40mm,right=20mm,footskip=0mm,a4paper}
\setlength{\topskip}{5mm}
\thispagestyle{myheadings}
\linespread{1.5}\selectfont
{\hfill\zihao{-4}\sf\@thesiscode
\begin{center}\zihao{1}\rule[0mm]{0mm}{25mm}\@sign\par\vspace{15mm}
\@title\par
\zihao{2}\@subtitletrue\par\vskip\stretch{1}\zihao{3}
作\qquad 者:\underline{\makebox[90mm]\@author}\hfill\par
学\qquad 院:\underline{\makebox[90mm]\@school}\hfill\par
专\qquad 业:\underline{\makebox[90mm]\@field}\hfill\par
年\qquad 级:\underline{\makebox[90mm]\@grade}\hfill\par
学\qquad 号:\underline{\makebox[90mm]\@studentid}\hfill\par
指导教师:\underline{\makebox[90mm]\@advisor}\hfill\par
论文成绩:\underline{\makebox[90mm]\@score}\hfill\par
日\qquad 期:\underline{\makebox[90mm]\@date}\hfill
\end{center}}
\restoregeometry
\rowspace%本科全文行距
}
\else
\renewcommand{\maketitle}{
\pagestyle{empty}
\begin{center}
\includegraphics[width=7.6cm,height=1.474cm]{figures/clogo.pdf}\\
\sf\zihao{1}\ziju{0.4}\@sign\par
\tt\zihao{3}
\vspace{25mm}\ziju{0}\linespread{1.5}\selectfont
(中文题目)\underline{\parbox[b]{110mm}\@title}\hfill\par\vspace{3mm}
(英文题目)\underline{\parbox[b]{110mm}\@etitle}\hfill\par
\vfill\ziju{0.65}
作者学号:\underline{\makebox[80mm]\@studentid}\hfill\par
作者姓名:\underline{\makebox[80mm]\@author}\hfill\par
所在学院:\underline{\makebox[80mm]{\ziju{0.2}\@school}}\hfill\par
专业名称:\underline{\parbox[b]{80mm}{\centering\ziju{0}\@field}}\hfill\par\ziju{0.65}
导师姓名:\underline{\makebox[80mm]\@advisor}\hfill\par\ %
\ziju{0.25}
论文主题词:\underline{\parbox[b]{80mm}{\vspace*{1pt}\centering\ziju{0}\@keywords}}
\hfill\par\ziju{0}
论文提交日期:\underline{\makebox[80mm]\@date}\hfill
\end{center}
\rowspace%研究生全文行距
\clearpage
\if@twoside
\thispagestyle{empty}
\vspace*{\stretch{1}}
{\zihao{5}
\definecolor{light-gray}{gray}{0.86}
\noindent
\textcolor{light-gray}{
Typeset by \LaTeXe{}\\
With package \tt{\RUCThesis}\\
}}
\cleardoublepage
\fi
}
\fi
% \end{macrocode}
% \end{macro}
% \subsection{中文摘要}
% \begin{macro}{abstractzh} 中文摘要环境
% \begin{macrocode}
\newenvironment{abstractzh}
{\clearpage\chapter*{\cabstractpagesign}\vspace*{-5mm}
\pagenumbering{Roman}\zihao{-4}\rm}
{\par\vspace*{7mm}\noindent\sf\zihao{-4}关键词:
\rm\zihao{-4}\@keywordzh
\thispagestyle{headings}}
% \end{macrocode}
% \end{macro}
% \subsection{英文摘要}
% \begin{macro}{abstracten} 英文摘要环境
% \begin{macrocode}
\newenvironment{abstracten}
{\clearpage
\ifruc@bachelor\linespread{2}\selectfont
\chapter*{\bf{\eabstractpagesign}}\vspace*{-5mm}
\else\chapter*{\sf{\eabstractpagesign}}\vspace*{-5mm}\fi
\zihao{-4}\rm}
{\par\vspace*{7mm}\noindent
\zihao{-4}\textbf{Key Words : }
\rm\zihao{-4}\@keyworden
\thispagestyle{headings}\rowspace}
% \end{macrocode}
% \end{macro}
% \subsection{致谢}
% \begin{macro}{\acknowledge} 致谢环境
% \begin{macrocode}
\newenvironment{acknowledge}
{\chapter*{\acknowledgesign}\vspace*{-5mm}
\addcontentsline{toc}{chapter}{\acknowledgesign}\zihao{-4}\rm}
{\thispagestyle{plain}}
% \end{macrocode}
% \end{macro}
% \subsection{授权}
% \begin{macro}{\authorization} 插入授权影印件
% \begin{macrocode}
\newcommand{\authorization}[1]
{\ifruc@doctor\cleardoublepage\else\clearpage\fi
\newgeometry{top=0mm,left=0mm,bottom=0mm,right=0mm,
text={\paperwidth,\paperheight},marginparwidth=0mm}\hspace{-9mm}
\thispagestyle{empty}
\includegraphics[width=\paperwidth-1mm ,totalheight=\paperheight-1mm]{#1}
\restoregeometry}
% \end{macrocode}
% \end{macro}
% \subsection{独创性声明}
% \begin{macro}{\originality} 插入独创性声明
% \begin{macrocode}
\newcommand{\originality}{
\chapter*{\zihao{-2}\heiti 独创性声明}
{\tt\zihao{-4}本人郑重声明:所呈交的论文是我个人在导师的指导下进行的研究工作及取得的研究成果。尽我所知,除了文中特别加以标注和致谢的地方外,论文中不包含其他人已经发表或撰写的研究成果,也不包含为获得中国人民大学或其他教育机构的学位或证书所使用过的材料。与我一同工作的同志对本研究所做的任何贡献均已在论文中作了明确的说明并表示了谢意。\par}
\vskip 10mm\hfill
论文作者:\rule[-1ex]{30mm}{0.25pt}\qquad
日\qquad 期:\rule[-1ex]{30mm}{0.25pt}\par
\vfil\centerline{\heiti\zihao{-2}关于论文使用授权的说明}
\vskip 13mm
{\tt 本人完全了解中国人民大学有关保留、使用学位论文的规定,即:学校有保留送交论文的复印件,允许论文被查阅和借阅;学校可以公布论文的全部或部分内容,可以采用影印、缩印或其他复制手段保存论文。\par
\vskip 10mm\hfill
论文作者:\rule[-1ex]{30mm}{0.25pt}\qquad
日\qquad 期:\rule[-1ex]{30mm}{0.25pt}\par
\hfill \rule[0mm]{0mm}{8mm}
指导老师:\rule[-1ex]{30mm}{0.25pt}\qquad
日\qquad 期:\rule[-1ex]{30mm}{0.25pt}\par}
\thispagestyle{empty}
}
% \end{macrocode}
% \end{macro}
% \subsection{章节标题}
% \begin{macrocode}
\setcounter{secnumdepth}{4}
\ifruc@bachelor
\ctexset{
chapter = {
name = {,},
number = \arabic{chapter}
},
section = {
number = \thechapter.\arabic{section}
},
subsection = {
number = \thesection.\arabic{subsection}
},
subsubsection = {
number = \thesubsection.\arabic{subsubsection}
},
chapter/format =\vspace{-15mm}\centering,
chapter/numberformat = \bf\zihao{3},
chapter/titleformat = \sf\zihao{3},
chapter/nameformat = \sf\zihao{3},
section/format = ,
section/numberformat = \bf\zihao{4},
section/titleformat = \sf\zihao{4},
subsection/format = ,
subsection/numberformat = \bf\zihao{-4},
subsection/titleformat = \sf\zihao{-4},
subsubsection/format = ,
subsubsection/numberformat = \bf\zihao{5},
subsubsection/titleformat =\sf \zihao{5}
}
\else
\ctexset{
chapter = {
name = {第,章},
number = \arabic{chapter}
},
chapter/format =\centering,
chapter/numberformat = \bf\zihao{-2},
chapter/nameformat = \sf\zihao{-2},
chapter/titleformat = \sf\zihao{-2},
section/format = ,
section/titleformat =\sf\zihao{-3},
section/numberformat = \bf\zihao{-3},
subsection/format = ,
subsection/numberformat = \bf\zihao{-4},
subsection/titleformat = \sf\zihao{-4},
subsubsection/format = ,
subsubsection/titleformat = \sf\zihao{5},
subsubsection/numberformat = \bf\zihao{5}
}
\fi
% \end{macrocode}
% \subsection{目录样式}
% \begin{macrocode}
\RequirePackage{titletoc}
\titlecontents{chapter}[0pt]{\sf\zihao{4}\addvspace{2pt}\filright}
{\contentspush{\thecontentslabel\ }}
{}{\titlerule*[10pt]{.}{\bf\contentspage}}
\titlecontents{section}[2em]{\rm\zihao{-4}\addvspace{2pt}\filright}
{\contentspush{\thecontentslabel\ }}
{}{\titlerule*[10pt]{.}\contentspage}
\titlecontents{subsection}[4em]{\rm\zihao{-4}\addvspace{2pt}\filright}
{\contentspush{\thecontentslabel\ }}
{}{\titlerule*[10pt]{.}\contentspage}
\titlecontents{figure}[10pt]{\rm\zihao{-4}\addvspace{2pt}}
{图~\thecontentslabel\, }
{}{\titlerule*[10pt]{.}\contentspage}
\titlecontents{table}[10pt]{ \rm\zihao{-4}\addvspace{2pt}}
{表~\thecontentslabel\, }
{}{\titlerule*[10pt]{.}\contentspage}
% \end{macrocode}
% \subsection{本科脚注}
% \begin{macro}{\ruc@textcircled} 本科的圆形脚注...
% \begin{macrocode}
\RequirePackage{ifxetex}
\RequirePackage{ifthen,calc}
\def\ruc@textcircled#1{%
\ifnum \value{#1} <10 \textcircled{\zihao{-6}\arabic{#1}}
\else\ifnum \value{#1} <100 \textcircled{\zihao{7}\arabic{#1}}\fi
\fi}
\ifruc@bachelor
\renewcommand{\thefootnote}{\ruc@textcircled{footnote}}
\renewcommand{\thempfootnote}{\ruc@textcircled{mpfootnote}}
\def\footnoterule{\vskip-3\p@\hrule\@width0.3\textwidth\@height0.4\p@\vskip2.6\p@}
\let\ruc@footnotesize\footnotesize
\renewcommand\footnotesize{\ruc@footnotesize\zihao{-5}}
\def\@makefnmark{\textsuperscript{\hbox{\normalfont\@thefnmark}}}
\long\def\@makefntext#1{
\bgroup
\newbox\ruc@tempboxa
\setbox\ruc@tempboxa\hbox{%
\hb@xt@ 1.5em{\@thefnmark\hss}}
\leftmargin\wd\ruc@tempboxa
\rightmargin\z@
\linewidth \columnwidth
\advance \linewidth -\leftmargin
\parshape \@ne \leftmargin \linewidth
\footnotesize
\@setpar{{\@@par}}%
\leavevmode
\llap{\box\ruc@tempboxa}%
#1
\par\egroup}\else\fi
% \end{macrocode}
% \end{macro}
% \subsection{本科签名}
% \begin{macro}{\autograph} 插入签名,在普通章节文件中插入无限制,但在\tt main.tex\rm 文件插入时被插入的章节不能使用\tt\textbackslash include\rm 命令,需使用\tt\textbackslash input\rm 命令。
% \begin{macrocode}
\ifruc@bachelor
\newcommand{\autograph}{ %
{\noindent\zihao{4}\sf\rule[0mm]{0mm}{15mm}作者签名:
\rule[-1ex]{30mm}{0.25pt}}}
\else\fi
% \end{macrocode}
% \end{macro}
% \subsection{封面}
% \noindent 封皮都是研究生院统一从印刷厂印制,普通的打印店貌似做不出来......
% \begin{macrocode}
\RequirePackage{lscape}
\RequirePackage{multicol}
\RequirePackage{color}
\RequirePackage[dvipsnames,prologue,table]{pstricks}
\definecolor{rucblue}{rgb}{0.129,0.482,0.663}
\definecolor{rucorange}{rgb}{0.976,0.769,0.325}
\definecolor{rucred}{rgb}{0.569,0.129,0.2}
\definecolor{rucgreen}{rgb}{0.333,0.608,0.627}
\definecolor{rucwhite}{rgb}{0.999,0.999,0.999}
\definecolor{rucbalck}{rgb}{0,0,0}
% \end{macrocode}
% \begin{macro}{\X}封面标识使用的是方正小标宋字体,PostScript名称:FZXBSJW--GB1-0
% \begin{macrocode}
\setCJKfamilyfont{X}{FZXBSJW--GB1-0}
\newcommand{\X}{\CJKfamily{X}}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\cover}封面生成命令需在\tt cover.tex\rm 文件中使用
% \begin{macrocode}
\newcommand{\cover}{
\newgeometry{top=0mm,left=20mm,bottom=0mm,right=0mm,voffset=10mm,columnsep=5.5cm}
\ifruc@doctor
\pagecolor{rucorange}
\else
\ifruc@master
\pagecolor{rucblue}
\else
\ifruc@promaster
\pagecolor{rucgreen}
\else
\pagecolor{rucred}
\fi
\fi
\fi
\begin{landscape}
\begin{multicols}{2}
\rule[0mm]{22mm}{0mm}
\ifruc@doctor
\includegraphics[width=5.7cm,height=1.14cm]{figures/logo.pdf}\\
\else
\ifruc@promaster
\includegraphics[width=6.3cm,height=1.26cm]{figures/logoW.pdf}\\
\else
\includegraphics[width=5.7cm,height=1.14cm]{figures/logoW.pdf}\\
\fi\fi
{\X
\ifruc@doctor
\color{rucred}
\else\color{rucwhite}
\fi\zihao{2}\rule[10mm]{30mm}{0mm}
\ifruc@doctor
\makebox[5.7cm][s]{\doctorsign}\\
\zihao{-4}\rule[6mm]{32mm}{0mm}\makebox[5.7cm][s]{\doctoresign}
\else
\ifruc@master
\makebox[5.7cm][s]{\mastersign}\\
\zihao{-4}\rule[6mm]{32mm}{0mm}\makebox[5.7cm][s]{\masteresign}
\else
\ifruc@promaster
\makebox[6.3cm][s]{\promastersign}\\
\zihao{-5}\rule[6mm]{32mm}{0mm}\makebox[6.3cm][s]{\promasteresign}
\else
\makebox[5.7cm][s]{\bachelorsign}\\
\zihao{5}\rule[0mm]{32mm}{0mm}\makebox[5.7cm][s]{\bacheloresign}
\fi\fi\fi}
\vfill
\begin{center}
\rule[0mm]{0mm}{30mm}\\
\ifruc@doctor
\includegraphics[width=2cm,height=2cm]{figures/logo2.pdf}\vspace{2mm}\\
\includegraphics[width=5.7cm,height=1.5048cm]{figures/logo3.pdf}\\
\else
\includegraphics[width=2cm,height=2cm]{figures/logoW2.pdf}\vspace{2mm}\\
\includegraphics[width=5.7cm,height=1.5048cm]{figures/logoW3.pdf}\\
\fi
{\X
\ifruc@doctor
\color{rucred}
\else
\color{rucwhite}
\fi
\zihao{0}\ziju{0.3}
\ifruc@doctor\doctorsign
\else
\ifruc@master\mastersign
\else
\ifruc@promaster\ziju{0.1}\promastersign
\else\bachelorsign
\fi\fi\fi\par\zihao{-4}\rule[0mm]{0mm}{10mm}
\ifruc@doctor\doctoresign
\else
\ifruc@master\masteresign
\else
\ifruc@promaster\promasteresign
\else\bacheloresign
\fi\fi\fi\par}\sf\zihao{-3}
\vspace{40mm}\ziju{0}\linespread{1.5}\rule[0mm]{0mm}{30mm}
\ifruc@doctor\color{rucbalck}\else\color{rucwhite}\fi
论文题目:\underline{\parbox[b]{100mm}\@title}\hfill\par \rule[0mm]{0mm}{10mm}
英\qquad 文:\underline{\parbox[b]{100mm}\@etitle}\hfill\par
\vspace{20mm}\
作\qquad 者:\underline{\makebox[100mm]\@author}\hfill\par\rule[0mm]{0mm}{10mm}
指导教师:\underline{\makebox[100mm]\@advisor}\hfill\par
\vspace{18mm}\@date
\end{center}
\end{multicols}
\thispagestyle{empty}
% \end{macrocode}
% \end{macro}
% 要求中只有博士是需要书脊的(硕士可选),需要设置纸张高度为两张A4纸宽度(420mm)再加书脊的宽度,100张A4纸厚度约为1cm。
% \begin{macrocode}
\ifruc@shuji
\ifruc@doctor\color{rucbalck}\else\color{rucwhite}\fi
\uput[u]{0}(0.5\paperheight,15){{\sf\zihao{3}\shortstack[c]{\@covertitle}}}
\uput[u]{0}(0.5\paperheight,3){{\sf\zihao{3}\shortstack[c]{中\\国\\人\\民\\大\\学}}}
\else\fi
\end{landscape}
\restoregeometry
}
% \end{macrocode}
% \subsection{参考文献}
% \begin{macrocode}
\RequirePackage{natbib}%参考文献
% \end{macrocode}
% \subsection{图表caption设定}
% \begin{macrocode}
\RequirePackage{caption2}
\captionstyle{normal}
\renewcommand{\captionfont}{\zihao{5}\rm}
\renewcommand{\captionlabelfont}{\zihao{5}\bf}
\renewcommand{\captionlabeldelim}{\,\,}
% \end{macrocode}
% \subsection{表格宏包}
% \begin{macrocode}
\RequirePackage{booktabs}%三线表
\RequirePackage{colortbl}%表格颜色
\RequirePackage{diagbox}%表头制作
\RequirePackage{longtable}%长表格
\let\ruc@LT@array\LT@array
\def\LT@array{\zihao{5}\rm\ruc@LT@array}
\let\old@tabular\@tabular
\def\ruc@tabular{\old@tabular\zihao{5}}
\RequirePackage{multirow}%跨行宏包
% \end{macrocode}
% \subsection{表格caption上下间距}
% \begin{macrocode}
\setlength{\abovecaptionskip}{6pt}
\setlength{\belowcaptionskip}{6pt}
% \end{macrocode}
% \subsection{插图宏包}
% \begin{macrocode}
\RequirePackage{wrapfig}%图文混排,段落首字下沉
\RequirePackage{subfigure}%子图
\RequirePackage{tikz}%绘图
% \end{macrocode}
% \subsection{数学宏包}
% \begin{macrocode}
\RequirePackage{amsmath,amsfonts}%
\RequirePackage{latexsym,bm}%
\RequirePackage{extarrows}%
\RequirePackage{pifont}%
%</cls>
% \end{macrocode}
% \Finale
\endinput