summaryrefslogtreecommitdiff
path: root/macros/unicodetex
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2023-11-15 03:01:12 +0000
committerNorbert Preining <norbert@preining.info>2023-11-15 03:01:12 +0000
commitf5460c92605f1b3b17448b27ce53375157c3e4b1 (patch)
treec02171bfdb42a95c39a65edd35f227ae61c8de72 /macros/unicodetex
parente20928a0f9f4a7faa8bb21915e761e11e34f04ff (diff)
CTAN sync 202311150301
Diffstat (limited to 'macros/unicodetex')
-rw-r--r--macros/unicodetex/latex/njuthesis/njuthesis.dtx131
-rw-r--r--macros/unicodetex/latex/njuthesis/njuthesis.pdfbin1250747 -> 1249527 bytes
2 files changed, 87 insertions, 44 deletions
diff --git a/macros/unicodetex/latex/njuthesis/njuthesis.dtx b/macros/unicodetex/latex/njuthesis/njuthesis.dtx
index cf1443a781..b2e693bf63 100644
--- a/macros/unicodetex/latex/njuthesis/njuthesis.dtx
+++ b/macros/unicodetex/latex/njuthesis/njuthesis.dtx
@@ -112,7 +112,7 @@ To produce the documentation run the original source files ending with
%
%<class>\NeedsTeXFormat{LaTeX2e}
%<*!(driver|install)>
-%<+!driver>\GetIdInfo $Id: njuthesis.dtx 1.3.0 2023-06-06 11:30:00
+%<+!driver>\GetIdInfo $Id: njuthesis.dtx 1.3.1 2023-11-14 11:30:00
%<+!driver> +0800 NJU LUG <git+nju-lug-email-3104-issue-@yaoge123.cn>$
%<class> {Thesis template for Nanjing University}
%<class>\ProvidesExplClass{njuthesis}
@@ -148,7 +148,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{v1.3.0 \quad 2023-06-06}
+% \date{v1.3.1 \quad 2023-11-14}
%
% \changes{v0.1}{2021/09/04}{开始开发。}
% \changes{v0.2}{2021/09/07}{初步搭建了可用的模板。}
@@ -444,6 +444,7 @@ To produce the documentation run the original source files ending with
% \file{njuthesis.dtx}\TblrNote{a} & 文档类源代码 \\
% \file{njuthesis.ins}\TblrNote{a} & 文档类安装脚本 \\
% \file{njuthesis.pdf} & 用户手册(本文档) \\
+% \file{njuthesis-doc.cls} & 用户手册样式 \\
% \file{njuthesis-sample.bib} & 示例参考文献列表 \\
% \file{njuthesis-sample.tex} & 示例文档,不妨以此为基础撰写论文 \\
% \file{njuthesis-graduate.def} & 研究生参数配置文件 \\
@@ -915,12 +916,15 @@ To produce the documentation run the original source files ending with
% 若要手动选择字体,则需将字体设置为 \opt{none},再通过 \pkg{fontspec}
% 宏包或 \pkg{ctex} 宏包中给出的命令来实现。
%
-% ^^A \begin{function}[added=2022-07-02]{font-path}
-% ^^A \begin{syntax}
-% ^^A font-path = \Arg{文件夹}
-% ^^A \end{syntax}
-% ^^A 字体文件目录。
-% ^^A \end{function}
+% \begin{function}[added=2022-07-02]{font-path}
+% \begin{syntax}
+% font-path = \Arg{文件夹}
+% \end{syntax}
+% 字体文件目录。
+% \end{function}
+%
+% 模板用到的部分字体(例如华文中宋)可能尚未安装在操作系统,
+% 可以使用此选项手动指定搜索路径。
%
% ^^A 本模板默认使用操作系统安装的字体。可以使用本选项从任意目录载入字体。
%
@@ -2234,7 +2238,7 @@ To produce the documentation run the original source files ending with
% \begin{syntax}
% \tn{njusetformat}\marg{名称}\marg{样式}
% \end{syntax}
-% 修改样式。默认样式可以参见 \ref{subsubsec:constant-format} 节。
+% 修改样式。所有可以修改的默认样式参见 \ref{subsubsec:constant-format} 节。
% \end{function}
%
% 譬如,将章标题字号加大到小二号,示例如下:
@@ -2243,6 +2247,12 @@ To produce the documentation run the original source files ending with
% \njusetformat{chapter}{\zihao{-2}\sffamily\centering}
% \end{latexexample}
%
+% 修改表格内容的字体:
+%
+% \begin{latexexample}[moretexcs={\njusetformat,\zihao,\bfseries}]
+% \njusetformat{tabular}{\zihao{-4}\bfseries}
+% \end{latexexample}
+%
%
% \subsection{视觉识别系统}
%
@@ -2622,6 +2632,16 @@ To produce the documentation run the original source files ending with
}
% \end{macrocode}
%
+% \changes{v1.3}{2023/11/14}{兼容新版 \LaTeX3 的 |e| 型展开变化。}
+% 兼容新版 L3 特性。另见 \url{https://github.com/CTeX-org/ctex-kit/pull/678}。
+% \begin{macrocode}
+\@ifpackagelater { expl3 } { 2023/10/10 } { }
+ {
+ \cs_generate_variant:Nn \tl_set:Nn { Ne }
+ \cs_generate_variant:Nn \tl_const:Nn { Ne }
+ }
+% \end{macrocode}
+%
% 目前 \cls{njuthesis} 仅支持 \XeTeX 和 \LuaTeX。
% \begin{macrocode}
\msg_new:nnn { njuthesis } { unsupported-engine }
@@ -2635,7 +2655,7 @@ To produce the documentation run the original source files ending with
\bool_lazy_or:nnF
{ \sys_if_engine_xetex_p: }
{ \sys_if_engine_luatex_p: }
- { \msg_fatal:nnx { njuthesis } { unsupported-engine } { \c_sys_engine_str } }
+ { \msg_fatal:nne { njuthesis } { unsupported-engine } { \c_sys_engine_str } }
% \end{macrocode}
%
%
@@ -2741,7 +2761,7 @@ To produce the documentation run the original source files ending with
% \begin{variable}{\c_@@_name_today_tl}
% 编译当天日期,格式为 |yyyy-mm-dd|。
% \begin{macrocode}
-\tl_const:Nx \c_@@_name_today_tl
+\tl_const:Ne \c_@@_name_today_tl
{
\int_to_arabic:n { \c_sys_year_int } -
\int_to_arabic:n { \c_sys_month_int } -
@@ -2977,11 +2997,11 @@ To produce the documentation run the original source files ending with
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\@@_box_spread:NNn,\@@_box_spread:NNv,\@@_box_spread:NNx}
+% \begin{macro}{\@@_box_spread:NNn,\@@_box_spread:NNv,\@@_box_spread:NNe}
% \begin{macrocode}
\cs_new:Npn \@@_box_spread:NNn { \@@_box_spread:NNNn \l_@@_tmp_skip }
\cs_generate_variant:Nn \@@_box_spread:NNn { NNv }
-\cs_generate_variant:Nn \@@_box_spread:NNn { NNx }
+\cs_generate_variant:Nn \@@_box_spread:NNn { NNe }
% \end{macrocode}
% \end{macro}
%
@@ -3116,7 +3136,7 @@ To produce the documentation run the original source files ending with
% \end{macro}
%
% \begin{macro}{\@@_get_width_print:Nn,\@@_get_width_print:Nv,
-% \@@_get_width_print:Nx}
+% \@@_get_width_print:Ne}
% 横跨整页的下划线。
% \begin{arguments}
% \item 宽度,|dim| 型变量
@@ -3131,7 +3151,7 @@ To produce the documentation run the original source files ending with
\dim_set:Nn #1 { \textwidth - #1 } #2
}
\cs_generate_variant:Nn \@@_get_width_print:Nn { Nv }
-\cs_generate_variant:Nn \@@_get_width_print:Nn { Nx }
+\cs_generate_variant:Nn \@@_get_width_print:Nn { Ne }
% \end{macrocode}
% \end{macro}
%
@@ -3459,7 +3479,7 @@ To produce the documentation run the original source files ending with
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\@@_uline_list:NNn,\@@_uline_list:NNx}
+% \begin{macro}{\@@_uline_list:NNn,\@@_uline_list:NNe}
% \changes{v0.16}{2022/03/25}{使用原生断行算法处理摘要页标题。}
% 用于研究生摘要页面的多行标题。
% \begin{arguments}
@@ -3507,7 +3527,7 @@ To produce the documentation run the original source files ending with
}
}
}
-\cs_generate_variant:Nn \@@_uline_list:NNn { NNx }
+\cs_generate_variant:Nn \@@_uline_list:NNn { NNe }
% \end{macrocode}
% \end{macro}
%
@@ -3705,7 +3725,7 @@ To produce the documentation run the original source files ending with
You~ have~ not~ selected~ local~ files~
for~ emblem~ and~ name~ images.\\
It~ seems~ that~ you~ haven't~ fill~ in~ both~
- "image/nju-emblem"~ and~ "image/nju-name",~ therefore
+ "image/nju-emblem"~ and~ "image/nju-name",~ therefore~
I~ am~ using~ the~ package~ "njuvisual"~ instead,~
which~ may~ slow~ down~ the~ compilation.
}
@@ -4144,7 +4164,7 @@ To produce the documentation run the original source files ending with
% \changes{v0.12}{2021/12/07}{重新组织宏包载入顺序。}
% 将选项传入 \cls{ctexbook} 文档类。
% \begin{macrocode}
-\exp_args:Nx \PassOptionsToClass
+\exp_args:Ne \PassOptionsToClass
{
a4paper,
UTF8,
@@ -4351,7 +4371,7 @@ To produce the documentation run the original source files ending with
% 入对应默认配置。注意,尽管在手册中封面、摘要、常量等的代码实现位于靠
% 后部分,拆分后实际上是在此处载入运行的,务必要注意处理的逻辑顺序。
% \begin{macrocode}
-\exp_args:Nx \file_input:n
+\exp_args:Ne \file_input:n
{
njuthesis-
\int_case:nn { \g_@@_info_type_int }
@@ -4569,18 +4589,18 @@ To produce the documentation run the original source files ending with
% \end{macrocode}
% 拼合双导师的姓名和职称。
% \begin{macrocode}
- \tl_set:Nx \g_@@_info_supvfull_tl
+ \tl_set:Ne \g_@@_info_supvfull_tl
{ \clist_use:Nn \g_@@_info_supv_clist { \@@_hskip: } }
\clist_if_empty:NF \g_@@_info_supvii_clist
{
\bool_gset_true:N \g_@@_opt_supvii_bool
- \tl_gput_right:Nx \g_@@_info_supvfull_tl
+ \tl_gput_right:Ne \g_@@_info_supvfull_tl
{ \@@_quad: \clist_use:Nn \g_@@_info_supvii_clist { \@@_hskip: } }
}
\tl_set_eq:NN \g_@@_info_supvfull_en_tl \g_@@_info_supv_en_tl
\tl_if_empty:NF \g_@@_info_supvii_en_tl
{
- \tl_gput_right:Nx \g_@@_info_supvfull_en_tl
+ \tl_gput_right:Ne \g_@@_info_supvfull_en_tl
{ \@@_quad: \g_@@_info_supvii_en_tl }
}
}
@@ -4614,7 +4634,7 @@ To produce the documentation run the original source files ending with
% 文档类型字样。
% \begin{macrocode}
\tl_new:N \g_@@_info_type_tl
-\tl_set:Nx \g_@@_info_type_tl
+\tl_set:Ne \g_@@_info_type_tl
{ \clist_item:Nn \c_@@_name_type_clist { \g_@@_info_type_int } }
% \end{macrocode}
% \end{variable}
@@ -4633,7 +4653,7 @@ To produce the documentation run the original source files ending with
% 英文的学位字样。
% \begin{macrocode}
\tl_new:N \g_@@_info_degree_en_tl
-\tl_set:Nx \g_@@_info_degree_en_tl
+\tl_set:Ne \g_@@_info_degree_en_tl
{ \clist_item:Nn \c_@@_name_type_en_clist { \g_@@_info_type_int } }
%</def-g>
% \end{macrocode}
@@ -4922,6 +4942,7 @@ To produce the documentation run the original source files ending with
%
% \begin{macro}{\@@_loadfont_stzhongs:,\@@_stzhongs:}
% \changes{v1.2}{2023/04/30}{在研究生模板载入华文中宋。}
+% \changes{v1.3}{2023/10/09}{可以手动指定华文中宋文件位置。}
% 研究生封面额外需要的华文中宋。
% \begin{macrocode}
\cs_new:Npn \@@_loadfont_stzhongs:
@@ -4932,8 +4953,15 @@ To produce the documentation run the original source files ending with
[ \c_@@_name_fakebold_tl ]
}
{
- \cs_set_eq:NN \@@_stzhongs: \rmfamily
- \msg_warning:nn { njuthesis } { missing-stzhongs }
+ \bool_if:NTF \g_@@_font_path_bool
+ {
+ \newCJKfontfamily \@@_stzhongs: { \c_@@_name_stzhongsfile_tl }
+ [ Path = \g_@@_font_path_tl, \c_@@_name_fakebold_tl ]
+ }
+ {
+ \cs_set_eq:NN \@@_stzhongs: \rmfamily
+ \msg_warning:nn { njuthesis } { missing-stzhongs }
+ }
}
}
% \end{macrocode}
@@ -5133,7 +5161,7 @@ To produce the documentation run the original source files ending with
%
% 只有研究生模板需要华文中宋。我们把它放在文档类最后载入。
% \begin{macrocode}
-%<def-g>\ctex_at_end:n { \@@_loadfont_stzhongs: }
+%<def-g>\ctex_at_end_preamble:n { \@@_loadfont_stzhongs: }
% \end{macrocode}
%
%
@@ -5864,7 +5892,7 @@ To produce the documentation run the original source files ending with
% \changes{v1.0}{2022/08/06}{兼容 \pkg{tabularray} 设置。}
% 表格默认居中,字号设置为五号。^^A https://www.zhihu.com/question/366803177/answer/977853129
% \begin{macrocode}
-\BeforeBeginEnvironment { tabular } { \centering \zihao {5} }
+\BeforeBeginEnvironment { tabular } { \centering \c_@@_fmt_tabular_tl }
\ctex_at_end_package:nn { tabularray }
{
% \end{macrocode}
@@ -5872,7 +5900,7 @@ To produce the documentation run the original source files ending with
% \begin{macrocode}
\__tblr_use_lib_booktabs:
\tl_set:Nn \l_@@_tmpb_tl
- { , abovesep = 4 pt, stretch = 0.8, cells = { font = \small } }
+ { , abovesep = 4 pt, stretch = 0.8, cells = { font = \c_@@_fmt_tabular_tl } }
\tl_put_right:NV \l__tblr_default_tblr_inner_tl \l_@@_tmpb_tl
\tl_put_right:NV \l__tblr_default_talltblr_inner_tl \l_@@_tmpb_tl
\tl_put_right:Nn \l__tblr_default_talltblr_outer_tl { , headsep = -4 pt }
@@ -6702,6 +6730,7 @@ To produce the documentation run the original source files ending with
% \end{macro}
%
% \subparagraph{英文封面} 包括标题、顶部、中部、校徽、底部。
+% \changes{v1.3}{2023/08/21}{修复英文标题超长引发的页面元素混乱。}
%
% \begin{macro}{g/cover-en/title}
% 研究生英文封面标题实例。
@@ -6710,7 +6739,7 @@ To produce the documentation run the original source files ending with
{
content = \g_@@_info_title_en_tl,
format = \bf \sffamily \zihao { 2 },
- bottom-skip = 2 cm
+ bottom-skip = 1 cm plus 1 fil minus .5 cm
}
% \end{macrocode}
% \end{macro}
@@ -6730,7 +6759,7 @@ To produce the documentation run the original source files ending with
\textsf { \g_@@_info_supv_en_tl
\tex_par:D \g_@@_info_supvii_en_tl },
format = \zihao { 4 },
- bottom-skip = 0 pt plus 1.2 fil minus 1 cm
+ bottom-skip = 1 cm plus 1 fil minus .5 cm
}
% \end{macrocode}
% \end{macro}
@@ -6744,7 +6773,7 @@ To produce the documentation run the original source files ending with
\c_@@_text_cover_en_tl \@@_vskip:
\group_begin: \scshape \g_@@_info_degree_en_tl \group_end:
\@@_vskip: { in } \@@_vskip: \g_@@_info_major_en_tl,
- bottom-skip = 2 cm
+ bottom-skip = .5 cm plus 1 fil
}
% \end{macrocode}
% \end{macro}
@@ -6755,7 +6784,7 @@ To produce the documentation run the original source files ending with
\@@_declare_element:nn { g / cover-en / emblem-img }
{
content = \@@_emblem:N \c_@@_emblemwdii_dim,
- bottom-skip = 1.5 cm
+ bottom-skip = 1 cm minus .5 cm
}
% \end{macrocode}
% \end{macro}
@@ -6889,7 +6918,7 @@ To produce the documentation run the original source files ending with
% \begin{macrocode}
\cs_new_protected:Npn \@@_cover_info_nl:
{
- \tl_set:Nx \l_@@_tmpa_tl
+ \tl_set:Ne \l_@@_tmpa_tl
{
\clist_use:Nn \g_@@_info_supv_clist { ~ }
\clist_use:Nn \g_@@_info_supvii_clist { ~ }
@@ -7575,10 +7604,6 @@ To produce the documentation run the original source files ending with
\@@_make_cover:
}
% \end{macrocode}
-% 生成封面后清除标题中的换行控制符,便于在摘要中输出。
-% \begin{macrocode}
- \tl_remove_all:Nn \g_@@_info_title_tl { \\ }
-% \end{macrocode}
% 如果在选择了 \opt{decl-page},就生成本科生的诚信承诺书,
% 或研究生的原创性声明和出版授权书。
% \begin{macrocode}
@@ -7767,12 +7792,12 @@ To produce the documentation run the original source files ending with
% \begin{macrocode}
\cs_new_protected:Npn \@@_abs_info_g:N #1
{
- \@@_uline_list:NNx \g_@@_info_title_tl \g_@@_abs_title_left_skip
+ \@@_uline_list:NNe \g_@@_info_title_tl \g_@@_abs_title_left_skip
{ \c_@@_name_titlea_tl #1 }
% \end{macrocode}
% 专业、年级、姓名。
% \begin{macrocode}
- \@@_get_width_print:Nx \l_@@_tmp_skip
+ \@@_get_width_print:Ne \l_@@_tmp_skip
{
\dim_set:Nn \l_@@_tmpa_dim { 11 em }
\dim_set:Nn \l_@@_tmpb_dim { 4 em }
@@ -7785,7 +7810,7 @@ To produce the documentation run the original source files ending with
% \end{macrocode}
% 导师姓名、职称。
% \begin{macrocode}
- \@@_get_width_print:Nx \l_@@_tmpa_dim { \c_@@_name_supva_tl #1 }
+ \@@_get_width_print:Ne \l_@@_tmpa_dim { \c_@@_name_supva_tl #1 }
\@@_box_ulined_info:Nn \l_@@_tmpa_dim { supvfull }
}
% \end{macrocode}
@@ -7804,12 +7829,12 @@ To produce the documentation run the original source files ending with
{
\bool_if:NTF \g_@@_abs_underline_bool
{
- \@@_uline_list:NNx \g_@@_info_title_en_tl
+ \@@_uline_list:NNe \g_@@_info_title_en_tl
\g_@@_abs_title_left_skip { \c_@@_name_title_en_tl #1 }
\clist_map_inline:nn { major, author, supvfull }
{
\tex_par:D
- \@@_get_width_print:Nx \l_@@_tmpa_dim
+ \@@_get_width_print:Ne \l_@@_tmpa_dim
{ \@@_name:n { ##1 _en } #1 }
\@@_box_ulined_info:Nn \l_@@_tmpa_dim { ##1 _en }
}
@@ -7957,6 +7982,7 @@ To produce the documentation run the original source files ending with
\cleardoublepage
\thispagestyle { plain }
\@@_abs_bookmark:Vn \c_@@_name_abstracta_tl { abstract }
+ \tl_gremove_all:Nn \g_@@_info_title_tl { \\ }
\@@_make_abstract:
\group_begin: \kaishu \zihao { -4 } #1
}
@@ -7972,6 +7998,11 @@ To produce the documentation run the original source files ending with
\cleardoublepage
\thispagestyle { plain }
\@@_abs_bookmark:Vn \c_@@_name_abstracta_en_tl { abstract-en }
+% \end{macrocode}
+% \changes{v1.3}{2023/08/21}{修复英文标题手动换行与摘要页的冲突。}
+% 生成封面后清除标题中的换行控制符,便于在摘要中输出。
+% \begin{macrocode}
+ \tl_gremove_all:Nn \g_@@_info_title_en_tl { \\ }
\@@_make_abstract_en:
\group_begin: \zihao { -4 } #1
}
@@ -8213,6 +8244,7 @@ To produce the documentation run the original source files ending with
%<def-g> { sign } { (签字) },
%<def-g> { sign a } { 研究生签名 },
%<def-g> { sign b } { 导师签名 },
+%<def-g> { stzhongs file } { STZHONGS.TTF },
%<def-u> { submit date } { 提交日期 },
%<def-g> { submit date } { 论文提交日期 },
%<def-p> { submit date } { 完成日期 },
@@ -8475,6 +8507,11 @@ To produce the documentation run the original source files ending with
% \end{macrocode}
% “目录”二字的样式。
% \begin{macrocode}
+% \end{macrocode}
+% \changes{v1.3}{2023/07/08}{整合表格环境字体设置。}
+% \env{tabular} 环境内的字体样式。
+% \begin{macrocode}
+ { tabular } { \zihao { 5 } },
{ toc title } { \centering \zihao { 3 } \bfseries },
{ header } { \small \kaishu },
{ footer } { \small \rmfamily }
@@ -8546,6 +8583,12 @@ To produce the documentation run the original source files ending with
}
% \end{macrocode}
%
+% 处理 \cls{l3doc} 新追加的 |e| 型展开。
+% \begin{macrocode}
+\cs_if_exist:NF \__codedoc_get_hyper_target:xN
+ { \cs_new_eq:NN \__codedoc_get_hyper_target:xN \__codedoc_get_hyper_target:eN }
+% \end{macrocode}
+%
% \subsubsection{杂项}
%
% 封面背景图案。
diff --git a/macros/unicodetex/latex/njuthesis/njuthesis.pdf b/macros/unicodetex/latex/njuthesis/njuthesis.pdf
index 14ead75879..441b2ee9bf 100644
--- a/macros/unicodetex/latex/njuthesis/njuthesis.pdf
+++ b/macros/unicodetex/latex/njuthesis/njuthesis.pdf
Binary files differ