summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/fduthesis/fduthesis.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/fduthesis/fduthesis.dtx')
-rw-r--r--macros/latex/contrib/fduthesis/fduthesis.dtx598
1 files changed, 269 insertions, 329 deletions
diff --git a/macros/latex/contrib/fduthesis/fduthesis.dtx b/macros/latex/contrib/fduthesis/fduthesis.dtx
index c6439e661b..2b001b151c 100644
--- a/macros/latex/contrib/fduthesis/fduthesis.dtx
+++ b/macros/latex/contrib/fduthesis/fduthesis.dtx
@@ -2,7 +2,7 @@
% !TeX program = XeLaTeX
% !TeX encoding = UTF-8
%
-% Copyright (C) 2017--2022 by Xiangdong Zeng <xdzeng96@gmail.com>
+% Copyright (C) 2017--2023 by Xiangdong Zeng <xdzeng96@gmail.com>
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either
@@ -46,7 +46,7 @@
The `fduthesis` Class
=====================
-*LaTeX thesis template for Fudan University, v0.8*
+*LaTeX thesis template for Fudan University, v0.9*
Overview
--------
@@ -86,7 +86,7 @@ To install `fduthesis`, you can use one of the following methods:
git clone https://github.com/stone-zeng/fduthesis.git
- Run `install-win.bat` (on Windows) or `install-linux.sh` (on Linux)
+ Run `install-win.bat` (Windows) or `install-unix.sh` (Linux or macOS)
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.
@@ -123,7 +123,7 @@ version.
-----
-Copyright (C) 2017&ndash;2022 by Xiangdong Zeng <xdzeng96@gmail.com>.
+Copyright (C) 2017&ndash;2023 by Xiangdong Zeng <xdzeng96@gmail.com>.
%</readme>
%
%<*internal>
@@ -141,7 +141,7 @@ Copyright (C) 2017&ndash;2022 by Xiangdong Zeng <xdzeng96@gmail.com>.
\preamble
- Copyright (C) 2017--2022 by Xiangdong Zeng <xdzeng96@gmail.com>
+ Copyright (C) 2017--2023 by Xiangdong Zeng <xdzeng96@gmail.com>
This work may be distributed and/or modified under the
conditions of the LaTeX Project Public License, either
@@ -231,7 +231,7 @@ Copyright (C) 2017&ndash;2022 by Xiangdong Zeng <xdzeng96@gmail.com>.
%
%<class|class-en|doc|logo>\NeedsTeXFormat{LaTeX2e}[2020/10/01]
%<*!(driver|install|ex-logo|cover)>
-%<!readme>\GetIdInfo $Id: fduthesis.dtx 0.8 2022-09-04 12:00:00Z Xiangdong Zeng <xdzeng96@gmail.com> $
+%<!readme>\GetIdInfo $Id: fduthesis.dtx 0.9 2023-02-26 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)}
@@ -271,13 +271,13 @@ Copyright (C) 2017&ndash;2022 by Xiangdong Zeng <xdzeng96@gmail.com>.
\title{\textcolor{MaterialIndigo800}{\textbf{fduthesis: 复旦大学论文模板}}}
\author{曾祥东}
-\date{2022/09/04\quad v0.8%
+\date{2023/02/26\quad v0.9%
\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{2022/09/04\quad v0.8%
+%^^A! \date{2023/02/26\quad v0.9%
%^^A! \thanks{\url{https://github.com/stone-zeng/fduthesis}.}}
%^^A!
@@ -433,7 +433,7 @@ Copyright (C) 2017&ndash;2022 by Xiangdong Zeng <xdzeng96@gmail.com>.
% \begin{itemize}
% \item 名字后面带有 \rexptarget\rexpstar{} 的,表示只能在\emph{中文模板}中使用;
% \item 名字后面带有 \exptarget\expstar{} 的,表示只能在\emph{英文模板}中使用;
-% \item 名字后面不带有特殊符号的,表示既可以在中文模板中使用,也可以在英文模板中使用。
+% \item 名字后面不带有特殊标记的,表示既可以在中文模板中使用,也可以在英文模板中使用。
% \end{itemize}
%^^A! The options, commands and environments in \cls{fduthesis} can be
%^^A! divided into the following three types:
@@ -442,8 +442,8 @@ Copyright (C) 2017&ndash;2022 by Xiangdong Zeng <xdzeng96@gmail.com>.
%^^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! \item If they do not have marks afterwards, then you can use
+%^^A! them in both Chinese and English templates.
%^^A! \end{itemize}
%^^A!
%
@@ -494,7 +494,7 @@ Copyright (C) 2017&ndash;2022 by Xiangdong Zeng <xdzeng96@gmail.com>.
% \item 从 CTAN 上下载 \cls{fduthesis} 的
% \href{https://mirror.ctan.org/install/macros/latex/contrib/fduthesis.tds.zip}{TDS 安装包};
% \item 按目录结构将 \file{fduthesis.tds.zip} 中的文件复制到 \TeX{} 发行版的本地 TDS 根目录;
-% \item 执行 \bashcmd{mktexlsr} 命令刷新文件名数据库以完成安装。
+% \item 执行 \texttt{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:
@@ -503,7 +503,7 @@ Copyright (C) 2017&ndash;2022 by Xiangdong Zeng <xdzeng96@gmail.com>.
%^^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! \item Run \texttt{mktexlsr} to update the ls-R database.
%^^A! \end{itemize}
%^^A
%
@@ -520,7 +520,7 @@ Copyright (C) 2017&ndash;2022 by Xiangdong Zeng <xdzeng96@gmail.com>.
% \begin{shellexample}[gobble=7,alsoletter={.},morekeywords={git,clone}]
% git clone https://github.com/stone-zeng/fduthesis.git
% \end{shellexample}
-% \item 执行 \file{install-win.bat}(Windows 系统)或 \file{install-linux.sh}(Linux 或 macOS
+% \item 执行 \file{install-win.bat}(Windows 系统)或 \file{install-unix.sh}(Linux 或 macOS
% 系统),所有需要的文件便会在 \file{thesis} 文件夹中生成。
% \end{itemize}
%^^A! On CTAN, only the stable version of \cls{fduthesis} is provided, where new features and
@@ -533,8 +533,8 @@ Copyright (C) 2017&ndash;2022 by Xiangdong Zeng <xdzeng96@gmail.com>.
%^^A! \begin{shellexample}[gobble=5,alsoletter={.},morekeywords={git,clone}]
%^^A! git clone https://github.com/stone-zeng/fduthesis.git
%^^A! \end{shellexample}
-%^^A! \item Run \file{install-win.bat} (on Windows) or \file{install-linux.sh} (on Linux),
-%^^A! then all the necessary files will be found in the \file{thesis} folder.
+%^^A! \item Run \file{install-win.bat} (Windows) or \file{install-unix.sh} (Linux or macOS),
+%^^A! all the necessary files will be found in the \file{thesis} folder then.
%^^A! \end{itemize}
%^^A!
%
@@ -1744,7 +1744,7 @@ Copyright (C) 2017&ndash;2022 by Xiangdong Zeng <xdzeng96@gmail.com>.
% 曰\CJKunderdot{鳳頭、豬肚、豹尾}六字是也。」大概起要美麗,中要浩蕩,
% 結要響亮。尤貴在首尾貫穿,意思清新。苟能若是,斯可以言樂府矣。
% \end{quotation}
-% \hfill ——陶宗儀《南村輟耕錄·作今樂府法》
+% \hfill ^^^^2e3a陶宗儀《南村輟耕錄·作今樂府法》 ^^A ^^^^2e3a = 破折号
%
% \subsubsection{凤头}
%^^A! \subsubsection{Front matter}
@@ -1937,7 +1937,7 @@ Copyright (C) 2017&ndash;2022 by Xiangdong Zeng <xdzeng96@gmail.com>.
% \paragraph{参考文献引用}
%^^A! \paragraph{Citations}
%
-% \begin{function}{\cite}
+% \begin{function}[updated=2021-09-20]{\cite}
% \begin{fdusyntax}[deletetexcs={\cite},morekeywords={\cite}]
% \cite(*\marg{文献标签}*)
% \cite(*\oarg{页码}\marg{文献标签}*)
@@ -1947,7 +1947,7 @@ Copyright (C) 2017&ndash;2022 by Xiangdong Zeng <xdzeng96@gmail.com>.
% 用来标记引用。顺序编码制和著者—出版年制下的各种引用方式见
% 表~\ref{tab:citation-numerical} 和表~\ref{tab:citation-author-year}。
% \end{function}
-%^^A! \begin{function}{\cite}
+%^^A! \begin{function}[updated=2021-09-20]{\cite}
%^^A! \begin{fdusyntax}[deletetexcs={\cite},morekeywords={\cite}]
%^^A! \cite(*\marg{bib key}*)
%^^A! \cite(*\oarg{page number}\marg{bib key}*)
@@ -2175,7 +2175,7 @@ Copyright (C) 2017&ndash;2022 by Xiangdong Zeng <xdzeng96@gmail.com>.
%^^A! the position of QED symbol correct.
%^^A!
%
-% \begin{function}[updated=2017-12-12]{\newtheorem}
+% \begin{function}[updated=2023-02-08]{\newtheorem}
% \begin{fdusyntax}[deletetexcs={\newtheorem},
% morekeywords={\newtheorem,\newtheorem*}]
% \newtheorem(*\oarg{选项}\marg{环境名}\marg{标题}*)
@@ -2360,6 +2360,24 @@ Copyright (C) 2017&ndash;2022 by Xiangdong Zeng <xdzeng96@gmail.com>.
%^^A! \end{function}
%^^A!
%
+% \begin{function}[added=2023-02-06]{acknowledgements}
+% \begin{fdusyntax}[emph={[2]acknowledgements}]
+% \begin{acknowledgements}
+% (*\meta{致谢内容}*)
+% \end{acknowledgements}
+% \end{fdusyntax}
+% 致谢。
+% \end{function}
+%^^A! \begin{function}[added=2023-02-06]{acknowledgements}
+%^^A! \begin{fdusyntax}[emph={[2]acknowledgements}]
+%^^A! \begin{acknowledgements}
+%^^A! (*\meta{acknowledgements}*)
+%^^A! \end{acknowledgements}
+%^^A! \end{fdusyntax}
+%^^A! Acknowledgements.
+%^^A! \end{function}
+%^^A!
+%
% \section{宏包依赖情况}
%^^A! \section{Packages dependencies}
%^^A!
@@ -2754,17 +2772,15 @@ Copyright (C) 2017&ndash;2022 by Xiangdong Zeng <xdzeng96@gmail.com>.
% \subsubsection{内部变量声明}
%
% \begin{variable}{\l_@@_tmpa_box,
-% \l_@@_tmpa_clist,\l_@@_tmpb_clist,
-% \l_@@_tmpa_dim,\l_@@_tmpb_dim,
+% \l_@@_tmpa_clist,
+% \l_@@_tmpa_dim,
% \l_@@_tmpa_skip,
% \l_@@_tmpa_tl,\l_@@_tmpb_tl}
% 临时变量。
% \begin{macrocode}
\box_new:N \l_@@_tmpa_box
\clist_new:N \l_@@_tmpa_clist
-\clist_new:N \l_@@_tmpb_clist
\dim_new:N \l_@@_tmpa_dim
-\dim_new:N \l_@@_tmpb_dim
\skip_new:N \l_@@_tmpa_skip
\tl_new:N \l_@@_tmpa_tl
\tl_new:N \l_@@_tmpb_tl
@@ -2812,17 +2828,14 @@ Copyright (C) 2017&ndash;2022 by Xiangdong Zeng <xdzeng96@gmail.com>.
%
% \subsubsection{内部函数}
%
-% \begin{macro}{\file_input:V,
-% \int_to_arabic:v,
-% \keys_define:nx,
-% \tl_map_inline:xn}
+% \begin{macro}{\file_input:V,\int_to_arabic:v,\keys_define:nx,\regex_replace_all:nnc}
% \begin{macro}[TF]{\tl_if_eq:Vn}
% \LaTeX3{} 函数变体。
% \begin{macrocode}
-\cs_generate_variant:Nn \file_input:n { V }
-\cs_generate_variant:Nn \int_to_arabic:n { v }
-\cs_generate_variant:Nn \keys_define:nn { nx }
-\cs_generate_variant:Nn \tl_map_inline:nn { xn }
+\cs_generate_variant:Nn \file_input:n { V }
+\cs_generate_variant:Nn \int_to_arabic:n { v }
+\cs_generate_variant:Nn \keys_define:nn { nx }
+\cs_generate_variant:Nn \regex_replace_all:nnN { nnc }
\prg_generate_conditional_variant:Nnn \tl_if_eq:nn { Vn } { T, TF }
% \end{macrocode}
% \end{macro}
@@ -2876,7 +2889,7 @@ Copyright (C) 2017&ndash;2022 by Xiangdong Zeng <xdzeng96@gmail.com>.
%
% \begin{macro}{\@@_gadd_ltxhook:nn}
% 封装 \LaTeX{} 的钩子管理机制。本模板中的字体加载命令位于
-% |begindocument/before| 钩子中,需确保在 \pkg{xeCJK} 之前执行。
+% \texttt{begindocument/\allowbreak before} 钩子中,需确保在 \pkg{xeCJK} 之前执行。
% \begin{macrocode}
\cs_new_protected:Npn \@@_gadd_ltxhook:nn #1#2
{ \hook_gput_code:nnn {#1} { . } {#2} }
@@ -2902,8 +2915,6 @@ Copyright (C) 2017&ndash;2022 by Xiangdong Zeng <xdzeng96@gmail.com>.
%
% \begin{macro}{\@@_define_fn_style:nn,
% \@@_define_punct:nn,
-% \@@_define_sep:nn,
-% \@@_define_format:nn,
% \@@_define_name:nn,
% \@@_define_name:nnn}
% 用来定义脚注样式、标点、默认名称的辅助函数。
@@ -2912,10 +2923,6 @@ Copyright (C) 2017&ndash;2022 by Xiangdong Zeng <xdzeng96@gmail.com>.
{ \tl_const:cn { c_@@_fn_style_ #1 _tl } {#2} }
\cs_new_protected:Npn \@@_define_punct:nn #1#2
{ \tl_const:cn { c_@@_ #1 _tl } {#2} }
-% \cs_new_protected:Npn \@@_define_sep:nn #1#2
-% { \tl_const:cn { c_@@_ #1 _sep_tl } {#2} }
-% \cs_new_protected:Npn \@@_define_format:nn #1#2
-% { \tl_const:cn { c_@@_ #1 _format_tl } {#2} }
\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
@@ -2927,7 +2934,7 @@ Copyright (C) 2017&ndash;2022 by Xiangdong Zeng <xdzeng96@gmail.com>.
% \end{macro}
%
% \begin{macro}{\@@_msg_new:nn,
-% \@@_error:n,\@@_error:nn,\@@_error:nx,\@@_error:nnn,\@@_error:nnnn
+% \@@_error:n,\@@_error:nn,\@@_error:nx,\@@_error:nnn,\@@_error:nnnn,
% \@@_warning:n,\@@_warning:nn,\@@_warning:nxx,
% \@@_info:nx}
% 各种信息函数的缩略形式。
@@ -3288,8 +3295,7 @@ Copyright (C) 2017&ndash;2022 by Xiangdong Zeng <xdzeng96@gmail.com>.
% \setmathfont,
% \setCJKmainfont,
% \setCJKsansfont,
-% \setCJKmonofont,
-% \@@_set_font:n}
+% \setCJKmonofont}
% 重新定义以上宏包提供的字体选择命令。我们把它放在导言区末尾,使得用户配置不被
% 模板配置覆盖。
% \begin{macrocode}
@@ -3301,108 +3307,16 @@ Copyright (C) 2017&ndash;2022 by Xiangdong Zeng <xdzeng96@gmail.com>.
{ \use:c { @@_set #1 font:nn } {##2} { ##1, ##3 } }
}
}
-\clist_map_inline:nn { main, sans, mono, math } { \@@_set_font_helper:n {#1} }
-%<class>\clist_map_inline:nn { CJKmain, CJKsans, CJKmono } { \@@_set_font_helper:n {#1} }
+\clist_map_inline:nn { main, sans, mono, math }
+ { \@@_set_font_helper:n {#1} }
+%<class>\clist_map_inline:nn { CJKmain, CJKsans, CJKmono }
+%<class> { \@@_set_font_helper:n {#1} }
% \end{macrocode}
% \end{macro}
%
% \changes{v0.7e}{2019/04/10}{兼容 Libertinus 和 XITS 字体的文件名变动。}
% \changes{v0.8}{2021/09/15}{判断 Libertinus Sans Bold Oblique 字体是否存在。}
-%
-% \begin{macro}{
-% \g_@@_font_family_libertinus_serif_tl,
-% \g_@@_font_family_libertinus_sans_tl,
-% \g_@@_font_style_libertinus_rm_tl,
-% \g_@@_font_style_libertinus_bf_tl,
-% \g_@@_font_style_libertinus_it_tl,
-% \g_@@_font_style_libertinus_bfit_tl,
-% \g_@@_font_style_libertinus_bfsl_tl,
-% \g_@@_font_family_xits_tl,
-% \g_@@_font_style_xits_rm_tl,
-% \g_@@_font_style_xits_bf_tl,
-% \g_@@_font_style_xits_it_tl,
-% \g_@@_font_style_xits_bfit_tl,
-% \g_@@_font_name_libertinus_serif_tl,
-% \g_@@_font_name_libertinus_sans_tl,
-% \g_@@_font_name_libertinus_math_tl,
-% \g_@@_font_name_xits_tl,
-% \g_@@_font_name_xits_math_rm_tl,
-% \g_@@_font_name_xits_math_bf_tl}
-% Libertinus 和 XITS 字体的文件名做过变动,需要特殊处理。
-% \begin{macrocode}
-\tl_new:N \g_@@_font_family_libertinus_serif_tl
-\tl_new:N \g_@@_font_family_libertinus_sans_tl
-\tl_new:N \g_@@_font_style_libertinus_rm_tl
-\tl_new:N \g_@@_font_style_libertinus_bf_tl
-\tl_new:N \g_@@_font_style_libertinus_it_tl
-\tl_new:N \g_@@_font_style_libertinus_bfit_tl
-\tl_new:N \g_@@_font_style_libertinus_bfsl_tl
-\tl_new:N \g_@@_font_family_xits_tl
-\tl_new:N \g_@@_font_style_xits_rm_tl
-\tl_new:N \g_@@_font_style_xits_bf_tl
-\tl_new:N \g_@@_font_style_xits_it_tl
-\tl_new:N \g_@@_font_style_xits_bfit_tl
-\tl_new:N \g_@@_font_name_libertinus_serif_tl
-\tl_new:N \g_@@_font_name_libertinus_sans_tl
-\tl_new:N \g_@@_font_name_libertinus_math_tl
-\tl_new:N \g_@@_font_name_xits_tl
-\tl_new:N \g_@@_font_name_xits_math_rm_tl
-\tl_new:N \g_@@_font_name_xits_math_bf_tl
-\fontspec_font_if_exist:nTF { LibertinusSerif-Regular.otf }
- {
- \tl_set:Nn \g_@@_font_family_libertinus_serif_tl { LibertinusSerif }
- \tl_set:Nn \g_@@_font_family_libertinus_sans_tl { LibertinusSans }
- \tl_set:Nn \g_@@_font_family_libertinus_math_tl { LibertinusMath }
- \tl_set:Nn \g_@@_font_style_libertinus_rm_tl { Regular }
- \tl_set:Nn \g_@@_font_style_libertinus_bf_tl { Bold }
- \tl_set:Nn \g_@@_font_style_libertinus_it_tl { Italic }
- \tl_set:Nn \g_@@_font_style_libertinus_bfit_tl { BoldItalic }
-% \end{macrocode}
-% 较新版本中 Libertinus Sans Bold Oblique 字体被移除,需进行额外判断。
-% \begin{macrocode}
- \fontspec_font_if_exist:nTF { LibertinusSans-BoldOblique.otf }
- { \tl_set:Nn \g_@@_font_style_libertinus_bfsl_tl { BoldOblique } }
- { \tl_set:Nn \g_@@_font_style_libertinus_bfsl_tl { Bold } }
- }
- {
- \tl_set:Nn \g_@@_font_family_libertinus_serif_tl { libertinusserif }
- \tl_set:Nn \g_@@_font_family_libertinus_sans_tl { libertinussans }
- \tl_set:Nn \g_@@_font_family_libertinus_math_tl { libertinusmath }
- \tl_set:Nn \g_@@_font_style_libertinus_rm_tl { regular }
- \tl_set:Nn \g_@@_font_style_libertinus_bf_tl { bold }
- \tl_set:Nn \g_@@_font_style_libertinus_it_tl { italic }
- \tl_set:Nn \g_@@_font_style_libertinus_bfit_tl { bolditalic }
- \tl_set:Nn \g_@@_font_style_libertinus_bfsl_tl { bolditalic }
- }
-\fontspec_font_if_exist:nTF { XITS-Regular.otf }
- {
- \tl_set:Nn \g_@@_font_family_xits_tl { XITS }
- \tl_set:Nn \g_@@_font_style_xits_rm_tl { Regular }
- \tl_set:Nn \g_@@_font_style_xits_bf_tl { Bold }
- \tl_set:Nn \g_@@_font_style_xits_it_tl { Italic }
- \tl_set:Nn \g_@@_font_style_xits_bfit_tl { BoldItalic }
- \tl_set:Nn \g_@@_font_name_xits_math_rm_tl { XITSMath-Regular }
- \tl_set:Nn \g_@@_font_name_xits_math_bf_tl { XITSMath-Bold }
- }
- {
- \tl_set:Nn \g_@@_font_family_xits_tl { xits }
- \tl_set:Nn \g_@@_font_style_xits_rm_tl { regular }
- \tl_set:Nn \g_@@_font_style_xits_bf_tl { bold }
- \tl_set:Nn \g_@@_font_style_xits_it_tl { italic }
- \tl_set:Nn \g_@@_font_style_xits_bfit_tl { bolditalic }
- \tl_set:Nn \g_@@_font_name_xits_math_rm_tl { xits-math }
- \tl_set:Nn \g_@@_font_name_xits_math_bf_tl { xits-mathbold }
- }
-\tl_set:Nx \g_@@_font_name_libertinus_serif_tl
- { \g_@@_font_family_libertinus_serif_tl - \g_@@_font_style_libertinus_rm_tl }
-\tl_set:Nx \g_@@_font_name_libertinus_sans_tl
- { \g_@@_font_family_libertinus_sans_tl - \g_@@_font_style_libertinus_rm_tl }
-\tl_set:Nx \g_@@_font_name_libertinus_math_tl
- { \g_@@_font_family_libertinus_math_tl - \g_@@_font_style_libertinus_rm_tl }
-\tl_set:Nx \g_@@_font_name_xits_tl
- { \g_@@_font_family_xits_tl - \g_@@_font_style_xits_rm_tl }
-% \end{macrocode}
-% \end{macro}
+% \changes{v0.9}{2023/02/18}{不再检查 Libertinus 和 XITS 字体的文件名。}
%
% \begin{macro}{\@@_load_font_garamond:}
% EB Garamond 系列。
@@ -3417,13 +3331,12 @@ Copyright (C) 2017&ndash;2022 by Xiangdong Zeng <xdzeng96@gmail.com>.
ItalicFont = *-Italic,
BoldItalicFont = *-BoldItalic
}
- \@@_setsansfont:nn { \g_@@_font_family_libertinus_sans_tl }
+ \@@_setsansfont:nn { LibertinusSans }
{
Extension = .otf,
- UprightFont = *-\g_@@_font_style_libertinus_rm_tl,
- BoldFont = *-\g_@@_font_style_libertinus_bf_tl,
- ItalicFont = *-\g_@@_font_style_libertinus_it_tl,
- BoldItalicFont = *-\g_@@_font_style_libertinus_bfsl_tl
+ UprightFont = *-Regular,
+ BoldFont = *-Bold,
+ ItalicFont = *-Italic,
}
\@@_setmonofont:nn { lmmonolt10 }
{
@@ -3443,21 +3356,20 @@ Copyright (C) 2017&ndash;2022 by Xiangdong Zeng <xdzeng96@gmail.com>.
% \begin{macrocode}
\cs_new_protected:Npn \@@_load_font_libertinus:
{
- \@@_setmainfont:nn { \g_@@_font_family_libertinus_serif_tl }
+ \@@_setmainfont:nn { LibertinusSerif }
{
Extension = .otf,
- UprightFont = *-\g_@@_font_style_libertinus_rm_tl,
- BoldFont = *-\g_@@_font_style_libertinus_bf_tl,
- ItalicFont = *-\g_@@_font_style_libertinus_it_tl,
- BoldItalicFont = *-\g_@@_font_style_libertinus_bfit_tl
+ UprightFont = *-Regular,
+ BoldFont = *-Bold,
+ ItalicFont = *-Italic,
+ BoldItalicFont = *-BoldItalic,
}
- \@@_setsansfont:nn { \g_@@_font_family_libertinus_sans_tl }
+ \@@_setsansfont:nn { LibertinusSans }
{
Extension = .otf,
- UprightFont = *-\g_@@_font_style_libertinus_rm_tl,
- BoldFont = *-\g_@@_font_style_libertinus_bf_tl,
- ItalicFont = *-\g_@@_font_style_libertinus_it_tl,
- BoldItalicFont = *-\g_@@_font_style_libertinus_bfsl_tl
+ UprightFont = *-Regular,
+ BoldFont = *-Bold,
+ ItalicFont = *-Italic,
}
\@@_setmonofont:nn { lmmonolt10 }
{
@@ -3467,7 +3379,7 @@ Copyright (C) 2017&ndash;2022 by Xiangdong Zeng <xdzeng96@gmail.com>.
ItalicFont = *-oblique,
BoldItalicFont = *-boldoblique
}
- \@@_setmathfont:nn { \g_@@_font_name_libertinus_math_tl .otf } { }
+ \@@_setmathfont:nn { LibertinusMath-Regular.otf } { }
}
% \end{macrocode}
% \end{macro}
@@ -3494,14 +3406,13 @@ Copyright (C) 2017&ndash;2022 by Xiangdong Zeng <xdzeng96@gmail.com>.
ItalicFont = *-italic,
BoldItalicFont = *-bolditalic
}
- \@@_setsansfont:nn { \g_@@_font_family_libertinus_sans_tl }
+ \@@_setsansfont:nn { LibertinusSans }
{
Extension = .otf,
- UprightFont = *-\g_@@_font_style_libertinus_rm_tl,
- BoldFont = *-\g_@@_font_style_libertinus_bf_tl,
- ItalicFont = *-\g_@@_font_style_libertinus_it_tl,
- BoldItalicFont = *-\g_@@_font_style_libertinus_bfsl_tl,
- Scale = MatchUppercase
+ UprightFont = *-Regular,
+ BoldFont = *-Bold,
+ ItalicFont = *-Italic,
+ Scale = MatchUppercase,
}
\@@_setmonofont:nn { lmmonolt10 }
{
@@ -3521,13 +3432,13 @@ Copyright (C) 2017&ndash;2022 by Xiangdong Zeng <xdzeng96@gmail.com>.
% \begin{macrocode}
\cs_new_protected:Npn \@@_load_font_times:
{
- \@@_setmainfont:nn { \g_@@_font_family_xits_tl }
+ \@@_setmainfont:nn { XITS }
{
- Extension = .otf,
- UprightFont = *-\g_@@_font_style_xits_rm_tl,
- BoldFont = *-\g_@@_font_style_xits_bf_tl,
- ItalicFont = *-\g_@@_font_style_xits_it_tl,
- BoldItalicFont = *-\g_@@_font_style_xits_bfit_tl
+ Extension = .otf,
+ UprightFont = *-Regular,
+ BoldFont = *-Bold,
+ ItalicFont = *-Italic,
+ BoldItalicFont = *-BoldItalic,
}
\@@_setsansfont:nn { texgyreheros }
{
@@ -3546,8 +3457,8 @@ Copyright (C) 2017&ndash;2022 by Xiangdong Zeng <xdzeng96@gmail.com>.
BoldItalicFont = *-bolditalic,
Ligatures = CommonOff
}
- \@@_setmathfont:nn { \g_@@_font_name_xits_math_rm_tl .otf }
- { BoldFont = \g_@@_font_name_xits_math_bf_tl .otf }
+ \@@_setmathfont:nn { XITSMath-Regular.otf }
+ { BoldFont = XITSMath-Bold.otf }
}
% \end{macrocode}
% \end{macro}
@@ -3560,8 +3471,8 @@ Copyright (C) 2017&ndash;2022 by Xiangdong Zeng <xdzeng96@gmail.com>.
\@@_setmainfont:nn { Times~ New~ Roman } { }
\@@_setsansfont:nn { Arial } { }
\@@_setmonofont:nn { Courier~ New } { }
- \@@_setmathfont:nn { \g_@@_font_name_xits_math_rm_tl .otf }
- { BoldFont = \g_@@_font_name_xits_math_bf_tl .otf }
+ \@@_setmathfont:nn { XITSMath-Regular.otf }
+ { BoldFont = XITSMath-Bold.otf }
}
% \end{macrocode}
% \end{macro}
@@ -3754,41 +3665,18 @@ Copyright (C) 2017&ndash;2022 by Xiangdong Zeng <xdzeng96@gmail.com>.
%
% \subsubsection{字号}
%
-% \begin{macrocode}
-\keys_define:nn { fdu / style }
- {
-% \end{macrocode}
-%
% \begin{macro}{style/font-size}
+% \changes{v0.9}{2023/02/08}{通过引入 \file{ctex-c5size.clo} 来修改字号。}
% |font-size| 不是文档类选项,不能传给 \cls{ctexbook} 文档类,因此
-% 只能手动重定义字号命令。
+% 需要手动引入 |.clo| 文件。
% \begin{macrocode}
+\keys_define:nn { fdu / style }
+ {
font-size .choice:,
font-size .value_required:n = true,
font-size / -4 .code:n = { },
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\tiny,\scriptsize,\footnotesize,\small,
-% \normalsize,\large,\Large,\LARGE,\huge,\Huge}
-% 默认使用小四号字,所以只有五号字需要重新设置。
-% \begin{macrocode}
- font-size / 5 .code:n =
- {
- \RenewDocumentCommand \tiny { } { \zihao { 7 } }
- \RenewDocumentCommand \scriptsize { } { \zihao { -6 } }
- \RenewDocumentCommand \footnotesize { } { \zihao { 6 } }
- \RenewDocumentCommand \small { } { \zihao { -5 } }
- \RenewDocumentCommand \normalsize { } { \zihao { 5 } }
- \RenewDocumentCommand \large { } { \zihao { -4 } }
- \RenewDocumentCommand \Large { } { \zihao { -3 } }
- \RenewDocumentCommand \LARGE { } { \zihao { -2 } }
- \RenewDocumentCommand \huge { } { \zihao { 2 } }
- \RenewDocumentCommand \Huge { } { \zihao { 1 } }
-%<class-en> }
+ font-size / 5 .code:n = { \ctex_file_input:n { ctex-c5size.clo } },
%<class-en> }
-%<*class>
- },
% \end{macrocode}
% \end{macro}
%
@@ -3798,6 +3686,7 @@ Copyright (C) 2017&ndash;2022 by Xiangdong Zeng <xdzeng96@gmail.com>.
% \changes{v0.6}{2017/10/14}{支持类别码和 TECKit 映射两种机制。}
% 设置句号形状(圆圈或是圆点)。
% \begin{macrocode}
+%<*class>
fullwidth-stop .choice:,
fullwidth-stop .value_required:n = true,
% \end{macrocode}
@@ -3985,17 +3874,31 @@ Copyright (C) 2017&ndash;2022 by Xiangdong Zeng <xdzeng96@gmail.com>.
% \end{macrocode}
%
% \changes{v0.7d}{2019/03/24}{优化目录、摘要、参考文献等的标题实现。}
+% \changes{v0.9}{2023/02/05}{在目录和书签中删除章标题中的 \tn{quad}。}
+%
+% \begin{macro}{\@@_sanitize_chapter_title:n}
+% 删除章标题中的 \tn{quad}。
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_sanitize_chapter_title:n #1
+ {
+ \tl_clear:N \l_@@_tmpa_tl
+ \tl_set:No \l_@@_tmpa_tl {#1}
+ \tl_remove_all:Nn \l_@@_tmpa_tl { \quad }
+ }
+% \end{macrocode}
+% \end{macro}
%
% \begin{macro}{\@@_chapter:n,\@@_chapter:V}
% 手动生成章的标题,用于摘要、参考文献等。
% \begin{macrocode}
\cs_new_protected:Npn \@@_chapter:n #1
{
+ \@@_sanitize_chapter_title:n {#1}
\group_begin:
\ctexset { chapter / numbering = false }
- \chapter {#1}
- \@@_chapter_header:n {#1}
+ \chapter [ \l_@@_tmpa_tl ] {#1}
\group_end:
+ \@@_chapter_header:n {#1}
}
\cs_generate_variant:Nn \@@_chapter:n { V }
% \end{macrocode}
@@ -4007,9 +3910,10 @@ Copyright (C) 2017&ndash;2022 by Xiangdong Zeng <xdzeng96@gmail.com>.
% \begin{macrocode}
\cs_new_protected:Npn \@@_chapter_no_toc:n #1
{
- \chapter * {#1}
+ \chapter * {#1}
+ \@@_sanitize_chapter_title:n {#1}
+ \pdfbookmark [0] { \l_@@_tmpa_tl } { toc }
\@@_chapter_header:n {#1}
- \pdfbookmark [0] {#1} { toc }
}
\cs_generate_variant:Nn \@@_chapter_no_toc:n { V }
% \end{macrocode}
@@ -4128,13 +4032,6 @@ Copyright (C) 2017&ndash;2022 by Xiangdong Zeng <xdzeng96@gmail.com>.
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\@@_fn_symbol_libertinus_sans:n}
-% \opt{libertinus} 阳文无衬线版。符号排列与普通版相同。
-% \begin{macrocode}
-\cs_new_eq:NN \@@_fn_symbol_libertinus_sans:n \@@_fn_symbol_libertinus:n
-% \end{macrocode}
-% \end{macro}
-%
% \begin{macro}{\@@_fn_symbol_pifont:n}
% \opt{pifont} 普通版。以下四种都只包含 \numrange{1}{10}。
% \begin{macrocode}
@@ -4226,18 +4123,18 @@ Copyright (C) 2017&ndash;2022 by Xiangdong Zeng <xdzeng96@gmail.com>.
% \begin{macrocode}
\c_@@_fn_style_libertinus_tl
{
- \fontspec { \g_@@_font_name_libertinus_serif_tl .otf }
+ \fontspec { LibertinusSerif-Regular.otf }
\@@_fn_symbol_libertinus:n {#1}
}
\c_@@_fn_style_libertinus_neg_tl
{
- \fontspec { \g_@@_font_name_libertinus_serif_tl .otf }
+ \fontspec { LibertinusSerif-Regular.otf }
\@@_fn_symbol_libertinus_neg:n {#1}
}
\c_@@_fn_style_libertinus_sans_tl
{
- \fontspec { \g_@@_font_name_libertinus_sans_tl .otf }
- \@@_fn_symbol_libertinus_sans:n {#1}
+ \fontspec { LibertinusSans-Regular.otf }
+ \@@_fn_symbol_libertinus:n {#1}
}
% \end{macrocode}
% \opt{pifont} 类型无需进行额外的操作。
@@ -4255,17 +4152,17 @@ Copyright (C) 2017&ndash;2022 by Xiangdong Zeng <xdzeng96@gmail.com>.
% \begin{macrocode}
\c_@@_fn_style_xits_tl
{
- \fontspec { \g_@@_font_name_xits_tl .otf }
+ \fontspec { XITS-Regular.otf }
\@@_fn_symbol_xits:n {#1}
}
\c_@@_fn_style_xits_sans_tl
{
- \fontspec { \g_@@_font_name_xits_tl .otf }
+ \fontspec { XITS-Regular.otf }
\@@_fn_symbol_xits_sans:n {#1}
}
\c_@@_fn_style_xits_sans_neg_tl
{
- \fontspec { \g_@@_font_name_xits_tl .otf }
+ \fontspec { XITS-Regular.otf }
\@@_fn_symbol_xits_sans_neg:n {#1}
}
}
@@ -4356,9 +4253,10 @@ Copyright (C) 2017&ndash;2022 by Xiangdong Zeng <xdzeng96@gmail.com>.
% \cs{new\-the\-orem}。}
%
% \begin{macro}{\newtheorem}
+% \changes{v0.9}{2023/02/08}{改用 \cs{DeclareDocumentCommand} 定义。}
% 定义新的定理环境。
% \begin{macrocode}
-\RenewDocumentCommand \newtheorem { s o m m }
+\DeclareDocumentCommand \newtheorem { s o m m }
{
% \end{macrocode}
% 默认情况下,由 \cs{newtheorem*} 创建的定理其证毕符号为 \cs{QED},
@@ -4587,6 +4485,35 @@ Copyright (C) 2017&ndash;2022 by Xiangdong Zeng <xdzeng96@gmail.com>.
% \end{macrocode}
% \end{variable}
%
+% \changes{v0.9}{2023/02/12}{删除论文标题中的 \tn{\textbackslash} 和汉字间的空格。}
+%
+% \begin{variable}{\l_@@_info_title_sanitized_tl,
+% \l_@@_info_title_en_sanitized_tl}
+% 处理后的论文标题。
+% \begin{macrocode}
+\tl_new:N \l_@@_info_title_sanitized_tl
+\tl_new:N \l_@@_info_title_en_sanitized_tl
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{macro}{\@@_set_title:nn}
+% 设置论文标题,并删除其中的 |\\| 和汉字间的空格。
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_set_title:nn #1#2
+ {
+ \tl_set:cn { l_@@_info_ #1 _tl } {#2}
+ \tl_set:cn { l_@@_info_ #1 _sanitized_tl } {#2}
+ \tl_replace_all:cnn { l_@@_info_ #1 _sanitized_tl } { \\ } { ~ }
+ \regex_replace_all:nnc
+ { \s+ } { \ }
+ { l_@@_info_ #1 _sanitized_tl }
+ \regex_replace_all:nnc
+ { ([\x{4e00}-\x{9fff}]) \s+ ([\x{4e00}-\x{9fff}]) } { \1 \2 }
+ { l_@@_info_ #1 _sanitized_tl }
+ }
+% \end{macrocode}
+% \end{macro}
+%
% 定义 |fdu/info| 键值类。
% \begin{macrocode}
\keys_define:nn { fdu / info }
@@ -4607,8 +4534,8 @@ Copyright (C) 2017&ndash;2022 by Xiangdong Zeng <xdzeng96@gmail.com>.
% \begin{macro}{info/title,info/title*}
% 论文题目。以下带星号的项目均表示相应的英文字段。
% \begin{macrocode}
- title .tl_set:N = \l_@@_info_title_tl,
- title* .tl_set:N = \l_@@_info_title_en_tl,
+ title .code:n = { \@@_set_title:nn { title } {#1} },
+ title* .code:n = { \@@_set_title:nn { title_en } {#1} },
% \end{macrocode}
% \end{macro}
%
@@ -4769,7 +4696,7 @@ Copyright (C) 2017&ndash;2022 by Xiangdong Zeng <xdzeng96@gmail.com>.
%
% \subsubsection{定义内部函数}
%
-% \begin{macro}{\@@_spread_box:nn}
+% \begin{macro}{\@@_spread_box:nn,\@@_spread_box:no}
% 分散对齐的水平盒子。
% \begin{arguments}
% \item 宽度
@@ -4777,14 +4704,13 @@ Copyright (C) 2017&ndash;2022 by Xiangdong Zeng <xdzeng96@gmail.com>.
% \end{arguments}
% 利用 \cs{tl_map_inline:nn} 在字符间插入 \tn{hfil};紧随其后的 \tn{unskip}
% 将会去掉最后一个 \tn{hfil}。见 \url{https://tex.stackexchange.com/q/169689}。
-% |#2| 需要完全展开以避免 underfull 警告。
% \begin{macrocode}
\cs_new_protected:Npn \@@_spread_box:nn #1#2
{
\mode_leave_vertical:
- \hbox_to_wd:nn {#1}
- { \tl_map_inline:xn {#2} { ##1 \hfil } \unskip }
+ \hbox_to_wd:nn {#1} { \tl_map_inline:nn {#2} { ##1 \hfil } \unskip }
}
+\cs_generate_variant:Nn \@@_spread_box:nn { no }
% \end{macrocode}
% \end{macro}
%
@@ -4796,7 +4722,7 @@ Copyright (C) 2017&ndash;2022 by Xiangdong Zeng <xdzeng96@gmail.com>.
\mode_leave_vertical:
\hbox_to_wd:nn {#1} { \hfil #2 \hfil }
}
-\cs_generate_variant:Nn \@@_center_box:nn { Vn }
+\cs_generate_variant:Nn \@@_center_box:nn { Vn }
% \end{macrocode}
% \end{macro}
%
@@ -4832,36 +4758,6 @@ Copyright (C) 2017&ndash;2022 by Xiangdong Zeng <xdzeng96@gmail.com>.
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\@@_get_max_text_width:NN}
-% \changes{v0.6}{2017/11/24}{移除不必要的字号设置。}
-% 获取多个文本中的最大宽度,并存入 |dim| 型变量。
-% \begin{arguments}
-% \item |dim| 型变量
-% \item 文本 |clist|
-% \end{arguments}
-% 当 \cs{l_@@_tmpa_clist} 非空时,弹出最后一个元素
-% 赋给 \cs{l_@@_tmpa_tl},获取其长度后与 |#1| 进行比较,
-% 二者中较大的那一个将成为 |#1| 的新值。
-% 不断循环,直至 \cs{l_@@_tmpa_clist} 为空。
-% \begin{macrocode}
-\cs_new:Npn \@@_get_max_text_width:NN #1#2
- {
-% \end{macrocode}
-% 这里用 |group| 确保局部变量不会被污染。
-% \begin{macrocode}
- \group_begin:
- \clist_set_eq:NN \l_@@_tmpa_clist #2
- \bool_until_do:nn { \clist_if_empty_p:N \l_@@_tmpa_clist }
- {
- \clist_pop:NN \l_@@_tmpa_clist \l_@@_tmpa_tl
- \@@_get_text_width:NV \l_@@_tmpa_dim \l_@@_tmpa_tl
- \dim_gset:Nn #1 { \dim_max:nn {#1} { \l_@@_tmpa_dim } }
- }
- \group_end:
- }
-% \end{macrocode}
-% \end{macro}
-%
% \begin{macro}{\@@_blank_underline:n}
% \changes{v0.4}{2017/08/14}{改用 \tn{rule} 绘制下划线,不再依赖
% \pkg{ulem} 宏包。}
@@ -4953,7 +4849,7 @@ Copyright (C) 2017&ndash;2022 by Xiangdong Zeng <xdzeng96@gmail.com>.
\clist_item:Nn \c_@@_thesis_type_clist
{ \g_@@_thesis_type_int }
}
- \@@_spread_box:nn { 0.45 \textwidth } { \l_@@_tmpa_tl }
+ \@@_spread_box:no { 0.45 \textwidth } { \l_@@_tmpa_tl }
}
% \end{macrocode}
% \end{macro}
@@ -4975,68 +4871,67 @@ Copyright (C) 2017&ndash;2022 by Xiangdong Zeng <xdzeng96@gmail.com>.
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\@@_cover_info:,\l_@@_cover_info_left_width_tl}
+% \begin{macro}{\@@_cover_info_left:n}
+% 信息栏左侧字段。
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_cover_info_left:n #1
+ {
+ \int_case:nn { \l_@@_info_degree_type_int }
+ {
+ { 1 } { \_@@_spread_box:nn { 6 em } {#1} }
+ { 2 } { \_@@_spread_box:nn { 9 em } {#1} }
+ }
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{variable}{\c_@@_cover_info_align_tl}
+% 信息栏对齐格式:左右两栏均居中,中间以冒号分隔。
+% \begin{macrocode}
+\tl_const:Nn \c_@@_cover_info_align_tl
+ { c @ { \c_@@_fwid_colon_tl } c }
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{macro}{\@@_cover_info:}
% \changes{v0.8}{2021/09/21}{调整专业学位的封面信息栏。}
+% \changes{v0.9}{2023/02/05}{封面信息栏改用表格实现。}
% 信息栏。
% \begin{macrocode}
\cs_new_protected:Npn \@@_cover_info:
{
- \tl_set:Nx \l_@@_cover_info_left_width_tl
- {
- \int_case:nn { \l_@@_info_degree_type_int }
- {
- { 1 } { 6 em }
- { 2 } { 9 em }
- }
- }
- \begin{minipage} [ c ] { \textwidth }
- \centering \zihao { 4 }
+ \group_begin:
+ \zihao { 4 }
% \end{macrocode}
-% 读取左侧名称字段。
+% 专业学位与学术学位对应的左侧字段有所不同,这里统一存入 \cs{c_@@_name_major_tl}。
% \begin{macrocode}
- \clist_set:Nx \l_@@_tmpa_clist
+ \int_compare:nNnT { \l_@@_info_degree_type_int } = { 2 }
{
- \c_@@_name_department_tl,
- \int_case:nn { \l_@@_info_degree_type_int }
- {
- { 1 } { \c_@@_name_major_tl }
- { 2 } { \c_@@_name_major_professional_tl }
- },
- \c_@@_name_author_tl,
- \c_@@_name_supervisor_tl,
- \c_@@_name_date_tl,
+ \tl_set_eq:NN
+ \c_@@_name_major_tl \c_@@_name_major_professional_tl
}
% \end{macrocode}
-% 设置信息栏右侧宽度。读取各字段,并将最宽者的宽度赋给
-% \cs{l_@@_tmpb_dim}。
+% 将信息栏的每一行存入 |clist| 变量中。
% \begin{macrocode}
- \clist_set:Nx \l_@@_tmpb_clist
+ \clist_clear:N \l_@@_tmpa_clist
+ \clist_map_inline:nn { department, major, author, supervisor, date }
{
- { \l_@@_info_department_tl },
- { \l_@@_info_major_tl },
- { \l_@@_info_author_tl },
- { \l_@@_info_supervisor_tl },
- { \l_@@_info_date_tl }
+ \clist_gput_right:Nn \l_@@_tmpa_clist
+ {
+ \exp_args:Nx \@@_cover_info_left:n
+ { \tl_use:c { c_@@_name_ ##1 _tl } }
+ &
+ \tl_use:c { l_@@_info_ ##1 _tl }
+ }
}
- \@@_get_max_text_width:NN \l_@@_tmpb_dim \l_@@_tmpb_clist
% \end{macrocode}
-% 用循环输出各字段。
+% 通过 \env{tabular} 环境输出。
% \begin{macrocode}
- \bool_until_do:nn
- { \clist_if_empty_p:N \l_@@_tmpa_clist }
- {
- \clist_pop:NN \l_@@_tmpa_clist \l_@@_tmpa_tl
- \clist_pop:NN \l_@@_tmpb_clist \l_@@_tmpb_tl
- \@@_spread_box:nn
- { \l_@@_cover_info_left_width_tl }
- { \l_@@_tmpa_tl }
- \c_@@_fwid_colon_tl
- \@@_center_box:Vn \l_@@_tmpb_dim { \l_@@_tmpb_tl }
- \skip_vertical:n { 1 ex }
- }
- \end{minipage}
+ \begin{tabular} { \c_@@_cover_info_align_tl }
+ \clist_use:Nn \l_@@_tmpa_clist { \\ [ 1 ex ] }
+ \end{tabular}
+ \group_end:
}
-\tl_new:N \l_@@_cover_info_left_width_tl
% \end{macrocode}
% \end{macro}
%
@@ -5227,12 +5122,15 @@ Copyright (C) 2017&ndash;2022 by Xiangdong Zeng <xdzeng96@gmail.com>.
%
% \subsubsection{绘制封面}
%
+% \changes{v0.9}{2023/02/18}{为封面添加 PDF 页码。}
+%
% \begin{macro}{\makecoveri}
% 论文封面(封一)。
% \begin{macrocode}
\NewDocumentCommand \makecoveri { }
{
\thispagestyle { empty }
+ \tl_set:Nn \thepage { A }
\UseInstance { fdu / cover } { cover-i-default }
}
% \end{macrocode}
@@ -5246,7 +5144,9 @@ Copyright (C) 2017&ndash;2022 by Xiangdong Zeng <xdzeng96@gmail.com>.
\NewDocumentCommand \makecoverii { }
{
\thispagestyle { empty }
- \clist_if_empty:NF \l_@@_info_instructors_clist
+ \tl_set:Nn \thepage { B }
+ \clist_if_empty:NTF \l_@@_info_instructors_clist
+ { \hbox:n { } }
{ \UseInstance { fdu / cover } { cover-ii-default } }
}
% \end{macrocode}
@@ -5258,11 +5158,10 @@ Copyright (C) 2017&ndash;2022 by Xiangdong Zeng <xdzeng96@gmail.com>.
\NewDocumentCommand \makecoveriii { }
{
\cleardoublepage
+ \thispagestyle { empty }
+ \tl_set:Nn \thepage { C }
\tl_if_empty:NTF \l_@@_declaration_page_tl
- {
- \thispagestyle { empty }
- \UseInstance { fdu / cover } { cover-iii-default }
- }
+ { \UseInstance { fdu / cover } { cover-iii-default } }
{ \includepdf { \l_@@_declaration_page_tl } }
}
% \end{macrocode}
@@ -5307,7 +5206,8 @@ Copyright (C) 2017&ndash;2022 by Xiangdong Zeng <xdzeng96@gmail.com>.
type / format = \zihao { 2 },
degree / format = \zihao { 4 },
title / format = \zihao { -2 } \bfseries,
- title-en / format = \@@_line_spread:n { 1.2 } \zihao { 4 } \bfseries,
+ title-en / format =
+ \@@_line_spread:n { 1.2 } \zihao { 4 } \bfseries,
id / bottom-skip = 0 pt plus 1.6 fill,
logo / bottom-skip = 0 pt plus 0.3 fill,
type / bottom-skip = -18 pt,
@@ -5325,7 +5225,7 @@ Copyright (C) 2017&ndash;2022 by Xiangdong Zeng <xdzeng96@gmail.com>.
{
%<class-en> format = \@@_line_spread:N \c_@@_line_spread_fp,
title / content =
- \@@_spread_box:nn { 7 em } { \c_@@_name_instructors_tl },
+ \@@_spread_box:no { 7 em } { \c_@@_name_instructors_tl },
name-list / content =
\clist_use:Nn \l_@@_info_instructors_clist { \par },
title / format = \zihao { 2 } \sffamily,
@@ -5451,7 +5351,7 @@ Copyright (C) 2017&ndash;2022 by Xiangdong Zeng <xdzeng96@gmail.com>.
% \begin{macro}{\tableofcontents,\listoffigures,\listoftables}
% 修改 \cs{tableofcontents}、\cs{listoffigures} 和 \cs{listoftables} 的定义,
% 使得页眉正确显示,并出现在目录及 PDF 书签中。来自于 \LaTeXe{} 标准文档类
-% \file{book.cls}
+% \file{book.cls}^^A
% \footnote{原代码中只有 \cs{tableofcontents} 的 \cs{@mkboth} 出现在
% \cs{chapter*} 内部,这是出于兼容性的考虑而非 typo。}。
% \begin{macrocode}
@@ -5573,7 +5473,7 @@ Copyright (C) 2017&ndash;2022 by Xiangdong Zeng <xdzeng96@gmail.com>.
% \end{macro}
%
% \begin{macro}{\@@_keywords:nNn,\@@_keywords_prevdepth:,\@@_clc_jel:nn}
-% 关键字列表前要空一行,使用悬挂缩进;分类号不缩进。|\parbox| 之后的间距
+% 关键字列表前要空一行,使用悬挂缩进;分类号不缩进。\tn{parbox} 之后的间距
% 需要调整,见 \url{https://tex.stackexchange.com/a/34982}。
% \begin{macrocode}
\cs_new_protected:Npn \@@_keywords:nNn #1#2#3
@@ -5584,7 +5484,8 @@ Copyright (C) 2017&ndash;2022 by Xiangdong Zeng <xdzeng96@gmail.com>.
\parbox [t] { \dim_eval:n { \textwidth - \l_@@_tmpa_dim } }
{
\clist_use:Nn #2 {#3} \par
- \cs_gset:Npx \@@_keywords_prevdepth: { \dim_use:N \tex_prevdepth:D }
+ \cs_gset:Npx \@@_keywords_prevdepth:
+ { \dim_use:N \tex_prevdepth:D }
}
}
\cs_new_protected:Npn \@@_clc_jel:nn #1#2
@@ -5641,6 +5542,29 @@ Copyright (C) 2017&ndash;2022 by Xiangdong Zeng <xdzeng96@gmail.com>.
% \end{macrocode}
% \end{macro}
%
+% \subsection{致谢}
+%
+% \changes{v0.9}{2023/02/06}{新增致谢环境。}
+%
+% \begin{environment}{acknowledgements}
+% 致谢环境。
+% \begin{macrocode}
+\NewDocumentEnvironment { acknowledgements } { }
+ { \@@_acknowledgements_begin: } { }
+% \end{macrocode}
+% \end{environment}
+%
+% \begin{macro}{\@@_acknowledgements_begin:}
+% 致谢页标题。
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_acknowledgements_begin:
+ {
+%<class> \@@_chapter:V \c_@@_name_acknowledgements_tl
+%<class-en> \@@_chapter:V \c_@@_name_acknowledgements_en_tl
+ }
+% \end{macrocode}
+% \end{macro}
+%
% \subsection{参考文献著录与引用}
%
% \changes{v0.6}{2017/10/27}{支持 \BibTeX{},以实现参考文献的著录与引用。}
@@ -5742,19 +5666,21 @@ Copyright (C) 2017&ndash;2022 by Xiangdong Zeng <xdzeng96@gmail.com>.
\tl_if_empty:NTF \l_@@_bib_style_tl
{
\RequirePackage [ sort & compress ] { gbt7714 }
- \exp_args:No \bibliographystyle { gbt7714- \l_@@_bib_gb_style_tl }
+ \exp_args:No \bibliographystyle
+ { gbt7714- \l_@@_bib_gb_style_tl }
}
{
\RequirePackage [ sort & compress ] { natbib }
- \exp_args:NV \bibliographystyle \l_@@_bib_style_tl
+ \exp_args:No \bibliographystyle
+ { \l_@@_bib_style_tl }
}
\@@_bibtex_setup:
}
}
% \end{macrocode}
% \pkg{biblatex} 会写入 |begindocument/before| 钩子,因此需在其之前通过
-% \texttt{env/document/\-begin} 钩子载入 \pkg{biblatex} 宏包。注意这个钩子仅
-% 适用于 |\begin{document}| 的写法,对于 |\document| 命令本身无效。
+% \texttt{env/doc\-u\-ment/begin} 钩子载入 \pkg{biblatex} 宏包。注意这个
+% 钩子仅适用于 |\begin{document}| 的写法,对于 |\document| 命令本身无效。
% \begin{macrocode}
\@@_gadd_ltxhook:nn { env/document/begin }
{
@@ -5915,8 +5841,7 @@ Copyright (C) 2017&ndash;2022 by Xiangdong Zeng <xdzeng96@gmail.com>.
% \end{macrocode}
% \end{macro}
%
-% \changes{v0.7}{2018/01/25}{同步 \pkg{gbt7714} v1.0,移除有关超链接
-% 的额外设置。}
+% \changes{v0.7}{2018/01/25}{同步 \pkg{gbt7714} v1.0,移除有关超链接的额外设置。}
% \changes{v0.8}{2021/09/20}{不再将著录用符号修改为中文标点符号。}
%
% \subsection{\pkg{hyperref} 相关配置}
@@ -5927,16 +5852,19 @@ Copyright (C) 2017&ndash;2022 by Xiangdong Zeng <xdzeng96@gmail.com>.
% \changes{v0.7}{2018/01/23}{将 \pkg{hyperref} 相关配置移至模板末尾,
% 以减少冲突。}
%
-% \begin{macro}{\hypersetup,\fdu_hyperref_setup:n}
+% \begin{macro}{\hypersetup}
+% \changes{v0.9}{2023/02/08}{改用 \cs{DeclareDocumentCommand} 定义。}
+% \begin{macro}{\fdu_hyperref_setup:n}
% \pkg{hyperref} 宏包是在导言区之后才引入的。若要在导言区中使用
% \tn{hypersetup} 命令,必须另行定义。
% \begin{macrocode}
-\NewDocumentCommand \hypersetup { m }
+\DeclareDocumentCommand \hypersetup { m }
{ \fdu_hyperref_setup:n {#1} }
\cs_new_protected:Npn \fdu_hyperref_setup:n #1
{ \clist_gput_right:Nn \g_@@_to_hyperref_clist {#1} }
% \end{macrocode}
% \end{macro}
+% \end{macro}
%
% \begin{macro}{\@@_set_hyperlink_color_key:n}
% 设置超链接颜色选项。最后的逗号用于确保 \pkg{l3keys} 可以正确解析,不能省去。
@@ -6060,12 +5988,12 @@ Copyright (C) 2017&ndash;2022 by Xiangdong Zeng <xdzeng96@gmail.com>.
% 填写 PDF 元信息。
% \begin{macrocode}
%<*class>
- pdftitle = \l_@@_info_title_tl,
+ pdftitle = \l_@@_info_title_sanitized_tl,
pdfauthor = \l_@@_info_author_tl,
pdfkeywords = \l_@@_info_keywords_clist,
%</class>
%<*class-en>
- pdftitle = \l_@@_info_title_en_tl,
+ pdftitle = \l_@@_info_title_en_sanitized_tl,
pdfauthor = \l_@@_info_author_en_tl,
pdfkeywords = \l_@@_info_keywords_en_clist,
%</class-en>
@@ -6338,17 +6266,20 @@ Copyright (C) 2017&ndash;2022 by Xiangdong Zeng <xdzeng96@gmail.com>.
{ lot } { 表格目录 },
{ bib_en } { Bibliography },
{ pdf_creator } { LaTeX~ with~ fduthesis~ class },
- { orig_decl } { \c_@@_name_simp_tl \\ 学位论文独创性声明 },
- { auth_decl } { \c_@@_name_simp_tl \\ 学位论文使用授权声明 }
+ { orig_decl }
+ { \c_@@_name_simp_tl \\ 学位论文独创性声明 },
+ { auth_decl }
+ { \c_@@_name_simp_tl \\ 学位论文使用授权声明 },
}
{ \@@_define_name:nn #1 }
\clist_map_inline:nn
{
- { abstract } { 摘 \quad 要 } { Abstract },
- { keywords } { 关键字 } { Keywords: },
- { clc } { 中图分类号 } { CLC~ code: },
- { jel } { JEL 分类号 } { JEL~ code: },
- { notation } { 符号表 } { List~ of~ Symbols }
+ { abstract } { 摘 \quad 要 } { Abstract },
+ { keywords } { 关键字 } { Keywords: },
+ { clc } { 中图分类号 } { CLC~ code: },
+ { jel } { JEL 分类号 } { JEL~ code: },
+ { notation } { 符号表 } { List~ of~ Symbols },
+ { acknowledgements } { 致 \quad 谢 } { Acknowledgements }
}
{ \@@_define_name:nnn #1 }
% \end{macrocode}
@@ -6366,9 +6297,18 @@ Copyright (C) 2017&ndash;2022 by Xiangdong Zeng <xdzeng96@gmail.com>.
{ theorem } { 定理 } { Theorem }
}
{ \@@_define_name:nnn #1 }
+% \end{macrocode}
+%
+% \begin{variable}{\c_@@_name_major_professional_tl}
+% \changes{v0.9}{2023/02/05}{处理右括号带来的间距。}
+% 处理右括号带来的间距。
+% \begin{macrocode}
+\tl_put_right:Nn \c_@@_name_major_professional_tl
+ { { \skip_horizontal:n { -0.5 em } } }
%</definition>
%<@@=>
% \end{macrocode}
+% \end{variable}
%
% \clearpage
%