Newer
Older
% \vspace{1cm}
% \begin{flushright}
% 我的名字\\
% 时间地点
% \end{flushright}
% \begin{function}{\tableofcontents,\listoffigures,\listoftables}
% 分别生成目录、图片清单和表格清单。
% \end{function}
% \begin{acknowledgement}
% 感谢NJU LUG
% \end{acknowledgement}
% \begin{function}{\appendix}
% 附录放在本命令后,以英文字母进行编号,编写方式同正文
% \end{function}
%
% \subsubsection{成果列表}
%
% \begin{function}{\njupaperlist,\njupaperlist*}
% \begin{syntax}
% \tn{njupaperlist}\Arg{文献}
% \end{syntax}
% 成果列表,分别为发表文章目录与合作文章目录。\Arg{文献}的填写方式同\tn{cite},多个文献需要使用英文半角逗号隔开。
% 符合GB7714-2015规范。使用\hologo{biber}作为后端。需要使用 |biber| 命令手动编译才会显示
% \begin{function}{\addbibresource}
% \begin{syntax}
% \tn{addbibresource}\Arg{文件}
% \end{syntax}
% 示例参考文献存储于 \file{njuthesis-sample.bib},直接向其中粘贴新的参考文献即可。如果希望额外添加参考文献列表,可以在导言区中多次调用 \tn{addbibresource} 命令。注意本命令与 |\bibliography{bibfile1,bibfile2}| 不同,不可以用逗号分隔多个输入文件,且必须使用带扩展名的完整文件名。
% \begin{function}{\printbibliography}
% 生成参考文献列表页面。
% \end{function}
% \begin{function}{\cite,\citeauthor,\citeyear}
% \begin{syntax}
% \tn{cite}\Arg{文献}
% \tn{citeauthor}\Arg{文献}
% \tn{citeyear}\Arg{文献}
% \end{syntax}
% 引用文献
% \end{function}
%
%
% \subsubsection{文献管理}
%
% \subparagraph{使用EndNote}
%
% 南京大学信息化建设管理服务中心已购买\href{https://itsc.nju.edu.cn/EndNote/list.htm}{EndNote}供全校师生免费试用,最新版为EndNote 20。
%
%
% \subparagraph{使用Zotero}
%
% \href{https://www.zotero.org/}{Zotero}是一款免费的文献管理软件,支持所有桌面平台。
%
% 在保持Zotero程序运行的情况下,点击浏览器工具栏的Zotero Connector插件即可自动从网页抓取参考文件信息。Zotero可以通过\href{https://github.com/l0o0/jasminum}{jasminum插件}支持中文参考文献的识别。在选中希望使用的文献后右键导出文献条目即可生成\file{.bib}文件。
%
% \njuemblem{!}{3cm} % 默认生成指定大小的紫色南大校徽
% \njuname{4cm}{!} % 默认生成指定大小的紫色南大中文校名
% \njuname*{4cm}{!} % 默认生成指定大小的紫色南大英文校名
% \njuemblem[black]{!}{3cm} % 黑色的南大校徽
% \njuemblem[department=dii]{!}{4cm} % 紫色匡院徽标
% \njuemblem[department=cs,color=blue]{!}{3cm} % 纯蓝色计科徽标
% 本宏包的详细使用方法请参考其\href{http://mirrors.ctan.org/macros/latex/contrib/njuvisual/njuvisual.pdf}{说明文档}。
% 本模板使用 \hologo{LaTeX3} 语法编写,依赖 \pkg{expl3} 环境,
% 并需调用 \pkg{l3packages} 中的相关宏包。
%
% 以下代码中有一些形如 |<*class>|
% 的标记,这是 \pkg{DocStrip} 中的“guard”,用来选择性地提取文件。
% “|*|”和“|/|”分别表示该部分的开始和结束。不含
% “|*|”和“|/|”的 guard 出现在行号右侧,它们用来确定
% 单独一行代码的归属。这些 guard 的颜色深浅不一,用以明确嵌套关系。
%
% 另有若干包含 |@@| 的guard,用以表示名空间(模块)。
% 在删除注释生成格式文件时,变量名称中的 |@@| 会被等号后的字段替换,
% 譬如在本模板 \cls{njuthesis} 中 |@@=nju|。
% \changes{v0.12}{2021/12/03}{放宽对于 \pkg{l3packages} 的版本要求。}
\msg_new:nnn { njuthesis } { l3-too-old }
{
Package~ "#1"~ is~ too~ old. \\\\
Please~ update~ an~ up-to-date~ version~ of~ \\
the~ bundles "l3kernel"~ and~ "l3packages"~ \\
{ } { \msg_error:nnn { njuthesis } { l3-too-old } {#1} }
}
% \end{macrocode}
%
% \begin{macrocode}
\msg_new:nnn { njuthesis } { unsupported-engine }
{
The~ njuthesis~ class~ requires~ either~ \\
XeTeX~ or~ LuaTeX. \\\\
"#1"~ is~ not~ supported~ at~ present.~ \\
You~ must~ change your~ typesetting~ engine~ \\
to~ "xelatex"~ or~ "lualatex".
}
\sys_if_engine_xetex:F
{
\sys_if_engine_luatex:F
{
\msg_fatal:nnx { njuthesis } { unsupported-engine }
{ \c_sys_engine_str }
}
}
% \end{macrocode}
%
% \c_@@_name_degree_clist,\c_@@_name_degree_en_clist}
% 论文类型与学位类型。
% \begin{macrocode}
\clist_const:Nn \c_@@_name_type_clist
{ 毕业论文, 毕业设计 }
{ 学士, 硕士, 硕士专业, 博士 }
\clist_const:Nn \c_@@_name_degree_en_clist
{ Bachelor, Master, Master, Doctor~of~Philosophy }
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
% \begin{macro}{\@@_define_name:nn,\@@_define_name:nnn}
% 用来定义默认名称的辅助函数。
% \begin{macrocode}
\cs_new_protected:Npn \@@_define_name:nn #1#2
{ \tl_const:cn { c_@@_name_ #1 _tl } {#2} }
\cs_new_protected:Npn \@@_define_name:nnn #1#2#3
{
\tl_const:cn { c_@@_name_ #1 _tl } {#2}
\tl_const:cn { c_@@_name_ #1 _en_tl } {#3}
}
% \end{macrocode}
% \end{macro}
%
% 默认名称。注意空格是忽略掉的。
% \begin{macrocode}
\clist_map_inline:nn
{
{ pdf_creator } { LaTeX~ with~ njuthesis~ class },
}
{ \@@_define_name:nn #1 }
\clist_map_inline:nn
{
{ keywords } { 关键词: } { Keywords: },
}
{ \@@_define_name:nnn #1 }
% \end{macrocode}
%
% \begin{variable}{\c_@@_orig_decl_text_tl}
% 学位论文原创性声明。
% \begin{macrocode}
\tl_const:Nn \c_@@_orig_decl_text_tl
{
本人郑重声明,所提交的学位论文是本人在导师指导下独立进行科学研究工作
所取得的成果。除本论文中已经注明引用的内容外,本论文不包含其他个人或
集体已经发表或撰写过的研究成果,也不包含为获得南京大学或其他教育机构
的学位证书而使用过的材料。对本文的研究做出重要贡献的个人和集体,均已
在论文的致谢部分明确标明。本人郑重申明愿承担本声明的法律责任。
}
% \end{macrocode}
% \end{variable}
%
%
% \begin{variable}{\g_@@_info_degree_int,\g_@@_info_type_int,
% \g_@@_info_diploma_tl}
\int_new:N \g_@@_info_degree_int
\int_new:N \g_@@_info_type_int
% \begin{variable}{\g_@@_latin_fontset_tl,\g_@@_cjk_fontset_tl}
% 用于存储所使用字体名称的全局变量
% \begin{macrocode}
\tl_new:N \g_@@_latin_fontset_tl
\tl_new:N \g_@@_cjk_fontset_tl
% \end{macrocode}
% \end{variable}
%
degree .choices:nn =
{ ug, mg, mf, phd }
{ \int_set_eq:NN \g_@@_info_degree_int \l_keys_choice_int
\int_compare:nTF { \g_@@_info_degree_int == 1 }
{ \tl_set:Nn \g_@@_info_diploma_tl { ug } }
{ \tl_set:Nn \g_@@_info_diploma_tl { g } } },
degree .initial:n = ug,
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{type}
% 论文类型。
% \begin{macrocode}
type .choices:nn =
{ thesis, design }
{ \int_set_eq:NN \g_@@_info_type_int \l_keys_choice_int },
type .initial:n = thesis,
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{nlcover}
% 是否需要国家图书馆封面的设置。
% \begin{macrocode}
nlcover .bool_set:N = \g_@@_nlcover_bool,
nlcover .initial:n = false,
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{customlatinfont,customchinesefont}
% 定义字体选项
% \begin{macrocode}
customlatinfont .choices:nn =
{ gyre, macos, windows, none }
{ \tl_set_eq:NN \g_@@_latin_fontset_tl \l_keys_choice_tl },
customchinesefont .choices:nn =
{ fandol, founder, macos, noto, windows, none }
{ \tl_set_eq:NN \g_@@_cjk_fontset_tl \l_keys_choice_tl },
}
% \begin{macrocode}
\ProcessKeysOptions { nju }
% \end{macrocode}
% \end{macro}
%
%
\keys_define:nn { nju } { info.meta:nn = { nju / info } { #1 } }
% \begin{macro}{info/titlea,info/titleb,info/titlec,info/title*}
titlea .tl_set:N = \l_@@_info_title_a_tl,
titleb .tl_set:N = \l_@@_info_title_b_tl,
titlec .tl_set:N = \l_@@_info_title_c_tl,
title* .tl_set:N = \l_@@_info_title_en_tl,
% \begin{macro}{info/keywords,info/keywords*}
keywords .clist_set:N = \l_@@_info_keywords_clist,
keywords* .clist_set:N = \l_@@_info_keywords_en_clist,
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{info/grade,info/student-id,info/author,info/author*}
grade .tl_set:N = \l_@@_info_grade_tl,
student-id .tl_set:N = \l_@@_info_id_tl,
author .tl_set:N = \l_@@_info_author_tl,
author* .tl_set:N = \l_@@_info_author_en_tl,
% \begin{macro}{info/department,info/department*,info/major,info/major*,info/field,info/field*}
department .tl_set:N = \l_@@_info_dept_tl,
department* .tl_set:N = \l_@@_info_dept_en_tl,
major .tl_set:N = \l_@@_major_tl,
major* .tl_set:N = \l_@@_major_en_tl,
field .tl_set:N = \l_@@_field_tl,
field* .tl_set:N = \l_@@_field_en_tl,
% \begin{macro}{info/supervisora,info/supervisora*,info/supervisora-title,info/supervisora-title*}
supervisora .tl_set:N = \l_@@_info_supv_a_tl,
supervisora* .tl_set:N = \l_@@_info_supv_a_en_tl,
supervisora-title .tl_set:N = \l_@@_info_supv_a_title_tl,
supervisora-title*.tl_set:N = \l_@@_info_supv_a_title_en_tl,
% \begin{macro}{info/supervisorb,info/supervisorb*,info/supervisorb-title,info/supervisorb-title*}
supervisorb .tl_set:N = \l_@@_info_supv_b_tl,
supervisorb* .tl_set:N = \l_@@_info_supv_b_en_tl,
supervisorb-title .tl_set:N = \l_@@_info_supv_b_title_tl,
supervisorb-title*.tl_set:N = \l_@@_info_supv_b_title_en_tl,
% \begin{macro}{info/submit-date,info/submit-date*}
submit-date .tl_set:N = \l_@@_submit_date_tl,
submit-date* .tl_set:N = \l_@@_submit_date_en_tl,
% \begin{macro}{info/defend-date,info/chairman,info/reviewer}
defend-date .tl_set:N = \l_@@_defend_date_tl,
chairman .tl_set:N = \l_@@_info_chairman_tl,
reviewer .clist_set:N = \l_@@_info_reviewer_clist,
% \begin{macro}{info/clc,info/secret-level,info/udc,info/supervisor-contact}
clc .tl_set:N = \l_@@_info_clc_tl,
secret-level .tl_set:N = \l_@@_info_seclv_tl,
udc .tl_set:N = \l_@@_info_udc_tl,
supervisor-contact.tl_set:N = \l_@@_info_supv_cont_tl,
}
% \begin{macro}{\njusetup}
% \changes{v0.6}{2021/09/10}{改用键值对输入信息。}
% \changes{v0.11}{2021/10/01}{将个人信息变量名改为小写字母加连字符的形式。}
\NewDocumentCommand \njusetup { m } { \keys_set:nn { nju } { #1 } }
\LoadClass[
a4paper,
twoside,
UTF8,
scheme=chinese,
% \end{macrocode}
% 关于行距,\hologo{LaTeX}默认1.2行距,word默认行距是1.3,要求1.5倍word行距,故
% \begin{macrocode}
linespread=1.625,
% \end{macrocode}
% 默认不载入任何字体,供模板自行设置
% \begin{macrocode}
fontset=none,
zihao=-4
]{ctexbook}[2018/04/01]
{
geometry,
caption,
setspace,
emptypage,
fancyhdr,
hologo
}
\RequirePackage[titles]{tocloft}
\RequirePackage[hyphens]{url} % generate better linebreaks in the url
% 针对编译引擎,使用不同的宏包构建可以对中文正常换行的下划线命令。\pkg{lua-ul} 中需要在结尾使用\tn{null}保护尾部空白。
\NewDocumentCommand \njuline { m } { \CJKunderline{#1} }
}
\NewDocumentCommand \njuline { m } { \underLine{#1} \null }
}
% 数学,\pkg{amsmath} 必须在 \pkg{unicode-math} 前加载。
% \pkg{unicode-math} 指定了 \hologo{XeTeX} 和 \hologo{LuaTeX} 下所使用的数学字体。
% 用于配置数学环境的 \pkg{mathtools} 会与 \pkg{unicode-math} 发生冲突,此处手动消除其警告。
\RequirePackage[hidelinks,bookmarksnumbered=true]{hyperref}
\RequirePackage[capitalise,nameinlink,noabbrev]{cleveref}
% \end{macrocode}
%
% 载入南京大学识别视觉系统。
% \begin{macrocode}
\RequirePackage{njuvisual}
% \end{macrocode}
%
% \begin{macro}{\@@_check_package:nnn}
% 检查过时宏包。
% \begin{macrocode}
\msg_new:nnn { njuthesis } { package-too-old }
{
Package~ "#1"~ is~ too~ old. \\
The~ njuthesis~ class~ only~ supports~ "#1"~ with~ \\
a~ version higher~ than~ v#2. \\\\
Please~ update~ an~ up-to-date~ version~ of~ it~ \\
using~ your TeX~ package~ manager~ or~ from~ CTAN.
}
\cs_new_protected:Npn \@@_check_package:nnn #1#2#3
{
\@ifpackagelater {#1} {#2}
{ } { \msg_error:nnnn { njuthesis } { package-too-old } {#1} {#3} }
}
% \end{macrocode}
% \end{macro}
%
% 检查绘制下划线所需的 \pkg{luatexja} 包版本。该宏包在2021-09-18的解决了下划线中断问题,然而在2021-10-24的更新才提供了正确的内嵌日期。
{ \@@_check_package:nnn { luatexja } { 2021/10/24 } { 20211024.0 } }
% \begin{macrocode}
\tl_if_empty:NTF \g_@@_latin_fontset_tl
{
\tl_if_empty:NT \g_@@_cjk_fontset_tl
{ \bool_gset_true:N \g_@@_load_system_fontset_bool }
}
% \end{macrocode}
%
% 进行系统检测。
% 检测 Windows 的命令由\pkg{l3kernal}提供,
% 检测 macOS 的命令由\pkg{ctex}提供,
% 这两种情况外的系统被判断为 Linux,一律使用自由字体。
% \begin{macrocode}
{
\sys_if_platform_windows:TF
{ \tl_set:Nn \g_@@_latin_fontset_tl { windows }
\tl_set:Nn \g_@@_cjk_fontset_tl { windows } }
{ \ctex_if_platform_macos:TF
{ \tl_set:Nn \g_@@_latin_fontset_tl { macos }
\tl_set:Nn \g_@@_cjk_fontset_tl { macos } }
{ \tl_set:Nn \g_@@_latin_fontset_tl { gyre }
\tl_set:Nn \g_@@_cjk_fontset_tl { fandol } } }
%
% \begin{macro}{\@@_load_latin_font_windows:}
% Windows 西文字体
% \begin{macrocode}
\cs_new_protected:Npn \@@_load_latin_font_windows:
{
\setmainfont{Times~New~Roman}
\setsansfont{Arial}
\setmonofont{Courier~New}[Scale=MatchLowercase]
}
{
\setmainfont{Times~New~Roman}
\setsansfont{Arial}
\setmonofont{Menlo}[Scale=MatchLowercase]
}
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
{
\setmainfont{texgyretermes}[
Extension=.otf,
UprightFont=*-regular,
BoldFont=*-bold,
ItalicFont=*-italic,
BoldItalicFont=*-bolditalic]
\setsansfont{texgyreheros}[
Extension=.otf,
UprightFont=*-regular,
BoldFont=*-bold,
ItalicFont=*-italic,
BoldItalicFont=*-bolditalic]
\setmonofont{texgyrecursor}[
Extension=.otf,
UprightFont=*-regular,
BoldFont=*-bold,
ItalicFont=*-italic,
BoldItalicFont=*-bolditalic,
Scale=MatchLowercase,
Ligatures=CommonOff]
}
{
\setCJKmainfont{SimSun}[
AutoFakeBold=2.17,
ItalicFont=KaiTi]
\setCJKsansfont{SimHei}
\setCJKmonofont{FangSong}
\setCJKfamilyfont{zhsong}{SimSun}[AutoFakeBold=2.17]
\setCJKfamilyfont{zhhei}{SimHei}
\setCJKfamilyfont{zhfs}{FangSong}
\setCJKfamilyfont{zhkai}{KaiTi}[AutoFakeBold=2.17]
}
{
% 移除 does not contain script "CJK" 警告
\msg_redirect_name:nnn {fontspec} {no-script} {info}
\setCJKmainfont{Songti~SC~Light}[
BoldFont=Songti~SC~Bold,
ItalicFont=Kaiti~SC,
BoldItalicFont=Kaiti~SC~Bold]
\setCJKsansfont{Heiti~SC~Light}[BoldFont=Heiti~SC~Medium]
\setCJKmonofont{STFangsong}
\setCJKfamilyfont{zhsong}{Songti~SC~Light}[BoldFont=Songti~SC~Bold]
\setCJKfamilyfont{zhhei}{Heiti~SC~Light}[BoldFont=Heiti~SC~Medium]
\setCJKfamilyfont{zhfs}{STFangsong}
\setCJKfamilyfont{zhkai}{Kaiti~SC}[BoldFont=Kaiti~SC~Bold]
\setCJKfamilyfont{zhnewhei}{PingFang~SC}
}
% \begin{macro}{\@@_load_cjk_font_fandol:}
% Fandol 字体
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
{
% 移除 does not contain script "CJK" 警告
\msg_redirect_name:nnn {fontspec} {no-script} {info}
\setCJKmainfont{FandolSong-Regular}[
Extension=.otf,
BoldFont=FandolSong-Bold,
ItalicFont=FandolKai-Regular]
\setCJKsansfont{FandolHei-Regular}[
Extension=.otf,
BoldFont=FandolHei-Bold]
\setCJKmonofont{FandolFang-Regular}[Extension=.otf]
\setCJKfamilyfont{zhsong}{FandolSong-Regular}[
Extension=.otf,
BoldFont=FandolSong-Bold]
\setCJKfamilyfont{zhhei}{FandolHei-Regular}[
Extension=.otf,
BoldFont=FandolHei-Bold]
\setCJKfamilyfont{zhfs}{FandolFang-Regular}[Extension=.otf]
\setCJKfamilyfont{zhkai}{FandolKai-Regular}[
Extension=.otf,
AutoFakeBold=2.17]
}
%
% \begin{macro}{\@@_load_cjk_font_founder:}
\sys_if_engine_luatex:T
{
% \end{macrocode}
% 在 LuaTeX 中调整方正字体括号位置
% XeTeX 暂无好的解决方法
% \begin{macrocode}
\defaultCJKfontfeatures{JFM={zh_CN/{quanjiao,fzpr}}}
}
\setCJKmainfont{FZSSK}[% 方正书宋
BoldFont=FZXBSK,% 方正小标宋
ItalicFont=FZKTK]% 方正楷体
\setCJKsansfont{FZXH1K}[% 方正细黑一
BoldFont=FZHTK]% FZHTK 方正黑体
\setCJKmonofont{FZFSK}[Extension=.ttf]% 方正仿宋
\setCJKfamilyfont{zhsong}
{FZSSK}[
Extension=.ttf,
BoldFont=FZXBSK]
\setCJKfamilyfont{zhhei}
{FZHTK}[
Extension=.ttf,
AutoFakeBold=2.17]
\setCJKfamilyfont{zhfs}
{FZFSK}[Extension=.ttf]
\setCJKfamilyfont{zhkai}
{FZKTK}[Extension=.ttf]
\defaultCJKfontfeatures{}
}
{
% 思源宋体
\setCJKmainfont[
UprightFont=NotoSerifSC-Regular,
BoldFont=NotoSerifSC-Bold,
ItalicFont=NotoSerifSC-Regular,
BoldItalicFont=NotoSerifSC-Bold,
ItalicFeatures=FakeSlant,
BoldItalicFeatures=FakeSlant]{Noto~Serif~SC}
% 思源黑体
\setCJKsansfont[
UprightFont=NotoSansSC-Regular,
BoldFont=NotoSansSC-Bold,
ItalicFont=NotoSansSC-Regular,
BoldItalicFont=NotoSansSC-Bold,
ItalicFeatures=FakeSlant,
BoldItalicFeatures=FakeSlant]{Noto~Sans~SC}
\setCJKfamilyfont{zhsong}{Noto~Serif~SC}
\setCJKfamilyfont{zhhei}{Noto~Sans~SC}
\setCJKfamilyfont{zhfs}
{FZFSK}[Extension=.ttf]
\setCJKfamilyfont{zhkai}
{FZKTK}[Extension=.ttf]
}
{
\use:c { @@_load_latin_font_ \g_@@_latin_fontset_tl : }
\use:c { @@_load_cjk_font_ \g_@@_cjk_fontset_tl : }
% \end{macrocode}
% 自行定义C\hologo{TeX}中的四类字体命令。
% \begin{macrocode}
\NewDocumentCommand \songti { } { \CJKfamily{zhsong} }
\NewDocumentCommand \heiti { } { \CJKfamily{zhhei} }
\NewDocumentCommand \fangsong { } { \CJKfamily{zhfs} }
\NewDocumentCommand \kaishu { } { \CJKfamily{zhkai} }
}
% \end{macrocode}
%
% 载入设置的字体。
% \begin{macrocode}
% 设置数学字体 (XITS, 或者 \href{https://www.stixfonts.org}{STIX}, 与 Times New Roman 最为相近)
% \setmathfont{STIXTwoMath-Regular}[Extension = .otf]
\setmathfont{XITSMath-Regular}[
BoldFont = XITSMath-Bold,
Extension = .otf]
\setmathfont{latinmodern-math.otf}[range={cal,bb,frak}]
% 使用\pkg{geometry}设置页边距。
% \begin{macrocode}
\geometry{
vmargin = 2.5 cm,
\fancypagestyle{plain}{
\fancyhf{}
\fancyfoot[C]{\zihao{5}\thepage}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
\fancyhead[CO]{\leftmark}
\fancyhead[CE]{\rightmark}
\fancyfoot[C]{\zihao{5}\thepage}
\renewcommand{\footrulewidth}{0pt}
\renewcommand{\headrulewidth}{0.4pt}
\setlength{\headheight}{20pt}
% \begin{macro}{\frontmatter}
% 重定义 \cs{frontmatter},清空页眉页脚以及页码设置。
% 此命令仅为解决原 \cls{book} 类中使用小写罗马字母序号的冲突,并不建议使用。
\RenewDocumentCommand \frontmatter { }
{
\cleardoublepage
\pagestyle{empty}
\pagenumbering{Roman}
}
% \changes{v0.12}{2021/12/03}{修复了摘要页字体格式泄漏到正文的问题。}
% \changes{v0.12}{2021/12/03}{修复了页眉上长标题重叠的问题。}
% 重定义 \cs{mainmatter},在论文主体部分载入页眉页脚设置,并重新进行数字编号。
% \begin{macrocode}
\RenewDocumentCommand \mainmatter { }
{
\cleardoublepage
\int_compare:nTF { \g_@@_info_degree_int == 1 }
\pagenumbering{arabic}
\normalfont\normalsize
}
% \end{macrocode}
% \end{macro}
chapter/format = \zihao{4}\heiti\centering\selectfont,
chapter/beforeskip = 10pt,
chapter/afterskip = 60pt,
section/format = \zihao{4}\heiti\raggedright\selectfont,
subsection/format = \zihao{4}\heiti\raggedright\selectfont,
subsubsection/format = \zihao{4}\heiti\raggedright\selectfont,
\ctexset{
contentsname = 目录,
listfigurename = 插图清单,
listtablename = 表格清单,
% \begin{macrocode}
\cftsetpnumwidth{2em}
\renewcommand{\cftchapleader}{\cftdotfill{\cftchapdotsep}}
\renewcommand{\cftchapdotsep}{\cftdotsep}
\setlength{\cftsecindent}{2em}
\setlength{\cftsubsecindent}{52pt}
\setlength{\cftsubsecnumwidth}{2em}
% \end{macrocode}
%
\RenewDocumentCommand \tableofcontents { }
{
\raggedbottom
\group_begin:
\ctexset{
contentsname = {目\hspace{2em}录},
chapter/format = {\centering\songti\bf\zihao{3}\selectfont},
}
\chapter*{\contentsname}
\group_end:
\addcontentsline{toc}{chapter}{\contentsname}
\vskip 20pt
\@starttoc{toc}
}
\RenewDocumentCommand \listoffigures { }
{
\group_begin:
\ctexset{
chapter/format = {\centering\songti\bf\zihao{3}\selectfont},