-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathsysuthesis.dtx
More file actions
3839 lines (3831 loc) · 279 KB
/
sysuthesis.dtx
File metadata and controls
3839 lines (3831 loc) · 279 KB
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 2024 - 2026 Renier Tan <[email protected]>
%
% 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
% https://www.latex-project.org/lppl.txt
% and version 1.3c or later is part of all distributions of LaTeX
% version 2008 or later.
%
% This work has the LPPL maintenance status `maintained'.
%
% The Current Maintainer of this work is Renier Tan.
%
% This work consists of the files sysuthesis.dtx,
% and the derived files sysuthesis.ins,
% sysuthesis.cls,
% sysuvisual.sty,
% sysuthesis.pdf
% and README.md.
%
%<*internal>
\begingroup
\def\NameOfLaTeXe{LaTeX2e}
\expandafter\endgroup\ifx\NameOfLaTeXe\fmtname\else
\csname fi\endcsname
%</internal>
%
%<*install>
\input docstrip.tex
\keepsilent
\askforoverwritefalse
\preamble
Copyright (C) 2024 - 2026 by Renier Tan <[email protected]>
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
https://www.latex-project.org/lppl.txt
and version 1.3c or later is part of all distributions of LaTeX
version 2008 or later.
To produce the documentation run the original source files ending with
`.dtx' through XeTeX.
\endpreamble
\generate{
\usedir{tex/latex/sysuthesis}
\file{\jobname.cls} {\from{\jobname.dtx}{class}}
\file{sysuvisual.sty} {\from{\jobname.dtx}{visual}}
%<*internal>
\usedir{source/latex/sysuthesis}
\file{\jobname.ins} {\from{\jobname.dtx}{install}}
%</internal>
}
\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/sysuthesis *}
\Msg{* *}
\Msg{* sysuthesis.cls *}
\Msg{* sysuvisual.sty *}
\Msg{* sysuthesis.ins *}
\Msg{* *}
\Msg{* To produce the documentation, run the file sysuthesis.dtx *}
\Msg{* through XeLaTeX. *}
\Msg{* *}
\Msg{* Happy TeXing! *}
\Msg{* *}
\Msg{*************************************************************}
\endbatchfile
%</install>
%
%<*internal>
\fi
%</internal>
%
%<class|visual>\NeedsTeXFormat{LaTeX2e}
%<*!(driver|install)>
%<!driver> \GetIdInfo $Id: sysuthesis.dtx 1.0.0 2026-02-06 12:00:00 +0800 Renier Tan <[email protected]> $
%<class> {Thesis template for Sun Yat-sen University}
%<class>\ProvidesExplClass{sysuthesis}
%<visual> {Sun Yat-sen University's visual elements}
%<visual>\ProvidesExplPackage{sysuvisual}
%<!driver> {\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription}
%</!(driver|install)>
%
%<*driver>
\PassOptionsToPackage{svgnames}{xcolor}
\PassOptionsToPackage{olddefault}{fontsetup}
\documentclass{l3doc}
\usepackage[
scheme=chinese,
fontset=fandol,
linespread=1.2
]{ctex}
\usepackage{
fontsetup,
amsmath,
siunitx,
tabularray,
hvlogos,
listings,
gbt7714,
xcolor,
hyperref
}
\UseTblrLibrary{booktabs}
\bibliographystyle{gbt7714-numerical}
\def\tableautorefname{表}
\def\figureautorefname{图}
\lstnewenvironment{latexexample}{
\lstset{
basicstyle=\ttfamily\small,
language=[LaTeX]TeX,
gobble=4,
backgroundcolor=\color{AliceBlue!70!white}
}
}{}
\lstnewenvironment{bashexample}{
\lstset{
basicstyle=\ttfamily\small,
language=bash,
gobble=4,
backgroundcolor=\color{Beige!50!white}
}
}{}
\ExplSyntaxOn
\cs_new_protected:Npn \__syntax_bar:
{ \textup { \textbar } }
\cs_new_protected:Npn \__syntax_opt:n #1
{ \textsl { #1 } }
\cs_new_protected:Npn \__syntax_def:n #1
{ \textbf { \textup { #1 } } }
\cs_new_protected:Npn \__syntax_opt_aux:n #1>
{ \__syntax_opt:n { \ensuremath { \langle } #1 \ensuremath { \rangle } } }
\cs_new_protected:Npn \__syntax_def_aux:n #1)
{ \__syntax_def:n { #1 } }
\hook_gput_code:nnn { env / syntax / begin } { . }
{
\cs_set:Npn \lparen { \textup { ( } }
\cs_set:Npn \rparen { \textup { ) } }
\char_set_catcode_active:N \|
\char_set_catcode_active:N <
\char_set_catcode_active:N \(
\char_set_active_eq:NN \| \__syntax_bar:
\char_set_active_eq:NN < \__syntax_opt_aux:n
\char_set_active_eq:NN \( \__syntax_def_aux:n
}
\ExplSyntaxOff
\begin{document}
\RecordChanges
\DocInput{sysuthesis.dtx}
\newpage
\PrintChanges
\newpage
\PrintIndex
\end{document}
%</driver>
% \fi
%
% \title{\heiti 中山大学学位论文模板}
% \author{Renier Tan}
% \date{2026/02/06\quad v1.0.0}
%
% \changes{v0.1.0}{2025/04/30}{进行模板编写。}
% \changes{v1.1.0}{2026/04/10}{将不能完全展开的函数声明为 protected。}
%
% \maketitle
%
% \begin{documentation}
%
% \section{介绍}
%
% \subsection{模板介绍}
%
% \cls{sysuthesis} 是中山大学学位论文 \LaTeX 模板,用于排版本科生、研究生学位论文。
% 格式分别遵循《中山大学本科生毕业论文(设计)写作与印制规范》和《中山大学研究生学位论文格式要求》。
%
% \subsection{历史模板}
%
% 编写之初,可供参考的校内 \LaTeX{} 论文模板有:
% \begin{itemize}
% \item 黄俊杰和陈冠英的 sysuthesis \cite{sysugitlab2021}
% \item 中山大学超算队的 sysu-thesis \cite{SYSUSCC2025}
% \item \href{https://github.com/1FCENdoge}{@1FCENDOGE} 的 sysuthesis \cite{1FCENdoge2025}
% \item \href{https://github.com/DapengFeng}{@DapengFeng} 的 sysuthesis \cite{DapengFeng2025}
% \item \href{https://github.com/yanghw8}{@yanghw8} 的 sysuthesis-unofficial \cite{Yang2025}
% \end{itemize}
% 鉴于上述模板或年久失修,或仅针对特定学位设计,本项目在参考其实现以及 \cls{fduthesis}\cite{Zeng2025}、\cls{njuthesis}\cite{njulug2025} 等优秀模板的基础上,利用 \LaTeX3 语法重构,旨在提供一个统一、简洁、易用的解决方案。
%
% \subsection{快速上手}
%
% 若需了解 \LaTeX{} 排版基础,请阅读 \textit{lshort-zh-cn}\cite{Oetiker2024} 或《\LaTeX{} 入门》\cite{刘2013}。
%
% \subsection{关于本说明手册}
%
% 本模板使用 \textsc{DocStrip} 进行维护,源文件 \file{sysuthesis.dtx} 包含了模板的全部信息。其前半部分为使用说明,后半部分为带有详细注释的代码实现。
%
% 本手册采用不同字体区分不同内容:无衬线字体表示宏包(如 \pkg{xeCJK})和文档类(如 \cls{sysuthesis});等宽字体表示代码或文件(如 \cs{sysusetup} 命令、\env{abstract} 环境、\file{thesis.tex} 文件);楷体(或西文斜体)表示命令参数(如 \meta{模板选项}、\meta{English title})。使用时无需输入参数两侧的尖括号。
%
% \subsection{文件构成}
%
% 本模板的文件构成如\autoref{tab-sysuthesis-files} 所示。
%
% \begin{table}
% \centering
% \begin{talltblr}[
% caption = {\cls{sysuthesis} 文件构成},
% label = {tab-sysuthesis-files},
% note{a} = {仅供开发使用,不会出现在发布版本中。}
% ] { row{1} = {font=\bfseries}, colspec = {ll} }
% \toprule
% 名称 & 说明 \\
% \midrule
% \file{LICENSE} & 许可证文件 \\
% \file{sysuthesis.cls} & 文档类文件 \\
% \file{sysuthesis.dtx}\TblrNote{a} & 模板源代码 \\
% \file{sysuthesis.ins}\TblrNote{a} & 模板安装脚本 \\
% \file{sysuthesis.pdf} & 用户手册(即本文档) \\
% \file{sysuthesis-sample.bib} & 参考文献示例数据库 \\
% \file{sysuthesis-sample.tex} & 示例文档,可作撰写论文的基础 \\
% \file{sysu-emblem.pdf} & 校徽矢量图 \\
% \file{sysu-name-cn.pdf} & 中文校名矢量图 \\
% \file{README.md} & 项目自述文件 \\
% \bottomrule
% \end{talltblr}
% \end{table}
%
% \subsection{安装}
%
% \subsubsection{CTAN}
%
% 本模板已发布至 CTAN,通常随 \TeX{} 发行版自动安装,无需手动操作。若未安装,请使用发行版的宏包管理器安装 \cls{sysuthesis}。例如,在 \TeX{} Live 中执行(可能需要管理员权限):
% \begin{bashexample}
% tlmgr install sysuthesis
% \end{bashexample}
%
% \subsubsection{GitHub 仓库}
%
% 若需使用最新开发版,可从本项目的 \href{https://github.com/irenier/sysuthesis}{GitHub 仓库} 克隆。克隆后,在项目根目录执行以下命令完成安装:
% \begin{bashexample}
% l3build install
% \end{bashexample}
%
% \subsubsection{GitHub Releases}
%
% 模板不定期打包正式发行版,发布于 \href{https://github.com/irenier/sysuthesis/releases/latest}{GitHub Releases}。可供下载的文件主要有:
% \begin{description}
% \item[\file{sysuthesis-user-v*.zip}] 用户模板包,包含编译论文所需的所有文件。解压后可用于本地编译,或直接上传至在线平台。
% \item[\file{sysuthesis-ctan-v*.zip}] CTAN 发布包,普通用户无需关心。
% \end{description}
%
% \subsection{编译}
%
% \subsubsection{四步编译}
%
% 假设主文档为 \file{thesis.tex},使用 \XeLaTeX{} 编译时,请在命令行中依次执行:
% \begin{bashexample}
% xelatex thesis
% bibtex thesis
% xelatex thesis
% xelatex thesis
% \end{bashexample}
%
% 使用 \LuaLaTeX{} 编译时,请在命令行中依次执行:
% \begin{bashexample}
% lualatex thesis
% bibtex thesis
% lualatex thesis
% lualatex thesis
% \end{bashexample}
%
% \subsubsection{\pkg{latexmk} 编译}
%
% 推荐使用 \pkg{latexmk} 实现自动编译,命令如下:
% \begin{bashexample}
% latexmk -xelatex thesis
% \end{bashexample}
% 或者
% \begin{bashexample}
% latexmk -lualatex thesis
% \end{bashexample}
%
% \subsubsection{在线编译}
%
% 本模板已上传 \href{https://www.overleaf.com/latex/templates/sysuthesis/sghrrhbdvjbd}{Overleaf} 和 \href{https://www.texpage.com/zh/template/88eb11aa-bd5c-4b6b-b654-86517c5148a1/}{TeXPage} 平台,打开链接即可在线使用。
%
% \section{使用说明}
%
% \subsection{基本用法}
%
% 以下是一个使用本模板的最小示例:
%
% \begin{latexexample}
% \documentclass{sysuthesis}
% \sysusetup[option]{type=bachelor}
% \begin{document}
% \maketitle
% \frontmatter
% \begin{abstract}
% 中文摘要。
% \end{abstract}
% \begin{abstract*}
% abstract.
% \end{abstract*}
% \tableofcontents
% \mainmatter
% \chapter{欢迎}
% 欢迎使用 \LaTeX{}!
% \appendix
% \end{document}
% \end{latexexample}
%
% 编译上述代码将生成一份空白的本科生论文框架。下文将介绍如何填充具体内容。
%
% \subsection{模板选项}
%
% 模板选项在 \tn{documentclass} 的可选参数中指定,位于 \tn{documentclass} 后的方括号内,用于控制全局样式。下文列出了可用选项,其中加粗的为默认值。
%
% \subsubsection{学位信息}
% \begin{function}[added=2025-04-30]{type}
% \begin{syntax}
% type = <(bachelor)|master|doctor>
% \end{syntax}
% 设置学位论文类型,决定模板整体格式。可选值为学士 (\texttt{bachelor})、硕士 (\texttt{master}) 和博士 (\texttt{doctor})。此选项也可在 \cs{sysusetup}|[option]| 中设置。
% \end{function}
%
% \subsubsection{页面模式}
%
% \begin{function}[added=2025-04-30]{oneside, twoside}
% \begin{syntax}
% <(oneside)|twoside>
% \end{syntax}
% 指定单面或双面模式。本选项为全局选项,继承自 \cls{book} 类。双面模式下,新章节(如 \tn{chapter})和特殊页面将始于奇数页,必要时会自动添加空白页,适合打印。单面模式则无此行为。
% \end{function}
%
% \begin{function}[added=2025-04-30]{draft}
% \begin{syntax}
% <draft>
% \end{syntax}
% 切换草稿模式,默认关闭。
% \end{function}
%
% 本选项为全局选项,继承自 \cls{book} 类。启用后效果如下:
% \begin{itemize}
% \item 不生成封面
% \item 显示版心、页眉页脚边框
% \item 在过宽行的右侧添加黑色方块标记
% \item 图片仅显示为含路径的占位框
% \item 不生成超链接
% \end{itemize}
%
% \begin{function}[added=2025-11-25]{anonymous}
% \begin{syntax}
% <anonymous>
% \end{syntax}
% 切换盲审(匿名)模式,默认关闭。开启时与师生身份相关的字段(作者姓名、导师姓名、学号)将不会被设置,
% 并且将去除封面、扉页、学术诚信声明和致谢页。
% \end{function}
%
% \subsubsection{配置文件}
%
% \begin{function}[added=2025-04-30]{config}
% \begin{syntax}
% config = \Arg{文件}
% \end{syntax}
% 指定并加载额外的用户配置文件。该文件可使用 \LaTeX3 语法。
% \end{function}
%
% \subsection{设置接口}
%
% \begin{function}[added=2025-04-30]{\sysusetup}
% \begin{syntax}
% \cs{sysusetup}\oarg{键路径}\marg{设置项}
% \end{syntax}
% 本模板的通用设置命令,用于各类自定义设置。
% \end{function}
%
% 当可选参数 \oarg{键路径} 留空时,在必选参数 \marg{设置项} 中以“键 = 值”的形式提供一组或多组设置,并以英文逗号分隔。
%
% \begin{latexexample}
% \sysusetup
% {
% info/title = {标题},
% info/author = {作者}
% }
% \end{latexexample}
%
% 也可以写为:
%
% \begin{latexexample}
% \sysusetup
% {
% info =
% {
% title = {标题},
% author = {作者}
% }
% }
% \end{latexexample}
%
% 当 \oarg{键路径} 为模块名时,可在 \marg{设置项} 中设置该模块下的多个选项。
%
% \begin{latexexample}
% \sysusetup[info]
% {
% title = {标题},
% author = {作者}
% }
% \end{latexexample}
%
% 当 \oarg{键路径} 为具体的选项路径时,在 \marg{设置项} 中直接提供其值。
%
% \begin{latexexample}
% \sysusetup[info/title]{标题}
% \sysusetup[info/author]{作者}
% \end{latexexample}
%
% \section{设置个人信息}
%
% \subsection{示例}
%
% \begin{latexexample}
% \sysusetup[info]
% {
% title = {标题第一行\\ 标题第二行},
% title* = {first line\\ second line},
% keywords = {中山大学, 论文模版, 本科生, 研究生},
% keywords* = {SYSU, template, undergraduate, graduate},
% student-id = {00000000},
% author = {作者名},
% author* = {XXX},
% department = {数学学院},
% department* = {Department of Mathematics},
% major = {数学与应用数学},
% major* = {Mathematics and Applied Mathematics},
% supervisors = {XXX~教授, XXX~教授},
% supervisors* = {Prof.~XXX, Prof.~XXX},
% date = {2025/05/31}, % 默认为编译当天
% secret-level = {公开}, % 仅研究生
% thesis-code = {00000000} % 仅研究生
% }
% \end{latexexample}
%
% \subsection{具体设置}
%
% |info| 类选项用于设置论文的元信息(如标题、作者等)。带星号的键名为对应的英文信息。
%
% \begin{function}[added=2025-04-30]{info/title, info/title*}
% \begin{syntax}
% title = \Arg{标题}
% title* = \Arg{英文标题}
% \end{syntax}
% 论文题目。可使用 |\\| 换行。
% \end{function}
%
% \begin{function}[added=2025-04-30]{info/author, info/author*}
% \begin{syntax}
% author = \Arg{姓名}
% author* = \Arg{英文姓名}
% \end{syntax}
% 作者姓名。
% \end{function}
%
% \begin{function}[added=2025-04-30]{info/date}
% \begin{syntax}
% date = \Arg{yyyy/mm/dd}
% \end{syntax}
% 封面日期,格式为 |yyyy/mm/dd|。
% \end{function}
%
% \begin{function}[added=2025-04-30]{info/department, info/department*}
% \begin{syntax}
% department = \Arg{学院}
% department* = \Arg{学院英文}
% \end{syntax}
% 作者所属院系。
% \end{function}
%
% \begin{function}[added=2025-04-30]{info/major, info/major*}
% \begin{syntax}
% major = \Arg{专业}
% major* = \Arg{专业英文}
% \end{syntax}
% 作者专业。
% \end{function}
%
% \begin{function}[added=2025-04-30]{info/supervisors, info/supervisors*}
% \begin{syntax}
% supervisors = \Arg{导师}
% supervisors* = \Arg{导师英文}
% \end{syntax}
% 指导教师。多位教师请用英文逗号分隔。
% \end{function}
%
% \begin{function}[added=2025-04-30]{info/keywords, info/keywords*}
% \begin{syntax}
% keywords = \Arg{关键词}
% keywords* = \Arg{关键词英文}
% \end{syntax}
% 摘要关键词。多个关键词请用英文逗号分隔。
% \end{function}
%
% \begin{function}[added=2025-04-30]{info/student-id}
% \begin{syntax}
% student-id = \Arg{学号}
% \end{syntax}
% 作者学号。
% \end{function}
%
% \begin{function}[added=2025-04-30]{info/secret-level}
% \begin{syntax}
% secret-level = \Arg{密级}
% \end{syntax}
% 论文密级(仅研究生)。
% \end{function}
%
% \begin{function}[added=2025-04-30]{info/thesis-code}
% \begin{syntax}
% thesis-code = \Arg{论文编号}
% \end{syntax}
% 论文编号(仅研究生)。
% \end{function}
%
% \section{设置样式}
%
% \subsection{中文字体}
%
% 因学校规定英文字体为 Times New Roman,故仅提供中文字体和数学字体的设置选项。
%
% \begin{function}[added=2025-04-30, updated=2025-11-26]{style/cjk-font}
% \begin{syntax}
% cjk-font = <adobe|fandol|founder|mac|macnew|macold|ubuntu|windows|none>
% \end{syntax}
% 指定中文字体族,默认按操作系统设置。推荐使用 |windows|, |founder| 或 |ubuntu|。
% 建议 macOS 用户使用 |macnew|。
% \end{function}
%
% \begin{description}
% \item[adobe] 调用 Adobe 公司的四款中文字体。
% \item[fandol] 调用 Fandol 中文字体。
% \item[founder] 调用方正公司的中文字体。
% \item[mac] 调用 macOS 系统字体,根据版本分为 |macnew| 和 |macold|。
% \item[macnew] 调用 El Capitan 或更新版本的多字重华文和苹方字体。
% \item[macold] 调用 Yosemite 或更早版本的华文字体。
% \item[ubuntu] 调用 Ubuntu 系统下的思源宋体、思源黑体和文鼎楷体。
% \item[windows] 调用 Windows 系统下的中易字体和微软雅黑字体。
% \item[none] 不配置中文字体,需要用户自己配置,并且需要提供 \cs{songti} 和 \cs{heiti} 命令。
% \end{description}
%
% \subsection{数学字体}
%
% \begin{function}[added=2025-04-30, updated=2026-01-08]{style/math-font}
% \begin{syntax}
% math-font = <asana|bonum|cambria|concrete|dejavu|erewhon|euler|garamond|
% gfsneohellenic|ibmplex|kp|libertinus|lm|newcm|oldstandard|
% pagella|schola|stix|stix2|termes|xcharter|(xits)|none>
% \end{syntax}
% 指定数学字体,默认为 |xits|。推荐使用 |xits|, |newcm|, |stix2|。
% \end{function}
%
% \subsection{元素颜色}
%
% \begin{function}[added=2025-07-06]{sytle/color}
% \begin{syntax}
% color = \Arg{颜色名称}
% \end{syntax}
% 指定全局的元素颜色,默认为 |sysugreen|。本模板预定义了 |sysugreen| 和 |sysured| 两种颜色,
% 并且可以使用 \pkg{xcolor} 宏包中 |svgnames| 定义的颜色。
% \end{function}
%
% \subsection{封面图片}
%
% \begin{function}[added=2025-04-30]{style/logo-path}
% \begin{syntax}
% logo-path = \Arg{图片路径}
% \end{syntax}
% 设置封面图片路径。本科生默认为 \file{sysu-emblem.pdf},研究生默认为 \file{sysu-name-cn.pdf}。
% 图片文件应置于主文档同级目录,或 \file{figures}, \file{images}, \file{logos}, \file{pictures} 子目录中。
% 如果未找到指定图片,将添加视觉元素宏包 \pkg{sysuvisual},使用 \pkg{tikz} 绘图,可能延长编译时间。
% \end{function}
%
% \subsection{\pkg{unicode-math} 选项设置}
%
% \begin{function}[added=2025-04-30]{unicode-math}
% \begin{syntax}
% math-style = <(ISO)|TeX|french|upright|literal>
% bold-style = <(ISO)|TeX|upright>
% sans-style = <upright|(italic)>
% nabla = <(upright)|italic>
% partial = <upright|(italic)>
% \end{syntax}
% 配置 \pkg{unicode-math} 宏包选项,具体含义请参考其官方手册\cite{Robertson2023}。
% \end{function}
%
% \section{特殊页面}
%
% \subsection{封面与扉页}
%
% \begin{function}[added=2025-04-30, updated=2025-09-30]{\maketitle}
% \begin{syntax}
% \tn{maketitle}\oarg{页面}
% \end{syntax}
% 生成封面、扉页和声明页。默认生成全部页面,也可在可选参数中指定生成特定页面,
% 可选值为 |cover|、|titlepage|、|declaration|。
% 例如可使用命令 \tn{maketitle}|[cover, declaration]|。
% \end{function}
%
% \subsection{摘要页}
%
% \DescribeEnv{abstract}
% \DescribeEnv{abstract*}
% 用于排版中、英文摘要。星号版环境 \env{abstract*} 用于排版英文摘要。
%
% \begin{latexexample}
% \begin{abstract}
% 中文摘要。
% \end{abstract}
% \begin{abstract*}
% Abstract.
% \end{abstract*}
% \end{latexexample}
%
% \subsection{目录页}
%
% \begin{function}[added=2025-04-30]{\tableofcontents, \listoffigures, \listoftables}
% 分别生成正文目录、插图目录和表格目录。
% \end{function}
%
% \subsection{致谢页}
%
% \DescribeEnv{acknowledgements}
% 用于排版致谢内容。
%
% \begin{latexexample}
% \begin{acknowledgements}
% 致谢内容。
% \end{acknowledgements}
% \end{latexexample}
%
% \section{参考文献}
%
% 参考文献排版可选用基于 \BibTeX{} 的 \pkg{gbt7714} 宏包\cite{Lee2025},或基于 \BibLaTeX{} 的 \pkg{biblatex-gb7714-2015} 宏包\cite{胡2025}。
%
% \begin{function}[added=2025-04-30]{bib/backend}
% \begin{syntax}
% backend = <bibtex|biblatex>
% \end{syntax}
% 选择参考文献处理后端。
% \end{function}
%
% \begin{function}[added=2025-04-30]{bib/style}
% \begin{syntax}
% style = <gbt7714-numerical|gbt7714-author-year> 使用 bibtex
% style = <gb7714-2015|gb7714-2015ay> 使用 biblatex
% \end{syntax}
% 指定参考文献著录格式。
% \end{function}
%
% \begin{function}[added=2025-04-30]{bib/option}
% \begin{syntax}
% option = \Arg{键值对}
% \end{syntax}
% 设置 \pkg{biblatex} 宏包的额外选项。更多选项请参阅 \pkg{biblatex-gb7714-2015}\cite{胡2025} 及 \pkg{biblatex}\cite{Kime2024} 的宏包手册。例如 |option = {url = false, doi = false}|。
% \end{function}
%
% \begin{function}[added=2025-04-30]{bib/resource}
% \begin{syntax}
% resource = \Arg{文件名}
% \end{syntax}
% 指定参考文献数据库文件。使用 \BibTeX{} 后端时无需写后缀名,例如 |resource = {ref1, ref2}|;
% 使用 \BibLaTeX{} 后端时需要写后缀名,例如 |resource = {ref1.bib, ref2.bib}|。
% \end{function}
%
% \subsection{示例}
%
% 使用 \BibTeX{} 的示例如下:
% \begin{latexexample}
% \sysusetup[bib]
% {
% backend = bibtex,
% style = gbt7714-numerical,
% resource = reference
% }
% \end{latexexample}
%
% 使用 \BibLaTeX{} 的示例如下:
% \begin{latexexample}
% \sysusetup[bib]
% {
% backend = biblatex,
% style = gb7714-2015,
% resource = reference.bib
% }
% \end{latexexample}
%
% \section{定理环境}
%
% 本模板兼容 \pkg{thmtools} 和 \pkg{keytheorems} 宏包,用户可在导言区自行引入其一以使用定理类环境。
%
% 模板预定义了 \env{theorem}, \env{definition}, \env{example}, \env{remark}, \env{lemma}, \env{proposition}, \env{corollary}, \env{assumption}, \env{proof} 常用定理类环境。
% 其中,定理、引理、命题、推论、假设共享一套计数器;定义、示例、注记各自独立编号。
%
% \section{视觉形象元素}
%
% 使用 \pkg{tikz} 绘制中山大学视觉形象元素。
%
% \begin{function}[added=2025-04-30]{\sysudraw}
% \begin{syntax}
% \cs{sysudraw}\marg{元素}\oarg{布局}\oarg{尺寸}\oarg{颜色}\oarg{其他参数}
% \end{syntax}
% 绘制视觉形象元素。
% \begin{arguments}
% \item 元素: badge, name-cn, name-en, name, badge-name
% \item 布局: \textbf{landscape}, portrait, landscape-lr, landscape-rl
% \item 尺寸: \textbf{3cm}, 12pt, \dots
% \item 颜色: \textbf{sysugreen}, sysured, anngreen, annred, anngold
% \item 其他参数 (可选)
% \end{arguments}
% \end{function}
%
% \subsection{示例}
%
% \begin{latexexample}
% \sysudraw{badge}
% \sysudraw{name-cn}
% \sysudraw{name-cn}[portrait]
% \sysudraw{name-en}
% \sysudraw{name-en}[portrait]
% \sysudraw{name}
% \sysudraw{name}[portrait]
% \sysudraw{badge-name}
% \sysudraw{badge-name}[portrait]
% \sysudraw{badge-name}[landscape-lr]
% \sysudraw{badge-name}[landscape-rl]
% \sysudraw{name-cn}[landscape][2.5cm][white][draw=sysugreen, line width=1pt]
% \end{latexexample}
%
% \begin{thebibliography}{15}
% \providecommand{\natexlab}[1]{#1}
% \providecommand{\url}[1]{#1}
% \expandafter\ifx\csname urlstyle\endcsname\relax\else
% \urlstyle{same}\fi
% \expandafter\ifx\csname href\endcsname\relax
% \DeclareUrlCommand\doi{\urlstyle{rm}}
% \def\eprint#1#2{#2}
% \else
% \def\doi#1{\href{https://doi.org/#1}{\nolinkurl{#1}}}
% \let\eprint\href
% \fi
%
% \bibitem[1FCENdoge(2025)]{1FCENdoge2025}
% 1FCENDOGE.
% \newblock 1fcendoge/sysuthesis\allowbreak[CP/OL].
% \newblock 2025\allowbreak[2025-05-26].
% \newblock \url{https://github.com/1FCENdoge/sysuthesis}.
%
% \bibitem[CTeX-org(2022)]{CTeXorg2022}
% CTEX-ORG.
% \newblock CTEX 宏集手册\allowbreak[M/OL].
% \newblock 2022.
% \newblock \url{http://mirrors.ctan.org/language/chinese/ctex/ctex.pdf}.
%
% \bibitem[{DapengFeng}(2025)]{DapengFeng2025}
% {DapengFeng}.
% \newblock {DapengFeng}/sysuthesis\allowbreak[CP/OL].
% \newblock 2025\allowbreak[2025-05-26].
% \newblock \url{https://github.com/DapengFeng/sysuthesis}.
%
% \bibitem[Kime et~al.(2024)Kime, Wemheuer, and Lehman]{Kime2024}
% KIME P, WEMHEUER M, LEHMAN P.
% \newblock The biblatex package\allowbreak[M/OL].
% \newblock 2024.
% \newblock \url{http://mirrors.ctan.org/macros/latex/contrib/biblatex/doc/biblatex.pdf}.
%
% \bibitem[Lee(2025)]{Lee2025}
% LEE Z.
% \newblock Gb/t 7714 {\BibTeX} style\allowbreak[M/OL].
% \newblock 2025.
% \newblock \url{http://mirrors.ctan.org/biblio/bibtex/contrib/gbt7714/gbt7714.pdf}.
%
% \bibitem[nju lug(2025)]{njulug2025}
% NJU LUG.
% \newblock nju-lug/{NJUThesis}\allowbreak[CP/OL].
% \newblock Nanjing University Linux Users Group, 2025\allowbreak[2025-05-26].
% \newblock \url{https://github.com/nju-lug/NJUThesis}.
%
% \bibitem[Oetiker\ 等(2024)Oetiker, Partl, Hyna, and Schlegl]{Oetiker2024}
% OETIKER T, PARTL H, HYNA I, 等.
% \newblock 一份(不太)简短的 \LaTeX{}2ε 介绍\allowbreak[M/OL].
% \newblock 开发小组CTEX, 译.
% \newblock 2024.
% \newblock \url{http://mirrors.ctan.org/info/lshort/chinese/lshort-zh-cn.pdf}.
%
% \bibitem[Robertson et~al.(2023)Robertson, Stephani, Wright, and Hosny]{Robertson2023}
% ROBERTSON W, STEPHANI P, WRIGHT J, et~al.
% \newblock Experimental unicode mathematical typesetting\allowbreak[M/OL].
% \newblock 2023.
% \newblock \url{http://mirrors.ctan.org/macros/unicodetex/latex/unicode-math/unicode-math.pdf}.
%
% \bibitem[sysu gitlab(2021)]{sysugitlab2021}
% SYSU GITLAB.
% \newblock sysu-gitlab / thesis-template / thesis · {GitLab}\allowbreak[CP/OL].
% \newblock 2021\allowbreak[2025-05-26].
% \newblock \url{https://gitlab.com/sysu-gitlab/thesis-template/thesis}.
%
% \bibitem[SYSU-SCC(2025)]{SYSUSCC2025}
% SYSU-SCC.
% \newblock {SYSU}-{SCC}/sysu-thesis\allowbreak[CP/OL].
% \newblock 中山大学超算队, 2025\allowbreak[2025-05-26].
% \newblock \url{https://github.com/SYSU-SCC/sysu-thesis}.
%
% \bibitem[Yang(2025)]{Yang2025}
% YANG H~W.
% \newblock yanghw8/sysuthesis-unofficial\allowbreak[CP/OL].
% \newblock 2025\allowbreak[2025-05-26].
% \newblock \url{https://github.com/yanghw8/sysuthesis-unofficial}.
%
% \bibitem[Zeng(2025)]{Zeng2025}
% ZENG X.
% \newblock stone-zeng/fduthesis\allowbreak[CP/OL].
% \newblock 2025\allowbreak[2025-05-26].
% \newblock \url{https://github.com/stone-zeng/fduthesis}.
%
% \bibitem[胡振震(2025)]{胡2025}
% 胡振震.
% \newblock 符合 GB/T 7714-2015 标准的 biblatex 参考文献样式\allowbreak[M/OL].
% \newblock 2025.
% \newblock \url{http://mirrors.ctan.org/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/biblatex-gb7714-2015.pdf}.
%
% \bibitem[刘海洋(2013)]{刘2013}
% 刘海洋.
% \newblock \LaTeX{} 入门\allowbreak[M].
% \newblock 电子工业出版社, 2013.
%
% \bibitem[王然(2025)]{王2025}
% 王然.
% \newblock 一份简短的关于 \LaTeX{} 安装的介绍\allowbreak[M/OL].
% \newblock 2025.
% \newblock \url{http://mirrors.ctan.org/info/install-latex-guide-zh-cn/install-latex-guide-zh-cn.pdf}.
%
% \end{thebibliography}
%
% \end{documentation}
%
% \begin{implementation}
%
% \section{代码实现}
%
% \subsection{准备}
%
% \begin{macrocode}
%<*class>
%<@@=sysu>
% \end{macrocode}
%
% 检查 \LaTeX3 编译环境。
% \begin{macrocode}
\msg_new:nnn { sysuthesis } { l3-too-old }
{
LaTeX3~ programming~ layer~ is~ too~ old. \\\\
The~ sysuthesis~ class~ requires~ at~ least~ \\
a~ version~ of~ L3~ programming~ layer~\\
after~ #1.
}
\cs_new_protected:Npn \@@_if_expl_as_least:n #1
{
\@ifl@t@r \ExplLoaderFileDate { #1 } { }
{ \msg_error:nnn { sysuthesis } { l3-too-old } { #1 } }
}
\@@_if_expl_as_least:n { 2024/06/01 }
% \end{macrocode}
%
% \cls{sysuthesis} 仅支持 \XeTeX{} 和 \LuaTeX{}。
% \begin{macrocode}
\msg_new:nnn { sysuthesis } { unsupported-engine }
{
The~ sysuthesis~ class~ requires~ either~ XeTeX~ or~ LuaTeX. \\\\
"#1"~ is~ not~ supported~ at~ present.~ You~ must~ change \\
your~ typesetting~ engine~ to~ "xelatex"~ or~ "lualatex".
}
\bool_if:nF { \sys_if_engine_xetex_p: || \sys_if_engine_luatex_p: }
{ \msg_fatal:nne { sysuthesis } { unsupported-engine } { \c_sys_engine_str } }
% \end{macrocode}
%
% 定义消息模板。
% \begin{macrocode}
\msg_new:nnn { sysuthesis } { unknown-option }
{ Class~ option~ "#1"~ is~ unknown. }
\msg_new:nnn { sysuthesis } { invalid-option }
{
The~ option~ "#1"~ is~ not~ valid.\\
Please~ select~ one~ of~ the~ following~ valid~ options:~ #2.
}
\msg_new:nnn { sysuthesis } { load-config-file }
{ You~ are~ loading~ config~ file~ "#1". }
\msg_new:nnn { sysuthesis } { package-conflict }
{ The~ "#2"~ package~ is~ incompatible~ with~ "#1". }
\msg_new:nnn { sysuthesis } { too-many-footnotes }
{ Too~many~footnotes.~ Maximum~allowed~is~50. }
\msg_new:nnn { sysuthesis } { image-not-found }
{
The~ image~ "#1"~ is~ not~ found. \\
TikZ~ will~ be~ used~ to~ generate~ the~ figure~ instead, \\
which~ may~ slow~ down~ the~ compilation~ speed.
}
% \end{macrocode}
%
% \subsubsection{内部变量声明}
%
% \begin{variable}{
% \l_@@_tmpa_box,
% \l_@@_tmpa_seq,
% \l_@@_tmpa_dim,
% \l_@@_tmpa_tl
% }
% 临时变量。
% \begin{macrocode}
\box_new:N \l_@@_tmpa_box
\seq_new:N \l_@@_tmpa_seq
\dim_new:N \l_@@_tmpa_dim
\tl_new:N \l_@@_tmpa_tl
% \end{macrocode}
% \end{variable}
%
% \begin{variable}{\g_@@_info_type_int}
% 存储论文类型 (1: 学士;2: 硕士;3: 博士)。
% \begin{macrocode}
\int_new:N \g_@@_info_type_int
% \end{macrocode}
% \end{variable}
%
% \begin{variable}{\g_@@_pass_to_ctexbook_seq}
% 存储由 \cls{sysuthesis} 传入 \cls{ctexbook} 文档类的选项列表。
% \begin{macrocode}
\seq_new:N \g_@@_pass_to_ctexbook_seq
% \end{macrocode}
% \end{variable}
%
% \begin{variable}{\g_@@_opt_twoside_bool}
% 判断开启双页模式(默认打开)。
% \begin{macrocode}
\bool_new:N \g_@@_opt_twoside_bool
\bool_gset_true:N \g_@@_opt_twoside_bool
% \end{macrocode}
% \end{variable}
%
% \begin{variable}{\g_@@_opt_draft_bool}
% 判断开启草稿模式(默认关闭)。
% \begin{macrocode}
\bool_new:N \g_@@_opt_draft_bool
% \end{macrocode}
% \end{variable}
%
% \begin{variable}{\g_@@_opt_anon_bool}
% 判断开启盲审模式(默认关闭)。
% \begin{macrocode}
\bool_new:N \g_@@_opt_anon_bool
% \end{macrocode}
% \end{variable}
%
% \begin{variable}{\g_@@_opt_config_tl}
% 存储配置文件名称,默认为空。
% \begin{macrocode}
\tl_new:N \g_@@_opt_config_tl
% \end{macrocode}
% \end{variable}
%
% \subsubsection{内部函数}
%
% \begin{macro}{\@@_quad:}
% 等价于 \LaTeXe{} 中的 \tn{quad} 和 \tn{qquad}。
% \begin{macrocode}
\cs_new_protected:Npn \@@_quad: { \skip_horizontal:n { 1 em } }
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_hss:, \@@_hfill}
% 等价于 \LaTeXe{} 中的 \tn{hss} 和 \tn{hfill}。
% \begin{macrocode}
\cs_new_protected:Npn \@@_hss:
{ \skip_horizontal:n { 0pt plus 1fil minus 1fil } }
\cs_new_protected:Npn \@@_hfill:
{ \skip_horizontal:n { 0pt plus 1fill } }
% \end{macrocode}
% \end{macro}