diff options
author | Norbert Preining <norbert@preining.info> | 2022-05-02 03:04:05 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2022-05-02 03:04:05 +0000 |
commit | 29bacc2ed13a988db81626180c697ecff8583672 (patch) | |
tree | c38dd89d9be6eb09bc20c7b2588000f365baf25f /macros | |
parent | bd031e64d0627026284118a2a8ceaf112f7e04e9 (diff) |
CTAN sync 202205020304
Diffstat (limited to 'macros')
-rw-r--r-- | macros/latex/contrib/easybook/easybook.dtx | 11 | ||||
-rw-r--r-- | macros/latex/contrib/easybook/easybook.pdf | bin | 591558 -> 591122 bytes | |||
-rw-r--r-- | macros/latex/contrib/easybook/easybook.tex | 256 | ||||
-rw-r--r-- | macros/latex/contrib/hvfloat/Changes | 1 | ||||
-rw-r--r-- | macros/latex/contrib/hvfloat/doc/hvfloat.pdf | bin | 5031955 -> 5039170 bytes | |||
-rw-r--r-- | macros/latex/contrib/hvfloat/doc/hvfloat.tex | 22 | ||||
-rw-r--r-- | macros/latex/contrib/hvfloat/latex/hvfloat.sty | 53 | ||||
-rw-r--r-- | macros/unicodetex/latex/njuthesis/njuthesis.dtx | 980 | ||||
-rw-r--r-- | macros/unicodetex/latex/njuthesis/njuthesis.ins | 4 | ||||
-rw-r--r-- | macros/unicodetex/latex/njuthesis/njuthesis.pdf | bin | 1221585 -> 1261937 bytes |
10 files changed, 860 insertions, 467 deletions
diff --git a/macros/latex/contrib/easybook/easybook.dtx b/macros/latex/contrib/easybook/easybook.dtx index 07c562221e..2a1c0e3d78 100644 --- a/macros/latex/contrib/easybook/easybook.dtx +++ b/macros/latex/contrib/easybook/easybook.dtx @@ -15,7 +15,7 @@ %<*class> \NeedsTeXFormat{LaTeX2e}[2020/10/01] \RequirePackage{l3keys2e} -\ProvidesExplClass{easybook}{2022/04/24}{1.68} +\ProvidesExplClass{easybook}{2022/05/01}{1.682} {Easily typesetting Chinese theses or books} \bool_set_false:N \l__eb_compile_draft_bool @@ -303,7 +303,7 @@ %<*package> \NeedsTeXFormat{LaTeX2e}[2020/10/01] \RequirePackage{l3keys2e,etoolbox} -\ProvidesExplPackage{easybase}{2022/04/24}{1.68} +\ProvidesExplPackage{easybase}{2022/05/01}{1.682} {Easily typesetting Chinese theses or books} \cs_generate_variant:Nn \dim_set:Nn { NV } @@ -496,7 +496,7 @@ \LoadPackage { - spbmark[both]+ + spbmark[text]+ ulem[normalem]+ enumitem[shortlabels,inline]+ chemformula+siunitx+pifont+ @@ -1142,7 +1142,8 @@ { \cs_set:Npn \@makefnmark { \hbox:n {#1} } } \cs_new_protected:Npn \defdownfntmark #1 { \cs_set:Npn \eb@makefnmark { \hbox:n {#1} } } -\cs_new:Npn \notminipage { \tl_if_eq:NnTF \@mpfn { footnote } } +\cs_new_protected:Npn \notminipage + { \tl_if_eq:NnTF \@mpfn { footnote } } \defupfntmark { \eb_fnmate_format_initial: @@ -2322,7 +2323,7 @@ } %</package> %<*tcolorbox> -\ProvidesExplFile{eb-tcolorbox.cfg}{2022/04/24}{1.68} +\ProvidesExplFile{eb-tcolorbox.cfg}{2022/05/01}{1.682} {Customization of tcolorbox for easybook} \cs_set_protected:Npn \addtotcbstyle #1#2 diff --git a/macros/latex/contrib/easybook/easybook.pdf b/macros/latex/contrib/easybook/easybook.pdf Binary files differindex 9dc4327a1a..b0ba222f53 100644 --- a/macros/latex/contrib/easybook/easybook.pdf +++ b/macros/latex/contrib/easybook/easybook.pdf diff --git a/macros/latex/contrib/easybook/easybook.tex b/macros/latex/contrib/easybook/easybook.tex index b7cf89b7aa..0525656103 100644 --- a/macros/latex/contrib/easybook/easybook.tex +++ b/macros/latex/contrib/easybook/easybook.tex @@ -21,8 +21,8 @@ name = easybook, color-scheme = blue, title = EASYBOOK使用手册, - version = v1.68, - date = 2022/04/24, + version = v1.682, + date = 2022/05/01, authors = 瞿毅, info = 简便地排版中文学位论文或书籍, email = toquyi@163.com, @@ -239,7 +239,9 @@ \section{文档类选项} \label{sec:document class options} -文档类选项应当在使用 \cls*{easybook} 文档类或 \pkg*{easybase} 宏包(部分支持)时载入,可见\ref{subsec:basic usage} 的例子。选项前带有 \ding{73} 符号表示只可用于文档类,否则文档类与宏包都适用。除了下面列举的选项以外,还支持标准和 \CTeX 文档类的选项。 +文档类选项应当在使用 \cls*{easybook} 文档类或 \pkg*{easybase} 宏包(部分支持)时指定,可见\ref{subsec:basic usage} 的例子。选项前带有 \ding{73} 符号表示只可用于文档类,否则文档类与宏包都适用。除了下面列举的选项以外,还支持标准和 \CTeX 文档类的选项。 + +\subsection{基本选项} \begin{options} \opt{draft} 开启草稿模式会加快编译速度,表现有显示页面边框、行溢出的地方显示黑色方块、图片变成占位方框、显示当前日期和关闭超链接渲染。不使用绘图宏包及依赖于 \pkg*{tcolorbox} 宏包的盒子环境也会增快编译速度,详情见\ref{subsec:box}。 @@ -259,7 +261,7 @@ 是否提供定理功能支持。选项开启时定理样式模块生效,此时会载入 \pkg*{amsthm} 和 \pkg*{thmtools} 宏包。 \end{options} -\subsection{中文字体} +\subsection{配置字体} \begin{options} \keychoice{cjkfont}{adobe,fandol,founder,mac,macnew,macold,ubuntu,windows,none}\dtag 中文字体采用 \CTeX 宏集包含的字库并与其一致,具体配置方案可以查看 \CTeX 使用手册。它与 \option*{fontset} 选项是等效的,如果没有指定 \option{cjkfont} 的值,将会自动检测操作系统并选择相应的字体。 @@ -273,7 +275,6 @@ \end{ctexexam} \end{options} -\subsection{英文字体} \begin{options} \keychoice{font}{noto,times,times*,ebgaramond,libertine,palatino,auto}\dtag\Default{auto} 预置的英文字体相关配置方案如下表所示。这些字体已经包含在了 \TeX Live 发行版中,所以通常不需要再专门安装。如果您想使用其它英文字体,可以使用 \pkg*{fontspec} 宏包的相关命令进行设置。 @@ -294,7 +295,6 @@ } \end{options} -\subsection{数学字体} \begin{options} \keychoice{mathfont}{times,noto,notosans,nc,stix2,charter,ebgaramond,libertine,none}\dtag\Default{times} 选择合适的数学字体,将会加载 \pkg*{newtxmath} 和 \pkg*{bm} 宏包。使用选项 \code{none} 时可以使用 \pkg*{unicode-math} 等其它数学字体宏包定义字体。 @@ -303,125 +303,13 @@ \subsection{\textsf{article} 模式} \begin{options} \keychoice{class}{book,article}\Default{book} - 使用 \cls*{easybook} 文档类可以有两种模式,默认为 \cls*{book} 模式。选用 \code{article} 会变为 \code{oneside} 单面排版,同时使文档编号、结构等与标准 \cls*{article} 文档类的特性相似,可用于短篇幅的文章,不需要再使用 \cs*{chapter} 命令。此时\ref{sec:document command} 中目录命令的 \option{chapter} 选项会失效,将以 \code{section} 标题级别输出目录。如果使用 \cls*{ctexart} 配合 \pkg*{easybase} 宏包,则选项值 \code{book} 会失效。 + 使用 \cls*{easybook} 文档类可以有两种模式,默认为 \cls*{book} 模式。选用 \code{article} 会变为 \code{oneside} 单面排版,同时使文档编号、结构等与标准 \cls*{article} 文档类的特性相似,可用于短篇幅的文章,不需要再使用 \cs*{chapter} 命令。此时\ref{subsec:directory command} 中目录命令的 \option{chapter} 选项会失效,将以 \code{section} 标题级别输出目录。如果使用 \cls*{ctexart} 配合 \pkg*{easybase} 宏包,则选项值 \code{book} 会失效。 \opt{book} 开启 \cls*{book} 书籍模式,与 \keyis*{class}{book} 等效。 \opt{article} 开启 \cls*{article} 文章模式,与 \keyis*{class}{article} 等效。 \end{options} -\section{文档命令} -\label{sec:document command} - -\subsection{文区命令} -\begin{commands} - \command{frontmatter}[\sarg\oarg{编号格式}]\Default{Roman} - 前言区命令。使部分和章标题不编号,带有星号的变体命令不使用 \cs{cleardoublepage} 命令。页码 \meta{编号格式} 可设置为例如 \code{roman} 或 \code{Alph} 等形式。 - \command{mainmatter}[\sarg] - 主文区命令。章标题正常编号且页码为从1开始计数的阿拉伯数字,带有星号的变体命令不使用 \cs{cleardoublepage} 清双页命令。 - \command{backmatter} - 后记区命令。页码格式与编号保持不变,章标题不编号。 - \command{cleardoublepage}[\oarg{页面风格}]\Default{empty} - 清双页命令可以确保下一页文本总在奇数页开始,在奇数页使用它会产生空白偶数页。文区命令 \cs{frontmatter} 和 \cs{mainmatter} 会用到清双页命令,在启用文类选项 \option*{openright} 时标题命令 \cs*{part} 和 \cs*{chapter} 也会默认用到清双页命令。 - \command{blankpagestyle}[\marg{页面风格}] - 多出空白页的 \meta{页面风格} 用空白页面风格命令 \cs{blankpagestyle} 全局指定,或使用清双页命令的可选参数局部指定。空白页默认的风格为 \code{empty},即空的页眉页脚。 - \end{commands} - -\subsection{目录命令} -\begin{commands} - \command{tableofcontents}[\sarg\oarg{键值列表}\darg{代码钩子}] - 文档主目录命令。带有星号参数的命令不输出目录标题。\meta{代码钩子} 是当方案 \keyis{plan}{both} 时中文与英文目录之间执行的代码,可以插入目录样式和换页等命令。 - \begin{options} - \keychoice{plan}{cn,bi,both}\Default{cn}\newtag[Exp]% - 文档主目录的输出方案。\code{cn} 只输出中文目录,\code{bi} 只输出英文目录。\code{both} 同时连续输出中文和英文目录,需要与双语目录标题命令 \cs{bichapter} 等或双语标题选项 \option{title} 配合使用。 - \keyval{bicontentsname}{英文目录标题}\Default{Contents}\newtag% - 英文目录的标题,为通用接口命令 \cs*{ctexset} 的选项。 - \end{options} - \command{listoffigures}[\sarg\oarg{键值列表}] - 输出图片目录命令。带有星号参数的命令不输出目录标题。 - \command{listoftables}[\sarg\oarg{键值列表}] - 输出表格目录命令。带有星号参数的命令不输出目录标题。 - \command{listoflstlistings}[\sarg\oarg{键值列表}] - 输出代码目录命令。带有星号参数的命令不输出目录标题。 - - 如果需要部分而不是全文的目录或其它类型的目录,可以查看 \pkg*{titletoc} 宏包的相关示例。如果需要双语图表目录,可以查看 \pkg*{bicaption} 宏包的相关示例。上面目录命令的可选参数改进了原本单一的功能,其中 \meta{键值列表} 的选项如下: - \begin{options} - \keyval{level}{标题命令}\newtag% - 设定输出目录标题的命令。如果使用 \option{title} 选项设置了双语标题则需要配合双语标题命令。 - \begin{ctexexam} - \tableofcontents[level = \chapter*] - \listoffigures[level = \bichapter,title = {图片索引,List of Figures}] - \end{ctexexam} - \keyval{multoc}{整数}\Default{2} - 设置目录的排版栏数。\meta{整数} 代表目录栏数,不指定栏数的值则默认为双栏。 - \kvsplit{title}{中文目录标题,英文目录标题} - 用于更改目录的双语标题。标题之间用一个英文逗号分开,对主目录来说前部分为中文目录标题,后部分为英文目录标题,对图表和代码目录来说后部分则是加入英文目录的条目。也可以只有一部分,表示中文目录的标题。 - \keychoice{bilist}{mix,new}\Default{new} - 确定文档主目录中双语标题列表的输出排列方式。选项 \code{mix} 使每个英文标题条目在中文目录中跟随对应的中文标题输出,\code{new} 则在新建的英文目录中输出英文标题。 - \keyval{format}{目录标题格式} - 设置目录标题的格式,在标题级别为 \code{chapter} 或者 \cls*{article} 模式且标题级别为 \code{section} 时有效。 - \keyval{aftertitle}{标题后代码} - 目录标题文本之后插入的代码,生效情形同上。 - \keyval{pagestyle}{页面风格}\Default{empty} - 目录标题所在页的页面格式,仅当目录以 \code{chapter} 级别输出时有效。除了上述选项还支持 \CTeX 键值列表路径 \module*{chapter} 或 \module*{section} 所有的章节标题样式选项。 - \end{options} -\end{commands} - -\subsection{双语标题} -双语目录标题命令目前设置了常用的三个级别,它们将中文标题正常输出,并使中英文标题加入双语目录。类似于标准文档类,这三个标题命令分别具有独立的计数器\footnote{默认情况下与普通标题命令共享使用计数器。},并对应 \cs*{the}\meta{计数器} 的值,可以用于 \option{binumber} 选项更改英文目录中的编号。这个功能是为国内一些高校的学位论文模板的要求设计,在一般情况和英文模式下\textbf{不需要使用}。 -\begin{commands} - \command{bichapter}[\sarg\oarg{目录中文标题}\marg{中文标题}\marg{目录英文标题}] - \code{chapter} 章级别的双语目录标题命令,具有独立的 \code{bichapter} 计数器。 - \command{bisection}[\sarg\oarg{目录中文标题}\marg{中文标题}\marg{目录英文标题}] - \code{section} 节级别的双语目录标题命令,具有独立的 \code{bisection} 计数器。 - \command{bisubsection}[\sarg\oarg{目录中文标题}\marg{中文标题}\marg{目录英文标题}] - \code{subsection} 小节级别的双语目录标题命令,具有独立的 \code{bisubsection} 计数器。 - - 它们的星号变体命令使文中标题不编号,但是仍然加入双语目录,若英文标题参数空置那么仅加入中文目录而不加入英文目录,这一特点与 \cs*{chapter}\sarg{} 等命令的行为不太一样,在一些情况下会用到。可选参数是目录中的中文标题,默认与中文标题一致,正文标题过长时可用它设置在目录中显示的标题。默认情况下双语目录的格式是一致的,共享使用 \module*{tocset} 模块的设置,英文目录的章级别标题名及编号的修改方式如下: - \begin{options} - \kvsplit{biname}{英文目录前名字,英文目录后名字}\Module{chapter}\Default{Chapter\cs*{space}} - 更改英文目录 \code{chapter} 级别的标题编号前后名字,类似于 \CTeX 的 \option*{name} 选项。 - \keyval{binmuber}{英文目录数字输出命令}\Default{\cs*{arabic}\Marg{chapter}} - 更改英文目录 \code{chapter} 级别的标题编号输出格式,类似于 \CTeX 的 \option*{number} 选项。 - \end{options} -\end{commands} - -\begin{commands} - \command{appendix}[\splitoarg{前名字,后名字}\darg{数字输出命令}] - 附录起始命令,其后的章节标题变为附录形式。英文目录中附录标题的 \meta{前名字} 为英文附录目录前名字,\meta{后名字} 为英文附录目录后名字。前后名字之间用一个半角逗号分开,也可以只有一部分,表示英文附录目录前名字。\meta{数字输出命令} 为附录标题计数器在英文目录中的编号命令。 - \command{BeforeAddBitoc}[\sarg\marg{英文标题加入目录前的代码}] - 作用于局部范围的英文目录钩子,可以插入标题或目录设置的命令改变英文目录中标题的显示格式,也可以覆盖上述的目录前后名字和编号等设置,带有星号的命令会重置之前的代码,放置在导言区或 \cs{bichapter} 等命令前生效。 -\end{commands} - -\subsection{上标和下标} -上标和下标的功能来自 \pkg*{spbmark} 宏包,下面有三个命令可以用于输出上标和下标。可以使用键值列表的形式对上下标格式进行局部或全局设置,下面命令中两个可选参数的键值列表是等效的。全局设置的详情见\ref{subsubsec:super-sub-script}。 -\begin{commands} - \command{super}[\sarg\oarg{键值列表1}\marg{内容}\oarg{键值列表2}] - 输出上标的命令,与简短命令 \cs{sp} 等效。 - \command{sub}[\sarg\oarg{键值列表1}\marg{内容}\oarg{键值列表2}] - 输出下标的命令,与简短命令 \cs{sb} 等效。用法和参数与上标命令 \cs{super} 类似。 - \command{supersub}[\sarg\oarg{键值列表1}\marg{上标内容}\marg{下标内容}\oarg{键值列表2}] - 同时输出上标和下标的命令,与简短命令 \cs{spb} 等效。 - \command{spbifmath}[\marg{数学模式代码}\marg{文本模式代码}] - 根据上下标处于数学还是文本模式分别设置不同的值,应当在格式命令或偏移距离选项中使用。 - - 上下标命令键值列表中共同的选项如下所示。当下面除 \option{mode} 以外的选项用于 \module*{style} 模块全局设置时,它们将根据前面最近一个命令的类型设定相应值。 - \begin{options} - \keyval{vmove}{刚性长度}\Default{0pt} - 上标或下标的垂直偏移。如果是上下标命令使用则代表上标和上标间的额外垂直距离 \option{vsep}。 - \keyval{hmove}{刚性长度}\Default{0pt} - 上标或下标的水平偏移。如果是上下标命令使用则代表上标和上标的共同偏移。 - \keyval{cmd}{格式命令} - 上标或下标的格式命令选项。最后一个命令可以带有一个参数,这个参数用于接受上标或下标。 - \keyval{height}{刚性长度} - 段落中当前行上标或下标的基线与前一行的间距。 - \keyval{depth}{刚性长度} - 段落中当前行上标或下标的基线与下一行的间距。 - \keychoice{mode}{text,math,match}\Default{match} - 上标或下标的输出格式。可以为文本 \code{text} 或数学 \code{math} 模式。当使用选项 \code{match} 时可以根据当前段落所处的模式自动匹配。 - \end{options} -\end{commands} - \section{接口选项} \label{sec:interface options} \begin{commands} @@ -469,7 +357,7 @@ \keyval{color-every}{HTML颜色代码} 统一设置主题的各部分颜色。参数是6个十六进制数字组成的 \code{HTML} 颜色代码,任意颜色的代码可以在常见的图片处理工具拾色器中查看。 \keyval{multoc}{整数}\Default{2} - 设置目录的排版栏数,与\ref{sec:document command} 中目录命令的同名选项有相同效果。 + 设置目录的排版栏数,与\ref{subsec:directory command} 中目录命令的同名选项有相同效果。 \keybool{withpart}\Default{false} 使章标题跟随部分计数器编号,当开启新的一部分时章编号从1开始。 \keychoice{fntnumwith}{part,chapter,page}\Default{chapter} @@ -616,7 +504,7 @@ \begin{commands} \command{printbibliography}[\oarg{键值列表}] - 两种方式\textbf{均使用}此命令打印参考文献,不同处理后端此命令的 \meta{键值列表} 不同。使用 \hologo{BibTeX} 处理时选项与\ref{sec:document command} 目录命令的选项相同,使用 \hologo{biber} 处理时常用的选项如下: + 两种方式\textbf{均使用}此命令打印参考文献,不同处理后端此命令的 \meta{键值列表} 不同。使用 \hologo{BibTeX} 处理时选项与\ref{subsec:directory command} 目录命令的选项相同,使用 \hologo{biber} 处理时常用的选项如下: \end{commands} \begin{options} @@ -840,13 +728,14 @@ \keychoice{fntext-vmove}{fixed length,match}\Default{0pt} 脚注内容标记的垂直偏移。可以设为刚性长度,或用 \code{match} 匹配 \option*{spvmove} 全局的值。 \keychoice{fnmate-form}{format code,match} - 默认脚注标记的格式,选项 \code{match} 可以匹配 \option*{spcmd} 全局的值。一般配合 \keyis{fnmate-num}{plain} 原生编号形式使用,例如用 \pkg*{circledsteps} 宏包的带圈符号命令 \cs*{Circled} 给脚注标记添加圆圈: + 默认脚注标记的格式,选项 \code{match} 可以匹配 \option*{spcmd} 全局的值。一般配合 \keyis{fnmate-num}{plain} 原生编号形式使用,例如用 \pkg*{circledtext} 宏包的带圈字符命令 \cs*{circledtext} 给脚注标记添加圆圈: \begin{ctexexam} - \usepackage{circledsteps} + \usepackage{circledtext} + \circledtextset{resize = real,width = 0.5em} \ebhdrset { fntext-pos = normal, - fnmate-form = \tiny\Circled + fnmate-form = \circledtext } \end{ctexexam} \begin{commands} @@ -854,7 +743,7 @@ 定义脚注正文标记的格式,与正文标记编号命令 \cs{theupfootnote} 配合使用。 \command{defdownfntmark}[\marg{脚注内容标记格式}] 定义脚注内容标记的格式,与内容标记编号命令 \cs{thedownfootnote} 配合使用。 - \command{notminipage}[\marg{普通页内容}\marg{迷你页内容}] + \command{notminipage}[\marg{普通页内容}\marg{迷你页内容}]\newtag[Chg]% 用于在定义脚注标记的命令中判断当前脚注是否处于迷你页而输出不同的内容。 \command{theupfootnote} 保存正文标记编号类型选项 \option{fnmark-num} 指定的正文标记。 @@ -933,7 +822,7 @@ \command{contentsuse}[\marg{条目名}\marg{扩展名}] 激活名称为 \meta{条目名} 的浮动环境目录定制功能,它使用的目录文件后缀为 \meta{扩展名}。需要在激活条目后再使用命令 \cs{RegisterTocName} 注册选项。 \command{DeclareFloatList}[\marg{条目名}\marg{扩展名}]\newtag% - 声明一个新的 \cs*{listof}\meta{条目名}\code{\textcolor{cs}{s}} 的浮动环境目录命令,并且支持\ref{sec:document command} 中图表目录命令的机制。使用这个命令要确保将条目加入目录的机制已经存在,推荐搭配 \pkg*{newfloat} 宏包创建新的浮动环境。选项前有符号 \textcolor{red}{\ding{73}} 表示在声明后可用。下面举一个声明算法目录的例子: + 声明一个新的 \cs*{listof}\meta{条目名}\code{\textcolor{cs}{s}} 的浮动环境目录命令,并且支持\ref{subsec:directory command} 中图表目录命令的机制。使用这个命令要确保将条目加入目录的机制已经存在,推荐搭配 \pkg*{newfloat} 宏包创建新的浮动环境。选项前有符号 \textcolor{red}{\ding{73}} 表示在声明后可用。下面举一个声明算法目录的例子: \begin{ctexexam} \usepackage{newfloat} \DeclareFloatingEnvironment[ @@ -975,7 +864,117 @@ 统一设置所有级别的目录引导线样式。 \end{options} -\section{常用环境} +\section{环境和命令} + +\subsection{文区命令} +\begin{commands} + \command{frontmatter}[\sarg\oarg{编号格式}]\Default{Roman} + 前言区命令。使部分和章标题不编号,带有星号的变体命令不使用 \cs{cleardoublepage} 命令。页码 \meta{编号格式} 可设置为例如 \code{roman} 或 \code{Alph} 等形式。 + \command{mainmatter}[\sarg] + 主文区命令。章标题正常编号且页码为从1开始计数的阿拉伯数字,带有星号的变体命令不使用 \cs{cleardoublepage} 清双页命令。 + \command{backmatter} + 后记区命令。页码格式与编号保持不变,章标题不编号。 + \command{cleardoublepage}[\oarg{页面风格}]\Default{empty} + 清双页命令可以确保下一页文本总在奇数页开始,在奇数页使用它会产生空白偶数页。文区命令 \cs{frontmatter} 和 \cs{mainmatter} 会用到清双页命令,在启用文类选项 \option*{openright} 时标题命令 \cs*{part} 和 \cs*{chapter} 也会默认用到清双页命令。 + \command{blankpagestyle}[\marg{页面风格}] + 多出空白页的 \meta{页面风格} 用空白页面风格命令 \cs{blankpagestyle} 全局指定,或使用清双页命令的可选参数局部指定。空白页默认的风格为 \code{empty},即空的页眉页脚。 + \end{commands} + +\subsection{目录命令} +\label{subsec:directory command} +\begin{commands} + \command{tableofcontents}[\sarg\oarg{键值列表}\darg{代码钩子}] + 文档主目录命令。带有星号参数的命令不输出目录标题。\meta{代码钩子} 是当方案 \keyis{plan}{both} 时中文与英文目录之间执行的代码,可以插入目录样式和换页等命令。 + \begin{options} + \keychoice{plan}{cn,bi,both}\Default{cn}\newtag[Exp]% + 文档主目录的输出方案。\code{cn} 只输出中文目录,\code{bi} 只输出英文目录。\code{both} 同时连续输出中文和英文目录,需要与双语目录标题命令 \cs{bichapter} 等或双语标题选项 \option{title} 配合使用。 + \keyval{bicontentsname}{英文目录标题}\Default{Contents}\newtag% + 英文目录的标题,为通用接口命令 \cs*{ctexset} 的选项。 + \end{options} + \command{listoffigures}[\sarg\oarg{键值列表}] + 输出图片目录命令。带有星号参数的命令不输出目录标题。 + \command{listoftables}[\sarg\oarg{键值列表}] + 输出表格目录命令。带有星号参数的命令不输出目录标题。 + \command{listoflstlistings}[\sarg\oarg{键值列表}] + 输出代码目录命令。带有星号参数的命令不输出目录标题。 + + 如果需要部分而不是全文的目录或其它类型的目录,可以查看 \pkg*{titletoc} 宏包的相关示例。如果需要双语图表目录,可以查看 \pkg*{bicaption} 宏包的相关示例。上面目录命令的可选参数改进了原本单一的功能,其中 \meta{键值列表} 的选项如下: + \begin{options} + \keyval{level}{标题命令}\newtag% + 设定输出目录标题的命令。如果使用 \option{title} 选项设置了双语标题则需要配合双语标题命令。 + \begin{ctexexam} + \tableofcontents[level = \chapter*] + \listoffigures[level = \bichapter,title = {图片索引,List of Figures}] + \end{ctexexam} + \keyval{multoc}{整数}\Default{2} + 设置目录的排版栏数。\meta{整数} 代表目录栏数,不指定栏数的值则默认为双栏。 + \kvsplit{title}{中文目录标题,英文目录标题} + 用于更改目录的双语标题。标题之间用一个英文逗号分开,对主目录来说前部分为中文目录标题,后部分为英文目录标题,对图表和代码目录来说后部分则是加入英文目录的条目。也可以只有一部分,表示中文目录的标题。 + \keychoice{bilist}{mix,new}\Default{new} + 确定文档主目录中双语标题列表的输出排列方式。选项 \code{mix} 使每个英文标题条目在中文目录中跟随对应的中文标题输出,\code{new} 则在新建的英文目录中输出英文标题。 + \keyval{format}{目录标题格式} + 设置目录标题的格式,在标题级别为 \code{chapter} 或者 \cls*{article} 模式且标题级别为 \code{section} 时有效。 + \keyval{aftertitle}{标题后代码} + 目录标题文本之后插入的代码,生效情形同上。 + \keyval{pagestyle}{页面风格}\Default{empty} + 目录标题所在页的页面格式,仅当目录以 \code{chapter} 级别输出时有效。除了上述选项还支持 \CTeX 键值列表路径 \module*{chapter} 或 \module*{section} 所有的章节标题样式选项。 + \end{options} +\end{commands} + +\subsection{双语标题} +双语目录标题命令目前设置了常用的三个级别,它们将中文标题正常输出,并使中英文标题加入双语目录。类似于标准文档类,这三个标题命令分别具有独立的计数器\footnote{默认情况下与普通标题命令共享使用计数器。},并对应 \cs*{the}\meta{计数器} 的值,可以用于 \option{binumber} 选项更改英文目录中的编号。这个功能是为国内一些高校的学位论文模板的要求设计,在一般情况和英文模式下\textbf{不需要使用}。 +\begin{commands} + \command{bichapter}[\sarg\oarg{目录中文标题}\marg{中文标题}\marg{目录英文标题}] + \code{chapter} 章级别的双语目录标题命令,具有独立的 \code{bichapter} 计数器。 + \command{bisection}[\sarg\oarg{目录中文标题}\marg{中文标题}\marg{目录英文标题}] + \code{section} 节级别的双语目录标题命令,具有独立的 \code{bisection} 计数器。 + \command{bisubsection}[\sarg\oarg{目录中文标题}\marg{中文标题}\marg{目录英文标题}] + \code{subsection} 小节级别的双语目录标题命令,具有独立的 \code{bisubsection} 计数器。 + + 它们的星号变体命令使文中标题不编号,但是仍然加入双语目录,若英文标题参数空置那么仅加入中文目录而不加入英文目录,这一特点与 \cs*{chapter}\sarg{} 等命令的行为不太一样,在一些情况下会用到。可选参数是目录中的中文标题,默认与中文标题一致,正文标题过长时可用它设置在目录中显示的标题。默认情况下双语目录的格式是一致的,共享使用 \module*{tocset} 模块的设置,英文目录的章级别标题名及编号的修改方式如下: + \begin{options} + \kvsplit{biname}{英文目录前名字,英文目录后名字}\Module{chapter}\Default{Chapter\cs*{space}} + 更改英文目录 \code{chapter} 级别的标题编号前后名字,类似于 \CTeX 的 \option*{name} 选项。 + \keyval{binmuber}{英文目录数字输出命令}\Default{\cs*{arabic}\Marg{chapter}} + 更改英文目录 \code{chapter} 级别的标题编号输出格式,类似于 \CTeX 的 \option*{number} 选项。 + \end{options} +\end{commands} + +\begin{commands} + \command{appendix}[\splitoarg{前名字,后名字}\darg{数字输出命令}] + 附录起始命令,其后的章节标题变为附录形式。英文目录中附录标题的 \meta{前名字} 为英文附录目录前名字,\meta{后名字} 为英文附录目录后名字。前后名字之间用一个半角逗号分开,也可以只有一部分,表示英文附录目录前名字。\meta{数字输出命令} 为附录标题计数器在英文目录中的编号命令。 + \command{BeforeAddBitoc}[\sarg\marg{英文标题加入目录前的代码}] + 作用于局部范围的英文目录钩子,可以插入标题或目录设置的命令改变英文目录中标题的显示格式,也可以覆盖上述的目录前后名字和编号等设置,带有星号的命令会重置之前的代码,放置在导言区或 \cs{bichapter} 等命令前生效。 +\end{commands} + +\subsection{上标和下标} +上标和下标的功能来自 \pkg*{spbmark} 宏包,下面有三个命令可以用于输出上标和下标。可以使用键值列表的形式对上下标格式进行局部或全局设置,下面命令中两个可选参数的键值列表是等效的。全局设置的详情见\ref{subsubsec:super-sub-script}。 +\begin{commands} + \command{super}[\sarg\oarg{键值列表1}\marg{内容}\oarg{键值列表2}] + 输出上标的命令,与简短命令 \cs{sp} 等效。 + \command{sub}[\sarg\oarg{键值列表1}\marg{内容}\oarg{键值列表2}] + 输出下标的命令,与简短命令 \cs{sb} 等效。用法和参数与上标命令 \cs{super} 类似。 + \command{supersub}[\sarg\oarg{键值列表1}\marg{上标内容}\marg{下标内容}\oarg{键值列表2}] + 同时输出上标和下标的命令,与简短命令 \cs{spb} 等效。 + \command{spbifmath}[\marg{数学模式代码}\marg{文本模式代码}] + 根据上下标处于数学还是文本模式分别设置不同的值,应当在格式命令或偏移距离选项中使用。 + + 上下标命令键值列表中共同的选项如下所示。当下面除 \option{mode} 以外的选项用于 \module*{style} 模块全局设置时,它们将根据前面最近一个命令的类型设定相应值。 + \begin{options} + \keyval{vmove}{刚性长度}\Default{0pt} + 上标或下标的垂直偏移。如果是上下标命令使用则代表上标和上标间的额外垂直距离 \option{vsep}。 + \keyval{hmove}{刚性长度}\Default{0pt} + 上标或下标的水平偏移。如果是上下标命令使用则代表上标和上标的共同偏移。 + \keyval{cmd}{格式命令} + 上标或下标的格式命令选项。最后一个命令可以带有一个参数,这个参数用于接受上标或下标。 + \keyval{height}{刚性长度} + 段落中当前行上标或下标的基线与前一行的间距。 + \keyval{depth}{刚性长度} + 段落中当前行上标或下标的基线与下一行的间距。 + \keychoice{mode}{text,math,match}\Default{match} + 上标或下标的输出格式。可以为文本 \code{text} 或数学 \code{math} 模式。当使用选项 \code{match} 时可以根据当前段落所处的模式自动匹配。 + \end{options} +\end{commands} \subsection{公式} \begin{environments}\noitemsep @@ -1218,7 +1217,7 @@ \command{makeindex}[\oarg{键值列表}] 用于导言区开启索引收集的命令。这个命令可以重复使用收集多个索引表,以不同的 \meta{索引名} 作为区分,如果仅打印一个索引表没必要重复使用。 \command{printindex}[\sarg\oarg{键值列表}] - 打印不同索引表的命令。这个命令被重新定义,\meta{键值列表} 中的选项与\ref{sec:document command} 其它目录命令相同,但是接口命令 \cs{indexsetup} 的部分选项失效。 + 打印不同索引表的命令。这个命令被重新定义,\meta{键值列表} 中的选项与\ref{subsec:directory command} 其它目录命令相同,但是接口命令 \cs{indexsetup} 的部分选项失效。 \begin{options} \keyval{name}{索引名} 指定输出名为 \meta{索引名} 的索引表,如果只使用一个索引表则默认为项目文件名不需要指定。 @@ -1319,6 +1318,7 @@ \end{version} \shortversion{v = 1.638,date = 2022/03/04,changes = 增加目录条目样式选项注册命令 \cs{RegisterTocName}。} \shortversion{v = 1.644,date = 2022/03/10,changes = 增加浮动环境目录声明命令 \cs{DeclareFloatList} 配合 \pkg*{caption} 宏包。} + \shortversion{v = 1.682,date = 2022/05/01,changes = 将迷你页判断命令 \cs*{notminipage} 改为被保护命令兼容 \pkg*{circledtext} 宏包。} \end{changelog} \nocite{*} diff --git a/macros/latex/contrib/hvfloat/Changes b/macros/latex/contrib/hvfloat/Changes index 5cd0c94e9d..9976f84d27 100644 --- a/macros/latex/contrib/hvfloat/Changes +++ b/macros/latex/contrib/hvfloat/Changes @@ -1,4 +1,5 @@ hvfloat.sty: +2.39 2022-05-01 - fix for using package calc and global length setting 2.38 2022-04-02 - added option l for capWidth to get a caption with linewidth, if also using the option wide for the object 2.37 2022-02-28 - fix bug for doublepage floats in twoside and twocolumn mode diff --git a/macros/latex/contrib/hvfloat/doc/hvfloat.pdf b/macros/latex/contrib/hvfloat/doc/hvfloat.pdf Binary files differindex 856cdd1ffb..83ad56d472 100644 --- a/macros/latex/contrib/hvfloat/doc/hvfloat.pdf +++ b/macros/latex/contrib/hvfloat/doc/hvfloat.pdf diff --git a/macros/latex/contrib/hvfloat/doc/hvfloat.tex b/macros/latex/contrib/hvfloat/doc/hvfloat.tex index 820136ff36..116141dec6 100644 --- a/macros/latex/contrib/hvfloat/doc/hvfloat.tex +++ b/macros/latex/contrib/hvfloat/doc/hvfloat.tex @@ -1,4 +1,4 @@ -%% $Id: hvfloat.tex 488 2022-04-02 19:32:17Z herbert $ +%% $Id: hvfloat.tex 530 2022-05-01 11:01:31Z herbert $ \listfiles \errorcontextlines=100 \documentclass[twoside,paper=a4,usegeometry]{scrartcl} @@ -2610,7 +2610,7 @@ in the inner margin on both pages. \begin{lstlisting} -\hvFloat[doubleFULLPAGE,capPos=right,bindCorr=5mm]% +\hvFloat[doubleFULLPAGE,capPos=after,bindCorr=5mm]% {figure}% {\includegraphics[width=2\paperwidth]{images/r+j3}}% [A doublepage image with a caption on the image.]% @@ -2622,7 +2622,7 @@ in the inner margin on both pages. \end{lstlisting} \marginnote{Fig.~\ref{fig:doubleFULLPAGE0a}} - \hvFloat[doubleFULLPAGE,capPos=right,bindCorr=5mm]% + \hvFloat[doubleFULLPAGE,capPos=after,bindCorr=5mm]% {figure}% {\includegraphics[height=2\paperwidth]{images/r+j3}}% [A doublepage image with a caption on the image.]% @@ -2771,6 +2771,7 @@ There will be pagenumbers and a caption can be rotated on the right of the objec {fig:doublePAGE0} \hvblindtext +\hvblindtext \Blindtext @@ -2813,7 +2814,9 @@ and the rest of the text area is filled with text. \hvblindtext +\Blindtext +\hvblindtext \begin{lstlisting} @@ -2825,13 +2828,13 @@ and the rest of the text area is filled with text. right-hand part of the illustration. The illustration begins on the left edge of the paper. A short form is used for the LOF. The parameter is \texttt{doublePage}}% - {fig:doublePage0} + {fig:doublePage1} \end{lstlisting} \hvFloatSetDefaults -\marginnote{Fig. \ref{fig:doublePage0}} +\marginnote{Fig. \ref{fig:doublePage1}} \hvFloat[doublePage,capPos=right,capVPos=top]% {figure}% {\includegraphics[width=2\textwidth]{images/sonne-meer}}% @@ -2840,7 +2843,9 @@ and the rest of the text area is filled with text. right-hand part of the illustration. The illustration begins on the left edge of the paper. A short form is used for the LOF. The parameter is \texttt{doublePage}}% - {fig:doublePage0} + {fig:doublePage1} + +\Blindtext \Blindtext @@ -2867,7 +2872,8 @@ and the rest of the text area is filled with text. \hvFloatSetDefaults \marginnote{Fig. \ref{fig:doublePage0sH2}} -\hvFloat[doublePage,,bindCorr=inner]% +\hvFloat[doublePage,bindCorr=inner +]% {figure}% {\includegraphics[width=2\textwidth]{images/sonne-meer}}% [A doublepage image with a caption on the right side of the right part.]% @@ -2881,7 +2887,7 @@ and the rest of the text area is filled with text. \Blindtext -%\Blindtext +\Blindtext diff --git a/macros/latex/contrib/hvfloat/latex/hvfloat.sty b/macros/latex/contrib/hvfloat/latex/hvfloat.sty index c3d8d0e57d..ec23f2c318 100644 --- a/macros/latex/contrib/hvfloat/latex/hvfloat.sty +++ b/macros/latex/contrib/hvfloat/latex/hvfloat.sty @@ -1,4 +1,4 @@ -%% $Id: hvfloat.sty 488 2022-04-02 19:32:17Z herbert $ +%% $Id: hvfloat.sty 530 2022-05-01 11:01:31Z herbert $ %% %% %% IMPORTANT NOTICE: @@ -6,6 +6,7 @@ %% This is file `hvfloat.sty', %% %% Herbert Voss <hvoss@tug.org> +%% Copyright (C) 2003-22 %% %% This program can be redistributed and/or modified under the terms %% of the LaTeX Project Public License Distributed from CTAN archives @@ -15,8 +16,8 @@ %% `hvfloat' offers rotating of captions and objects for floats %% \NeedsTeXFormat{LaTeX2e} -\def\fileversion{2.38} -\def\filedate{2022/04/02} +\def\fileversion{2.39} +\def\filedate{2022/05/01} %\message{`hvfloat' v\fileversion, \filedate\space (Herbert Voss)} \ProvidesPackage{hvfloat}[\filedate\space v\fileversion\space special floating objects (hv)] \let\hvFloatFileVersion\fileversion @@ -299,13 +300,13 @@ \newcommand\hv@set@noverticalSpace{% no space on top for a float page \let\hv@dblfptop\@dblfptop \let\hv@fptop\@fptop - \global\setlength{\@dblfptop}{0\p@}% - \global\setlength{\@fptop}{0\p@}% + \global\@dblfptop=0\p@ + \global\@fptop=0\p@ } \newcommand\hv@reset@noverticalSpace{% - \global\setlength{\@dblfptop}{\hv@dblfptop}% - \global\setlength{\@fptop}{\hv@fptop}% + \global\@dblfptop=\hv@dblfptop + \global\@fptop=\hv@fptop } \providecommand\figcaption[2][]{}% @@ -560,8 +561,8 @@ \gdef\hv@label{#3}% \ifhv@capbeside\def\@@temp{1}\else\def\@@temp{0}\fi \ifhv@sameHeight\global\hv@global@sameHeighttrue\else\global\hv@global@sameHeightfalse\fi - \global\setlength\hvSet@bindCorrection{\hvSet@bindCorr}% for doublepage objects - \global\setlength\hv@floatCapSep{\hvSet@floatCapSep}% + \global\hvSet@bindCorrection=\hvSet@bindCorr% for doublepage objects + \global\hv@floatCapSep=\hvSet@floatCapSep% % \ifhv@fullpage \def\hvSet@CapWidth{n}% relative value @@ -1099,10 +1100,11 @@ % \def\do@hvFloat@doublePage#1{% image on left and right page with caption on the right page % #1-> 0/1 caption under/right - \global\setlength\hv@leftPageObjectWidth{\dimexpr\paperwidth-1in-\evensidemargin-\hvSet@bindCorrection}% - \global\setlength\hv@tempWidthA{\the\dimexpr1in+\oddsidemargin-\hvSet@bindCorrection}% + \hv@typeout{>>>doublePage: start with definitions of \hv@floatObject}% + \global\hv@leftPageObjectWidth=\dimexpr\paperwidth-1in-\evensidemargin-\hvSet@bindCorrection\relax + \global\hv@tempWidthA=\the\dimexpr1in+\oddsidemargin-\hvSet@bindCorrection\relax \xdef\hv@caption@format@temp{\hv@caption@format}% it gets lost otherwise for next afterpage - \setlength\@dblfpbot{0\p@ \@plus 1fil}% + \@dblfpbot=0\p@ \@plus 1fil% \global\hv@switchTypefalse \setcounter{hv@tempCNTfigA}{\value{figure}}% \setcounter{hv@tempCNTfigB}{\value{figure}}% @@ -1196,8 +1198,8 @@ } % \def\do@hvFloat@doublePageCaptionRightObjectLeft#1{% left part of the object - \hv@typeout{do@hvFloat@doublePageCaptionRightObjectLeft: start}% \begin{\hv@floatType*}[!t] + \hv@typeout{>>>doublePage: start with left side of the object \hv@floatObject}% \hv@set@noverticalSpace \hfuzz=\maxdimen \let\c@hv@tempCNTfigA\c@figure @@ -1225,15 +1227,16 @@ } \def\do@hvFloat@doublePageCaptionRightObjectRight#1{% right part of the object \begin{\hv@floatType*}[!t] + \hv@typeout{>>>doublePage: start with right side of the object \hv@floatObject}% \hv@set@noverticalSpace \hfuzz=\maxdimen \expandafter\hvFloatSet\expandafter{\hv@save@setting}% - \global\savebox\hvObjectBox{\ifhv@useOBox\usebox{\hvOBox}\else\hv@floatObject\fi}% - \global\setlength\hv@tempWidthA{\the\dimexpr1in+\oddsidemargin-\hvSet@bindCorrection}% FÜR DTK + \savebox\hvObjectBox{\ifhv@useOBox\usebox{\hvOBox}\else\hv@floatObject\fi}% + \hv@tempWidthA=\the\dimexpr1in+\oddsidemargin-\hvSet@bindCorrection\relax% FÜR DTK \hspace*{-\hv@tempWidthA}% - \global\setlength\hv@leftPageObjectWidth{\the\dimexpr\paperwidth-1in-\evensidemargin-\hvSet@bindCorrection}% FÜR FTK + \hv@leftPageObjectWidth=\the\dimexpr\paperwidth-1in-\evensidemargin-\hvSet@bindCorrection\relax% FÜR FTK \savebox\hv@rightBox{\clipbox*{\hv@leftPageObjectWidth{} -\depth{} \width{} \height{}}{\usebox\hvObjectBox}}% - \global\setlength\hv@tempWidthB{\dimexpr\textwidth-\wd\hv@rightBox-\hvSet@bindCorrection+1in+\oddsidemargin-\hv@floatCapSep\relax}% + \hv@tempWidthB=\dimexpr\textwidth-\wd\hv@rightBox-\hvSet@bindCorrection+1in+\oddsidemargin-\hv@floatCapSep\relax \hv@typeout{Height of right box: \the\ht\hv@rightBox}% \hv@typeout{Depth of right box : \the\dp\hv@rightBox}% \ifdim\dp\hv@rightBox > \z@ @@ -1271,11 +1274,11 @@ }}}% \ifx\hv@label\@empty\else\label{\hv@label-cap}\fi \else - \global\setlength\hv@tempWidthB{\dimexpr\textwidth-\wd\hv@rightBox-\hvSet@bindCorrection+1in+\oddsidemargin-\hv@floatCapSep\relax}% + \hv@tempWidthB=\dimexpr\textwidth-\wd\hv@rightBox-\hvSet@bindCorrection+1in+\oddsidemargin-\hv@floatCapSep\relax \hspace{\hv@floatCapSep}% \rlap{\parbox[b][\dimexpr\ht\hv@rightBox+\dp\hv@rightBox][\hv@@capVPos]{\hv@tempWidthB}{% - \abovecaptionskip=0pt% local inside parbox - \belowcaptionskip=0pt% local inside parbox + \abovecaptionskip=0pt % local inside parbox + \belowcaptionskip=0pt % local inside parbox \ifx\hv@shortCap\@empty \caption{\hv@longCap}% \else @@ -1351,8 +1354,8 @@ \global\savebox\hvObjectBox{\hv@floatObject}% \fi \noindent - \global\setlength\hv@tempWidthA{\the\dimexpr1in+\oddsidemargin-\hvSet@bindCorrection}% - \global\setlength\hv@leftPageObjectWidth{\the\dimexpr\paperwidth-1in-\evensidemargin-\hvSet@bindCorrection}% + \global\hv@tempWidthA=\the\dimexpr1in+\oddsidemargin-\hvSet@bindCorrection% + \global\hv@leftPageObjectWidth=\the\dimexpr\paperwidth-1in-\evensidemargin-\hvSet@bindCorrection% \clipbox*{0 -\depth{} \hv@leftPageObjectWidth{} \height}{\usebox\hvObjectBox}% \null\newpage\if@twocolumn\null\newpage\fi \expandafter\global\expandafter\savebox\expandafter\hvObjectBox\expandafter{\ifhv@useOBox\usebox{\hvOBox}\else\hv@floatObject\fi}% @@ -1410,9 +1413,9 @@ \fi\fi \checkoddpage \global\savebox{\hvObjectBox}{\ifhv@useOBox\usebox{\hvOBox}\else\hv@floatObject\fi}% - \global\setlength\hv@tempWidthA{\dimexpr-\oddsidemargin-1in-\parindent+\hvSet@bindCorrection}% the width of the right side offset - \global\setlength\hv@tempWidthB{\dimexpr\ht\hvCaptionBox+\wd\hvObjectBox+2\hvSet@bindCorrection}% - \global\setlength\hv@leftPageObjectWidth{\dimexpr\paperwidth-\hvSet@bindCorrection}% + \global\hv@tempWidthA=\dimexpr-\oddsidemargin-1in-\parindent+\hvSet@bindCorrection% the width of the right side offset + \global\hv@tempWidthB=\dimexpr\ht\hvCaptionBox+\wd\hvObjectBox+2\hvSet@bindCorrection% + \global\hv@leftPageObjectWidth=\dimexpr\paperwidth-\hvSet@bindCorrection% % \savebox\hv@leftBox{\clipbox*{0 0 \the\hv@leftPageObjectWidth{} \height}{\usebox\hvObjectBox}}% % \savebox\hv@rightBox{\clipbox*{\the\hv@leftPageObjectWidth{} \depth{} \width{} \height}{\usebox\hvObjectBox}}% % \expandafter\captionsetup\expandafter{\hv@caption@format}% diff --git a/macros/unicodetex/latex/njuthesis/njuthesis.dtx b/macros/unicodetex/latex/njuthesis/njuthesis.dtx index f333e6d6b3..faeaa2defc 100644 --- a/macros/unicodetex/latex/njuthesis/njuthesis.dtx +++ b/macros/unicodetex/latex/njuthesis/njuthesis.dtx @@ -111,7 +111,7 @@ To produce the documentation run the original source files ending with % %<class>\NeedsTeXFormat{LaTeX2e} %<*!(driver|install)> -%<+!driver>\GetIdInfo $Id: njuthesis.dtx 0.17.0 2022-04-09 16:30:00 +0800 NJU LUG <git+nju-lug-email-3104-issue-@yaoge123.cn>$ +%<+!driver>\GetIdInfo $Id: njuthesis.dtx 0.18.0 2022-05-01 12:40:00 +0800 NJU LUG <git+nju-lug-email-3104-issue-@yaoge123.cn>$ %<class> {Thesis template for Nanjing University} %<class>\ProvidesExplClass{njuthesis} %<definition-ug> {Undergraduate definition file for njuthesis} @@ -124,7 +124,7 @@ To produce the documentation run the original source files ending with %<*driver> \ProvidesFile{njuthesis.dtx} \documentclass[fontset=fandol]{ctxdoc} -\usepackage{listings,njuvisual,tabularray} +\usepackage{listings,njuvisual,tabularray,unicode-math} \usepackage[firstpage=true]{background} \backgroundsetup{contents={\njuemblem[white!85!gray]{22cm}{!}},scale=1,angle=0,hshift=-4cm} \colorlet{at@guard}{njuviolet} @@ -144,7 +144,10 @@ To produce the documentation run the original source files ending with \SetTblrStyle{caption-tag}{font=\bfseries} \SetTblrInner{row{1}={font=\bfseries}} \DefTblrTemplate{caption-sep}{default}{\quad} -\lstdefinestyle{style@base} +\setmathfont{XITSMath-Regular}[ + BoldFont = XITSMath-Bold, + Extension = .otf] + \lstdefinestyle{style@base} { basewidth = 0.5 em, gobble = 3, @@ -200,7 +203,7 @@ To produce the documentation run the original source files ending with % \thanks{E-mail: \href{mailto:git+nju-lug-email-3104-issue-@yaoge123.cn} % {git+nju-lug-email-3104-issue-@yaoge123.cn}}} % -% \date{v0.17.0 \quad 2022-04-09} +% \date{v0.18.0 \quad 2022-05-01} % % \changes{v0.1}{2021/09/04}{开始开发。} % \changes{v0.2}{2021/09/07}{初步搭建了可用的模板。} @@ -811,7 +814,7 @@ To produce the documentation run the original source files ending with % \end{latexexample} % % -% \subsubsection{单双面模式} +% \subsubsection{页面模式} % % \begin{function}[added=2022-01-14]{oneside,twoside} % \begin{syntax} @@ -822,17 +825,15 @@ To produce the documentation run the original source files ending with % % 本选项继承自 \hologo{LaTeX2e} \cls{book} 标准文档类。 % 单双面选项为全局选项,开启后会改变页码编号,以及部分宏包的行为。 -% 在单面模式下,页面是连续的,不会产生空白页;在双面模式下,封面、摘要、 -% 参考文献表等特殊页面,以及新的章节都会从奇数页开始,更适合印刷输出。 -% -% -% \subsubsection{草稿模式} +% 在单面模式下,页面是连续的,不会产生空白页;在双面模式下, +% 新的一章以及封面、摘要、参考文献表等特殊页面都会从奇数页开始, +% 在奇数页结束的内容后会补上一页空页,更适合印刷输出。 % % \begin{function}[added=2021-12-15]{draft} % \begin{syntax} % draft = <\TFF> % \end{syntax} -% 选择是否开启草稿模式,默认关闭。 +% 是否开启草稿模式,默认关闭。 % \end{function} % % 本选项继承自 \hologo{LaTeX2e} \cls{book} 标准文档类。 @@ -850,6 +851,20 @@ To produce the documentation run the original source files ending with % 宏包的代码环境不会显示内容,具体效果需要参照各个宏包的说明文档。 % 如需抵消草稿模式的影响,请使用 \opt{final} 选项载入相关宏包。 % +% \begin{function}[added=2022-04-19]{blind} +% \begin{syntax} +% <blind> +% \end{syntax} +% 是否开启盲审模式。这个选项并不包含 |=| 号。 +% \end{function} +% +% 盲审模式会抹除论文中的学校和个人信息,效果包括: +% \begin{itemize} +% \item 不显示校名校徽图片 +% \item 不显示“南京大学”字样 +% \item 不显示作者、导师等基本信息 +% \end{itemize} +% % % \subsubsection{配置文件} % @@ -1124,21 +1139,21 @@ To produce the documentation run the original source files ending with % \begin{latexexample}[moretexcs={\njusetup},emph={[2]info}] % \njusetup { % info = { -% title = {第一行标题\\第二行标题}, -% title* = {My title in English}, -% keywords = {我,就是,充数的,关键词}, -% keywords* = {Dummy,Keywords,Here,{it is}}, -% grade = {2018}, -% student-id = {189114514}, -% author = {周煜华}, -% author* = {Zhou Yuhua}, -% department = {化学化工学院}, -% department* = {School of Chemistry and Chemical Engineering}, -% major = {化学}, -% major* = {Chemistry}, -% supervisor = {李成殿,教授}, -% supervisor*= {Professor Li Chengdian}, -% submit-date = {2021-09-12} +% title = {第一行标题\\第二行标题}, +% title* = {My title in English}, +% keywords = {我,就是,充数的,关键词}, +% keywords* = {Dummy, Keywords, Here, {it is}}, +% grade = {2018}, +% student-id = {189114514}, +% author = {周煜华}, +% author* = {Zhou Yuhua}, +% department = {化学化工学院}, +% department* = {School of Chemistry and Chemical Engineering}, +% major = {化学}, +% major* = {Chemistry}, +% supervisor = {李成殿,教授}, +% supervisor* = {Professor Li Chengdian}, +% submit-date = {2021-09-12} % } % } % \end{latexexample} @@ -1148,30 +1163,30 @@ To produce the documentation run the original source files ending with % \begin{latexexample}[moretexcs={\njusetup},emph={[2]info}] % \njusetup { % info = { -% title = {第一行标题\\第二行标题\\第三行标题}, -% title* = {My title in English}, -% keywords = {我,就是,充数的,关键词}, -% keywords* = {Dummy,Keywords,Here,{it is}}, -% grade = {2018}, -% student-id = {DZ18114514}, -% author = {周煜华}, -% author* = {Zhou Yuhua}, -% department = {化学化工学院}, -% department* = {School of Chemistry and Chemical Engineering}, -% major = {化学}, -% major* = {Chemistry}, -% field = {物理化学}, -% field* = {Physical Chemistry}, -% supervisor = {李成殿,教授}, -% supervisor*= {Professor Li Chengdian}, -% submit-date = {2021-09-12}, -% defend-date = {2022-01-15}, -% email = {git+nju-lug-email-3104-issue-@yaoge123.cn}, -% chairman = {张晓山~教授}, -% reviewer = {王瑞希~教授,郭德纲~副教授,华芈库~教授,戴菲菲~教授}, -% clc = {0175.2}, +% title = {第一行标题\\第二行标题\\第三行标题}, +% title* = {My title in English}, +% keywords = {我,就是,充数的,关键词}, +% keywords* = {Dummy,Keywords,Here,{it is}}, +% grade = {2018}, +% student-id = {DZ18114514}, +% author = {周煜华}, +% author* = {Zhou Yuhua}, +% department = {化学化工学院}, +% department* = {School of Chemistry and Chemical Engineering}, +% major = {化学}, +% major* = {Chemistry}, +% field = {物理化学}, +% field* = {Physical Chemistry}, +% supervisor = {李成殿,教授}, +% supervisor* = {Professor Li Chengdian}, +% submit-date = {2021-09-12}, +% defend-date = {2022-01-15}, +% email = {git+nju-lug-email-3104-issue-@yaoge123.cn}, +% chairman = {张晓山~教授}, +% reviewer = {王瑞希~教授,郭德纲~副教授,华芈库~教授,戴菲菲~教授}, +% clc = {0175.2}, % secret-level = {限制}, -% udc = {004.72}, +% udc = {004.72}, % supervisor-contact = {拉太赫科学与技术学院 枝江市结丘路 19 号 114514} % } % } @@ -1252,7 +1267,7 @@ To produce the documentation run the original source files ending with % \end{latexexample} % % -% \subsubsection{文字} +% \subsubsection{字形} % % \begin{function}{\songti,\heiti,\kaishu,\fangsong,\zihao} % \begin{syntax} @@ -1269,9 +1284,29 @@ To produce the documentation run the original source files ending with % \begin{syntax} % \tn{njuline}\Arg{文字} % \end{syntax} -% 为了避免原生\tn{uline}命令在中文环境下不能正常换行的问题,本模板使用\tn{njuline}作为替代方案,分别对 \hologo{XeLaTeX} 的 \pkg{xeCJKfntef} 包和 \hologo{LuaLaTeX} 的 \pkg{lua-ul} 包中的下划线命令进行了包装。 +% 为了避免原生 \tn{uline} 命令在中文环境下不能正常换行的问题, +% 本模板使用 \tn{njuline} 作为替代方案,分别对 \hologo{XeLaTeX} 的 +% \pkg{xeCJKfntef} 包和 \hologo{LuaLaTeX} 的 \pkg{lua-ul} +% 包中的下划线命令进行了包装。 +% \end{function} +% +% \subsubsection{列表} +% +% \begin{function}{itemize,enumerate,description} +% \begin{syntax} +% \tn{begin}\marg{列表环境} +% \tn{item}\oarg{标签1} \meta{条目1} +% \tn{item}\oarg{标签2} \meta{条目2} +% ... +% \tn{end}\marg{列表环境} +% \end{syntax} +% 添加列表环境。 % \end{function} % +% 模板默认载入 \pkg{enumitem} 宏包,对三个常用列表环境内的条目间距进行压缩。 +% +% \subsubsection{脚注} +% % \begin{function}{\footnote} % \begin{syntax} % \tn{footnote}\Arg{脚注} @@ -1279,6 +1314,13 @@ To produce the documentation run the original source files ending with % 添加脚注。 % \end{function} % +% \begin{function}[added=2022-05-01]{style/footnote-style} +% \begin{syntax} +% footnote-style = <(plain)|pifont> +% \end{syntax} +% 设置脚注编号样式。默认为普通数字,使用 |pifont| +% 选项可修改为带圈数字。单一页面内请尽量避免超过 10 条脚注。 +% \end{function} % % \subsubsection{图片} % @@ -1293,8 +1335,7 @@ To produce the documentation run the original source files ending with % % 在使用特定类型的图片文件时,可以省略其扩展名,包括 \file{*.jpg}, \file{*.png}, \file{*.pdf}, \file{*.eps}。 % -% -% \paragraph{图片} +% \paragraph{单张图片} % % 下面这个例子展示了如何插入一张名称为 \file{myfig.jpg},宽度占页面文字宽度一半的图片。注意标签命令 \tn{label} 必须放在图注命令 \tn{caption} 之后。 % \begin{latexexample}[moretexcs={\includegraphics},emph={[1]figure}] @@ -1308,7 +1349,6 @@ To produce the documentation run the original source files ending with % % \emph{以下图片相关功能的实现均需要手动载入相关宏包}。 % -% % \paragraph{文字环绕} % % 对于较为瘦长,或者仅起到辅助作用的图像,可以使用 \pkg{wrapfig} 宏包提供的 \env{wrapfigure} 实现文字环绕效果。注意这个环境后紧跟的一行不能为空。 @@ -1322,7 +1362,6 @@ To produce the documentation run the original source files ending with % <text> % \end{latexexample} % -% % \paragraph{多张嵌套} % % 使用 \pkg{subcaption} 宏包提供的 \env{subfigure} 环境可以实现多张图片嵌套的效果。 @@ -1349,7 +1388,6 @@ To produce the documentation run the original source files ending with % % 请尽量避免使用较为老旧的 \pkg{subfig} 宏包,完全不要使用过时的 \pkg{subfigure} 宏包。两者的 CTAN 页面上均建议转移至更新的 \pkg{subcaption} 宏包。 % -% % \subsubsection{表格} % % 下面这个例子展示了如何插入一张表格。通过 \pkg{booktabs} 宏包提供的 \tn{toprule}、\tn{midrule} 和 \tn{bottomrule} 命令,我们可以很轻松地绘制出一张漂亮规范的三线表。 @@ -1370,7 +1408,6 @@ To produce the documentation run the original source files ending with % % \emph{以下表格功能的实现均需要手动载入相关宏包。} % -% % \paragraph{合并单元格} % % \begin{function}{\multirow,\multicolumn} @@ -1384,7 +1421,6 @@ To produce the documentation run the original source files ending with % TODO:\pkg{multirow} 宏包的使用方法,命令较为复杂。 % \url{http://www.ctex.org/documents/packages/table/multirow.htm} % -% % \paragraph{更多样式} % % \pkg{tabularray} 宏包\cite{tabularray}运用 \hologo{LaTeX3} 语法重新实现了表格的绘制,提供了简明的用户接口与丰富的单元格样式,详见其使用手册。 @@ -1402,29 +1438,78 @@ To produce the documentation run the original source files ending with % \end{latexexample} % % 如不需要编号,可以用 \env{equation*} 或者 |\[|\meta{公式}|\]|, -% 请不要使用可能引发问题的 |$$|\meta{公式}|$$|\footnote{\url{https://tex.stackexchange.com/questions/503/why-is-preferable-to}}。 +% 请不要使用可能引发问题的 |$$|\meta{公式}|$$| +% \footnote{\url{https://tex.stackexchange.com/q/503/}}。 % % % \paragraph{符号和单位} % -% 模板使用 \pkg{unicode-math} 配置数学字体,可以替代传统方案下的 \pkg{bm}、 -% \pkg{mathrsfs} 等宏包\footnote{\url{https://tex.stackexchange.com/questions/528831/why-doesnt-the-bm-package-work-with-the-unicode-math-package}}。 -% 相应地,也需要使用新方案提供的命令。例如,加粗数学符号的命令可以使用 -% \tn{symbf}。更多细节请查阅 \pkg{unicode-math} 手册。 -% -% 符号表可以参考 \url{https://www.caam.rice.edu/~heinken/latex/symbols.pdf}。 -% -% 单位请参考相关国家标准\footnote{GB 3100-1993, GB/T 3101-1993, GB/T 3102-1993},使用 \pkg{siunitx} 宏包。\pkg{siunitx} 是一个更新频繁的包,可能会引发兼容性问题。 +% ^^A \url{https://www.caam.rice.edu/~heinken/latex/symbols.pdf} +% 模板使用 \pkg{unicode-math} 宏包配置数学字体,完整符号表可以参考 +% \href{http://mirrors.ctan.org/macros/unicodetex/latex/unicode-math/unimath-symbols.pdf}{\file{unimath-symbols.pdf}}。 +% 该方案目前不兼容传统的 \pkg{amsfonts}、\pkg{amssymb}、\pkg{bm} +% \footnote{\url{https://tex.stackexchange.com/q/528831/}} +% 、\pkg{upgreek} 等宏包。需要使用新方案提供的相应命令。 +% 例如,加粗数学符号的命令为 \tn{symbf}。 +% 更多细节请查阅 \pkg{unicode-math} 手册。 +% +% ^^A 本段说明来自 THuThesis,待补充相应配置 +% 中文论文的数学符号默认遵循 GB/T 3102--93《物理科学和技术中 +% 使用的数学符号》\cite{gb-3102-93},该标准参照采纳 ISO 31-11:1992, +% 但是与 \TeX{} 默认的美国数学学会(AMS)的习惯有许多差异。 +% 本模板尚未完成自动样式适配,一些需要写作时手动处理的要点包括: +% \begin{itemize} +% ^^A \item 小于等于号和大于等于号使用斜线($\leqslant$、$\geqslant$) +% \item 数学常数和特殊函数名用正体,如 +% \begin{itemize} +% \item $\uppi$ 使用 |$\uppi$| +% \item $\symup{i}$ 使用 |$\symup{e}$| +% \item $\symup{e}$ 使用 |$\symup{i}$| +% \end{itemize} +% \item 微分号使用正体,如 +% \begin{itemize} +% \item $\mathrm{d} \varphi / \mathrm{d} t$ +% 使用 |$\mathrm{d} \varphi / \mathrm{d} t$| +% \end{itemize} +% ^^A 可以提供一个设置项,|\renewcommand{\vec}[1]{\symbf{#1}}| +% \item 向量、矩阵和张量用粗斜体(\cs{symbf}),如 +% \begin{itemize} +% \item $\symbf{\Sigma}$ 使用 |$\symbf{\Sigma}$| +% \item $\symbfsf{T}$ 使用 |$\symbfsf{T}$| +% \end{itemize} +% \end{itemize} % +% 单位默认遵循 GB 3100--93《国际单位制及其应用》\cite{gb-3100-93}和 +% GB 3101--93《有关量、单位和符号的一般原则》\cite{gb-3101-93}, +% SI 单位可通过载入 \pkg{siunitx} 宏包\cite{siunitx}进行输入。 +% ^^A \pkg{siunitx} 是一个更新频繁的包,可能会引发兼容性问题。 % % \paragraph{定理环境} % % 本模板也提供了一系列的数学定理环境。 -% 全部预定义的数学定理环境如表~\ref{tab:mathenv} 所示。其中证明环境较为特殊,会在结尾添加证毕符号(\mdwhtsquare)。用户也可以选择使用 \tn{newtheorem} 定义新的定理环境。 +% +% \begin{function}[added=2022-04-21]{theorem/predefine} +% \begin{syntax} +% predefine = <\TTF> +% \end{syntax} +% 是否使用模板默认配置的定理环境。默认会载入 \pkg{ntheorem} 并进行相关设置。 +% \end{function} +% +% 全部预定义的数学定理环境如表~\ref{tab:mathenv} 所示。 +% 其中证明环境较为特殊,会在结尾添加证毕符号(\mdwhtsquare)。 +% 当然,你也可以创建属于自己的定理环境,其样式继承自前部的设定。 +% +% \begin{function}{\newtheorem,\newtheorem*,\renewtheorem} +% \begin{syntax} +% \cs{newtheorem}\marg{环境名称}\marg{标题名称}\oarg{计数器范围} +% \end{syntax} +% 定义新的定理环境或者修改已有的定理环境。带星号的命令不包含计数器。 +% 本模板中请在 |\begin{document}| 后进行定制。 +% \end{function} % % \begin{table}[htbp] % \centering -% \caption{数学定理环境} +% \caption{预置的数学定理环境} % \label{tab:mathenv} % \begin{tabular}{cc|cc} % \toprule @@ -1449,6 +1534,53 @@ To produce the documentation run the original source files ending with % \end{definition} % \end{latexexample} % +% 对于预置的定理环境样式,本模板也提供了一系列选项进行修改。 +% 这些选项目前只对模板预定义的若干种环境有效。 +% +% \begin{function}[added=2022-04-21]{theorem/style} +% \begin{syntax} +% style = <(plain)|break|change|margin|empty|...> +% \end{syntax} +% 定理基本样式。等效于 \cs{theoremstyle}\marg{样式名称}。 +% \end{function} +% +% \begin{function}[added=2022-04-21]{theorem/header-font} +% \begin{syntax} +% header-font = \meta{头部字体格式} +% \end{syntax} +% 定理头部字体格式。等效于 \cs{theoremheaderfont}\marg{格式}。 +% \end{function} +% +% \begin{function}[added=2022-04-21]{theorem/body-font} +% \begin{syntax} +% body-font = \meta{内部字体格式} +% \end{syntax} +% 定理内部字体格式。等效于 \cs{theorembodyfont}\marg{格式}。 +% \end{function} +% +% \begin{function}[added=2022-04-21]{theorem/counter} +% \begin{syntax} +% counter = <part|(chapter)|section|...> +% \end{syntax} +% 定理计数器范围。 +% \end{function} +% +% 模板的默认设置等效于 +% +% \begin{latexexample}[moretexcs={\njusetup,\bfseries,\itshape,\mdwhtsquare}, +% emph={[2]theorem}] +% \njusetup { +% theorem = { +% predefine = true, +% style = plain, +% header=font = \normalfont \bfseries, +% body-font = \itshape, +% qed-symbol = \ensuremath { \mdwhtsquare }, +% counter = chapter +% } +% } +% \end{latexexample} +% % % \subsubsection{代码} % \changes{v0.13}{2021/12/13}{提供简化的行内代码环境。} @@ -1611,14 +1743,10 @@ To produce the documentation run the original source files ending with % } % \end{latexexample} % -% 如果开启了草稿模式,您可能会注意到部分条目存在超宽的问题,这时就要果断假装没有看到。 -% 该问题的产生是由于 \hologo{LaTeX} 中只有固定的字母组合中间可以断行。使条目右侧平齐的方法有如下两种 -% \footnote{详见 \url{https://github.com/nju-lug/NJUThesis/issues/57}。很不幸,\pkg{microtype} 与 \pkg{babel} 没能在我们的模板中解决问题。}: -% \begin{itemize} -% \item 自行在 \file{.bib} 文件中设置断行点,例如可以将 graphene 一词修改为 graph|\-|ene。缺点是需要逐条手动排查,建议在定稿时进行修改。 -% \item 在 |\printbibliography| 前添加 |\sloppy| 命令拉伸词间距,缺点是可能降低美观度。 -% \end{itemize} -% +% 如果开启了草稿模式,您可能会注意到部分条目存在超宽的问题。 +% 对此,需要将 \pkg{biblatex-gb7714-2015} 宏包手动更新至 2022-04-16 以后的版本。 +% 此外,由于 \TeX{} 预置的断词位置是有限的,不能覆盖学术上使用的复杂词汇, +% 您也可以自行在 \file{.bib} 文件中设置断行点,例如可以将 graphene 一词修改为 graph|\-|ene。 % % \subsubsection{正文引用} % @@ -2059,6 +2187,21 @@ To produce the documentation run the original source files ending with % % \subsection*{标准、规范} % +% \bibitem{gb-3100-93} +% 全国信息与文献标准化技术委员会. +% \newblock \textit{国际单位制及其应用: GB 3100--93} [S]. +% \newblock 北京: 中国标准出版社, 1993 +% +% \bibitem{gb-3101-93} +% 全国信息与文献标准化技术委员会. +% \newblock \textit{有关量、单位和符号的一般原则: GB 3101--93} [S]. +% \newblock 北京: 中国标准出版社, 1993 +% +% \bibitem{gb-3102-93} +% 全国信息与文献标准化技术委员会. +% \newblock \textit{物理科学和技术中使用的数学符号: GB/T 3102--93} [S]. +% \newblock 北京: 中国标准出版社, 1993 +% % \bibitem{gb-t-7408-2005} % 全国信息与文献标准化技术委员会. % \newblock \textit{数据元和交换格式\quad 信息交换~ 日期和时间表示法: GB/T 7408--2005} [S]. @@ -2131,6 +2274,14 @@ To produce the documentation run the original source files ending with % \urlprefix\url{https://ctan.org/pkg/njuvisual} % \urlprefix\CTANurl[文档:]{macros/latex/contrib/njuvisual/njuvisual.pdf} % +% \bibitem{siunitx} +% \textsc{Wright J}. +% \newblock \textit{A comprehensive (SI) units package} [EB/OL]. +% \newblock version 3.1.0, +% \newblock (2022-04-25) +% \urlprefix\url{https://www.ctan.org/pkg/siunitx} +% \urlprefix\CTANurl[文档:]{macros/latex/contrib/siunitx/siunitx.pdf} +% % \bibitem{tabularray} % \textsc{Jianrui Lyu}. % \newblock \textit{Typeset tabulars and arrays with \hologo{LaTeX3}} [EB/OL]. @@ -2398,17 +2549,17 @@ To produce the documentation run the original source files ending with % \end{macrocode} % \end{variable} % -% \begin{variable}{\g_@@_name_type_clist,\g_@@_name_type_en_clist, -% \g_@@_name_degree_clist,\g_@@_name_degree_en_clist} +% \begin{variable}{\c_@@_name_type_clist,\c_@@_name_type_en_clist, +% \c_@@_name_degree_clist,\c_@@_name_degree_en_clist} % 论文类型与学位类型。 % \begin{macrocode} -\clist_const:Nn \g_@@_name_type_clist +\clist_const:Nn \c_@@_name_type_clist { 毕业论文, 毕业设计 } -\clist_const:Nn \g_@@_name_type_en_clist +\clist_const:Nn \c_@@_name_type_en_clist { THESIS, DESIGN } -\clist_const:Nn \g_@@_name_degree_clist +\clist_const:Nn \c_@@_name_degree_clist { 学士, 硕士, 硕士专业, 博士 } -\clist_const:Nn \g_@@_name_degree_en_clist +\clist_const:Nn \c_@@_name_degree_en_clist { Bachelor, Master, Master, Doctor~of~Philosophy } % \end{macrocode} % \end{variable} @@ -2424,6 +2575,22 @@ To produce the documentation run the original source files ending with % \end{macrocode} % \end{variable} % +% \begin{variable}{\c_@@_blind_info_clist,\c_@@_blind_info_en_clist, +% \c_@@_blind_infolist_clist} +% 盲审模式下不显示的个人信息项。 +% \begin{macrocode} +\clist_const:Nn \c_@@_blind_info_clist + { + author, chairman, clc, dept, email, field, grade, + id, major, secretlv, supvcont, udc + } +\clist_const:Nn \c_@@_blind_info_en_clist + { author, dept, field, major, supv, supv_ii } +\clist_const:Nn \c_@@_blind_infolist_clist + { reviewer, supv, supv_ii } +% \end{macrocode} +% \end{variable} +% % % \subsection{内部函数} % @@ -2438,8 +2605,8 @@ To produce the documentation run the original source files ending with % \begin{macro}{\@@_vskip:,\@@_hskip:} % 生成一个较小的 skip。 % \begin{macrocode} -\cs_new:Nn \@@_vskip: { \skip_vertical:N \g_@@_smallvskip_dim } -\cs_new:Nn \@@_hskip: { \skip_horizontal:N \g_@@_smallhskip_dim } +\cs_new:Nn \@@_vskip: { \skip_vertical:N \c_@@_smallvskip_dim } +\cs_new:Nn \@@_hskip: { \skip_horizontal:N \c_@@_smallhskip_dim } % \end{macrocode} % \end{macro} % @@ -2461,16 +2628,11 @@ To produce the documentation run the original source files ending with % 用来定义默认名称的辅助函数。 % \begin{macrocode} \cs_new_protected:Npn \@@_define_name:nn #1#2 - { - \tl_new:c { g_@@_name_ #1 _tl } - \tl_gset:cn { g_@@_name_ #1 _tl } { #2 } - } + { \tl_const:cn { c_@@_name_ #1 _tl } { #2 } } \cs_new_protected:Npn \@@_define_name:nnn #1#2#3 { - \tl_new:c { g_@@_name_ #1 _tl } - \tl_gset:cn { g_@@_name_ #1 _tl } { #2 } - \tl_new:c { g_@@_name_ #1 _en_tl } - \tl_gset:cn { g_@@_name_ #1 _en_tl } { #3 } + \tl_const:cn { c_@@_name_ #1 _tl } { #2 } + \tl_const:cn { c_@@_name_ #1 _en_tl } { #3 } } % \end{macrocode} % \end{macro} @@ -2479,10 +2641,7 @@ To produce the documentation run the original source files ending with % 用来定义默认样式的辅助函数。 % \begin{macrocode} \cs_new_protected:Npn \@@_define_fmt:nn #1#2 - { - \tl_new:c { g_@@_fmt_ #1 _tl } - \tl_gset:cn { g_@@_fmt_ #1 _tl } { #2 } - } + { \tl_const:cn { c_@@_fmt_ #1 _tl } { #2 } } % \end{macrocode} % \end{macro} % @@ -2490,15 +2649,9 @@ To produce the documentation run the original source files ending with % 用来定义默认间距的辅助函数。 % \begin{macrocode} \cs_new_protected:Npn \@@_define_dim:nn #1#2 - { - \dim_new:c { g_@@_ #1 _dim } - \dim_gset:cn { g_@@_ #1 _dim } { #2 } - } + { \dim_const:cn { c_@@_ #1 _dim } { #2 } } \cs_new_protected:Npn \@@_define_skip:nn #1#2 - { - \skip_new:c { g_@@_ #1 _skip } - \skip_gset:cn { g_@@_ #1 _skip } { #2 } - } + { \skip_const:cn { c_@@_ #1 _skip } { #2 } } % \end{macrocode} % \end{macro} % @@ -2516,7 +2669,7 @@ To produce the documentation run the original source files ending with % \begin{macro}{\@@_name:n,\@@_info:n} % 根据变量名调用名称和内容信息。 % \begin{macrocode} -\cs_new:Npn \@@_name:n #1 { \tl_use:c { g_@@_name_ #1 _tl } } +\cs_new:Npn \@@_name:n #1 { \tl_use:c { c_@@_name_ #1 _tl } } \cs_new:Npn \@@_info:n #1 { \tl_use:c { g_@@_info_ #1 _tl } } % \end{macrocode} % \end{macro} @@ -2579,24 +2732,6 @@ To produce the documentation run the original source files ending with % \end{macrocode} % \end{macro} % -% \begin{macro}{\@@_put_inempty_seg:nnn} -% 将固定长度的非空字符串插入 |clist|。 -% \begin{arguments} -% \item 原始字符串 -% \item 起始位置 -% \item 长度 -% \end{arguments} -% \begin{macrocode} -\cs_new_protected:Npn \@@_put_inempty_seg:nnn #1#2#3 - { - \tl_set:Nx \l_@@_tmpa_tl - { \tl_range:Nnn { #1 } { #2 } { #2 + #3 - 1 } } - \tl_if_empty:NF \l_@@_tmpa_tl - { \clist_put_right:NV \l_@@_tmp_clist { \l_@@_tmpa_tl } } - } -% \end{macrocode} -% \end{macro} -% % \begin{macro}{\@@_uline:n} % 指定宽度的下划线。 % \begin{arguments} @@ -2761,17 +2896,17 @@ To produce the documentation run the original source files ending with { \tl_if_empty:NT \g_@@_info_title_tl { \msg_error:nn { njuthesis } { missing-title } } - \@@_spread_box:nnV { #2 } { \kaishu } \g_@@_name_title_tl + \@@_spread_box:nnV { #2 } { \kaishu } \c_@@_name_title_tl \mode_leave_vertical: \@@_hskip: % \end{macrocode} % 这里需要存储 \tn{baselineskip} 的值,以使 \tn{parbox} 后行距正确。 -% \footnote{\url{https://tex.stackexchange.com/questions/34971/how-to-keep-a-constant-baselineskip-when-using-minipages-or-parboxes}} +% \footnote{\url{https://tex.stackexchange.com/q/34971/}} % \begin{macrocode} \parbox [ t ] { #3 } { - \dim_set_eq:NN \baselineskip \g_@@_coverlineskip_dim + \dim_set_eq:NN \baselineskip \c_@@_coverlineskip_dim #1 \@@_uline_title: - \dim_set_eq:NN \l_@@_tmpa_dim \prevdepth + \dim_gset_eq:NN \l_@@_tmpa_dim \prevdepth } \par \prevdepth \l_@@_tmpa_dim } @@ -2834,7 +2969,7 @@ To produce the documentation run the original source files ending with \@@_ulined_center_box:nn { #3 } { \clist_item:cn { g_@@_info_ #1 _clist } { 1 } } \@@_hskip: - \@@_spread_box:nnV { #2 } { \kaishu } \g_@@_name_supv_ttl_tl + \@@_spread_box:nnV { #2 } { \kaishu } \c_@@_name_supv_ttl_tl \@@_hskip: \@@_ulined_center_box:nn { #3 } { \clist_item:cn { g_@@_info_ #1 _clist } { 2 } } @@ -2843,6 +2978,17 @@ To produce the documentation run the original source files ending with % \end{macrocode} % \end{macro} % +% \begin{macro}{\@@_emblem:N,\@@_name:N} +% 封装图片绘制命令,参数为图片宽度。 +% 此时 \cs{njuemblem}、\cs{njuname} 和相关长度都是没有定义的。 +% \begin{macrocode} +\cs_new_protected:Npn \@@_emblem:N #1 + { \njuemblem [ black ] { #1 } { ! } } +\cs_new_protected:Npn \@@_name:N #1 + { \njuname [ black ] { #1 } { ! } } +% \end{macrocode} +% \end{macro} +% % \subsubsection{摘要相关} % % \begin{macro}{\@@_abs_bookmark:nn,\@@_abs_bookmark:Vn} @@ -2905,8 +3051,10 @@ To produce the documentation run the original source files ending with % \item 内容 % \item 左边距 % \end{arguments} -% 这里使用了 Primitive \TeX{} 语法以利用原生的断行算法\footnote{\url{https://tex.stackexchange.com/questions/637861/underline-list-item-to-page-width}}。 -% 对其语法的简要介绍可以参考 \href{http://petr.olsak.net/ftp/olsak/optex/tex-nutshell.pdf}{\file{tex-nutshell.pdf}}。 +% 这里使用了 Primitive \TeX{} 语法以利用原生的断行算法 +% \footnote{\url{https://tex.stackexchange.com/q/637861/}}。 +% 对其语法的简要介绍可以参考 +% \href{http://petr.olsak.net/ftp/olsak/optex/tex-nutshell.pdf}{\file{tex-nutshell.pdf}}。 % \begin{macrocode} \cs_new_protected:Npn \@@_uline_list:nnn #1#2#3 { @@ -3062,7 +3210,8 @@ To produce the documentation run the original source files ending with } { \AssignTemplateKeys - \newpage + \clearpage + \thispagestyle { empty } \__nju_vskip:N \l_@@_top_skip \group_begin: \l_@@_format_tl @@ -3155,6 +3304,15 @@ To produce the documentation run the original source files ending with % \end{macrocode} % \end{macro} % +% \begin{macro}{blind} +% \changes{v0.18}{2022/04/19}{新增盲审模式选项。} +% 盲审模式。 +% \begin{macrocode} + blind .value_forbidden:n = true, + blind .bool_set:N = \g_@@_blind_bool, +% \end{macrocode} +% \end{macro} +% % \begin{macro}{latin-font,cjk-font} % \changes{v0.14}{2021/12/12}{简化字体选项名称。} % 字体选项。 @@ -3185,14 +3343,22 @@ To produce the documentation run the original source files ending with % % \subsection{用户接口} % -% \begin{macro}{bib,info,style} -% 定义元(meta)键值对。 +% \begin{macro}{bib,info,style,theorem} +% 定义元(meta)键值对。为 v1.0 升级预留了新的接口。 % \begin{macrocode} \keys_define:nn { nju } { - bib .meta:nn = { nju / bib } { #1 }, - info .meta:nn = { nju / info } { #1 }, - style .meta:nn = { nju / style } { #1 } + % abstract .meta:nn = { nju / abstract } { #1 }, + bib .meta:nn = { nju / bib } { #1 }, + % cover .meta:nn = { nju / cover } { #1 }, + % font .meta:nn = { nju / font } { #1 }, + % footer .meta:nn = { nju / footer } { #1 }, + % footnote .meta:nn = { nju / footnote } { #1 }, + % header .meta:nn = { nju / header } { #1 }, + info .meta:nn = { nju / info } { #1 }, + style .meta:nn = { nju / style } { #1 }, + theorem .meta:nn = { nju / theorem } { #1 } + % toc .meta:nn = { nju / toc } { #1 } } % \end{macrocode} % \end{macro} @@ -3210,7 +3376,7 @@ To produce the documentation run the original source files ending with % 定义修改固定文本的接口。 % \begin{macrocode} \NewDocumentCommand \njusetformat { m m } - { \tl_gset:cn { g_@@_fmt_ #1 _tl } { #2 } } + { \tl_gset:cn { c_@@_fmt_ #1 _tl } { #2 } } % \end{macrocode} % \end{macro} % @@ -3221,8 +3387,8 @@ To produce the documentation run the original source files ending with \NewDocumentCommand \njusetlength { s m m } { \bool_if:nTF { #1 } - { \skip_gset:cn { g_@@_ #2 _skip } { #3 } } - { \dim_gset:cn { g_@@_ #2 _dim } { #3 } } + { \skip_gset:cn { c_@@_ #2 _skip } { #3 } } + { \dim_gset:cn { c_@@_ #2 _dim } { #3 } } } % \end{macrocode} % \end{macro} @@ -3256,7 +3422,7 @@ To produce the documentation run the original source files ending with \bool_if:nTF { #1 } { \tl_set:Nn \l_@@_tmpb_tl { _en } } { \tl_clear:N \l_@@_tmpb_tl } - \tl_gset:cn { g_@@_ #5 _ #2 \l_@@_tmpa_tl \l_@@_tmpb_tl _tl } {#4} + \tl_gset:cn { c_@@_ #5 _ #2 \l_@@_tmpa_tl \l_@@_tmpb_tl _tl } {#4} } % \end{macrocode} % \end{macro} @@ -3303,7 +3469,6 @@ To produce the documentation run the original source files ending with { { no-math } { fontspec }, { perpage } { footmisc }, - { amsmath, thmmarks } { ntheorem }, { hyphens } { url }, { warnings-off={ mathtools-colon, mathtools-overbracket } } { unicode-math }, @@ -3326,19 +3491,20 @@ To produce the documentation run the original source files ending with { geometry, fancyhdr, + footmisc, setspace, % \end{macrocode} % \changes{v0.13}{2021/12/13}{使用 \pkg{ntheorem} 创建定理环境,删除 % \pkg{amsthm} 和 \pkg{thmtools}。} % \changes{v0.16}{2022/03/19}{不显式载入 \pkg{amsmath}。} -% 数学相关的宏包。其中,\pkg{amsmath} 必须在 \pkg{unicode-math} 前加载。 +% \changes{v0.18}{2022/04/20}{不强制载入 \pkg{ntheorem}。} +% 数学相关的宏包。其中,\pkg{amsmath} 会被 \pkg{unicode-math} 自动载入。 % \pkg{unicode-math} 指定了 \hologo{XeTeX} 和 \hologo{LuaTeX} 下所使用的 % 数学字体。用于配置数学环境的 \pkg{mathtools} 会与 \pkg{unicode-math} % 发生冲突,需要手动消除其警告。 % \begin{macrocode} mathtools, unicode-math, - ntheorem, % \end{macrocode} % \changes{v0.14}{2021/12/21}{移除内置的 \pkg{multirow}、\pkg{subcaption} % 和 \pkg{wrapfig}。} @@ -3394,8 +3560,8 @@ To produce the documentation run the original source files ending with { \RequirePackage { tabularray } } % \end{macrocode} % -% \begin{macro}{\@@_check_package:nnn} -% 检查过时宏包。 +% \begin{macro}{\@@_check_pkg_version:nnn} +% 检查宏包版本是否过时。 % \begin{macrocode} \msg_new:nnn { njuthesis } { package-too-old } { @@ -3405,7 +3571,7 @@ To produce the documentation run the original source files ending with 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 +\cs_new_protected:Npn \@@_check_pkg_version:nnn #1#2#3 { \@ifpackagelater {#1} {#2} { } { \msg_error:nnnn { njuthesis } { package-too-old } {#1} {#3} } @@ -3417,9 +3583,48 @@ To produce the documentation run the original source files ending with % 解决了下划线中断问题,然而在 2021-10-24 的更新才提供了正确的内嵌日期。 % \begin{macrocode} \sys_if_engine_luatex:T - { \@@_check_package:nnn { luatexja } { 2021/10/24 } { 20211024.0 } } + { \@@_check_pkg_version:nnn { luatexja } { 2021/10/24 } { 20211024.0 } } +% \end{macrocode} +% +% \changes{v0.18}{2022/04/28}{增加宏包冲突检查。} +% \begin{macrocode} +\RequirePackage { filehook } +% \end{macrocode} +% +% \begin{macro}{\@@_check_pkg_conflict:nn} +% 检查用户载入的宏包是否会与预置宏包发生冲突。 +% \begin{arguments} +% \item 模板载入的宏包 +% \item 产生冲突的宏包 +% \item 替代的解决办法 +% \end{arguments} +% \begin{macrocode} +\msg_new:nnn { njuthesis } { package-conflict } + { + The~ "#2"~ package~ is~ incompatible~ with~ "#1".\\ + I~ have~ loaded~ "#1"~ by~ default.~ Maybe~ You~ should~ + refer~ to~ section~ 4~ of~ the~ "njuthesis"~ manual. + } +\cs_new_protected:Npn \@@_check_pkg_conflict:nn #1#2 + { + \AtEndOfPackageFile * { #1 } + { + \AtBeginOfPackageFile * { #2 } + { \msg_error:nnnn { njuthesis } { package-conflict } {#1} {#2} } + } + } % \end{macrocode} +% \end{macro} % +% 检查数学宏包冲突。 +% \begin{macrocode} +\clist_map_inline:nn + { + amscd, amsfonts, amssymb, bbm, bm, eucal, + eufrak, mathrsfs, newtxmath, upgreek + } + { \@@_check_pkg_conflict:nn { unicode-math } { #1 } } +% \end{macrocode} % % \subsection{配置文件} % @@ -3552,7 +3757,7 @@ To produce the documentation run the original source files ending with clc .tl_set:N = \g_@@_info_clc_tl, secret-level .tl_set:N = \g_@@_info_secretlv_tl, udc .tl_set:N = \g_@@_info_udc_tl, - supervisor-contact .tl_set:N = \g_@@_info_supv_cont_tl, + supervisor-contact .tl_set:N = \g_@@_info_supvcont_tl, % \end{macrocode} % \end{macro} % @@ -3571,7 +3776,7 @@ To produce the documentation run the original source files ending with % \begin{macrocode} \tl_set:Nx \g_@@_info_degree_tl { - \clist_item:Nn \g_@@_name_degree_clist + \clist_item:Nn \c_@@_name_degree_clist { \g_@@_info_degree_int } } \int_compare:nTF { \g_@@_info_degree_int == 1 } @@ -3582,11 +3787,29 @@ To produce the documentation run the original source files ending with % 设置类型信息。 % \begin{macrocode} \tl_set:Nx \g_@@_info_type_tl - { \clist_item:Nn \g_@@_name_type_clist { \g_@@_info_type_int } } + { \clist_item:Nn \c_@@_name_type_clist { \g_@@_info_type_int } } \tl_set:Nx \g_@@_info_type_en_tl - { \clist_item:Nn \g_@@_name_type_en_clist { \g_@@_info_type_int } } + { \clist_item:Nn \c_@@_name_type_en_clist { \g_@@_info_type_int } } \tl_put_left:Nx \g_@@_info_type_tl - { \tl_use:c { g_@@_name_ \g_@@_info_diploma_tl _tl } } + { \tl_use:c { c_@@_name_ \g_@@_info_diploma_tl _tl } } +% \end{macrocode} +% +% 盲审模式下抹去个人信息和学校名称。 +% \begin{macrocode} +\bool_if:NT \g_@@_blind_bool + { + \ctex_at_end_preamble:n + { + \clist_map_inline:Nn \c_@@_blind_info_clist + { \tl_gclear:c { g_@@_info_ #1 _tl } } + \clist_map_inline:Nn \c_@@_blind_info_en_clist + { \tl_gclear:c { g_@@_info_ #1 _en_tl } } + \clist_map_inline:Nn \c_@@_blind_infolist_clist + { \clist_gclear:c { g_@@_info_ #1 _clist } } + \tl_gclear:N \c_@@_name_nju_tl + \tl_gclear:N \c_@@_name_nju_en_tl + } + } % \end{macrocode} % % \changes{v0.15}{2022/01/22}{正确处理双导师信息。} @@ -4190,7 +4413,7 @@ To produce the documentation run the original source files ending with % 为无编号章添加目录条目,需手动指定格式为四号、不加粗、黑体。 % \begin{macrocode} \cs_new_protected:Npn \@@_add_tocline:n #1 - { \addcontentsline { toc } { chapter } { \g_@@_fmt_chapterintoc_tl #1 } } + { \addcontentsline { toc } { chapter } { \c_@@_fmt_chapterintoc_tl #1 } } \cs_generate_variant:Nn \@@_add_tocline:n { V } % \end{macrocode} % \end{macro} @@ -4234,10 +4457,12 @@ To produce the documentation run the original source files ending with { chapter / beforeskip = 10 pt, chapter / afterskip = 60 pt, - chapter / format = \g_@@_fmt_chapter_tl, - section / format = \g_@@_fmt_section_tl, - subsection / format = \g_@@_fmt_subsection_tl, - subsubsection / format = \g_@@_fmt_subsubsection_tl, + chapter / format = \c_@@_fmt_chapter_tl, + section / format = \c_@@_fmt_section_tl, + subsection / format = \c_@@_fmt_subsection_tl, + subsubsection / format = \c_@@_fmt_subsubsection_tl, + paragraph / format = \c_@@_fmt_paragraph_tl, + subparagraph / format = \c_@@_fmt_subparagraph_tl, % \end{macrocode} % % @@ -4246,13 +4471,13 @@ To produce the documentation run the original source files ending with % % 设置目录标题默认名称。 % \begin{macrocode} - contentsname = \g_@@_name_tableofcontents_tl, - listfigurename = \g_@@_name_listoffigures_tl, - listtablename = \g_@@_name_listoftables_tl, + contentsname = \c_@@_name_tableofcontents_tl, + listfigurename = \c_@@_name_listoffigures_tl, + listtablename = \c_@@_name_listoftables_tl, % \end{macrocode} % 设置目录中章标题的样式。 % \begin{macrocode} - chapter / tocline = \g_@@_fmt_chapterintoc_tl \CTEXnumberline { #1 } #2 + chapter / tocline = \c_@@_fmt_chapterintoc_tl \CTEXnumberline { #1 } #2 } % \end{macrocode} % @@ -4279,7 +4504,7 @@ To produce the documentation run the original source files ending with { \group_begin: \keys_set:nn { ctex } - { chapter/format = \g_@@_fmt_toctitle_tl } + { chapter/format = \c_@@_fmt_toctitle_tl } \bool_if:NTF \g_@@_toc_in_toc_bool { \@@_chapter:n { #1 } } { @@ -4486,7 +4711,7 @@ To produce the documentation run the original source files ending with pdftitle = \g_@@_info_title_tl, pdfauthor = \g_@@_info_author_tl, pdfkeywords = \g_@@_info_keywords_clist, - pdfcreator = \g_@@_name_pdfcreator_tl + pdfcreator = \c_@@_name_pdfcreator_tl } } % \end{macrocode} @@ -4523,6 +4748,90 @@ To produce the documentation run the original source files ending with % \end{macrocode} % % +% \subsection{脚注} +% \changes{v0.18}{2022/05/01}{提供脚注设置项。} +% ^^A 来自 fduthesis +% \begin{macrocode} +\tl_new:N \l_@@_fn_style_tl +\keys_define:nn { nju / style } + { +% \end{macrocode} +% \begin{macro}{style/footnote-style} +% \begin{macrocode} + footnote-style .choices:nn = { plain, pifont } +% \end{macrocode} +% 若使用 \opt{pifont} 类型,则需引入 \pkg{pifont} 宏包。 +% \begin{macrocode} + { + \tl_gset_eq:NN \l_@@_fn_style_tl \l_keys_choice_tl + \int_compare:nT { \l_keys_choice_int = 2 } + { \RequirePackage { pifont } } + } + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@@_fn_symbol_pifont:n} +% \opt{pifont} 普通版。以下四种都只包含 \numrange{1}{10}。 +% \begin{macrocode} +\cs_new:Npn \@@_fn_symbol_pifont:n #1 + { \ding { \int_eval:n { 171 + #1 } } } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@@_footnote_number:N} +% 脚注编号样式。 +% \begin{macrocode} +\tl_const:Nn \c_@@_fn_style_plain_tl { plain } +\tl_const:Nn \c_@@_fn_style_pifont_tl { pifont } +\cs_new:Npn \@@_footnote_number:N #1 + { + \tl_case:NnF \l_@@_fn_style_tl + { +% \end{macrocode} +% \opt{plain} 类型直接使用计数器 |footnote| 的值。 +% \begin{macrocode} + \c_@@_fn_style_plain_tl + { \int_use:N #1 } +% \end{macrocode} +% \opt{pifont} 类型无需进行额外的操作。 +% \begin{macrocode} + \c_@@_fn_style_pifont_tl + { \@@_fn_symbol_pifont:n {#1} } + } +% \end{macrocode} +% 变量 \cs{l_@@_fn_style_tl} 保存的类型未知时,默认使用 \opt{plain} +% 类型。 +% \begin{macrocode} + { \int_use:N #1 } + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\thefootnote} +% 重定义脚注编号。 +% \begin{macrocode} +\cs_set:Npn \thefootnote { \@@_footnote_number:N \c@footnote } +% \end{macrocode} +% \end{macro} +% +% \subsubsection{整体样式} +% +% \begin{macro}[int]{\@makefntext} +% 重定义内部脚注文字命令,使脚注编号不使用上标,宽度为 \qty{1.5}{em}。 +% 见 \url{http://tex.stackexchange.com/q/19844} 和 +% \url{https://www.zhihu.com/question/53030087}。 +% \begin{macrocode} +\cs_set:Npn \@makefntext #1 + { + \mode_leave_vertical: + \hbox_to_wd:nn { 1.5 em } { \@thefnmark \hfil } + #1 + } +% \end{macrocode} +% \end{macro} +% +% % \subsection{图片表格} % % 设置默认图片扩展名,允许在不键入扩展名时自动进行补全。 @@ -4562,35 +4871,87 @@ To produce the documentation run the original source files ending with % % \subsection{定理环境} % -% \begin{macro}{\@@_new_theorem:N} +% \changes{v0.18}{2022/04/21}{新增定理环境的若干定制项。} +% +% \begin{macro}{theorem/style,theorem/header-font,theorem/body-font, +% theorem/qed-symbol,theorem/counter} +% 定义 |nju/theorem| 键值类。 +% 目前这套选项只适用于模板预定义的若干种定理环境。 +% \begin{macrocode} +\keys_define:nn { nju / theorem } + { + predefine .bool_set:N = \g_@@_thm_predefine_bool, + style .tl_set:N = \l_@@_thm_style_tl, + header-font .tl_set:N = \l_@@_thm_header_font_tl, + body-font .tl_set:N = \l_@@_thm_body_font_tl, + qed-symbol .tl_set:N = \l_@@_thm_qed_symbol_tl, + counter .tl_set:N = \l_@@_thm_counter_tl, +% \end{macrocode} +% 定理环境的缺省值。 +% \begin{macrocode} + predefine .initial:n = true, + style .initial:n = plain, + header-font .initial:n = \normalfont \bfseries, + body-font .initial:n = \itshape, + qed-symbol .initial:n = \ensuremath { \mdwhtsquare }, + counter .initial:n = chapter + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@@_new_theorem:Nn,\@@_new_theorem:NV} % 用于定义普通定理环境的辅助函数。 % \begin{arguments} % \item 定理名称列表,|clist| 型变量 +% \item 编号范围 % \end{arguments} -% 除证明以外的环境都不需要证毕符号,在此清空其设置。 % \begin{macrocode} -\cs_new_protected:Npn \@@_new_theorem:N #1 +\cs_new_protected:Npn \@@_new_theorem:Nn #1#2 { - \theoremsymbol { } \clist_map_inline:Nn #1 - { \newtheorem { ##1 } { \@@_name:n { ##1 } } } + { \newtheorem { ##1 } { \@@_name:n { ##1 } } [#2] } } +\cs_generate_variant:Nn \@@_new_theorem:Nn { NV } % \end{macrocode} % \end{macro} % +% \begin{macro}{\@@_ntheorem_post_setup:} +% 载入 \pkg{ntheorem} 后的相应设置。 +% \begin{macrocode} +\cs_new_protected:Npn \@@_ntheorem_post_setup: + { + \exp_args:NV \theoremstyle \l_@@_thm_style_tl + \exp_args:NV \theoremheaderfont \l_@@_thm_header_font_tl + \exp_args:NV \theorembodyfont \l_@@_thm_body_font_tl + \exp_args:NV \theoremsymbol \l_@@_thm_qed_symbol_tl +% \end{macrocode} % 定义证明环境。证毕符号使用 \tn{mdlgwhtsquare} 绘制,对应于 |U+25A1| 字符 -% \footnote{\url{https://tex.stackexchange.com/questions/567135/how-get-box-like-symbol-with-xelatex}}。 +% \footnote{\url{https://tex.stackexchange.com/q/567135/}}。 +% \begin{macrocode} + \newtheorem* { proof } { \c_@@_name_proof_tl } +% \end{macrocode} +% 定义普通定理环境。清除预设的证毕符号,并排除 \env{proof}。 % \begin{macrocode} -\theoremsymbol { \ensuremath { \mdwhtsquare } } -\newtheorem* { proof } { \g_@@_name_proof_tl } + \theoremsymbol { } + \group_begin: + \clist_remove_all:Nn \g_@@_theorem_type_clist { proof } + \@@_new_theorem:NV \g_@@_theorem_type_clist \l_@@_thm_counter_tl + \group_end: + } % \end{macrocode} +% \end{macro} % -% 定义普通定理环境,需要排除 \env{proof}。 +% 在导言区末尾,通过吸收的用户设置,选择是否载入并设置 \pkg{ntheorem}。 % \begin{macrocode} -\group_begin: - \clist_remove_all:Nn \g_@@_theorem_type_clist { proof } - \@@_new_theorem:N \g_@@_theorem_type_clist -\group_end: +\ctex_at_end_preamble:n + { + \bool_if:NT \g_@@_thm_predefine_bool + { + \PassOptionsToPackage { amsmath, thmmarks } { ntheorem } + \RequirePackage { ntheorem } + \@@_ntheorem_post_setup: + } + } %</class> % \end{macrocode} % @@ -4610,9 +4971,9 @@ To produce the documentation run the original source files ending with %<*definition-ug> \@@_declare_element:nn { cover / ug / emblem-img } { - content = \njuemblem [ black ] { ! } { 3.35 cm }, + content = \@@_emblem:N \c_@@_emblemwidth_dim, bottom-skip = 1 cm, - align = l + align = l } % \end{macrocode} % \end{macro} @@ -4622,7 +4983,7 @@ To produce the documentation run the original source files ending with % \begin{macrocode} \@@_declare_element:nn { cover / ug / name-img } { - content = \njuname [ black ] { ! } { 3 cm }, + content = \@@_name:N \c_@@_namewidth_dim, bottom-skip = 1 cm } % \end{macrocode} @@ -4647,7 +5008,7 @@ To produce the documentation run the original source files ending with \@@_declare_element:nn { cover / ug / info } { content = - \@@_cover_info_ug:NN \g_@@_coverlabel_dim \g_@@_coveruline_dim, + \@@_cover_info_ug:NN \c_@@_coverlabel_dim \c_@@_coveruline_dim, format = \zihao { 3 } } % \end{macrocode} @@ -4663,18 +5024,18 @@ To produce the documentation run the original source files ending with % \begin{macrocode} \cs_new_protected:Npn \@@_cover_info_ug:NN #1#2 { - \begin{minipage} { #1 + #2 + \g_@@_smallhskip_dim } - \dim_set_eq:NN \baselineskip \g_@@_coverlineskip_dim - \dim_set:Nn \l_@@_tmpb_dim { .5 #2 - .5 #1 - \g_@@_smallhskip_dim } - \@@_cover_entry:nnn { dept } { #1 } { #2 } - \@@_cover_entry:nnn { major } { #1 } { #2 } - \@@_cover_entry_title:nnn { \bf } { #1 } { #2 } - \@@_cover_bientry:nnnn { grade } { id } { #1 } { \l_@@_tmpb_dim } - \@@_cover_entry:nnn { author } { #1 } { #2 } + \begin{minipage} { #1 + #2 + \c_@@_smallhskip_dim } + \dim_set_eq:NN \baselineskip \c_@@_coverlineskip_dim + \dim_set:Nn \l_@@_tmpb_dim { .5 #2 - .5 #1 - \c_@@_smallhskip_dim } + \@@_cover_entry:nnn { dept } { #1 } { #2 } + \@@_cover_entry:nnn { major } { #1 } { #2 } + \@@_cover_entry_title:nnn { \bf } { #1 } { #2 } + \@@_cover_bientry:nnnn { grade } { id } { #1 } { \l_@@_tmpb_dim } + \@@_cover_entry:nnn { author } { #1 } { #2 } \@@_cover_entry_supv:nnn { supv } { #1 } { \l_@@_tmpb_dim } \bool_if:NT \l_@@_second_supv_bool { \@@_cover_entry_supv:nnn { supv_ii } { #1 } { \l_@@_tmpb_dim } } - \@@_cover_entry:nnn { submitdate } { #1 } { #2 } + \@@_cover_entry:nnn { submitdate } { #1 } { #2 } \end{minipage} } %</definition-ug> @@ -4691,8 +5052,8 @@ To produce the documentation run the original source files ending with %<*definition-g> \@@_declare_element:nn { cover / g / emblem-img } { - content = \njuemblem [ black ] { ! } { 1.9 cm }, - bottom-skip = 1 cm + content = \@@_emblem:N \c_@@_emblemwidthi_dim, + bottom-skip = 1.5 cm } % \end{macrocode} % \end{macro} @@ -4702,7 +5063,7 @@ To produce the documentation run the original source files ending with % \begin{macrocode} \@@_declare_element:nn { cover / g / name-img } { - content = \njuname [ black ] { 4.4 cm } { ! }, + content = \@@_name:N \c_@@_namewidth_dim, bottom-skip = 2 cm } % \end{macrocode} @@ -4726,7 +5087,7 @@ To produce the documentation run the original source files ending with % \begin{macrocode} \@@_declare_element:nn { cover / g / degree } { - content = \g_@@_name_apply_tl, + content = \c_@@_name_apply_tl, format = \zihao { -1 } \bfseries, bottom-skip = 1 cm plus 1.5 fil } @@ -4739,7 +5100,7 @@ To produce the documentation run the original source files ending with \@@_declare_element:nn { cover / g / info } { content = - \@@_cover_info_g:NN \g_@@_coverlabel_dim \g_@@_coveruline_dim, + \@@_cover_info_g:NN \c_@@_coverlabel_dim \c_@@_coveruline_dim, bottom-skip = 0 pt plus 1.5 fil } % \end{macrocode} @@ -4762,8 +5123,8 @@ To produce the documentation run the original source files ending with % \begin{macrocode} \cs_new_protected:Npn \@@_cover_info_g:NN #1#2 { - \begin{minipage} { #1 + #2 + \g_@@_smallhskip_dim } - \dim_set_eq:NN \baselineskip \g_@@_coverlineskip_dim + \begin{minipage} { #1 + #2 + \c_@@_smallhskip_dim } + \dim_set_eq:NN \baselineskip \c_@@_coverlineskip_dim \@@_cover_entry_title:nnn { } { #1 } { #2 } \clist_map_inline:nn { author, major, field, supvfull } { \@@_cover_entry:nnn { ##1 } { #1 } { #2 } } @@ -4790,14 +5151,14 @@ To produce the documentation run the original source files ending with % \begin{macrocode} \cs_new_protected:Npn \@@_cover_back_g: { - \@@_spread_box:nnV { 6.2 em } { \kaishu } \g_@@_name_id_tl + \@@_spread_box:nnV { 6.2 em } { \kaishu } \c_@@_name_id_tl { : \@@_quad: } \g_@@_info_id_tl \@@_vskip: - \@@_spread_box:nnV { 6.2 em } { \kaishu } \g_@@_name_defenddate_tl + \@@_spread_box:nnV { 6.2 em } { \kaishu } \c_@@_name_defenddate_tl { : \@@_quad: } \g_@@_info_defenddate_tl \@@_vskip: - \@@_spread_box:nnV { 6.2 em } { \kaishu } \g_@@_name_supvfull_tl - { : \@@_quad: } \skip_horizontal:n { 8 em } \g_@@_name_sign_tl + \@@_spread_box:nnV { 6.2 em } { \kaishu } \c_@@_name_supvfull_tl + { : \@@_quad: } \skip_horizontal:n { 8 em } \c_@@_name_sign_tl } % \end{macrocode} % \end{macro} @@ -4841,8 +5202,8 @@ To produce the documentation run the original source files ending with \@@_declare_element:nn { cover / g / en / middle } { content = - \g_@@_text_cover_en_tl \@@_vskip: - \textsc { \clist_item:Nn \g_@@_name_degree_en_clist + \c_@@_text_cover_en_tl \@@_vskip: + \textsc { \clist_item:Nn \c_@@_name_degree_en_clist { \g_@@_info_degree_int } } \@@_vskip: { in } \@@_vskip: \g_@@_info_major_en_tl, @@ -4856,7 +5217,7 @@ To produce the documentation run the original source files ending with % \begin{macrocode} \@@_declare_element:nn { cover / g / en / emblem-img } { - content = \njuemblem [ black ] { ! } { 2.5 cm }, + content = \@@_emblem:N \c_@@_emblemwidthii_dim, bottom-skip = 1.5 cm } % \end{macrocode} @@ -4869,7 +5230,7 @@ To produce the documentation run the original source files ending with { content = \g_@@_info_dept_en_tl \skip_vertical:N \c_zero_skip - \g_@@_name_nju_en_tl \skip_vertical:n { 1 cm } + \c_@@_name_nju_en_tl \skip_vertical:n { 1 cm } \g_@@_info_submitdate_en_tl } % \end{macrocode} @@ -4894,7 +5255,7 @@ To produce the documentation run the original source files ending with \@@_declare_element:nn { cover / nl / name } { content = - \@@_spread_box:nnV { 6 em } { } \g_@@_name_title_tl, + \@@_spread_box:nnV { 6 em } { } \c_@@_name_title_tl, format = \zihao { -0 }, bottom-skip = 0 pt plus 1 fil } @@ -4953,11 +5314,11 @@ To produce the documentation run the original source files ending with % \begin{macrocode} \cs_new_protected:Npn \@@_cover_top_nl: { - \@@_spread_box:nnV { 3.2 em } { } \g_@@_name_clc_tl \@@_hskip: + \@@_spread_box:nnV { 3.2 em } { } \c_@@_name_clc_tl \@@_hskip: \@@_ulined_center_box:nn { 9 em } { \g_@@_info_clc_tl } \hfill - \@@_spread_box:nnV { 3.2 em } { } \g_@@_name_secretlv_tl \@@_hskip: + \@@_spread_box:nnV { 3.2 em } { } \c_@@_name_secretlv_tl \@@_hskip: \@@_ulined_center_box:nn { 9 em } { \g_@@_info_secretlv_tl } \\ - \@@_spread_box:nnV { 3.2 em } { } \g_@@_name_udc_tl \@@_hskip: + \@@_spread_box:nnV { 3.2 em } { } \c_@@_name_udc_tl \@@_hskip: \@@_ulined_center_box:nn { 9 em } { \g_@@_info_udc_tl } \hfill \null } % \end{macrocode} @@ -4970,11 +5331,11 @@ To produce the documentation run the original source files ending with { \parbox [ b ] { 15 em } { \@@_uline_title: } \par \skip_vertical:n { - 0.5 cm } - { \zihao { 4 } \g_@@_name_title_b_tl } + { \zihao { 4 } \c_@@_name_title_b_tl } \skip_vertical:N \c_zero_skip \@@_ulined_center_box:nn { 4.5 em } { \g_@@_info_author_tl } \skip_vertical:n { - 0.5 cm } - { \zihao { 4 } { ( } \g_@@_name_author_tl { ) } } + { \zihao { 4 } { ( } \c_@@_name_author_tl { ) } } } % \end{macrocode} % \end{macro} @@ -4985,18 +5346,18 @@ To produce the documentation run the original source files ending with % \begin{macrocode} \cs_new_protected:Npn \@@_cover_info_nl: { - \@@_uline_list:nnn { \g_@@_name_supvinfo_tl } + \@@_uline_list:nnn { \c_@@_name_supvinfo_tl } { \clist_use:Nn \g_@@_info_supv_clist { ~ } - \clist_use:Nn \g_@@_info_supv_ii_clist { ~ } ~ - \g_@@_info_supv_cont_tl + \clist_use:Nn \g_@@_info_supv_ii_clist { ~ } + \@@_hskip: \g_@@_info_supvcont_tl } { 1 em plus 1 fill } \@@_uline_bientry:Nnnn \l_@@_tmpa_dim { degree } { degree } { } \@@_uline_bientry:Nnnn \l_@@_tmpa_dim { major_b } { major } { } \\ \@@_uline_bientry:Nnnn \l_@@_tmpa_dim { submitdate } { submitdate } { } \@@_uline_bientry:Nnnn \l_@@_tmpa_dim { defenddate } { defenddate } { } \\ - \@@_full_uline:Nn \l_@@_tmpa_dim { \g_@@_name_confer_tl } + \@@_full_uline:Nn \l_@@_tmpa_dim { \c_@@_name_confer_tl } \@@_uline:n { \l_@@_tmpa_dim } } % \end{macrocode} @@ -5023,8 +5384,8 @@ To produce the documentation run the original source files ending with % \begin{macrocode} \@@_declare_element:nn { authdecl / g / title } { - content = \g_@@_name_authdecl_tl, - format = \g_@@_fmt_chapter_tl, + content = \c_@@_name_authdecl_tl, + format = \c_@@_fmt_chapter_tl, bottom-skip = 3 cm } % \end{macrocode} @@ -5035,7 +5396,7 @@ To produce the documentation run the original source files ending with % \begin{macrocode} \@@_declare_element:nn { authdecl / g / text } { - content = \g_@@_text_authdecl_tl, + content = \c_@@_text_authdecl_tl, align = n, bottom-skip = 2 cm } @@ -5106,22 +5467,26 @@ To produce the documentation run the original source files ending with cell{1}{2} = {c=5}{m}, cell{3}{2} = {c=5}{m}, cell{4}{2} = {c=5}{m}, cell{5}{2} = {c=5}{m} } - \g_@@_name_title_c_tl & \g_@@_info_title_tl \\ - \g_@@_name_id_a_tl & \g_@@_info_id_tl & - \g_@@_name_dept_a_tl & \g_@@_info_dept_tl & - \g_@@_name_year_tl & + \c_@@_name_title_c_tl & \g_@@_info_title_tl \\ + \c_@@_name_id_a_tl & \g_@@_info_id_tl & + \c_@@_name_dept_a_tl & \g_@@_info_dept_tl & + \c_@@_name_year_tl & \tl_range:Nnn \g_@@_info_submitdate_raw_tl {1} {4} \\ - \g_@@_name_degree_a_tl & + \c_@@_name_degree_a_tl & { \@@_degree_checkbox:n { 2 } 学术学位硕士 \qquad{} \@@_degree_checkbox:n { 3 } 专业学位硕士 \\ \@@_degree_checkbox:n { 4 } 学术学位博士 \qquad{} \@@_degree_checkbox:n { 5 } 专业学位博士 } \\ - \g_@@_name_email_tl & \g_@@_info_email_tl \\ - \g_@@_name_supv_b_tl & - \clist_item:Nn \g_@@_info_supv_clist {1} - \clist_item:Nn \g_@@_info_supv_ii_clist {1} \\ + \c_@@_name_email_tl & \g_@@_info_email_tl \\ + \c_@@_name_supv_b_tl & + \clist_item:Nn \g_@@_info_supv_clist {1} + \bool_if:NT \l_@@_second_supv_bool + { + \@@_quad: + \clist_item:Nn \g_@@_info_supv_ii_clist {1} + } \\ \end{tblr} } % \end{macrocode} @@ -5132,8 +5497,8 @@ To produce the documentation run the original source files ending with % \begin{macrocode} \cs_new_protected:Npn \@@_authdecl_sign_g: { - \g_@@_name_authsign_tl \par - \g_@@_name_blankdate_tl + \c_@@_name_authsign_tl \par + \c_@@_name_blankdate_tl } % \end{macrocode} % \end{macro} @@ -5143,9 +5508,9 @@ To produce the documentation run the original source files ending with % \begin{macrocode} \cs_new_protected:Npn \@@_authdecl_secretlv_g: { - \g_@@_name_secretstatus_tl \par - \ensuremath { \mdwhtsquare } \g_@@_name_secretfree_tl \par - \ensuremath { \mdwhtsquare } \g_@@_name_secretdate_tl + \c_@@_name_secretstatus_tl \par + \ensuremath { \mdwhtsquare } \c_@@_name_secretfree_tl \par + \ensuremath { \mdwhtsquare } \c_@@_name_secretdate_tl } %</definition-g> % \end{macrocode} @@ -5266,9 +5631,9 @@ To produce the documentation run the original source files ending with % \begin{macrocode} \cs_new_protected:Npn \@@_make_origdecl: { - \chapter* { \g_@@_name_origdecl_tl } + \chapter* { \c_@@_name_origdecl_tl } \thispagestyle { empty } - \g_@@_text_origdecl_tl + \c_@@_text_origdecl_tl \vfil \begin{flushright} %<definition-ug> \clist_map_inline:nn { origsign, id, origdate } @@ -5286,12 +5651,8 @@ To produce the documentation run the original source files ending with % \begin{macrocode} \cs_new_protected:Npn \@@_make_authdecl: { -%<definition-ug> \prg_do_nothing: -%<*definition-g> - \thispagestyle{empty} - \UseInstance { nju } { authdecl-g-default } - \cleardoublepage -%</definition-g> +%<definition-ug> \prg_do_nothing: +%<definition-g> \UseInstance { nju } { authdecl-g-default } } %</(definition-ug|definition-g)> % \end{macrocode} @@ -5362,6 +5723,11 @@ To produce the documentation run the original source files ending with \msg_warning:nn { njuthesis } { missing-image } \RequirePackage { njuvisual } } + \bool_if:NT \g_@@_blind_bool + { + \RenewDocumentCommand \njuemblem { o m m } { \prg_do_nothing: } + \RenewDocumentCommand \njuname { o m m } { \prg_do_nothing: } + } } % \end{macrocode} % @@ -5393,15 +5759,19 @@ To produce the documentation run the original source files ending with % 如果在选择了 \opt{decl-page},就生成本科生的诚信承诺书, % 或研究生的原创性声明和出版授权书。 % \begin{macrocode} -\bool_if:NF \g_@@_draft_bool - { - \bool_if:NT \g_@@_decl_bool + \bool_if:NF \g_@@_draft_bool { - \@@_make_origdecl: - \AtEndEnvironment { document } - { \@@_make_authdecl: } + \bool_if:NT \g_@@_decl_bool + { + \@@_make_origdecl: + \AtEndEnvironment { document } + { + \cleardoublepage + \@@_make_authdecl: + \cleardoublepage + } + } } - } % \end{macrocode} % 在标题页后使用大写罗马字母页码,恢复正常字体设置。 % \begin{macrocode} @@ -5426,7 +5796,7 @@ To produce the documentation run the original source files ending with %<*(definition-ug|definition-g)> \@@_declare_element:nn { abstract / title } { - content = \@@_abs_title:V \g_@@_name_abstracttitle_tl, + content = \@@_abs_title:V \c_@@_name_abstracttitle_tl, format = \bfseries \kaishu \zihao { -2 }, bottom-skip = 1.2 cm } @@ -5454,7 +5824,7 @@ To produce the documentation run the original source files ending with % \begin{macrocode} \@@_declare_element:nn { abstract / en / title } { - content = \@@_abs_title:V \g_@@_name_abstracttitle_en_tl, + content = \@@_abs_title:V \c_@@_name_abstracttitle_en_tl, format = \bfseries \kaishu \zihao { -2 }, bottom-skip = 1.2 cm } @@ -5496,13 +5866,13 @@ To produce the documentation run the original source files ending with % 确定标题类型。 % \begin{macrocode} \tl_if_blank:eTF { #1 } - { \g_@@_name_title_tl } - { \clist_item:Nn \g_@@_name_type_en_clist { \g_@@_info_type_int } } + { \c_@@_name_title_tl } + { \clist_item:Nn \c_@@_name_type_en_clist { \g_@@_info_type_int } } #2 \tl_use:c { g_@@_info_title #1 _tl } \\ % \end{macrocode} % 由于作者姓名使用的字样发生了变动,这里进行替换以便嵌入循环。 % \begin{macrocode} - \tl_set_eq:NN \g_@@_name_author_tl \g_@@_name_author_a_tl + \tl_set_eq:NN \c_@@_name_author_tl \c_@@_name_author_a_tl % \end{macrocode} % 使用循环输出院系、专业、作者、导师信息。 % \begin{macrocode} @@ -5522,7 +5892,7 @@ To produce the documentation run the original source files ending with % \begin{macrocode} \@@_declare_element:nn { abstract / mark } { - content = \g_@@_name_abstract_b_tl, + content = \c_@@_name_abstract_b_tl, format = \sffamily \zihao { -3 }, bottom-skip = 1 cm } @@ -5534,7 +5904,7 @@ To produce the documentation run the original source files ending with % \begin{macrocode} \@@_declare_element:nn { abstract / en / mark } { - content = \g_@@_name_abstract_b_en_tl, + content = \c_@@_name_abstract_b_en_tl, format = \sffamily \zihao { -3 }, bottom-skip = 1 cm } @@ -5553,8 +5923,8 @@ To produce the documentation run the original source files ending with { \@@_uline_list:xnn { - \clist_item:Nn \g_@@_name_type_clist { \g_@@_info_type_int } - \g_@@_name_title_a_tl #1 + \clist_item:Nn \c_@@_name_type_clist { \g_@@_info_type_int } + \c_@@_name_title_a_tl #1 } { \g_@@_info_title_tl } { \g_@@_abs_title_left_skip } % \end{macrocode} @@ -5563,9 +5933,9 @@ To produce the documentation run the original source files ending with \@@_full_uline:NV \l_@@_tmpa_dim { \@@_ulined_center_box:nn { 11 em } { \g_@@_info_major_tl } - \g_@@_name_major_a_tl + \c_@@_name_major_a_tl \@@_ulined_center_box:nn { 4 em } { \g_@@_info_grade_tl } - \g_@@_name_grade_tl \g_@@_name_author_a_tl #1 + \c_@@_name_grade_tl \c_@@_name_author_a_tl #1 } \@@_ulined_center_box:nn { \l_@@_tmpa_dim } { \g_@@_info_author_tl } \\ @@ -5573,7 +5943,7 @@ To produce the documentation run the original source files ending with % 导师姓名、职称。 % \begin{macrocode} \@@_full_uline:NV \l_@@_tmpa_dim - { \g_@@_name_supv_a_tl #1 } + { \c_@@_name_supv_a_tl #1 } \@@_ulined_center_box:nn { \l_@@_tmpa_dim } { \g_@@_info_supvfull_tl } } @@ -5618,7 +5988,7 @@ To produce the documentation run the original source files ending with %<*class> \cs_new_protected:Npn \@@_print_keywords:nn #1#2 { - \tl_set:Nv \l_@@_tmpa_tl { g_@@_name_keywords #1 _tl } + \tl_set:Nv \l_@@_tmpa_tl { c_@@_name_keywords #1 _tl } \@@_get_text_width:NV \l_@@_tmpa_dim \l_@@_tmpa_tl % \end{macrocode} % 关键词列表的悬挂缩进样式由 \tn{list} 环境产生。 @@ -5723,7 +6093,7 @@ To produce the documentation run the original source files ending with { \cleardoublepage \thispagestyle { plain } - \@@_abs_bookmark:Vn \g_@@_name_abstract_a_tl { abstract } + \@@_abs_bookmark:Vn \c_@@_name_abstract_a_tl { abstract } \@@_make_abstract: \group_begin: \kaishu \zihao { -4 } #1 } @@ -5738,7 +6108,7 @@ To produce the documentation run the original source files ending with { \cleardoublepage \thispagestyle { plain } - \@@_abs_bookmark:Vn \g_@@_name_abstract_a_en_tl { abstract-en } + \@@_abs_bookmark:Vn \c_@@_name_abstract_a_en_tl { abstract-en } \@@_make_abstract_en: \group_begin: \zihao { -4 } #1 } @@ -5754,9 +6124,11 @@ To produce the documentation run the original source files ending with % 单独制作的前言致谢页。 % \begin{macrocode} \NewDocumentEnvironment { preface } { +b } - { \@@_chapter:V \g_@@_name_preface_tl #1 } { } + { \@@_chapter:V \c_@@_name_preface_tl #1 } + { \cleardoublepage } \NewDocumentEnvironment { acknowledgement } { +b } - { \@@_chapter:V \g_@@_name_acknowledgement_tl #1 } { } + { \@@_chapter:V \c_@@_name_acknowledgement_tl #1 } + { \cleardoublepage } % \end{macrocode} % \end{environment} % \end{environment} @@ -5770,7 +6142,7 @@ To produce the documentation run the original source files ending with % 成果列表。 % \begin{macrocode} \NewDocumentCommand \njupaperlist - { O { \g_@@_name_paperlist_tl } m } + { O { \c_@@_name_paperlist_tl } m } { \group_begin: % \end{macrocode} @@ -5848,10 +6220,10 @@ To produce the documentation run the original source files ending with % \begin{macrocode} \NewDocumentEnvironment { notation } { O { 10 em } O { 5 em } } { - \@@_chapter:V \g_@@_name_notation_tl + \@@_chapter:V \c_@@_name_notation_tl \@@_make_notation:nn { #1 } { #2 } } - { \endlist } + { \endlist \cleardoublepage } % \end{macrocode} % \end{environment} % @@ -5860,7 +6232,7 @@ To produce the documentation run the original source files ending with % \begin{macrocode} \NewDocumentEnvironment { notation* } { O { 10 em } O { 5 em } } { - \chapter * { \g_@@_name_notation_tl } + \chapter * { \c_@@_name_notation_tl } \@@_make_notation:nn { #1 } { #2 } } { \endlist } @@ -5872,6 +6244,7 @@ To produce the documentation run the original source files ending with % \subsection{配置常量} % \label{subsec:constant-config} % \changes{v0.16}{2022/02/23}{将名称常量分离到 \file{.def} 文件。} +% \changes{v0.18}{2022/04/20}{使用 |const| 类型统一定义常量。} % % 本节内容用于生成常量的默认定义,分为本科生和研究生模板两种。 % @@ -5931,7 +6304,7 @@ To produce the documentation run the original source files ending with { author_a } { 本科生姓名 }, { grade } { 年级 }, { origdecl } - { \g_@@_name_nju_tl 本科毕业论文(设计)诚信承诺书 }, + { \c_@@_name_nju_tl 本科毕业论文(设计)诚信承诺书 }, { origsign } { 作者签名 }, { submitdate } { 提交日期 }, { supv } { 导师 }, @@ -5944,12 +6317,12 @@ To produce the documentation run the original source files ending with { { abstracttitle } { - \g_@@_name_nju_tl \g_@@_name_type_tl - \g_@@_name_lang_tl \g_@@_name_abstract_tl + \c_@@_name_nju_tl \c_@@_name_type_tl + \c_@@_name_lang_tl \c_@@_name_abstract_tl } { - \g_@@_name_nju_tl \g_@@_name_type_tl - \g_@@_name_lang_en_tl \g_@@_name_abstract_tl + \c_@@_name_nju_tl \c_@@_name_type_tl + \c_@@_name_lang_en_tl \c_@@_name_abstract_tl }, { author } { 学生姓名 } { UNDERGRADUATE }, { major } { 专业 } { SPECIALIZATION }, @@ -5991,15 +6364,16 @@ To produce the documentation run the original source files ending with { major_a } { 专业 }, % 用于国家图书馆封面的专业名称字样 { major_b } { 专业名称 }, - { origdecl } { 南京大学学位论文原创性声明 }, + { origdecl } + { \c_@@_name_nju_tl 学位论文原创性声明 }, { origsign } { 研究生签名 }, { reviewer } { 评阅人: }, { secretlv } { 密级 }, { secretstatus } { 论文涉密情况: }, { secretfree } { 不保密 }, { secretdate } - { 保密,保密期( \g_@@_name_blankdate_tl 至 - \g_@@_name_blankdate_tl ) }, + { 保密,保密期( \c_@@_name_blankdate_tl 至 + \c_@@_name_blankdate_tl ) }, { sign } { (签字) }, { submitdate } { 论文提交日期 }, { supv } { 导师 }, @@ -6024,11 +6398,11 @@ To produce the documentation run the original source files ending with \clist_map_inline:nn { { abstracttitle } - { 南京大学 \g_@@_info_type_tl 中文摘要首页用纸 } - { 南京大学 \g_@@_info_type_tl 英文摘要首页用纸 }, - { author } { 作者姓名 } { POSTGRADUATE }, - { major } { 专业方向 } { SPECIALIZATION }, - { supvfull } { 指导教师 } { MENTOR } + { \c_@@_name_nju_tl \g_@@_info_type_tl 中文摘要首页用纸 } + { \c_@@_name_nju_tl \g_@@_info_type_tl 英文摘要首页用纸 }, + { author } { 作者姓名 } { POSTGRADUATE }, + { major } { 专业方向 } { SPECIALIZATION }, + { supvfull } { 指导教师 } { MENTOR } } { \@@_define_name:nnn #1 } %</definition-g> @@ -6037,10 +6411,10 @@ To produce the documentation run the original source files ending with % \subsubsection{文本} % \label{subsubsec:constant-text} % -% \begin{variable}{\g_@@_text_origdecl_tl} +% \begin{variable}{\c_@@_text_origdecl_tl} % 本科生的学位论文诚信承诺书,或研究生的学位论文原创性声明。 % \begin{macrocode} -\tl_const:Nn \g_@@_text_origdecl_tl +\tl_const:Nn \c_@@_text_origdecl_tl { %<*definition-ug> 本人郑重承诺:所呈交的毕业论文(设计)(题目: \g_@@_info_title_tl ) @@ -6050,21 +6424,21 @@ To produce the documentation run the original source files ending with 本人承诺不存在抄袭、伪造、篡改、代写、买卖毕业论文(设计)等违纪行为。 %</definition-ug> %<*definition-g> - 本人郑重声明,所提交的学位论文是本人在导师指导下独立进行科学研究工作 - 所取得的成果。除本论文中已经注明引用的内容外,本论文不包含其他个人或 - 集体已经发表或撰写过的研究成果,也不包含为获得南京大学或其他教育机构 - 的学位证书而使用过的材料。对本文的研究做出重要贡献的个人和集体,均已 - 在论文的致谢部分明确标明。本人郑重申明愿承担本声明的法律责任。 + 本人郑重声明,所提交的学位论文是本人在导师指导下独立进行科学研究工作所 + 取得的成果。除本论文中已经注明引用的内容外,本论文不包含其他个人或集体 + 已经发表或撰写过的研究成果,也不包含为获得 \c_@@_name_nju_tl 或其他教 + 育机构的学位证书而使用过的材料。对本文的研究做出重要贡献的个人和集体, + 均已在论文的致谢部分明确标明。本人郑重申明愿承担本声明的法律责任。 %</definition-g> } % \end{macrocode} % \end{variable} % -% \begin{variable}{\g_@@_text_authdecl_tl} +% \begin{variable}{\c_@@_text_authdecl_tl} % 研究生的学位论文出版授权书。 % \begin{macrocode} %<*definition-g> -\tl_gset:Nn \g_@@_text_authdecl_tl +\tl_const:Nn \c_@@_text_authdecl_tl { 本人完全同意《中国优秀博硕士学位论文全文数据库出版章程》 (以下简称“章程”),愿意将本人的学位论文提交“中国学术期刊 @@ -6078,13 +6452,13 @@ To produce the documentation run the original source files ending with % \end{macrocode} % \end{variable} % -% \begin{variable}{\g_@@_text_cover_en_tl} +% \begin{variable}{\c_@@_text_cover_en_tl} % 研究生的英文封面字样。 % \begin{macrocode} -\tl_gset:Nn \g_@@_text_cover_en_tl +\tl_const:Nn \c_@@_text_cover_en_tl { A~ dissertation~ submitted~ to \\ - the~ graduate~ school~ of~ Nanjing~ University \\ + the~ graduate~ school~ of~ \c_@@_name_nju_en_tl \\ in~ partial~ fulfilment~ of~ the~ requirements~ for~ the~ degree~ of } %</definition-g> @@ -6112,6 +6486,7 @@ To produce the documentation run the original source files ending with % \label{subsubsec:constant-length} % % \changes{v0.17}{2022/04/09}{将长度值分离到 \file{.def} 文件。} +% \changes{v0.18}{2022/04/20}{统一管理校名校徽尺寸。} % 默认长度值。 % \begin{macrocode} \clist_map_inline:nn @@ -6120,6 +6495,11 @@ To produce the documentation run the original source files ending with %<definition-g> { coverlabel } { 100 pt }, { coverlineskip } { 40 pt }, { coveruline } { 270 pt }, +%<definition-ug> { emblemwidth } { 68 pt }, +%<definition-g> { emblemwidthi } { 46 pt }, +%<definition-g> { emblemwidthii } { 61 pt }, +%<definition-ug> { namewidth } { 300 pt }, +%<definition-g> { namewidth } { 126 pt }, { smallhskip } { 5 pt }, { smallvskip } { 1 ex } } @@ -6134,12 +6514,14 @@ To produce the documentation run the original source files ending with % \begin{macrocode} \clist_map_inline:nn { - { chapterintoc } { \large \normalfont \sffamily }, - { chapter } { \large \normalfont \sffamily \centering }, - { section } { \large \normalfont \sffamily }, - { subsection } { \large \normalfont \sffamily }, - { subsubsection } { \large \normalfont \sffamily }, - { toctitle } { \centering \zihao { 3 } \bfseries } + { section } { \large \normalfont \sffamily }, + { chapter } { \c_@@_fmt_section_tl \centering }, + { chapterintoc } { \c_@@_fmt_section_tl }, + { subsection } { \c_@@_fmt_section_tl }, + { subsubsection } { \c_@@_fmt_section_tl }, + { paragraph } { \c_@@_fmt_section_tl }, + { subparagraph } { \c_@@_fmt_section_tl }, + { toctitle } { \centering \zihao { 3 } \bfseries } } { \@@_define_fmt:nn #1 } %</(definition-ug|definition-g)> diff --git a/macros/unicodetex/latex/njuthesis/njuthesis.ins b/macros/unicodetex/latex/njuthesis/njuthesis.ins index 131bf3bb9c..5efc57a52f 100644 --- a/macros/unicodetex/latex/njuthesis/njuthesis.ins +++ b/macros/unicodetex/latex/njuthesis/njuthesis.ins @@ -78,13 +78,13 @@ To produce the documentation run the original source files ending with \endbatchfile \__nju_declare_element:nn { abstract / mark } { - content = \g__nju_name_abstract_b_tl, + content = \c__nju_name_abstract_b_tl, format = \sffamily \zihao { -3 }, bottom-skip = 1 cm } \__nju_declare_element:nn { abstract / en / mark } { - content = \g__nju_name_abstract_b_en_tl, + content = \c__nju_name_abstract_b_en_tl, format = \sffamily \zihao { -3 }, bottom-skip = 1 cm } diff --git a/macros/unicodetex/latex/njuthesis/njuthesis.pdf b/macros/unicodetex/latex/njuthesis/njuthesis.pdf Binary files differindex 4863e8f027..97e9015106 100644 --- a/macros/unicodetex/latex/njuthesis/njuthesis.pdf +++ b/macros/unicodetex/latex/njuthesis/njuthesis.pdf |