From 98aebbd10392f1773f43fb6dcc7a082af144ca3a Mon Sep 17 00:00:00 2001 From: Yu Xiong Date: Mon, 15 Apr 2024 23:47:02 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=8C=B9=E9=85=8D=E6=96=B0=E7=89=88?= =?UTF-8?q?=E7=9B=B2=E5=AE=A1=E6=A8=A1=E6=9D=BF=20(#185)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 8 ++++ docs/njuthesis-sample.tex | 3 +- source/njuthesis.dtx | 89 +++++++++++++++++++++++++++------------ 3 files changed, 73 insertions(+), 27 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 10be169..1cf5066 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,14 @@ ## [未发布] +### 新增 + +- 匹配新版盲审模板 - [#185] + - 作者和导师姓名用占位符代替 + - 恢复显示校名校徽 + - 恢复显示摘要页的年级 + - 成果列表中仅显示期刊和年份 + ### 修复 - 修复成果列表中文姓名加粗的问题 - [#192] diff --git a/docs/njuthesis-sample.tex b/docs/njuthesis-sample.tex index 56693cf..281d1bd 100644 --- a/docs/njuthesis-sample.tex +++ b/docs/njuthesis-sample.tex @@ -5,7 +5,8 @@ % 贡献者 % Yu XIONG @atxy-blip Yichen ZHAO @FengChendian % Song GAO @myandeg Chang MA @glatavento -% Yilun SUN @HermitSun Yinfeng LIN @linyinfeng +% Yilun SUN @HermitSun Yinfeng LIN @ +% Yukai Chou @Muzimuzhi % % 许可证 % LaTeX Project Public License(版本 1.3c 或更高) diff --git a/source/njuthesis.dtx b/source/njuthesis.dtx index cb4bbb6..eba83b5 100644 --- a/source/njuthesis.dtx +++ b/source/njuthesis.dtx @@ -185,6 +185,7 @@ To produce the documentation run the original source files ending with % \changes{v1.1}{2023/01/05}{适配新版南大 \LaTeX 在线编辑器。} % \changes{v1.4}{2024/03/11}{总是全局修改全局变量。} % \changes{v1.4}{2024/03/18}{将变量统一为 |l| 类型。} +% \changes{v1.4}{2024/04/15}{盲审模式下仍然显示校名校徽。} % % \maketitle % @@ -2825,7 +2826,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 @@ -4731,13 +4732,23 @@ To produce the documentation run the original source files ending with % \end{macrocode} % \end{variable} % -% 盲审模式下抹去学校名称。 +% \changes{v1.4}{2024/04/15}{盲审模式下姓名使用占位符。} +% 盲审模式下作者和导师姓名用 $\times\times\times$ 代替。 % \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 + \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} % @@ -7752,11 +7763,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} % @@ -8216,40 +8222,68 @@ To produce the documentation run the original source files ending with % \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 } +\bool_if:NTF \g_@@_opt_anon_bool { - \group_begin: + \ctex_at_end_package:nn { biblatex } + { + \DeclareBibliographyDriver { anonymous } + { + \usebibmacro { begentry } + \usebibmacro { journal },~ + \usebibmacro { date } + \usebibmacro { finentry } + } + } + \NewDocumentCommand \njupaperlist + { O { \l_@@_name_paperlist_tl } m } + { + \group_begin: + \newrefsection + \nocite {#2} + \printbiblist + [ title = #1, driver = anonymous, env = bibliography, + heading = subbibliography ] { anonymous } + \endrefsection + \group_end: + } + } + { + \NewDocumentCommand \njupaperlist + { O { \l_@@_name_paperlist_tl } m } + { + \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 } - { \bfseries \njuline {##1} } {##1} } - \RenewDocumentCommand \mkbibnamefamily { m } - { \ifitemannotation { thesisauthor } - { \bfseries \njuline {##1} } {##1} } + \cs_set_eq:NN \MakeCapital \str_uppercase:f + \RenewDocumentCommand \mkbibnamegiven { m } + { \ifitemannotation { thesisauthor } + { \bfseries \njuline {##1} } {##1} } + \RenewDocumentCommand \mkbibnamefamily { m } + { \ifitemannotation { thesisauthor } + { \bfseries \njuline {##1} } {##1} } % \end{macrocode} % 修改年份的显示方式,默认进行加粗。 % \begin{macrocode} - \RenewDocumentCommand \mkbibdateshort { m m m } - { \textbf { \thefield {##1} } } + \RenewDocumentCommand \mkbibdateshort { m m m } + { \textbf { \thefield {##1} } } % \end{macrocode} % \changes{v1.1}{2023/04/07}{修复章末参考文献表与成果列表的冲突问题。} % 相较于直接使用 \env{refsection} 环境,\tn{newrefsection} 命令可以 % 自动结束上一个 \env{refsection},与章末参考文献表格式兼容更好。 % \begin{macrocode} - \newrefsection - \nocite {#2} - \printbibliography [ heading = subbibliography, title = #1 ] - \endrefsection - \group_end: + \newrefsection + \nocite {#2} + \printbibliography [ heading = subbibliography, title = #1 ] + \endrefsection + \group_end: + } } % \end{macrocode} % \end{macro} @@ -8352,6 +8386,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 } { 作者 },