From a31bd8158f86091f06dabe074c14dd277da57c68 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Mon, 22 Apr 2024 03:00:57 +0000 Subject: CTAN sync 202404220300 --- macros/unicodetex/latex/njuthesis/njuthesis.dtx | 297 ++++++++++++++++++------ macros/unicodetex/latex/njuthesis/njuthesis.pdf | Bin 1261076 -> 1272240 bytes 2 files changed, 224 insertions(+), 73 deletions(-) (limited to 'macros/unicodetex/latex/njuthesis') diff --git a/macros/unicodetex/latex/njuthesis/njuthesis.dtx b/macros/unicodetex/latex/njuthesis/njuthesis.dtx index 5a0f172040..90b0e949b1 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 % %\NeedsTeXFormat{LaTeX2e} %<*!(driver|install)> -%<+!driver>\GetIdInfo $Id: njuthesis.dtx 1.4.0 2024-03-19 20:30:00 +%<+!driver>\GetIdInfo $Id: njuthesis.dtx 1.4.1 2024-04-22 00:30:00 %<+!driver> +0800 NJU LUG $ % {Thesis template for Nanjing University} %\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.4.0 \quad 2024-03-19} +% \date{v1.4.1 \quad 2024-04-22} % % \changes{v0.1}{2021/09/04}{开始开发。} % \changes{v0.2}{2021/09/07}{初步搭建了可用的模板。} @@ -823,21 +823,31 @@ To produce the documentation run the original source files ending with % 宏包的代码环境不会显示内容,具体效果需要参照各个宏包的说明文档。 % 如需抵消草稿模式的影响,请使用 \opt{final} 选项载入相关宏包。 % -% \begin{function}[added=2022-04-19,updated=2022-09-26]{anonymous} +% \begin{function}[added=2022-04-19,updated=2024-04-19]{anonymous} % \begin{syntax} -% \OPT{anonymous} = <\TFF> +% <\OPT{anonymous}> % \end{syntax} % 是否开启盲审模式。 % \end{function} % % 盲审模式会抹除论文中的学校和个人信息,效果包括: % \begin{itemize} -% \item 不显示校名校徽图片 -% \item 不显示“南京大学”字样 -% \item 不显示作者、导师等基本信息 -% \item 不显示声明页、致谢页 +% \item 作者、导师姓名用 $\times\times\times$ 代替 +% \item 不显示学号,但保留年级 +% \item 不显示声明页 +% \item 致谢页仅显示书签 +% \item 成果列表仅显示刊名和年份 % \end{itemize} % +% 如果你想使用更严格的模式,可以参考 \ref{subsec:njusetup}~节的语法填写下面的选项。 +% +% \begin{function}[added=2024-04-19]{anonymous-mode/no-nju} +% \begin{syntax} +% \OPT{no-nju} = <\TFF> +% \end{syntax} +% 是否隐藏学校信息。默认关闭。开启后会隐藏校名、校徽和学校代码。 +% \end{function} +% % % \subsubsection{可选宏包} % \label{subsubsec:optional-pkg} @@ -1082,6 +1092,7 @@ To produce the documentation run the original source files ending with % % % \subsection{设置接口} +% \label{subsec:njusetup} % % \begin{function}[added=2021-09-10,updated=2022-08-01]{\njusetup} % \begin{syntax} @@ -2825,7 +2836,7 @@ To produce the documentation run the original source files ending with % \begin{macrocode} \clist_const:Nn \c_@@_name_anon_clist { - author, chairman, email, grade, student-id, reviewer, + author, chairman, email, student-id, reviewer, supervisor-contact, supervisor, supervisor-ii } \clist_const:Nn \c_@@_name_anon_en_clist @@ -3928,9 +3939,11 @@ To produce the documentation run the original source files ending with % \begin{macro}{anonymous} % \changes{v0.18}{2022/04/19}{新增盲审模式选项。} % \changes{v1.0}{2022/07/05}{重命名盲审模式选项。} +% \changes{v1.4}{2024/04/19}{盲审模式选项不接受传入值。} % \begin{macro}{\g_@@_opt_anon_bool} % 盲审模式。 % \begin{macrocode} + anonymous .value_forbidden:n = true, anonymous .bool_gset:N = \g_@@_opt_anon_bool, anonymous .initial:n = false, % \end{macrocode} @@ -4112,25 +4125,18 @@ To produce the documentation run the original source files ending with \ProcessKeysOptions { nju } % \end{macrocode} % -% \changes{v1.1}{2022/09/26}{盲审模式下不显示声明页。} -% 盲审模式下不显示声明页。 -% \begin{macrocode} -\bool_if:NT \g_@@_opt_anon_bool - { \bool_gset_false:N \g_@@_opt_decl_bool } -% \end{macrocode} -% % % \subsection{用户接口} % -% \begin{macro}{abstract, bib, image, footer, footnote, header, -% info, label-sep, listoffigures, listoftables, +% \begin{macro}{abstract, anonymous-mode, bib, image, footer, +% footnote, header, info, label-sep, listoffigures, listoftables, % math, style, theorem, tableofcontents} % 定义模块名的元(meta)键值对。 % \begin{macrocode} \clist_map_inline:nn { - abstract, bib, image, footer, footnote, header, - info, label-sep, listoffigures, listoftables, + abstract, anonymous-mode, bib, image, footer, footnote, + header, info, label-sep, listoffigures, listoftables, math, style, theorem, tableofcontents } { \keys_define:nn { nju } { #1 .meta:nn = { nju / #1 } {##1} } } @@ -4138,15 +4144,18 @@ To produce the documentation run the original source files ending with % \end{macro} % % \begin{macro}{\@@_keys_set:nn} +% +% \begin{macrocode} +\cs_new_eq:NN \@@_keys_set:nn \keys_set:nn +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@@_keys_set_anon:nn} % \changes{v1.1}{2022/09/26}{使用 \cs{keys_set_filter:nnn} 重构盲审模式。} % 在开启盲审模式时,屏蔽被编入 \opt{anonymous} 分组的键值对输入。 % \begin{macrocode} -\bool_if:NTF \g_@@_opt_anon_bool - { - \cs_new:Npn \@@_keys_set:nn #1#2 - { \keys_set_filter:nnn {#1} { anonymous } {#2} } - } - { \cs_new_eq:NN \@@_keys_set:nn \keys_set:nn } +\cs_new:Npn \@@_keys_set_anon:nn #1#2 + { \keys_set_filter:nnn {#1} { anonymous } {#2} } % \end{macrocode} % \end{macro} % @@ -4357,7 +4366,7 @@ To produce the documentation run the original source files ending with \sys_if_engine_xetex:T { \RequirePackage { xeCJKfntef } - \NewDocumentCommand \njuline { m } { \CJKunderline{#1} } + \cs_new_eq:NN \njuline \CJKunderline } % \end{macrocode} % \pkg{lua-ul} 中需要在结尾使用 \tn{null} 保护尾部空白。 @@ -4365,7 +4374,7 @@ To produce the documentation run the original source files ending with \sys_if_engine_luatex:T { \RequirePackage { lua-ul } - \NewDocumentCommand \njuline { m } { \underLine{#1} \@@_null: } + \NewDocumentCommand \njuline { m } { \underLine {#1} \@@_null: } } % % \end{macrocode} @@ -4731,16 +4740,6 @@ To produce the documentation run the original source files ending with % \end{macrocode} % \end{variable} % -% 盲审模式下抹去学校名称。 -% \begin{macrocode} -%<*class> -\bool_if:NT \g_@@_opt_anon_bool - { - \tl_clear:N \l_@@_name_nju_tl - \tl_clear:N \l_@@_name_nju_en_tl - } -% \end{macrocode} -% % % \subsection{字体设置} % @@ -4751,6 +4750,7 @@ To produce the documentation run the original source files ending with % \begin{variable}{\c_@@_path_macoffice_tl} % mac Office 字体路径。 % \begin{macrocode} +%<*class> \tl_const:Nn \c_@@_path_macoffice_tl { /Applications/Microsoft~ Word.app/Contents/Resources/DFonts/ } % \end{macrocode} @@ -4910,7 +4910,7 @@ To produce the documentation run the original source files ending with \setCJKfamilyfont { zhhei } { SimHei } [#1] \setCJKfamilyfont { zhfs } { FangSong } [#1] \setCJKfamilyfont { zhkai } { KaiTi } [#1] - \@@_stzhongs:n {#1} + \@@_define_stzhongs:nn { STZhongsong } {#1} } \cs_new:Npn \@@_loadfont_cjk_win: { \@@_loadfont_cjk_win:N \c_@@_name_fakebold_tl } @@ -4953,7 +4953,7 @@ To produce the documentation run the original source files ending with \setCJKfamilyfont { zhhei } { SimHei.ttf } [#1] \setCJKfamilyfont { zhfs } { Fangsong.ttf } [#1] \setCJKfamilyfont { zhkai } { Kaiti.ttf } [#1] - \@@_stzhongs:nn { STZHONGS.ttf } {#1} + \@@_define_stzhongs:nn { STZHONGS.ttf } {#1} } \cs_new:Npn \@@_loadfont_cjk_macoffice: { @@ -5091,25 +5091,48 @@ To produce the documentation run the original source files ending with % \end{macrocode} % \end{variable} % -% \begin{macro}{\@@_loadfont_stzhongs:,\@@_stzhongs:nn,\@@_stzhongs:n,\@@_stzhongs:} +% \begin{variable}{\l_@@_name_stzhongsopts_tl} +% 华文中宋的字体特性列表,默认为仅使用伪粗体。 +% \begin{macrocode} +\tl_new:N \l_@@_name_stzhongsopts_tl +\tl_set_eq:NN \l_@@_name_stzhongsopts_tl \c_@@_name_fakebold_tl +% \end{macrocode} +% \end{variable} +% +% \begin{macro}{\@@_define_stzhongs:nn} % \changes{v1.2}{2023/04/30}{在研究生模板载入华文中宋。} % \changes{v1.3}{2023/10/09}{可以手动指定华文中宋文件位置。} % 研究生封面额外需要的华文中宋。 % \begin{macrocode} -\cs_new:Npn \@@_stzhongs:nn #1#2 - { \newCJKfontfamily \@@_stzhongs: {#1} [#2] } -\cs_new:Npn \@@_stzhongs:n { \@@_stzhongs:nn { 华文中宋 } } -\cs_new_protected:Npn \@@_loadfont_stzhongs: +\cs_new:Npn \@@_define_stzhongs:nn #1#2 { - \cs_if_exist_use:NF \@@_stzhongs: + \tl_set:Nn \l_@@_name_stzhongsfile_tl {#1} + \tl_set:Nn \l_@@_name_stzhongsopts_tl {#2} + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@@_loadfont_stzhongs:n} +% \changes{v1.2}{2023/04/30}{在研究生模板载入华文中宋。} +% \changes{v1.3}{2023/10/09}{可以手动指定华文中宋文件位置。} +% \changes{v1.4}{2024/04/03}{调整载入华文中宋文件的逻辑。} +% \begin{macro}{\@@_loadfont_stzhongs:V,\@@_loadfont_stzhongs:,\@@_stzhongs:} +% 研究生封面额外需要的华文中宋。 +% \begin{macrocode} +\cs_new:Npn \@@_loadfont_stzhongs: + { \@@_loadfont_stzhongs:V \l_@@_name_stzhongsfile_tl } +\cs_new_protected:Npn \@@_loadfont_stzhongs:n #1 + { + \fontspec_font_if_exist:nTF {#1} { - \fontspec_font_if_exist:nTF { 华文中宋 } - { \@@_stzhongs:n { \c_@@_name_fakebold_tl } } + \newCJKfontfamily \@@_stzhongs: {#1} + [ \l_@@_name_stzhongsopts_tl ] + } { \bool_if:NTF \g_@@_font_path_bool { - \@@_stzhongs:nn { \l_@@_name_stzhongsfile_tl } - { Path = \g_@@_font_path_tl, \c_@@_name_fakebold_tl } + \newCJKfontfamily \@@_stzhongs: {#1} + [ Path = \g_@@_font_path_tl, \c_@@_name_fakebold_tl ] } { \cs_set_eq:NN \@@_stzhongs: \rmfamily @@ -5117,9 +5140,10 @@ To produce the documentation run the original source files ending with } } } - } +\cs_generate_variant:Nn \@@_loadfont_stzhongs:n { V } % \end{macrocode} % \end{macro} +% \end{macro} % % % \subsubsection{定义数学字库} @@ -7728,11 +7752,6 @@ To produce the documentation run the original source files ending with \msg_warning:nn { njuthesis } { missing-image } \RequirePackage { njuvisual } } - \bool_if:NT \g_@@_opt_anon_bool - { - \RenewDocumentCommand \njuemblem { o m m } { } - \RenewDocumentCommand \njuname { o m m } { } - } } % \end{macrocode} % @@ -8168,44 +8187,92 @@ To produce the documentation run the original source files ending with % % \begin{environment}{preface} % \begin{environment}{acknowledgement} -% 单独制作的前言致谢页。 +% 单独制作的前言、致谢页。 % \begin{macrocode} \NewDocumentEnvironment { preface } { +b } { \@@_chapter:V \l_@@_name_preface_tl #1 } { \cleardoublepage } \NewDocumentEnvironment { acknowledgement } { +b } - { - \bool_if:NTF \g_@@_opt_anon_bool - { \@@_bookmark_toc:V \l_@@_name_acknowledgementa_tl } - { \@@_chapter:V \l_@@_name_acknowledgement_tl #1 } - } + { \@@_acknowledgement:n {#1} } { \cleardoublepage } % \end{macrocode} % \end{environment} % \end{environment} % +% \begin{macro}{\@@_acknowledgement:n} +% 正常模式的致谢标题。 +% \begin{macrocode} +\cs_new:Npn \@@_acknowledgement:n + { \@@_chapter:V \l_@@_name_acknowledgement_tl \use:n } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@@_acknowledgement_anon:n} +% 盲审模式下仅显示致谢书签。 +% \begin{macrocode} +\cs_new:Npn \@@_acknowledgement_anon:n + { \@@_bookmark_toc:V \l_@@_name_acknowledgementa_tl \use_none:n } +% \end{macrocode} +% \end{macro} +% % % \subsection{成果列表} % -% \begin{macro}{\njupaperlist} -% \changes{v0.10}{2021/09/29}{新增了成果列表页面。} -% \changes{v0.14}{2021/12/20}{成果列表中可突出指定作者姓名及年份。} -% \changes{v1.2}{2023/04/07}{修复成果列表与章末参考文献表的冲突。} -% 成果列表。 +% \begin{macro}{\@@_anon_paperlist_setup:} +% 创建一个仅包含刊名和年份的文献列表格式。 % \begin{macrocode} -\NewDocumentCommand \njupaperlist - { O { \l_@@_name_paperlist_tl } m } +\cs_new:Npn \@@_anon_paperlist_setup: + { + \ctex_at_end_package:nn { biblatex } + { + \DeclareBibliographyDriver { anonymous } + { + \usebibmacro { begentry } + \usebibmacro { journal },~ + \usebibmacro { date } + \usebibmacro { finentry } + } + } + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@@_paperlist_anon:nn} +% 生成盲审模式下的成果列表。 +% \begin{macrocode} +\cs_new:Npn \@@_paperlist_anon:nn #1#2 + { + \group_begin: + \newrefsection + \nocite {#2} + \printbiblist + [ title = #1, driver = anonymous, env = bibliography, + heading = subbibliography ] { anonymous } + \endrefsection + \group_end: + } +% \end{macrocode} +% \end{macro} + +% \begin{macro}{\@@_paperlist:nn} +% 生成普通模式下的成果列表。 +% \begin{macrocode} +\cs_new:Npn \@@_paperlist:nn #1#2 { \group_begin: % \end{macrocode} % 修改姓名的显示方式,使被注解的姓名可被加粗下划线表示。 +% 由于 \pkg{biblatex} 提供的 \tn{MakeCapital} 是一个 robust 命令, +% 在绘制下划线过程中无法被完全展开,我们将其替换为 +% 可被展开的 \cs{str_uppercase:f} 以避免造成错误。 % \begin{macrocode} + \cs_set_eq:NN \MakeCapital \str_uppercase:f \RenewDocumentCommand \mkbibnamegiven { m } { \ifitemannotation { thesisauthor } - { \njuline { \bf ##1 } } {##1} } + { \bfseries \njuline {##1} } {##1} } \RenewDocumentCommand \mkbibnamefamily { m } { \ifitemannotation { thesisauthor } - { \njuline { \bf ##1 } } {##1} } + { \bfseries \njuline {##1} } {##1} } % \end{macrocode} % 修改年份的显示方式,默认进行加粗。 % \begin{macrocode} @@ -8225,6 +8292,83 @@ To produce the documentation run the original source files ending with % \end{macrocode} % \end{macro} % +% \begin{macro}{\njupaperlist} +% \changes{v0.10}{2021/09/29}{新增了成果列表页面。} +% \changes{v0.14}{2021/12/20}{成果列表中可突出指定作者姓名及年份。} +% \changes{v1.2}{2023/04/07}{修复成果列表与章末参考文献表的冲突。} +% \changes{v1.4}{2024/03/21}{修复成果列表中文姓名加粗的问题。} +% \changes{v1.4}{2024/04/15}{盲审模式下成果列表只显示期刊和年份。} +% 成果列表。 +% \begin{macrocode} +\NewDocumentCommand \njupaperlist + { O { \l_@@_name_paperlist_tl } m } { \@@_paperlist:nn {#1} {#2} } +% \end{macrocode} +% \end{macro} +% +% +% \subsection{盲审模式} +% \changes{v1.4}{2024/04/19}{合并盲审模式设置。} +% +% \begin{macro}{anonymous-mode/no-nju} +% \changes{v1.4}{2024/04/19}{盲审模式下可选择是否隐藏学校信息。} +% \begin{macrocode} +\keys_define:nn { nju / anonymous-mode } + { + no-nju .bool_gset:N = \g_@@_opt_nonju_bool, + no-nju .initial:n = false + } +% \end{macrocode} +% \end{macro} +% +% \begin{macrocode} +\bool_if:NT \g_@@_opt_anon_bool + { +% \end{macrocode} +% \changes{v1.1}{2022/09/26}{盲审模式下不显示声明页。} +% 盲审模式下不显示声明页。 +% \begin{macrocode} + \bool_gset_false:N \g_@@_opt_decl_bool +% \end{macrocode} +% \changes{v1.4}{2024/04/15}{盲审模式下姓名使用占位符。} +% 盲审模式下作者和导师姓名用 $\times\times\times$ 代替。 +% \begin{macrocode} + \keys_set:nn { nju / info } + { + author = \@@_name:n { anonymous a }, + author* = \@@_name:n { anonymous a }, + supervisor = + { \@@_name:n { anonymous a }, \@@_name:n { anonymous b } }, + supervisor* = + { \@@_name:n { anonymous c } \@@_quad: \@@_name:n { anonymous a } }, + supervisor-ii = , + supervisor-ii* = + } +% \end{macrocode} +% 替换为匿名版本的命令。 +% \begin{macrocode} + \@@_anon_paperlist_setup: + \cs_gset_eq:NN \@@_paperlist:nn \@@_paperlist_anon:nn + \cs_gset_eq:NN \@@_keys_set:nn \@@_keys_set_anon:nn + \cs_gset_eq:NN \@@_acknowledgement:n \@@_acknowledgement_anon:n + } +% \end{macrocode} +% +% 开启 \opt{no-nju} 模式时,清除校名、校徽以及学校代码。 +% \begin{macrocode} +\ctex_at_end_preamble:n + { + \bool_lazy_and:nnT + { \g_@@_opt_anon_bool } { \g_@@_opt_nonju_bool } + { + \tl_clear:N \l_@@_name_nju_tl + \tl_clear:N \l_@@_name_nju_en_tl + \tl_gclear:N \g_@@_info_code_tl + \RenewDocumentCommand \njuemblem { o m m } { } + \RenewDocumentCommand \njuname { o m m } { } + } + } +% \end{macrocode} +% % % \subsection{符号表} % @@ -8323,6 +8467,9 @@ To produce the documentation run the original source files ending with { { acknowledgement } { 致 \qquad{} 谢 }, { acknowledgement a } { 致谢(盲审阶段,暂时隐去) }, + { anonymous a } { \ensuremath { \times\times\times } }, + { anonymous b } { \ensuremath { \times\times\times } }, + { anonymous c } { \ensuremath { \times\times\times } }, % { auth decl } { 学位论文出版授权书 }, % { auth decl } { 研究报告使用授权书 }, % { author } { 作者 }, @@ -8397,7 +8544,7 @@ To produce the documentation run the original source files ending with % { sign } { (签字) }, % { sign a } { 研究生签名 }, % { sign b } { 导师签名 }, -% { stzhongs file } { STZHONGS.TTF }, +% { stzhongs file } { STZhongsong }, % { submit date } { 提交日期 }, % { submit date } { 论文提交日期 }, % { submit date } { 完成日期 }, @@ -8461,7 +8608,11 @@ To produce the documentation run the original source files ending with { blankdate } { \qquad{}年 \quad{}月 \quad{}日 } { }, { blankdate a } { \njuline{\qquad\qquad} 年 \njuline{\qquad} 月 \njuline{\qquad} 日 } { }, - { colon } { : } { : \c_space_tl }, +% \end{macrocode} +% \changes{v1.4}{2024/04/03}{修复 \hologo{LuaLaTeX} 下的摘要页多余换行。} +% 这里加入伸缩量,是因为 \hologo{LuaLaTeX} 下全角冒号的宽度并不能被正确识别。 +% \begin{macrocode} + { colon } { :\hskip 0pt minus .4em } { : \c_space_tl }, % { dept } { 院系 } { DEPARTMENT }, { figure } { 图 } { figure }, { keywords } { 关键词 } { KEYWORDS }, diff --git a/macros/unicodetex/latex/njuthesis/njuthesis.pdf b/macros/unicodetex/latex/njuthesis/njuthesis.pdf index f7bec4075f..d6a658a1d7 100644 Binary files a/macros/unicodetex/latex/njuthesis/njuthesis.pdf and b/macros/unicodetex/latex/njuthesis/njuthesis.pdf differ -- cgit v1.2.3