-
Notifications
You must be signed in to change notification settings - Fork 212
/
fduthesis.dtx
6142 lines (6105 loc) · 214 KB
/
fduthesis.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
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
% \iffalse meta-comment
% !TeX program = XeLaTeX
% !TeX encoding = UTF-8
%
% Copyright (C) 2017--2020 by Xiangdong Zeng <xdzeng96@gmail.com>
%
% 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. 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 Xiangdong Zeng.
%
% This work consists of the files fduthesis.dtx,
% fduthesis-doc.dtx,
% fduthesis-logo.dtx,
% fduthesis-template.tex,
% and the derived files fduthesis.ins,
% fduthesis.cls,
% fduthesis-en.cls,
% fduthesis.def,
% fdudoc.cls,
% fdulogo.sty,
% fdulogo-example.tex,
% fduthesis-cover.tex,
% fduthesis-en.tex,
% fudan-emblem.pdf,
% fudan-emblem-new.pdf,
% fudan-name.pdf,
% fduthesis.pdf,
% fduthesis-en.pdf,
% fduthesis-code.pdf,
% and README.md.
%
%<*internal>
\iffalse
%</internal>
%
%<*readme>
The `fduthesis` Class
=====================
*LaTeX thesis template for Fudan University, v0.7e*
Overview
--------
This template supports doctoral or master dissertion and undergraduate
thesis, both in Chinese or English. With the help of modern LaTeX
technology, `fduthesis` aims to create a simple interface, a normative
format, as well as a hackable class for the users.
At present, `fduthesis` only supports XeTeX and LuaTeX engines.
Support for pdfTeX and [ApTeX](https://github.com/clerkma/ptex-ng) is
still under development. `fduthesis` only allows UTF-8 encoding.
The documentation can be found in
[fduthesis.pdf](http://mirrors.ctan.org/macros/latex/contrib/fduthesis/fduthesis.pdf)
(in Chinese) or
[fduthesis-en.pdf](http://mirrors.ctan.org/macros/latex/contrib/fduthesis/fduthesis-en.pdf)
(in English).
GitHub repository: <https://github.com/stone-zeng/fduthesis>.
Installation
------------
To install `fduthesis`, you can use one of the following methods:
- If you are running TeX Live, the simplest way is to run
tlmgr install fduthesis
- Download
[fduthesis.tds.zip](http://mirror.ctan.org/install/macros/latex/contrib/fduthesis.tds.zip)
from CTAN, extract it in the root of one of your TDS trees, and
update the filename database.
- Get the source from GitHub:
git clone https://github.com/stone-zeng/fduthesis.git
Run `install-win.bat` (on Windows) or `install-linux.sh` (on Linux)
to generate the templates and configuration files. These files would
be found in a new-created `thesis` folder. You can enjoy `fduthesis`
here at once.
For permanent installation, you may move the following files into a
directory where LaTeX will find them (e.g.
`TEXMF/tex/latex/fduthesis/`):
- `fduthesis.cls`
- `fduthesis-en.cls`
- `fduthesis.def`
- `fdudoc.cls`
- `fdulogo.sty`
- `fudan-emblem.pdf`
- `fudan-emblem-new.pdf`
- `fudan-name.pdf`
Do not forget to update the filename database afterwards.
Contributing
------------
[Issues](https://github.com/stone-zeng/fduthesis/issues) and
[pull requests](https://github.com/stone-zeng/fduthesis/pulls)
are always welcome.
License
-------
This work may be distributed and/or modified under the conditions of
the [LaTeX Project Public License](http://www.latex-project.org/lppl.txt),
either version 1.3c of this license or (at your option) any later
version.
-----
Copyright (C) 2017–2020 by Xiangdong Zeng <xdzeng96@gmail.com>.
%</readme>
%
%<*internal>
\fi
\begingroup
\def\NameOfLaTeXe{LaTeX2e}
\expandafter\endgroup\ifx\NameOfLaTeXe\fmtname\else
\csname fi\endcsname
%</internal>
%
%<*install>
\input l3docstrip.tex
\keepsilent
\askforoverwritefalse
\preamble
Copyright (C) 2017--2020 by Xiangdong Zeng <xdzeng96@gmail.com>
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. 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 Xiangdong Zeng.
This work consists of the files fduthesis.dtx,
fduthesis-doc.dtx,
fduthesis-logo.dtx,
fduthesis-template.tex,
and the derived files fduthesis.ins,
fduthesis.cls,
fduthesis-en.cls,
fduthesis.def,
fdudoc.cls,
fdulogo.sty,
fdulogo-example.tex,
fduthesis-cover.tex,
fduthesis-en.tex,
fudan-emblem.pdf,
fudan-emblem-new.pdf,
fudan-name.pdf,
fduthesis.pdf,
fduthesis-en.pdf,
fduthesis-code.pdf,
and README.md.
\endpreamble
\generate{
\usedir{tex/latex/fduthesis}
\file{\jobname.cls} {\from{\jobname.dtx}{class}}
\file{\jobname-en.cls} {\from{\jobname.dtx}{class-en}}
\file{\jobname.def} {\from{\jobname.dtx}{definition}}
\file{fdudoc.cls} {\from{\jobname.dtx}{doc}
\from{\jobname-doc.dtx}{doc}}
\file{fdulogo.sty} {\from{\jobname.dtx}{logo}
\from{\jobname-logo.dtx}{logo}}
\file{fdulogo-example.tex} {\from{\jobname.dtx}{ex-logo}
\from{\jobname-logo.dtx}{ex-logo}}
\file{\jobname-cover.tex} {\from{\jobname.dtx}{cover}
\from{\jobname-logo.dtx}{cover}}
%</install>
%<*internal>
\usedir{source/latex/fduthesis}
\file{\jobname.ins} {\from{\jobname.dtx}{install}}
%</internal>
%<*install>
\usedir{doc/latex/fduthesis}
\nopreamble\nopostamble
\file{README.md} {\from{\jobname.dtx}{readme}}
}
\obeyspaces
\Msg{*************************************************************}
\Msg{* *}
\Msg{* To finish the installation you have to move the following *}
\Msg{* files into a directory searched by TeX: *}
\Msg{* *}
\Msg{* The recommended directory is TDS:tex/latex/fduthesis *}
\Msg{* *}
\Msg{* fduthesis.cls *}
\Msg{* fduthesis-en.cls *}
\Msg{* fduthesis.def *}
\Msg{* fdudoc.cls *}
\Msg{* fdulogo.sty *}
\Msg{* *}
\Msg{* To produce the documentation, run the file fduthesis.dtx *}
\Msg{* through XeLaTeX. *}
\Msg{* *}
\Msg{* Happy TeXing! *}
\Msg{* *}
\Msg{*************************************************************}
\endbatchfile
%</install>
%
%<*internal>
\fi
%</internal>
%
%<class|class-en|doc|logo>\NeedsTeXFormat{LaTeX2e}
%<class|class-en|doc|logo>\RequirePackage{expl3}
%<*!(driver|install|ex-logo|cover)>
%<!readme>\GetIdInfo $Id: fduthesis.dtx 0.7e 2020-08-30 12:00:00Z Xiangdong Zeng <xdzeng96@gmail.com> $
%<class> {Thesis template for Fudan University}
%<class>\ProvidesExplClass{\ExplFileName}
%<class-en> {Thesis template for Fudan University (English version)}
%<class-en>\ProvidesExplClass{\ExplFileName-en}
%<definition> {Definition file for fduthesis}
%<definition>\ProvidesExplFile{\ExplFileName.def}
%<doc> {Documentation class for fduthesis}
%<doc>\ProvidesExplClass{fdudoc}
%<logo> {Fudan University's Visual Identity}
%<logo>\ProvidesExplPackage{fdulogo}
%<!readme> {\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription}
%</!(driver|install|ex-logo|cover)>
%<*driver>
% \PassOptionsToPackage{showframe}{geometry}
\documentclass{fdudoc}
\usepackage{multirow,xeCJKfntef,xpinyin}
\hypersetup{
pdftitle = {fduthesis: 复旦大学论文模板},
pdfauthor = {曾祥东}}
% 全角标点放在引号中,需要改成半角式,否则间距过大,不好看
\def\FSID{“{\xeCJKsetup{PunctStyle=banjiao}。}”} % U+3002
\def\FSFW{“{\xeCJKsetup{PunctStyle=banjiao}.}”} % U+FF0E
\def\COFW{“{\xeCJKsetup{PunctStyle=banjiao}:}”} % U+FF1A
\def\SCFW{“{\xeCJKsetup{PunctStyle=banjiao};}”} % U+FF1B
%^^A! \PassOptionsToPackage{scheme=plain, linespread=1.1}{ctex}
%^^A! \documentclass{fdudoc}
%^^A! \hypersetup{
%^^A! pdftitle = {fduthesis: LaTeX Thesis Template for Fudan University},
%^^A! pdfauthor = {Xiangdong Zeng}}
%^^A! \ctexset{
%^^A! section = {name = {}, format+ = \raggedright},
%^^A! subsubsection/tocline = {\CTEXnumberline{#1}#2}}
%^^A! \pagestyle{headings}
%^^A! \def\FSID{{\xeCJKsetup{PunctStyle=banjiao}。}}
%^^A! \def\FSFW{{\xeCJKsetup{PunctStyle=banjiao}.}}
%^^A!
\title{\textcolor{MaterialIndigo800}{%
\textbf{fduthesis: 复旦大学论文\xpinyin[font=\sffamily,format=\color{MaterialIndigo800}]{模}{mu2}板}}}
\author{曾祥东}
\date{2020/08/30\quad v0.7e%
\thanks{\url{https://github.com/stone-zeng/fduthesis}.}}
%^^A! \title{\textcolor{MaterialIndigo800}{%
%^^A! \textbf{The \textsf{fduthesis} Class \\
%^^A! \LaTeX{} Thesis Template for Fudan University}}}
%^^A! \author{Xiangdong Zeng}
%^^A! \date{2020/08/30\quad v0.7e%
%^^A! \thanks{\url{https://github.com/stone-zeng/fduthesis}.}}
%^^A!
\begin{document}
%^^A! \begin{document}
%^^A!
\DisableImplementation
%<!--CODEDOC--> \EnableImplementation
%<!--CODEDOC--> \def\FDUCODEDOC{}
\DocInput{fduthesis.dtx}
%<!--CODEDOC--> \DocInput{fduthesis-doc.dtx,fduthesis-logo.dtx}
%<!--CODEDOC--> \IndexLayout
%<!--CODEDOC--> \PrintChanges
%<!--CODEDOC--> \PrintIndex
\end{document}
%</driver>
% \fi
%
% \changes{v0.1}{2017/02/15}{开始编写模板。}
% \changes{v0.2}{2017/02/19}{使用 Git 进行版本控制,并发布至 GitHub。}
% \changes{v0.3}{2017/02/21}{使用 \cls{doc} 和 \pkg{DocStrip}。}
% \changes{v0.3}{2017/03/04}{支持 \LuaLaTeX{}。}
% \changes{v0.3}{2017/03/20}{添加测试文件。}
% \changes{v0.3}{2017/05/26}{使用 Travis CI 进行持续集成。}
% \changes{v0.3}{2017/06/23}{添加复旦大学视觉识别系统。}
% \changes{v0.3}{2017/07/05}{新增声明页。}
% \changes{v0.3}{2017/07/10}{添加英文模板。}
% \changes{v0.3}{2017/07/19}{使用 \pkg{l3docstrip} 管理名字空间。}
% \changes{v0.3}{2017/07/28}{整理代码,编写用户文档。}
% \changes{v0.4}{2017/08/03}{拆分 \file{.dtx} 文件。}
% \changes{v0.4}{2017/08/11}{添加错误信息提示。}
% \changes{v0.6}{2017/11/23}{同步 \pkg{ctex} v2.4.11。}
% \changes{v0.6}{2017/11/29}{添加英文版用户文档。}
% \changes{v0.7}{2018/01/26}{使用 \pkg{l3build} 进行回归测试。}
% \changes{v0.7}{2018/01/31}{不再需要 \file{fduthesis-user.def}。}
% \changes{v0.7}{2018/03/04}{所有选项更改为用连字符隔开的形式。}
% \changes{v0.7a}{2018/04/09}{更新文档,发布至 CTAN。}
% \changes{v0.7b}{2018/04/29}{支持 \TeXLive{} 2018。}
% \changes{v0.7b}{2018/05/06}{将校名、校徽图片添加至发行版。}
%
% \CheckSum{0}
%
% \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 \~}
%
%^^A 禁止使用 " 符号作为抄录文本缩略符
% \DeleteShortVerb\"
%^^A! \DeleteShortVerb\"
%^^A!
%
%^^A 封面与目录的页边距
%^^A+
% \newgeometry{
% left = 1.25 in,
% right = 1.25 in,
% top = 1.25 in,
% bottom = 1.00 in
% }
%
% \maketitle
% \vfill
% \begin{center}
% \includegraphics[width=8cm]{../logo/fduthesis-cover.pdf}
% \end{center}
% \vfill
% \thispagestyle{plain}
% \clearpage
%
% \tableofcontents
%
%^^A-
%
% \EnableDocumentation
%^^A \DisableDocumentation
%
% \begin{documentation}
%
%^^A 用户手册的页边距
%^^A+
% \newgeometry{
% left = 1.65 in,
% right = 0.80 in,
% top = 1.25 in,
% bottom = 1.00 in
% }
%
%^^A-
%
% \section{介绍}
%^^A! \section{Introduction}
%^^A!
%
% 目前,在网上可以找到的复旦大学 \LaTeX{} 论文模板主要有以下这些:
% \begin{itemize}
% \item 数学科学学院 2001 级的何力同学和李湛同学在 2005 年根据
% 学校要求所设计的 \cls{毕业论文格式 tex04 版},以及 2008 年
% 张越同学修改之后的 \cls{毕业论文格式 tex08 版},这是专为
% 数院本科生撰写毕业论文而设计的
% \scite{数院毕业论文格式,数院毕业论文格式更新};
% \item Pandoxie 编写的 \cls{FDU-Thesis-Latex}
% \scite{pandoxie2014fduthesislatex},基本满足了博士(硕士)
% 毕业论文格式要求,使用人数较多;
% \item richarddzh 编写的硕士论文模板 \cls{fudan-thesis}
% \scite{richard2016fudanthesis}。
% \end{itemize}
% 以上这些模板大都没有经过系统的设计,也鲜有后续维护。相比之下,
% 清华大学 \scite{thuthesis}、重庆大学 \scite{cquthesis}、
% 中国科学技术大学 \scite{ustcthesis} 中国科学院大学 \scite{ucasthesis}
% 以及友校上海交通大学 \scite{sjtuthesis}等,都有成熟、
% 稳定的解决方案,值得参考。
%
% 本模板将借鉴前辈经验,重新设计,并使用 \LaTeX3
% \scite{source3} 编写,以适应 \TeX{} 技术发展潮流;
% 同时还将构建一套简洁的接口,方便用户使用。
%^^A! \cls{fduthesis} is a thesis template for Fudan University.
%^^A! This template is mostly written in \LaTeX3 syntax, and
%^^A! provides a simple interface for users.
%^^A!
%
% \subsection*{\LaTeX{} 入门}
%^^A! \subsection*{Getting started with \LaTeX{}}
%^^A!
%
% 本文档并非是一份 \LaTeX{} 零基础教程。如果您是完完全全的新手,
% 建议先阅读相关入门文档,如刘海洋编著的《\LaTeX{} 入门》
% \scite{刘海洋2013latex入门} 第一章,或大名鼎鼎的“\pkg{lshort}”
% \scite{lshort} 及其中文翻译版 \scite{lshort-zh-cn}。当然,
% 网络上的入门教程多如牛毛,您可以自行选取。
%^^A! This documentation is \emph{not} a \LaTeX{} tutorial at
%^^A! starter's level. If you are totally a newbie, please read some
%^^A! introductions like the famous \pkg{lshort}. Of course, there
%^^A! are countless \LaTeX{} tutorials on the Internet. You can
%^^A! choose whatever you like.
%^^A!
%
% \subsection*{关于本文档}
%^^A! \subsection*{About this documentation}
%^^A!
%
% 本文采用不同字体表示不同内容。无衬线字体表示宏包名称,如
% \pkg{xeCJK} 宏包、\cls{fduthesis} 文档类等;等宽字体表示代码或
% 文件名,如 \cs{fdusetup} 命令、\env{abstract} 环境、\TeX{} 文档
% \file{thesis.tex} 等;带有尖括号的楷体(或西文斜体)表示命令参数,
% 如 \meta{模板选项}、\meta{English title} 等。在使用时,参数两侧
% 的尖括号不必输入。示例代码进行了语法高亮处理,以方便阅读。
%^^A! In this documentation, different typefaces are used to
%^^A! represent different contents. Packages and classes are shown
%^^A! in sans-serif font, e.g.\ \pkg{xeCJK} package and
%^^A! \cls{fduthesis} class. Commands and file names are shown in
%^^A! monospaced font, e.g.\ command \cs{fdusetup}, environment
%^^A! \env{abstract} and \TeX{} document \file{thesis.tex}.
%^^A! Italic-shaped font with angle brackets outside means arguments,
%^^A! e.g.\ \meta{English title}. However, you do not need to type
%^^A! the brackets when using these commands. The example code has
%^^A! proper syntax highlighting so it will be much easier to read.
%^^A!
%
% 在用户手册中,带有蓝色侧边线的为 \LaTeX{} 代码,而带有粉色侧边线
% 的则为命令行代码,请注意区分。模板提供的选项、命令、环境等,
% 均用横线框起,同时给出使用语法和相关说明。
%^^A! \LaTeX{} code lines will have a blue line on their left, while
%^^A! for command lines there will be a pink line. The options,
%^^A! commands and environments in \cls{fduthesis} will be surrounded
%^^A! by two horizontal lines. Their usages and descriptions are
%^^A! provided at the same time.
%^^A!
%
% 本模板中的选项、命令或环境可以分为以下三类:
% \begin{itemize}
% \item 名字后面带有 \rexptarget\rexpstar{} 的,表示只能在^^A
% \emph{中文模板}中使用;
% \item 名字后面带有 \exptarget\expstar{} 的,表示只能在^^A
% \emph{英文模板}中使用;
% \item 名字后面不带有特殊符号的,表示既可以在中文模板中使用,
% 也可以在英文模板中使用。
% \end{itemize}
%^^A! The options, commands and environments in \cls{fduthesis} can be
%^^A! divided into the following three types:
%^^A! \begin{itemize}
%^^A! \item Those can be only used in \emph{Chinese templates} are
%^^A! indicated by \rexptarget\rexpstar{}.
%^^A! \item Those can be only used in \emph{English templates} are
%^^A! indicated by \rexptarget\expstar{}.
%^^A! \item If they do not have special characters afterwards, then
%^^A! you can use them in both Chinese and English templates.
%^^A! \end{itemize}
%^^A!
%
% 代码实现主要面向对 \LaTeX{} 宏包开发感兴趣的用户。如果您有任何改进
% 意见或者功能需求,欢迎前往 GitHub 仓库
% \href{https://github.com/stone-zeng/fduthesis/issues}{提交 issue}。
%^^A! If you want to read the implementation part, please turn to the
%^^A! Chinese version. Any issues or feature requests can be submitted
%^^A! in the \href{https://github.com/stone-zeng/fduthesis/issues}%
%^^A! {GitHub repository}.
%^^A!
%
% 文档的最后还提供了版本历史和代码索引,以供查阅。
%
% \section{安装}
%^^A! \section{Installation}
%^^A!
%
% \subsection{获取 \cls{fduthesis}}
%^^A! \subsection{Obtaining \cls{fduthesis}}
%^^A!
%
% \subsubsection{标准安装}
%^^A! \subsubsection{Standard installation}
%^^A!
%
% 如果没有特殊理由,始终建议您使用宏包管理器安装 \cls{fduthesis}。
% 例如在 \TeXLive{} 中,执行(可能需要管理员权限)
% \begin{shellexample}[morekeywords={tlmgr,install}]
% tlmgr install fduthesis
% \end{shellexample}
% 即可完成安装。
%^^A! If there are no special reasons, it is always recommended to
%^^A! install \cls{fduthesis} with a package manager. For example,
%^^A! the following command will install the package in \TeXLive{}
%^^A! (administrator permission may be required):
%^^A! \begin{shellexample}[morekeywords={tlmgr,install}]
%^^A! tlmgr install fduthesis
%^^A! \end{shellexample}
%^^A!
%
% 在 \TeXLive{} 和 \MiKTeX{} 中,您还可以通过图形界面进行安装,
% 此处不再赘述。
%^^A! In \TeXLive{} and \MiKTeX{}, you can also install \cls{fduthesis}
%^^A! through a graphical interface. It's rather simple and will not be
%^^A! described here.
%^^A!
%
% \subsubsection{手动安装}
%^^A! \subsubsection{Install manually}
%^^A!
%
% 如果您需要从 CTAN 上自行下载并手动安装,较好的方法是使用 TDS
% 安装包:
% \begin{itemize}
% \item 从 CTAN 上下载 \cls{fduthesis} 的
% \href{http://mirror.ctan.org/install/macros/latex/contrib/fduthesis.tds.zip}{TDS 安装包};
% \item 按目录结构将 \file{fduthesis.tds.zip} 中的文件复制到 \TeX{}
% 发行版的本地 TDS 根目录;
% \item 执行 \bashcmd{mktexlsr} 刷新文件名数据库以完成安装。
% \end{itemize}
%^^A! If you want to download the template from CTAN and install it
%^^A! manually, the recommended way is to use the TDS ZIP file:
%^^A! \begin{itemize}
%^^A! \item Download the \href{http://mirror.ctan.org/install/macros/latex/contrib/fduthesis.tds.zip}%
%^^A! {TDS ZIP file} for \cls{fduthesis};
%^^A! \item Copy all the files in \file{fduthesis.tds.zip} into the
%^^A! local TDS directory of \TeX{} distribution.
%^^A! \item Run \bashcmd{mktexlsr} to update the ls-R database.
%^^A! \end{itemize}
%^^A
% 您也可以从源代码直接生成模板(不推荐):
% \begin{itemize}
% \item 打开 \href{https://github.com/stone-zeng/fduthesis}^^A
% {项目主页},点击“Clone or download”,并选择“Download ZIP”,
% 下载 \file{fduthesis-master.zip};如果您的电脑中安装有 git
% 程序,也可通过以下命令直接克隆代码仓库:
% \begin{shellexample}[gobble=7,alsoletter={.},^^A
% morekeywords={git,clone}]
% git clone https://github.com/stone-zeng/fduthesis.git
% \end{shellexample}
% \item 解压并进入到 \file{source} 文件夹,执行以下命令以生成
% 模板的各组件:
% \begin{shellexample}[gobble=7,morekeywords={xetex}]
% xetex fduthesis.dtx
% \end{shellexample}
% \item 将生成的文档类(\file{.cls})、宏包(\file{.sty})以及
% 参数配置文件(\file{.def})复制到 \TeX{} 发行版本地 TDS 树
% 的 \path{texmf-local/tex/latex/fduthesis/} 目录下,并执行
% \bashcmd{mktexlsr} 刷新文件名数据库,方可完成安装。
% \item 使用 \cls{fduthesis} 撰写论文时,您还需要从代码仓库下的
% \file{testfiles/support} 目录中复制 \file{fudan-name.pdf}
% 文件至工作目录,以确保封面中的校名图片可以正确显示。
% \end{itemize}
%^^A! Although not recommended, you may generate the whole template
%^^A! from source code as well:
%^^A! \begin{itemize}
%^^A! \item Open the project's \href{https://github.com/stone-zeng/fduthesis}%
%^^A! {homepage}, click ``Clone or download'' and choose
%^^A! ``Download ZIP'' to download \file{fduthesis-master.zip}.
%^^A! If you have git program on your computer, you can also
%^^A! clone the repository directly:
%^^A! \begin{shellexample}[gobble=5,alsoletter={.},%
%^^A! morekeywords={git,clone}]
%^^A! git clone https://github.com/stone-zeng/fduthesis.git
%^^A! \end{shellexample}
%^^A! \item Extract files, and get into the \file{source} directory.
%^^A! Run the following command to generate all the components:
%^^A! \begin{shellexample}[gobble=5,morekeywords={xetex}]
%^^A! xetex fduthesis.dtx
%^^A! \end{shellexample}
%^^A! \item Copy the generated document classes (\file{.cls}),
%^^A! packages (\file{.sty}) and configuration files (\file{.def})
%^^A! into \path{texmf-local/tex/latex/fduthesis/} under the local
%^^A! TDS tree of \TeX{} distribution. Then run \bashcmd{mktexlsr}
%^^A! to update the ls-R database.
%^^A! \item When writing your thesis with \cls{fduthesis}, you need
%^^A! to copy the file \file{fudan-name.pdf} (can be found in the
%^^A! \file{testfiles/support} directory of the Git repository) to
%^^A! your working directory, to make sure that the logo in the
%^^A! cover can be displayed correctly.
%^^A! \end{itemize}
%^^A!
%
% \subsubsection{扁平化安装}
%^^A! \subsubsection{\cls{fduthesis} on the fly}
%^^A!
%
% 如果您不希望安装本模板,但需要立刻使用,也可以使用模板提供的安装脚本。
% 从 GitHub 上获取代码仓库后,执行 \file{install-win.bat}(Windows 系统)
% 或 \file{install-linux.sh}(Linux 系统),所有需要的文件便会在
% \file{thesis} 文件夹中生成。
%^^A! If you don't want to install \cls{fduthesis} but need to use it
%^^A! at once, you can try the installation scripts. Download the
%^^A! repository from GitHub, run \file{install-win.bat} (on Windows)
%^^A! or \file{install-linux.sh} (on Linux), then all the necessary
%^^A! files will be found in the \file{thesis} folder.
%^^A!
%
% \subsection{模板组成}
%^^A! \subsection{Composition of the template}
%^^A!
%
% 本模板主要包含核心文档类、配置文件、附属宏包以及用户文档等几个
% 部分,其具体组成见表~\ref{tab:fduthesis-components}。
%^^A! There are several parts in \cls{fduthesis}, including kernel
%^^A! template classes, configuration files, affiliated packages and
%^^A! user's guides. More details are listed in table~%
%^^A! \ref{tab:fduthesis-components}.
%^^A!
%
% \begin{table}[ht]
% \caption{\cls{fduthesis} 的主要组成部分}
% \label{tab:fduthesis-components}
% \centering
% \begin{tabular}{lp{20em}}
% \toprule
% \textbf{文件} & \textbf{功能说明} \\
% \midrule
% \file{fduthesis.cls} & 中文模板文档类 \\
% \file{fduthesis-en.cls} & 英文模板文档类 \\
% \file{fduthesis.def} & 参数配置文件,用于设定
% \cls{fduthesis} 的初始参数,不建议您自行改动 \\
% \file{fdudoc.cls} & 用户手册文档类 \\
% \file{fdulogo.sty} & 复旦大学视觉识别系统 \\
% \file{fudan-emblem.pdf} & 校徽 \\
% \file{fudan-emblem-new.pdf} & 校徽(重修版) \\
% \file{fudan-name.pdf} & 校名图片 \\
% \file{README.md} & 简要自述 \\
% \ifdefined\FDUCODEDOC
% \file{fduthesis.pdf} & 中文用户手册 \\
% \file{fduthesis-en.pdf} & 英文用户手册 \\
% \file{fduthesis-code.pdf} & 模板实现代码(本文档) \\
% \else
% \file{fduthesis.pdf} & 中文用户手册(本文档) \\
% \file{fduthesis-en.pdf} & 英文用户手册 \\
% \file{fduthesis-code.pdf} & 模板实现代码 \\
% \fi
% \file{fduthesis-template.tex} & 空白模板,可据此为基础完成论文
% 撰写 \\
% \bottomrule
% \end{tabular}
% \end{table}
%^^A! \begin{table}[ht]
%^^A! \caption{The main components of \cls{fduthesis}}
%^^A! \label{tab:fduthesis-components}
%^^A! \centering
%^^A! \begin{tabular}{lp{24em}}
%^^A! \toprule
%^^A! \textbf{Files} & \textbf{Descriptions} \\
%^^A! \midrule
%^^A! \file{fduthesis.cls} & Document class for Chinese thesis. \\
%^^A! \file{fduthesis-en.cls} & Document class for English thesis.\\
%^^A! \file{fduthesis.def} & Configuration parameters file
%^^A! for \cls{fduthesis}. Please do \emph{not} modify it. \\
%^^A! \file{fdudoc.cls} & Document class for user guides. \\
%^^A! \file{fdulogo.sty} & Fudan University's visual identity. \\
%^^A! \file{fudan-emblem.pdf} & University emblem. \\
%^^A! \file{fudan-emblem-new.pdf} & University emblem (revised version). \\
%^^A! \file{fudan-name.pdf} & Figure of university name. \\
%^^A! \file{README.md} & The brief introduction. \\
%^^A! \file{fduthesis.pdf} & User's guide in Chinese. \\
%^^A! \file{fduthesis-en.pdf} & User's guide in English (this
%^^A! document). \\
%^^A! \file{fduthesis-code.pdf} & Code implementation. \\
%^^A! \file{fduthesis-template.tex} & An empty thesis template, and you can
%^^A! write your thesis based on it. \\
%^^A! \bottomrule
%^^A! \end{tabular}
%^^A! \end{table}
%^^A!
%
% \section{使用说明}
%^^A! \section{User's guide}
%^^A!
%
% \subsection{基本用法}
%^^A! \subsection{Getting started}
%^^A!
%
% 以下是一份简单的 \TeX{} 文档,它演示了 \cls{fduthesis}
% 的最基本用法:
%^^A! Here is a minimal \TeX{} file for \cls{fduthesis}:
%^^A+
% \begin{latexexample}[deletetexcs={\documentclass},%
% moretexcs={\chapter},morekeywords={\documentclass},%
% emph={[2]document}]
% % thesis.tex
% \documentclass{fduthesis}
% \begin{document}
% \chapter{欢迎}
% \section{Welcome to fduthesis!}
% 你好,\LaTeX{}!
% \end{document}
% \end{latexexample}
%^^A-
%^^A!
%
% 按照 \ref{subsec:编译方式}~小节中的方式编译该文档,您应当得到
% 一篇 5 页的文章。当然,这篇文章的绝大部分都是空白的。
%^^A! Compile this file under the instructions in subsection~%
%^^A! \ref{subsec:compilation}, you will get a 5-page article.
%^^A! Of course, most of it will be blank, as you may predicate.
%^^A!
%
% 英文模板可以用类似的方式使用:
%^^A! The English version can be used in the same way:
%^^A+
% \begin{latexexample}[deletetexcs={\documentclass},%
% moretexcs={\chapter},morekeywords={\documentclass},%
% emph={[2]document}]
% % thesis-en.tex
% \documentclass{fduthesis-en}
% \begin{document}
% \chapter{Welcome}
% \section{Welcome to fduthesis!}
% Hello, \LaTeX{}!
% \end{document}
% \end{latexexample}
%^^A-
% 英文模板只对正文部分进行了改动,封面、指导小组成员以及声明页仍将
% 显示为中文。
%^^A! The differences between English and Chinese version only
%^^A! live in the main body. Thesis cover, instructors list and
%^^A! declaration page are still printed in Chinese.
%^^A!
%
% \subsection{编译方式} \label{subsec:编译方式}
%^^A! \subsection{Compilation} \label{subsec:compilation}
%^^A!
%
% 本模板不支持 \pdfTeX{} 引擎,请使用 \XeLaTeX{} 或 \LuaLaTeX{}
% 编译。推荐使用 \XeLaTeX{}。为了生成正确的目录、脚注以及交叉引用,
% 您至少需要连续编译两次。
%^^A! \cls{fduthesis} does NOT support \pdfTeX{}. Please use
%^^A! \XeLaTeX{} or \LuaLaTeX{} to compile, and \XeLaTeX{} is
%^^A! recommended. To get the correct table of contents, footnotes
%^^A! and cross-references, you need to compile the source file at
%^^A! least twice.
%^^A!
%
% 以下代码中,假设您的 \TeX{} 源文件名为 \file{thesis.tex}。
% 使用 \XeLaTeX{} 编译论文,请在命令行中执行
% \begin{shellexample}[morekeywords={xelatex}]
% xelatex thesis
% xelatex thesis
% \end{shellexample}
% 或使用 \pkg{latexmk}:
% \begin{shellexample}[morekeywords={latexmk},emph={-xelatex}]
% latexmk -xelatex thesis
% \end{shellexample}
%^^A! In the following example, suppose your \TeX{} source file is
%^^A! \file{thesis.tex}. Please execute the following commands if
%^^A! you want to use \XeLaTeX{}:
%^^A! \begin{shellexample}[morekeywords={xelatex}]
%^^A! xelatex thesis
%^^A! xelatex thesis
%^^A! \end{shellexample}
%^^A! You can use \pkg{latexmk} as well:
%^^A! \begin{shellexample}[morekeywords={latexmk},emph={-xelatex}]
%^^A! latexmk -xelatex thesis
%^^A! \end{shellexample}
%^^A!
%
% 使用 \LuaLaTeX{} 编译论文,请在命令行中执行
% \begin{shellexample}[morekeywords={lualatex}]
% lualatex thesis
% lualatex thesis
% \end{shellexample}
% 或者
% \begin{shellexample}[morekeywords={latexmk},emph={-lualatex}]
% latexmk -lualatex thesis
% \end{shellexample}
%^^A! \LuaLaTeX{} can be used in a similar way:
%^^A! \begin{shellexample}[morekeywords={lualatex}]
%^^A! lualatex thesis
%^^A! lualatex thesis
%^^A! \end{shellexample}
%^^A! or
%^^A! \begin{shellexample}[morekeywords={latexmk},emph={-lualatex}]
%^^A! latexmk -lualatex thesis
%^^A! \end{shellexample}
%^^A!
%
% \subsection{模板选项}
%^^A! \subsection{Options of the template}
%^^A!
%
% 所谓“模板选项”,指需要在引入文档类的时候指定的选项:
% \begin{latexexample}[deletetexcs={\documentclass},%
% morekeywords={\documentclass}]
% \documentclass(*\oarg{模板选项}*){fduthesis}
% \documentclass(*\oarg{模板选项}*){fduthesis-en}
% \end{latexexample}
%^^A! You can specify some \emph{template options} when loading
%^^A! \cls{fduthesis}:
%^^A! \begin{latexexample}[deletetexcs={\documentclass},%
%^^A! morekeywords={\documentclass}]
%^^A! \documentclass(*\oarg{options}*){fduthesis}
%^^A! \documentclass(*\oarg{options}*){fduthesis-en}
%^^A! \end{latexexample}
%^^A!
%
% 有些模板选项为布尔型,它们只能在 \opt{true} 和 \opt{false}
% 中取值。对于这些选项,\kvopt{\meta{选项}}{true} 中的“|= true|”
% 可以省略。
%^^A! Some options are \emph{boolean} --- they only take the value
%^^A! \opt{true} or \opt{false}. For these options, you can
%^^A! abbreviate ``\kvopt{\meta{option}}{true}'' simply to
%^^A! ``\opt{\meta{option}}''.
%^^A!
%
%^^A+
% \begin{function}[added=2018-02-01]{type}
% \begin{fdusyntax}[emph={[1]type}]
% type = (*<doctor|master|(bachelor)>*)
% \end{fdusyntax}
%^^A-
% 选择论文类型。三种选项分别代表博士学位论文、硕士学位论文和本科
% 毕业论文。
% \end{function}
%^^A! Choose the type of your thesis. The three options represent
%^^A! doctoral dissertation, master degree thesis and undergraduate
%^^A! thesis, respectively.
%^^A! \end{function}
%^^A!
%
% \begin{function}{oneside,twoside}
% 指明论文的单双面模式,默认为 \opt{twoside}。该选项会影响每章
% 的开始位置,还会影响页眉样式。
% \end{function}
%^^A! \begin{function}{oneside,twoside}
%^^A! Specify whether single or double sided output should be
%^^A! generated. \opt{twoside} will be chosen by default. These
%^^A! option will determine where the new chapters begin and how
%^^A! the headers display. The option \opt{twoside} does
%^^A! \emph{not} tell the printer to actually make a two-sided
%^^A! printout.
%^^A! \end{function}
%^^A!
%
% 在双面模式(\opt{twoside})下,按照通常的排版惯例,每章应只从
% 奇数页(在右)开始;而在单页模式(\opt{oneside})下,则可以从
% 任意页面开始。本模板中,目录、摘要、符号表等均视作章,也按相同
% 方式排版。
%^^A! If choosing \opt{twoside}, chapters will begin at the odd pages
%^^A! (right hand). However, they will begin at arbitrary pages
%^^A! available when choosing \opt{oneside}. Table of contents,
%^^A! abstract and the list of symbols are considered as chapters and
%^^A! processed in the same way.
%^^A!
%
% 双面模式下,正文部分偶数页(在左)的左页眉显示章标题,奇数页
% (在右)的右页眉显示节标题;前置部分的页眉按同样格式显示,但文字
% 均为对应标题(如“目录”、“摘要”等)。
% 而在单面模式下,正文部分则页面不分奇偶,均同时显示左、右页眉,
% 文字分别为章标题和节标题;前置部分只有中间页眉,显示对应标题。
%^^A! At two-sided mode, left headers on the even pages (left hand)
%^^A! in \emph{main body} will show the title of chapters, while the
%^^A! right headers on the odd pages (right hand) will show the
%^^A! title of sections. Headers in \emph{front matter} have the
%^^A! same style, but they will only show the title as ``Contents'',
%^^A! ``Abstract'', etc.
%^^A!
%^^A! At one-sided mode, both left and right headers on \emph{all}
%^^A! pages in main body will be shown. The text is the title of
%^^A! chapters and sections, respectively. In front matter, there
%^^A! are only middle headers, which show the corresponding titles.
%^^A!
%
% \begin{function}{draft}
% \begin{fdusyntax}[emph={[1]draft}]
% draft = (*<\TFF>*)
% \end{fdusyntax}
% 选择是否开启草稿模式,默认关闭。
% \end{function}
%^^A! \begin{function}{draft}
%^^A! \begin{fdusyntax}[emph={[1]draft}]
%^^A! draft = (*<\TFF>*)
%^^A! \end{fdusyntax}
%^^A! Enable draft mode. Default off.
%^^A! \end{function}
%^^A!
%
% 草稿模式为全局选项,会影响到很多宏包的工作方式。
% 开启之后,主要的变化有:
% \begin{itemize}
% \item 把行溢出的盒子显示为黑色方块;
% \item 不实际插入图片,只输出一个占位方框;
% \item 关闭超链接渲染,也不再生成 PDF 书签;
% \item 显示页面边框。
% \end{itemize}
%^^A! \opt{draft} is a global option and will affect many packages.
%^^A! You may notice the following changes when using \opt{draft}:
%^^A! \begin{itemize}
%^^A! \item Lines with overfull \tn{hbox}'s will be marked with
%^^A! a thick black square on the right margin.
%^^A! \item Will not include graphics files actually, but instead
%^^A! print a box of the size the graphic would take up, as well
%^^A! as the file name.
%^^A! \item Will not make hyperlinks and PDF bookmarks.
%^^A! \item Show the page frames.
%^^A! \end{itemize}
%^^A!
%
% \begin{function}[added=2018-01-31]{config}
% \begin{fdusyntax}[emph={[1]config}]
% config = (*\marg{文件}*)
% \end{fdusyntax}
% 用户配置文件的文件名。默认为空,即不载入用户配置文件。
% \end{function}
%^^A! \begin{function}[added=2018-01-31]{config}
%^^A! \begin{fdusyntax}[emph={[1]config}]
%^^A! config = (*\marg{file}*)
%^^A! \end{fdusyntax}
%^^A! File name of user profile. Default value is empty, so no
%^^A! profile is loaded automatically.
%^^A! \end{function}
%^^A!
%
% \subsection{参数设置}
%^^A! \subsection{More options}
%^^A!
%
% \begin{function}{\fdusetup}
% \begin{fdusyntax}[morekeywords={\fdusetup}]
% \fdusetup(*\marg{键值列表}*)
% \end{fdusyntax}
% 本模板提供了一系列选项,可由您自行配置。载入文档类之后,以下
% 所有选项均可通过统一的命令 \cs{fdusetup} 来设置。
% \end{function}
%^^A! \begin{function}{\fdusetup}
%^^A! \begin{fdusyntax}[morekeywords={\fdusetup}]
%^^A! \fdusetup(*\marg{key-value list}*)
%^^A! \end{fdusyntax}
%^^A! \cls{fduthesis} has provided a number of options, which
%^^A! can be given via the general command \cs{fdusetup}.
%^^A! \end{function}
%^^A!
%
% \cs{fdusetup} 的参数是一组由(英文)逗号隔开的选项列表,列表中的
% 选项通常是 \kvopt{\meta{key}}{\meta{value}} 的形式。部分选项的
% \meta{value} 可以省略。对于同一项,后面的设置将会覆盖前面的设置。
% 在下文的说明中,将用\textbf{粗体}表示默认值。
%^^A! The argument of \cs{fdusetup} is a set of comma-separated option
%^^A! list. The options usually have the form of \kvopt{\meta{key}}%
%^^A! {\meta{value}} and in some cases \meta{value} can be omitted.
%^^A! For the same option, the values given later will override the
%^^A! the previous ones. Default values are indicated in
%^^A! \textbf{boldface} in the following descriptions.
%^^A!
%
% \cs{fdusetup} 采用 \LaTeX3 风格的键值设置,支持不同类型以及多种
% 层次的选项设定。键值列表中,“|=|”左右的空格不影响设置;但需注意,
% 参数列表中不可以出现空行。
%^^A! \cs{fdusetup} follows \LaTeX3 key-value style, and different
%^^A! types as well as various levels options are supported. In the
%^^A! key-value list, spaces around ``|=|'' will be trimmed; however,
%^^A! blank lines should never appear in the argument.
%^^A!
%
% 与模板选项相同,布尔型的参数可以省略 \kvopt{\meta{选项}}{true}
% 中的“|= true|”。
%^^A! Similar with template options, ``\kvopt{\meta{option}}{true}''
%^^A! can be abbreviated to \opt{\meta{option}} for boolean type.
%^^A!
%
% 另有一些选项包含子选项,如 \opt{style} 和 \opt{info} 等。它们可以
% 按如下两种等价方式来设定:
%^^A! Some options, such as \opt{style} and \opt{info}, may have
%^^A! sub-options. They can be set by the following two equivalent
%^^A! methods:
%^^A+
% \begin{latexexample}[morekeywords={\fdusetup},%
% emph={[1]style,cjk-font,font-size,info,title,title*,author,author*,department}]
% \fdusetup{