-
Notifications
You must be signed in to change notification settings - Fork 218
/
Copy pathfduthesis-doc.tex
1265 lines (1094 loc) · 49.3 KB
/
fduthesis-doc.tex
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
\documentclass{fdudoc}
\usepackage{multirow,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
\title{\textcolor{MaterialIndigo800}{%
\textbf{fduthesis: 复旦大学论文\xpinyin[font=\sffamily]{模}{mu2}板}}}
\author{曾祥东}
\date{2019/04/03\quad v0.7d%
\thanks{\url{https://github.com/stone-zeng/fduthesis}.}}
\begin{document}
% 禁止使用 " 符号作为抄录文本缩略符
\DeleteShortVerb\"
% 封面与目录的页边距
\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
% 用户手册的页边距
\newgeometry{
left = 1.65 in,
right = 0.80 in,
top = 1.25 in,
bottom = 1.00 in
}
\section{介绍}
目前,在网上可以找到的复旦大学 \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{} 技术发展潮流;
同时还将构建一套简洁的接口,方便用户使用。
\subsection*{\LaTeX{} 入门}
本文档并非是一份 \LaTeX{} 零基础教程。如果您是完完全全的新手,
建议先阅读相关入门文档,如刘海洋编著的《\LaTeX{} 入门》
\scite{刘海洋2013latex入门} 第一章,或大名鼎鼎的“\pkg{lshort}”
\scite{lshort} 及其中文翻译版 \scite{lshort-zh-cn}。当然,
网络上的入门教程多如牛毛,您可以自行选取。
\subsection*{关于本文档}
本文采用不同字体表示不同内容。无衬线字体表示宏包名称,如
\pkg{xeCJK} 宏包、\cls{fduthesis} 文档类等;等宽字体表示代码或
文件名,如 \cs{fdusetup} 命令、\env{abstract} 环境、\TeX{} 文档
\file{thesis.tex} 等;带有尖括号的楷体(或西文斜体)表示命令参数,
如 \meta{模板选项}、\meta{English title} 等。在使用时,参数两侧
的尖括号不必输入。示例代码进行了语法高亮处理,以方便阅读。
在用户手册中,带有蓝色侧边线的为 \LaTeX{} 代码,而带有粉色侧边线
的则为命令行代码,请注意区分。模板提供的选项、命令、环境等,
均用横线框起,同时给出使用语法和相关说明。
本模板中的选项、命令或环境可以分为以下三类:
\begin{itemize}
\item 名字后面带有 \rexptarget\rexpstar{} 的,表示只能在^^A
\emph{中文模板}中使用;
\item 名字后面带有 \exptarget\expstar{} 的,表示只能在^^A
\emph{英文模板}中使用;
\item 名字后面不带有特殊符号的,表示既可以在中文模板中使用,
也可以在英文模板中使用。
\end{itemize}
代码实现主要面向对 \LaTeX{} 宏包开发感兴趣的用户。如果您有任何改进
意见或者功能需求,欢迎前往 GitHub 仓库
\href{https://github.com/stone-zeng/fduthesis/issues}{提交 issue}。
文档的最后还提供了版本历史和代码索引,以供查阅。
\section{安装}
\subsection{获取 \cls{fduthesis}}
\subsubsection{标准安装}
如果没有特殊理由,始终建议您使用宏包管理器安装 \cls{fduthesis}。
例如在 \TeXLive{} 中,执行(可能需要管理员权限)
\begin{shellexample}[morekeywords={tlmgr,install}]
tlmgr install fduthesis
\end{shellexample}
即可完成安装。
在 \TeXLive{} 和 \MiKTeX{} 中,您还可以通过图形界面进行安装,
此处不再赘述。
\subsubsection{手动安装}
如果您需要从 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}
%
您也可以从源代码直接生成模板(不推荐):
\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}
\subsubsection{扁平化安装}
如果您不希望安装本模板,但需要立刻使用,也可以使用模板提供的安装脚本。
从 GitHub 上获取代码仓库后,执行 \file{install-win.bat}(Windows 系统)
或 \file{install-linux.sh}(Linux 系统),所有需要的文件便会在
\file{thesis} 文件夹中生成。
\subsection{模板组成}
本模板主要包含核心文档类、配置文件、附属宏包以及用户文档等几个
部分,其具体组成见表~\ref{tab:fduthesis-components}。
\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}
\section{使用说明}
\subsection{基本用法}
以下是一份简单的 \TeX{} 文档,它演示了 \cls{fduthesis}
的最基本用法:
\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}
按照 \ref{subsec:编译方式}~小节中的方式编译该文档,您应当得到
一篇 5 页的文章。当然,这篇文章的绝大部分都是空白的。
英文模板可以用类似的方式使用:
\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}
英文模板只对正文部分进行了改动,封面、指导小组成员以及声明页仍将
显示为中文。
\subsection{编译方式} \label{subsec:编译方式}
本模板不支持 \pdfTeX{} 引擎,请使用 \XeLaTeX{} 或 \LuaLaTeX{}
编译。推荐使用 \XeLaTeX{}。为了生成正确的目录、脚注以及交叉引用,
您至少需要连续编译两次。
以下代码中,假设您的 \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}
使用 \LuaLaTeX{} 编译论文,请在命令行中执行
\begin{shellexample}[morekeywords={lualatex}]
lualatex thesis
lualatex thesis
\end{shellexample}
或者
\begin{shellexample}[morekeywords={latexmk},emph={-lualatex}]
latexmk -lualatex thesis
\end{shellexample}
\subsection{模板选项}
所谓“模板选项”,指需要在引入文档类的时候指定的选项:
\begin{latexexample}[deletetexcs={\documentclass},
morekeywords={\documentclass}]
\documentclass(*\oarg{模板选项}*){fduthesis}
\documentclass(*\oarg{模板选项}*){fduthesis-en}
\end{latexexample}
有些模板选项为布尔型,它们只能在 \opt{true} 和 \opt{false}
中取值。对于这些选项,\kvopt{\meta{选项}}{true} 中的“|= true|”
可以省略。
\begin{function}[added=2018-02-01]{type}
\begin{fdusyntax}[emph={[1]type}]
type = (*<doctor|master|(bachelor)>*)
\end{fdusyntax}
选择论文类型。三种选项分别代表博士学位论文、硕士学位论文和本科
毕业论文。
\end{function}
\begin{function}{oneside,twoside}
指明论文的单双面模式,默认为 \opt{twoside}。该选项会影响每章
的开始位置,还会影响页眉样式。
\end{function}
在双面模式(\opt{twoside})下,按照通常的排版惯例,每章应只从
奇数页(在右)开始;而在单页模式(\opt{oneside})下,则可以从
任意页面开始。本模板中,目录、摘要、符号表等均视作章,也按相同
方式排版。
双面模式下,正文部分偶数页(在左)的左页眉显示章标题,奇数页
(在右)的右页眉显示节标题;前置部分的页眉按同样格式显示,但文字
均为对应标题(如“目录”、“摘要”等)。
而在单面模式下,正文部分则页面不分奇偶,均同时显示左、右页眉,
文字分别为章标题和节标题;前置部分只有中间页眉,显示对应标题。
\begin{function}{draft}
\begin{fdusyntax}[emph={[1]draft}]
draft = (*<\TFF>*)
\end{fdusyntax}
选择是否开启草稿模式,默认关闭。
\end{function}
草稿模式为全局选项,会影响到很多宏包的工作方式。
开启之后,主要的变化有:
\begin{itemize}
\item 把行溢出的盒子显示为黑色方块;
\item 不实际插入图片,只输出一个占位方框;
\item 关闭超链接渲染,也不再生成 PDF 书签;
\item 显示页面边框。
\end{itemize}
\begin{function}[added=2018-01-31]{config}
\begin{fdusyntax}[emph={[1]config}]
config = (*\marg{文件}*)
\end{fdusyntax}
用户配置文件的文件名。默认为空,即不载入用户配置文件。
\end{function}
\subsection{参数设置}
\begin{function}{\fdusetup}
\begin{fdusyntax}[morekeywords={\fdusetup}]
\fdusetup(*\marg{键值列表}*)
\end{fdusyntax}
本模板提供了一系列选项,可由您自行配置。载入文档类之后,以下
所有选项均可通过统一的命令 \cs{fdusetup} 来设置。
\end{function}
\cs{fdusetup} 的参数是一组由(英文)逗号隔开的选项列表,列表中的
选项通常是 \kvopt{\meta{key}}{\meta{value}} 的形式。部分选项的
\meta{value} 可以省略。对于同一项,后面的设置将会覆盖前面的设置。
在下文的说明中,将用\textbf{粗体}表示默认值。
\cs{fdusetup} 采用 \LaTeX3 风格的键值设置,支持不同类型以及多种
层次的选项设定。键值列表中,“|=|”左右的空格不影响设置;但需注意,
参数列表中不可以出现空行。
与模板选项相同,布尔型的参数可以省略 \kvopt{\meta{选项}}{true}
中的“|= true|”。
另有一些选项包含子选项,如 \opt{style} 和 \opt{info} 等。它们可以
按如下两种等价方式来设定:
\begin{latexexample}[morekeywords={\fdusetup},
emph={[1]style,cjk-font,font-size,info,title,title*,author,author*,department}]
\fdusetup{
style = {cjk-font = adobe, font-size = -4},
info = {
title = {论动体的电动力学},
title* = {On the Electrodynamics of Moving Bodies},
author = {阿尔伯特·爱因斯坦},
author* = {Albert Einstein},
department = {物理学系}
}
}
\end{latexexample}
或者
\begin{latexexample}[morekeywords={\fdusetup},
emph={[1]style,cjk-font,font-size,info,title,title*,author,author*,department}]
\fdusetup{
style/cjk-font = adobe,
style/font-size = -4,
info/title = {论动体的电动力学},
info/title* = {On the Electrodynamics of Moving Bodies},
info/author = {阿尔伯特·爱因斯坦},
info/author* = {Albert Einstein},
info/department = {物理学系}
}
\end{latexexample}
注意 “|/|” 的前后均不可以出现空白字符。
\subsubsection{论文格式} \label{subsubsec:论文格式}
\begin{function}{style}
\begin{fdusyntax}[emph={[1]style}]
style = (*\marg{键值列表}*)
style/(*\meta{key}*) = (*\meta{value}*)
\end{fdusyntax}
该选项包含许多子项目,用于设置论文格式。具体内容见下。
\end{function}
\begin{function}[updated=2019-03-05]{style/font}
\begin{fdusyntax}[emph={[1]font}]
font = (*<garamond|libertinus|lm|palatino|(times)|times*|none>*)
\end{fdusyntax}
设置西文字体(包括数学字体)。具体配置见表~\ref{tab:font}。
\end{function}
\begin{table}[ht]
\begin{threeparttable}
\caption{西文字体配置}
\label{tab:font}
\centering
\begin{tabular}{ccccc}
\toprule
& \strong{正文字体} & \strong{无衬线字体} & \strong{等宽字体} & \strong{数学字体} \\
\midrule
|garamond| & EB Garamond & Libertinus Sans & LM Mono\tnote{a} & Garamond Math \\
|libertinus| & Libertinus Serif & Libertinus Sans & LM Mono & Libertinus Math \\
|lm| & LM Roman & LM Sans & LM Mono & LM Math \\
|palatino| & TG Pagella\tnote{b} & Libertinus Sans & LM Mono & TG Pagella Math \\
|times| & XITS & TG Heros & TG Cursor & XITS Math \\
|times*|\tnote{c} & Times New Roman & Arial & Courier New & XITS Math \\
\bottomrule
\end{tabular}
\begin{tablenotes}
\item[a] “LM”是 Latin Modern 的缩写。
\item[b] “TG”是 TeX Gyre 的缩写。
\item[c] 本行中,Times New Roman、Arial 和 Courier New 是商业字体,
在 Windows 和 macOS 系统上均默认安装。
\end{tablenotes}
\end{threeparttable}
\end{table}
\begin{function}[rEXP,updated=2019-03-05]{style/cjk-font}
\begin{fdusyntax}[emph={[1]cjk-font}]
cjk-font = (*<adobe|(fandol)|founder|mac|sinotype|sourcehan|windows|none>*)
\end{fdusyntax}
设置中文字体。具体配置见表~\ref{tab:cjk-font}。
\end{function}
\begin{table}[ht]
\caption{中文字体配置}
\label{tab:cjk-font}
\centering
\begin{tabular}{cccc}
\toprule
& \strong{正文字体(宋体)} & \strong{无衬线字体(黑体)} & \strong{等宽字体(仿宋)} \\
\midrule
\multirow{2}*{|adobe|} & Adobe 宋体 & Adobe 黑体 & Adobe 仿宋 \\
& Adobe Song Std & Adobe Heiti Std & Adobe Fangsong Std \\
\multirow{2}*{|fandol|} & Fandol 宋体 & Fandol 黑体 & Fandol 仿宋 \\
& FandolSong & FandolHei & FandolFang \\
\multirow{2}*{|founder|} & 方正书宋 & 方正黑体 & 方正仿宋 \\
& FZShuSong-Z01 & FZHei-B01 & FZFangSong-Z02 \\
\multirow{2}*{|mac|} & (华文)宋体-简 & (华文)黑体-简 & 华文仿宋 \\
& Songti SC & Heiti SC & STFangsong \\
\multirow{2}*{|sinotype|} & 华文宋体 & 华文黑体 & 华文仿宋 \\
& STSong & STHeiti & STFangsong \\
\multirow{2}*{|sourcehan|} & 思源宋体 & 思源黑体 & --- \\
& Source Han Serif SC & Source Han Sans SC & --- \\
\multirow{2}*{|windows|} & (中易)宋体 & (中易)黑体 & (中易)仿宋 \\
& SimSun & SimHei & FangSong \\
\bottomrule
\end{tabular}
\end{table}
启用 \kvopt{font}{none} 或 \kvopt{cjk-font}{none} 之后,模板将关闭
默认西文 / 中文字体设置。此时,您需要自行使用 \cs{setmainfont}、
\cs{setCJKmainfont}、\cs{setmathfont} 等命令来配置字体。
\begin{function}{style/font-size}
\begin{fdusyntax}[emph={[1]font-size}]
font-size = (*<(-4)|5>*)
\end{fdusyntax}
设置论文的基础字号。
\end{function}
\begin{function}[rEXP,updated=2017-10-14]{style/fullwidth-stop}
\begin{fdusyntax}[emph={[1]fullwidth-stop}]
fullwidth-stop = (*<catcode|mapping|(false)>*)
\end{fdusyntax}
选择是否把全角实心句点\FSFW 作为默认的句号形状。
这种句号一般用于科技类文章,以避免与下标“$_o$”或“$_0$”混淆。
\end{function}
选择 \kvopt{fullwidth-stop}{catcode} 或 \opt{mapping} 后,都会实现
上述效果。有所不同的是,在选择 \opt{catcode} 后,只有^^A
\emph{显式的}\FSID 会被替换为\FSFW;但在选择 \opt{mapping} 后,
\emph{所有的}\FSID 都会被替换。例如,如果您用宏保存了一些含有^^A
\FSID 的文字,那么在选择 \opt{catcode} 时,其中的\FSID 不会被
替换为\FSFW。
选项 \kvopt{fullwidth-stop}{mapping} 只在 \XeTeX{} 下有效。使用
\LuaTeX{} 编译时,该选项相当于 \kvopt{fullwidth-stop}{catcode}。
如果您在选择 \kvopt{fullwidth-stop}{mapping} 后仍需要临时显示^^A
\FSID,可以按如下方法操作:
\begin{latexexample}[moretexcs={\CJKfontspec},emph={[1]Mapping}]
请使用 XeTeX 编译
外侧的花括号表示分组
这是一个句号{\CJKfontspec{(*\meta{字体名}*)}[Mapping=full-stop]。}
\end{latexexample}
\begin{function}{style/footnote-style}
% 这里奇怪的东西是用来控制对齐的。fdusyntax 会吃掉开头的几个
% 空格,因此这里用 X 来占位。
\begin{fdusyntax}[emph={[1]footnote-style}]
footnote-style = (*<plain|\\
XXXXXX\mbox{}~~~~~~~~~~~~~~~~~libertinus|libertinus*|libertinus-sans|\\
XXXXXX\mbox{}~~~~~~~~~~~~~~~~~pifont|pifont*|pifont-sans|pifont-sans*|\\
XXXXXX\mbox{}~~~~~~~~~~~~~~~~~xits|xits-sans|xits-sans*>*)
\end{fdusyntax}
设置脚注编号样式。西文字体设置会影响其默认取值(见
表~\ref{tab:footnote-font})。因此,要使得该选项生效,需将其
放置在 \opt{font} 选项之后。带有 |sans| 的为相应的无衬线字体
版本;带有 |*| 的为阴文样式(即黑底白字)。
\end{function}
\begin{table}[ht]
\caption{西文字体与脚注编号样式默认值的对应关系}
\label{tab:footnote-font}
\centering
\begin{tabular}{ccccc}
\toprule
\textbf{西文字体设置} &
|libertinus| & |lm| & |palatino| & |times| \\
\midrule
\textbf{脚注编号样式默认值} &
|libertinus| & |pifont| & |pifont| & |xits| \\
\bottomrule
\end{tabular}
\end{table}
\begin{function}[added=2017-08-13]{style/hyperlink}
\begin{fdusyntax}[emph={[1]hyperlink}]
hyperlink = (*<border|(color)|none>*)
\end{fdusyntax}
设置超链接样式。\opt{border} 表示在超链接四周绘制方框;
\opt{color} 表示用彩色显示超链接;\opt{none} 表示没有特殊装饰,
可用于生成最终的打印版文稿。
\end{function}
\begin{function}[added=2017-08-13,updated=2017-12-08]{style/hyperlink-color}
\begin{fdusyntax}[emph={[1]hyperlink-color}]
hyperlink-color = (*<(default)|classic|elegant|fantasy|material|\\
XXXXXX\mbox{}~~~~~~~~~~~~~~~~~~business|science|summer|autumn|graylevel|prl>*)
\end{fdusyntax}
设置超链接颜色。该选项在 \kvopt{hyperlink}{none} 时无效。
各选项所代表的颜色见表~\ref{tab:hyperlink-color}。
\end{function}
\begin{table}[ht]
\centering
\newcommand\linkcolorexam[3]{^^A
{\small 图~\textcolor[HTML]{#1}{1-2},
(\textcolor[HTML]{#1}{3.4})~式} &
{\small \textcolor[HTML]{#2}{\texttt{http://g.cn}}} &
{\small 文献~[\textcolor[HTML]{#3}{1}],
(\textcolor[HTML]{#3}{Knuth~1986})}}
\begin{threeparttable}
\caption{预定义的超链接颜色方案}
\label{tab:hyperlink-color}
\begin{tabular}{c*{3}{>{\hspace{0.2cm}}c<{\hspace{0.2cm}}}}
\toprule
\textsf{选项} & \textsf{链接} & \textsf{URL} & \textsf{引用} \\
\midrule
\opt{default} & \linkcolorexam{990000}{0000B2}{007F00} \\
\opt{classic} & \linkcolorexam{FF0000}{0000FF}{00FF00} \\
\opt{elegant}\tnote{a} & \linkcolorexam{961212}{C31818}{9B764F} \\
\opt{fantasy}\tnote{b} & \linkcolorexam{FF4A19}{FF3F94}{934BA1} \\
\opt{material}\tnote{c} & \linkcolorexam{E91E63}{009688}{4CAF50} \\
\opt{business}\tnote{d} & \linkcolorexam{D14542}{295497}{1F6E43} \\
\opt{science}\tnote{e} & \linkcolorexam{CA0619}{389F9D}{FF8920} \\
\opt{summer}\tnote{f} & \linkcolorexam{00AFAF}{5F5FAF}{5F8700} \\
\opt{autumn}\tnote{f} & \linkcolorexam{D70000}{D75F00}{AF8700} \\
\opt{graylevel}\tnote{c} & \linkcolorexam{616161}{616161}{616161} \\
\opt{prl}\tnote{g} & \linkcolorexam{2D3092}{2D3092}{2D3092} \\
\bottomrule
\end{tabular}
\begin{tablenotes}
\item[a] 来自 \href{https://tex.stackexchange.com/}^^A
{\TeX{} - \LaTeX{} Stack Exchange 网站}。
\item[b] Adobe CC 产品配色。
\item[c] 取自 Material 色彩方案
(见 \url{https://material.io/guidelines/style/color.html})。
\item[d] Microsoft Office 2016 产品配色。
\item[e] 来自 \href{https://www.wolfram.com/}{Wolfram Research 网站}。
\item[f] 均取自 Solarized 色彩方案
(见 \url{http://ethanschoonover.com/solarized})。
\item[g] \textit{Physical Review Letter} 杂志配色。
\end{tablenotes}
\end{threeparttable}
\end{table}
\begin{function}[added=2018-01-25]{style/bib-backend}
\begin{fdusyntax}[emph={[1]bib-backend}]
bib-backend = (*<bibtex|biblatex>*)
\end{fdusyntax}
选择参考文献的支持方式。选择 \opt{bibtex} 后,将使用 \BibTeX{}
处理文献,样式由 \pkg{natbib} 宏包负责;选择 \opt{biblatex} 后,
将使用 \biber{} 处理文献,样式则由 \pkg{biblatex} 宏包负责。
\end{function}
\begin{function}[added=2017-10-28,updated=2018-01-25]^^A
{style/bib-style}
\begin{fdusyntax}[emph={[1]bib-style}]
bib-style = (*<author-year|(numerical)|\meta{其他样式}>*)
\end{fdusyntax}
设置参考文献样式。\opt{author-year} 和 \opt{numerical} 分别对应
国家标准 GB/T 7714--2015 \scite{gb-t-7714-2015} 中的著者—出版年制
和顺序编码制。选择 \meta{其他样式} 时,如果 \kvopt{bib-backend}^^A
{bibtex},需保证相应的 \file{.bst} 格式文件能被调用;而如果
\kvopt{bib-backend}{biblatex},则需保证相应的 \file{.bbx} 格式文件
能被调用。
\end{function}
\begin{function}[added=2018-01-25]{style/cite-style}
\begin{fdusyntax}[emph={[1]cite-style}]
cite-style = (*\marg{引用样式}*)
\end{fdusyntax}
选择引用格式。默认为空,即与参考文献样式(著者—出版年制或顺序
编码制)保持一致。如果手动填写,需保证相应的 \file{.cbx} 格式文件
能被调用。该选项在 \kvopt{bib-backend}{bibtex} 时无效。
\end{function}
\begin{function}[added=2018-01-25]{style/bib-resource}
\begin{fdusyntax}[emph={[1]bib-resource}]
bib-resource = (*\marg{文件}*)
\end{fdusyntax}
参考文献数据源。可以是单个文件,也可以是用英文逗号隔开的一组文件。
如果 \kvopt{bib-backend}{biblatex},则必须明确给出 \file{.bib}
后缀名。
\end{function}
\begin{function}[added=2017-08-10]{style/logo}
\begin{fdusyntax}[emph={[1]logo}]
logo = (*\marg{文件}*)
\end{fdusyntax}
封面中校名图片的文件名。默认值为 \file{fudan-name.pdf}。
\end{function}
\begin{function}[added=2017-08-10]{style/logo-size}
\begin{fdusyntax}[emph={[1]logo-size}]
logo-size = (*\marg{宽度}*)
logo-size = {(*\meta{宽度}*), (*\meta{高度}*)}
\end{fdusyntax}
校名图片的大小。默认仅指定了宽度,为 |0.5\textwidth|\/。
如果仅需指定高度,可在 \meta{宽度} 处填入一个空的分组 |{}|。
\end{function}
\begin{function}[added=2017-07-06]{style/auto-make-cover}
\begin{fdusyntax}[emph={[1]auto-make-cover}]
auto-make-cover = (*<\TTF>*)
\end{fdusyntax}
是否自动生成论文封面(封一)、指导小组成员名单(封二)和
声明页(封三)。封面中的各项信息,可通过 \cs{fdusetup} 录入,
具体请参阅 \ref{subsubsec:信息录入}~节。
\end{function}
\begin{function}{\makecoveri,\makecoverii,\makecoveriii}
用于手动生成论文封面、指导小组成员名单和声明页。这几个命令不能
确保页码的正确编排,因此除非必要,您应当始终使用自动生成的封面。
\end{function}
\subsubsection{信息录入} \label{subsubsec:信息录入}
\begin{function}{info}
\begin{fdusyntax}[emph={[1]info}]
info = (*\marg{键值列表}*)
info/(*\meta{key}*) = (*\meta{value}*)
\end{fdusyntax}
该选项包含许多子项目,用于录入论文信息。具体内容见下。以下带“|*|”
的项目表示对应的英文字段。
\end{function}
\begin{function}[added=2018-02-01,updated=2019-03-12]{info/degree}
\begin{fdusyntax}[emph={[1]degree}]
degree = (*<(academic)|professional>*)
\end{fdusyntax}
学位类型,仅适用于博士和硕士学位论文。\opt{academic} 和 \opt{professional}
分别表示学术学位和专业学位。
\end{function}
\begin{function}{info/title,info/title*}
\begin{fdusyntax}[emph={[1]title,title*}]
title = (*\marg{中文标题}*)
title* = (*\marg{英文标题}*)
\end{fdusyntax}
论文标题。默认会在约 20 个汉字字宽处强制断行,但为了语义的
连贯以及排版的美观,如果您的标题长于一行,建议使用“|\\|”
手动断行。
\end{function}
\begin{function}{info/author,info/author*}
\begin{fdusyntax}[emph={[1]author,author*}]
author = (*\marg{姓名}*)
author* = (*\marg{英文姓名(或拼音)}*)
\end{fdusyntax}
作者姓名。
\end{function}
\begin{function}{info/supervisor}
\begin{fdusyntax}[emph={[1]supervisor}]
supervisor = (*\marg{姓名}*)
\end{fdusyntax}
导师姓名。
\end{function}
\begin{function}{info/department}
\begin{fdusyntax}[emph={[1]department}]
department = (*\marg{名称}*)
\end{fdusyntax}
院系名称。
\end{function}
\begin{function}{info/major}
\begin{fdusyntax}[emph={[1]major}]
major = (*\marg{名称}*)
\end{fdusyntax}
专业名称。
\end{function}
\begin{function}{info/student-id}
\begin{fdusyntax}[emph={[1]student-id}]
student-id = (*\marg{数字}*)
\end{fdusyntax}
作者学号。
\end{function}
复旦大学学号共 11 位,前两位为入学年份,之后一位为学生类型
代码(博士生为 1,硕士生为 2,本科生为 3),接下来的五位为
专业代码,最后三位为顺序号。
\begin{function}{info/school-id}
\begin{fdusyntax}[emph={[1]school-id}]
school-id = (*\marg{数字}*)
\end{fdusyntax}
学校代码。默认值为 10246(这是复旦大学的学校代码)。
\end{function}
\begin{function}{info/date}
\begin{fdusyntax}[emph={[1]date}]
date = (*\marg{日期}*)
\end{fdusyntax}
论文完成日期。默认值为文档编译日期(\tn{today})。
\end{function}
\begin{function}[added=2017-07-04]{info/secret-level}
\begin{fdusyntax}[emph={[1]secret-level}]
secret-level = (*<(none)|i|ii|iii>*)
\end{fdusyntax}
密级。\opt{i}、\opt{ii}、\opt{iii} 分别表示秘密、机密、绝密;
\opt{none} 表示论文不涉密,即不显示密级与保密年限。
\end{function}
\begin{function}[added=2017-07-04]{info/secret-year}
\begin{fdusyntax}[emph={[1]secret-year}]
secret-year = (*\marg{年限}*)
\end{fdusyntax}
保密年限。建议您使用中文,如“五年”。该选项在设置
\kvopt{secret-level}{none} 时无效。
\end{function}
\begin{function}{info/instructors}
\begin{fdusyntax}[emph={[1]instructors}]
instructors = (*\marg{成员 1, 成员 2, ...}*)
\end{fdusyntax}
指导小组成员。各成员之间需使用英文逗号隔开。为防止歧义,
可以用分组括号“|{...}|”把各成员字段括起来。
\end{function}
\begin{function}{info/keywords,info/keywords*}
\begin{fdusyntax}[emph={[1]keywords,keywords*}]
keywords = (*\marg{中文关键字}*)
keywords* = (*\marg{英文关键字}*)
\end{fdusyntax}
关键字列表。各关键字之间需使用英文逗号隔开。为防止歧义,
可以用分组括号“|{...}|”把各字段括起来。
\end{function}
\begin{function}{info/clc}
\begin{fdusyntax}[emph={[1]clc}]
clc = (*\marg{分类号}*)
\end{fdusyntax}
中图分类号(CLC)。
\end{function}
\subsection{正文编写}
\begin{quotation}
喬孟符(吉)博學多能,以樂府稱。嘗云:「作樂府亦有法,曰^^A
\CJKunderdot{鳳頭、豬肚、豹尾}六字是也。」大概起要美麗,中要浩蕩,
結要響亮。尤貴在首尾貫穿,意思清新。苟能若是,斯可以言樂府矣。
\end{quotation}
\hfill ——陶宗儀《南村輟耕錄·作今樂府法》
\subsubsection{凤头}
\begin{function}{\frontmatter}
声明前置部分开始。
\end{function}
在本模板中,前置部分包含目录、中英文摘要以及符号表等。
前置部分的页码采用小写罗马字母,并且与正文分开计数。
\begin{function}{\tableofcontents,\listoffigures,\listoftables}
生成目录。为了生成完整、正确的目录,您至少需要编译\emph{两次}。对于图表
较多的论文,也可以使用 \cs{listoffigures} 和 \cs{listoftables} 生成单独的
插图、表格目录。
\end{function}
% TODO: \DescribeEnv{abstract}
% TODO: \DescribeEnv{abstract*}
\begin{function}{abstract}
\begin{fdusyntax}[emph={[2]abstract}]
中文论文模板 (fduthesis) 英文论文模板 (fduthesis-en)
\begin{abstract} \begin{abstract}
(*\meta{中文摘要} \hspace{3.52cm} \meta{英文摘要}*)
\end{abstract} \end{abstract}
\end{fdusyntax}
\end{function}
\begin{function}[rEXP]{abstract*}
\begin{fdusyntax}[emph={[2]abstract*}]
中文论文模板 (fduthesis)
\begin{abstract*}
(*\meta{英文摘要}*)
\end{abstract*}
\end{fdusyntax}
摘要。中文模板中,不带星号和带星号的版本分别用来输入中文摘要
和英文摘要;英文模板中没有带星号的版本,您只需输入英文摘要。
\end{function}
摘要的最后,会显示关键字列表以及中图分类号(CLC)。
这两项可通过 \cs{fdusetup} 录入,具体
请参阅 \ref{subsubsec:信息录入}~节。
% TODO: \DescribeEnv{notation}
\begin{function}{notation}
\begin{fdusyntax}[emph={[2]notation}]
\begin{notation}(*\oarg{列格式说明}*)
(*\meta{符号 1}*) & (*\meta{说明}*) \\
(*\meta{符号 2}*) & (*\meta{说明}*) \\
(*\phantom{\meta{符号 $n$}}*) (*$\vdots$*)
(*\meta{符号\ \kern-0.1em$n$}*) & (*\meta{说明}*)
\end{notation}
\end{fdusyntax}
符号表。可选参数 \meta{列格式说明}与 \LaTeX{} 中标准表格的列格
式说明语法一致,默认值为“|lp{7.5cm}|”,即第一列宽度自动调整,
第二列限宽 \SI{7.5}{cm},两列均为左对齐。
\end{function}
\subsubsection{猪肚}
\begin{function}{\mainmatter}
声明主体部分开始。
\end{function}
主体部分是论文的核心,您可以分章节撰写。如有需求,也可以采用
多文件编译的方式。主体部分的页码采用阿拉伯数字。
\begin{function}[updated=2018-01-15]{\footnote}
\begin{fdusyntax}[deletetexcs={\footnote},
morekeywords={\footnote}]
\footnote(*\marg{脚注文字}*)
\end{fdusyntax}
插入脚注。脚注编号样式可利用 \opt{style/footnote-style} 选项控制,
具体见 \ref{subsubsec:论文格式}~小节。
\end{function}
% TODO: \DescribeEnv{proof}
\begin{function}{axiom,corollary,definition,example,lemma,
proof,theorem}
\begin{fdusyntax}[emph={[2]proof}]
\begin{proof}(*\oarg{小标题}*)
(*\meta{证明过程}*)
\end{proof}
\end{fdusyntax}
一系列预定义的数学环境。具体含义见表~\ref{tab:theorem}。
\end{function}
\begin{table}[ht]
\caption{预定义的数学环境} \label{tab:theorem}
\centering
\begin{tabular}{cccccccc}
\toprule
\textbf{名称} &
\env{axiom} & \env{corollary} & \env{definition} &
\env{example} & \env{lemma} & \env{proof} &
\env{theorem} \\
\midrule
\textbf{含义} &
公理 & 推论 & 定义 & 例 & 引理 & 证明 & 定理 \\
\bottomrule
\end{tabular}
\end{table}
证明环境(\env{proof})的最后会添加证毕符号“$\QED$”。要确保
该符号在正确的位置显示,您需要按照 \ref{subsec:编译方式}~节
中的有关说明编译\emph{两次}。
\begin{function}[updated=2017-12-12]{\newtheorem}
\begin{fdusyntax}[deletetexcs={\newtheorem},
morekeywords={\newtheorem,\newtheorem*}]
\newtheorem(*\oarg{选项}\marg{环境名}\marg{标题}*)
\newtheorem*(*\oarg{选项}\marg{环境名}\marg{标题}*)
\begin(*\marg{环境名}\oarg{小标题}*)
(*\meta{内容}*)
\end(*\marg{环境名}*)
\end{fdusyntax}
声明新的定理类环境(数学环境)。带星号的版本表示不进行编号,
并且会默认添加证毕符号“$\QED$”。声明后,即可同预定义的数学环境
一样使用。
\end{function}
事实上,表~\ref{tab:theorem} 中预定义的环境正是通过以下方式定义的:
\begin{latexexample}[deletetexcs={\newtheorem},
morekeywords={\newtheorem,\newtheorem*}]
\newtheorem*{proof}{证明}
\newtheorem{axiom}{公理}
\newtheorem{corollary}{定理}
...
\end{latexexample}
与 \cs{fdusetup} 相同,\cs{newtheorem} 的可选参数 \meta{选项}
也为一组键值列表。可用的选项见下。注意您无需输入“|theorem/|”。
\begin{function}{theorem/style}
\begin{fdusyntax}[emph={[1]style}]
style = (*<(plain)|margin|change|\\
XXXXXX\mbox{}~~~~~~~~break|marginbreak|changebreak>*)
\end{fdusyntax}
定理类环境的总体样式。
\end{function}
\begin{function}{theorem/header-font}
\begin{fdusyntax}[emph={[1]header-font}]
header-font = (*\marg{字体}*)
\end{fdusyntax}
定理头(即标题)的字体。中文模板默认为 \tn{sffamily},即无衬线体
(黑体);英文模板默认为 |\bfseries\upshape|,即加粗直立体。
\end{function}
\begin{function}{theorem/body-font}
\begin{fdusyntax}[emph={[1]body-font}]
body-font = (*\marg{字体}*)
\end{fdusyntax}
定理内容的字体。中文模板默认为 \tn{fdu@kai},即楷体;英文模板
默认为 \tn{itshape},即斜体。
\end{function}
\begin{function}{theorem/qed}
\begin{fdusyntax}[emph={[1]qed}]
qed = (*\marg{符号}*)
\end{fdusyntax}
定理结束标记(即证毕符号)。如果用 \cs{newtheorem} 声明定理,
则默认为空;用 \cs{newtheorem*} 声明,则默认为
|\ensuremath{\QED}|,即“$\QED$”。
\end{function}
\begin{function}{theorem/counter}
\begin{fdusyntax}[emph={[1]counter}]
counter = (*\marg{计数器}*)
\end{fdusyntax}
定理计数器,表示定理编号在 \meta{计数器} 的下一级,并会随
\meta{计数器} 的变化而清零。\scite{刘海洋2013latex入门}
默认为 |chapter|,表示按章编号。使用 \cs{newtheorem*} 时,
该选项无效。
\end{function}
\begin{function}{\caption}
\begin{fdusyntax}[deletetexcs={\caption},morekeywords={\caption}]
\caption(*\marg{图表标题}*)
\caption(*\oarg{短标题}\marg{长标题}*)
\end{fdusyntax}
插入图表标题。可选参数 \meta{短标题} 用于图表目录。在
\meta{长标题} 中,您可以进行长达多段的叙述;但 \meta{短标题}
和单独的 \meta{图表标题} 中则不允许分段。
\scite{刘海洋2013latex入门}
\end{function}
按照排版惯例,建议您将表格的标题放置在绘制表格的命令之前,
而将图片的标题放置在绘图或插图的命令之后。另需注意,
\tn{caption} 命令必须放置在浮动体环境(如 \env{table} 和
\env{figure})中。
\subsubsection{豹尾}
\begin{function}{\backmatter}
声明后置部分开始。
\end{function}
后置部分包含参考文献、声明页等。
\begin{function}[updated=2018-01-25]{\printbibliography}
\begin{fdusyntax}[morekeywords={\printbibliography}]
\printbibliography(*\oarg{选项}*)
\end{fdusyntax}
打印参考文献列表。如果 \kvopt{bib-backend}{bibtex},则 \meta{选项}
无效,相当于 \tn{bibliography} \texttt{\marg{文献数据库}},其中的
\meta{文献数据库} 可利用 \opt{style/bib-resource} 选项指定,具体见
\ref{subsubsec:论文格式}~小节;而如果 \kvopt{bib-backend}^^A
{biblatex},则该命令由 \pkg{biblatex} 宏包直接提供,可用选项请
参阅其文档 \cite{biblatex}。
\end{function}
\section{宏包依赖情况}