From 4bb9faccbbb2265f9fc4e0ea3a7f00c11c8c9ed8 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sun, 21 Apr 2024 20:16:17 +0000 Subject: njuthesis (21apr24) git-svn-id: svn://tug.org/texlive/trunk@71034 c570f23f-e606-0410-a88d-b1316a301751 --- .../tex/latex/njuthesis/njuthesis-doc.cls | 2 +- .../tex/latex/njuthesis/njuthesis-graduate.def | 9 +- .../tex/latex/njuthesis/njuthesis-postdoctoral.def | 7 +- .../latex/njuthesis/njuthesis-undergraduate.def | 7 +- .../texmf-dist/tex/latex/njuthesis/njuthesis.cls | 144 ++++++++++++++------- 5 files changed, 117 insertions(+), 52 deletions(-) (limited to 'Master/texmf-dist/tex') diff --git a/Master/texmf-dist/tex/latex/njuthesis/njuthesis-doc.cls b/Master/texmf-dist/tex/latex/njuthesis/njuthesis-doc.cls index 6ab2fac855c..57c75e288e6 100644 --- a/Master/texmf-dist/tex/latex/njuthesis/njuthesis-doc.cls +++ b/Master/texmf-dist/tex/latex/njuthesis/njuthesis-doc.cls @@ -23,7 +23,7 @@ %% To produce the documentation run the original source files ending with %% `.dtx' through XeTeX. %% -\GetIdInfo $Id: njuthesis.dtx 1.4.0 2024-03-19 20:30:00 +\GetIdInfo $Id: njuthesis.dtx 1.4.1 2024-04-22 00:30:00 +0800 NJU LUG $ {Documentation style for njuthesis} \ProvidesExplFile{njuthesis-doc.cls} diff --git a/Master/texmf-dist/tex/latex/njuthesis/njuthesis-graduate.def b/Master/texmf-dist/tex/latex/njuthesis/njuthesis-graduate.def index 2e4bbbaf95d..eb3bebc6731 100644 --- a/Master/texmf-dist/tex/latex/njuthesis/njuthesis-graduate.def +++ b/Master/texmf-dist/tex/latex/njuthesis/njuthesis-graduate.def @@ -23,7 +23,7 @@ %% To produce the documentation run the original source files ending with %% `.dtx' through XeTeX. %% -\GetIdInfo $Id: njuthesis.dtx 1.4.0 2024-03-19 20:30:00 +\GetIdInfo $Id: njuthesis.dtx 1.4.1 2024-04-22 00:30:00 +0800 NJU LUG $ {Graduate definition file for njuthesis} \ProvidesExplFile{njuthesis-graduate.def} @@ -548,6 +548,9 @@ { { acknowledgement } { 致 \qquad{} 谢 }, { acknowledgement a } { 致谢(盲审阶段,暂时隐去) }, + { anonymous a } { \ensuremath { \times\times\times } }, + { anonymous b } { \ensuremath { \times\times\times } }, + { anonymous c } { \ensuremath { \times\times\times } }, { auth decl } { 学位论文出版授权书 }, { author a } { \g__nju_info_type_tl 生姓名 }, { auth sign } { 作者签名:\njuline{\hspace{6em}} }, @@ -586,7 +589,7 @@ { sign } { (签字) }, { sign a } { 研究生签名 }, { sign b } { 导师签名 }, - { stzhongs file } { STZHONGS.TTF }, + { stzhongs file } { STZhongsong }, { submit date } { 论文提交日期 }, { subtitle } { (题名和副题名) }, { supv } { 导师 }, @@ -617,7 +620,7 @@ { blankdate } { \qquad{}年 \quad{}月 \quad{}日 } { }, { blankdate a } { \njuline{\qquad\qquad} 年 \njuline{\qquad} 月 \njuline{\qquad} 日 } { }, - { colon } { : } { : \c_space_tl }, + { colon } { :\hskip 0pt minus .4em } { : \c_space_tl }, { dept } { 院系 } { DEPARTMENT }, { figure } { 图 } { figure }, { keywords } { 关键词 } { KEYWORDS }, diff --git a/Master/texmf-dist/tex/latex/njuthesis/njuthesis-postdoctoral.def b/Master/texmf-dist/tex/latex/njuthesis/njuthesis-postdoctoral.def index 4fd12af3b1a..43aac200720 100644 --- a/Master/texmf-dist/tex/latex/njuthesis/njuthesis-postdoctoral.def +++ b/Master/texmf-dist/tex/latex/njuthesis/njuthesis-postdoctoral.def @@ -23,7 +23,7 @@ %% To produce the documentation run the original source files ending with %% `.dtx' through XeTeX. %% -\GetIdInfo $Id: njuthesis.dtx 1.4.0 2024-03-19 20:30:00 +\GetIdInfo $Id: njuthesis.dtx 1.4.1 2024-04-22 00:30:00 +0800 NJU LUG $ {Postdoctoral definition file for njuthesis} \ProvidesExplFile{njuthesis-postdoctoral.def} @@ -183,6 +183,9 @@ { { acknowledgement } { 致 \qquad{} 谢 }, { acknowledgement a } { 致谢(盲审阶段,暂时隐去) }, + { anonymous a } { \ensuremath { \times\times\times } }, + { anonymous b } { \ensuremath { \times\times\times } }, + { anonymous c } { \ensuremath { \times\times\times } }, { auth decl } { 研究报告使用授权书 }, { author } { 作者 }, { auth sign } { 本人签名 }, @@ -217,7 +220,7 @@ { blankdate } { \qquad{}年 \quad{}月 \quad{}日 } { }, { blankdate a } { \njuline{\qquad\qquad} 年 \njuline{\qquad} 月 \njuline{\qquad} 日 } { }, - { colon } { : } { : \c_space_tl }, + { colon } { :\hskip 0pt minus .4em } { : \c_space_tl }, { figure } { 图 } { figure }, { keywords } { 关键词 } { KEYWORDS }, { lang } { 中文 } { 英文 }, diff --git a/Master/texmf-dist/tex/latex/njuthesis/njuthesis-undergraduate.def b/Master/texmf-dist/tex/latex/njuthesis/njuthesis-undergraduate.def index a2120d56bd0..9cfe467a300 100644 --- a/Master/texmf-dist/tex/latex/njuthesis/njuthesis-undergraduate.def +++ b/Master/texmf-dist/tex/latex/njuthesis/njuthesis-undergraduate.def @@ -23,7 +23,7 @@ %% To produce the documentation run the original source files ending with %% `.dtx' through XeTeX. %% -\GetIdInfo $Id: njuthesis.dtx 1.4.0 2024-03-19 20:30:00 +\GetIdInfo $Id: njuthesis.dtx 1.4.1 2024-04-22 00:30:00 +0800 NJU LUG $ {Undergraduate definition file for njuthesis} \ProvidesExplFile{njuthesis-undergraduate.def} @@ -177,6 +177,9 @@ { { acknowledgement } { 致 \qquad{} 谢 }, { acknowledgement a } { 致谢(盲审阶段,暂时隐去) }, + { anonymous a } { \ensuremath { \times\times\times } }, + { anonymous b } { \ensuremath { \times\times\times } }, + { anonymous c } { \ensuremath { \times\times\times } }, { author a } { 本科生姓名 }, { date } { 日期 }, { grade } { 年级 }, @@ -210,7 +213,7 @@ { blankdate } { \qquad{}年 \quad{}月 \quad{}日 } { }, { blankdate a } { \njuline{\qquad\qquad} 年 \njuline{\qquad} 月 \njuline{\qquad} 日 } { }, - { colon } { : } { : \c_space_tl }, + { colon } { :\hskip 0pt minus .4em } { : \c_space_tl }, { dept } { 院系 } { DEPARTMENT }, { figure } { 图 } { figure }, { keywords } { 关键词 } { KEYWORDS }, diff --git a/Master/texmf-dist/tex/latex/njuthesis/njuthesis.cls b/Master/texmf-dist/tex/latex/njuthesis/njuthesis.cls index 2560e613a2e..b0ba863f570 100644 --- a/Master/texmf-dist/tex/latex/njuthesis/njuthesis.cls +++ b/Master/texmf-dist/tex/latex/njuthesis/njuthesis.cls @@ -24,7 +24,7 @@ %% `.dtx' through XeTeX. %% \NeedsTeXFormat{LaTeX2e} -\GetIdInfo $Id: njuthesis.dtx 1.4.0 2024-03-19 20:30:00 +\GetIdInfo $Id: njuthesis.dtx 1.4.1 2024-04-22 00:30:00 +0800 NJU LUG $ {Thesis template for Nanjing University} \ProvidesExplClass{njuthesis} @@ -106,7 +106,7 @@ } \clist_const:Nn \c__nju_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__nju_name_anon_en_clist @@ -598,6 +598,7 @@ \tl_gset:Nn \g__nju_name_pagemode_tl { twoside } \__nju_pass_option: }, + anonymous .value_forbidden:n = true, anonymous .bool_gset:N = \g__nju_opt_anon_bool, anonymous .initial:n = false, latin-font .choices:nn = @@ -666,21 +667,16 @@ } } \ProcessKeysOptions { nju } -\bool_if:NT \g__nju_opt_anon_bool - { \bool_gset_false:N \g__nju_opt_decl_bool } \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} } } -\bool_if:NTF \g__nju_opt_anon_bool - { - \cs_new:Npn \__nju_keys_set:nn #1#2 - { \keys_set_filter:nnn {#1} { anonymous } {#2} } - } - { \cs_new_eq:NN \__nju_keys_set:nn \keys_set:nn } +\cs_new_eq:NN \__nju_keys_set:nn \keys_set:nn +\cs_new:Npn \__nju_keys_set_anon:nn #1#2 + { \keys_set_filter:nnn {#1} { anonymous } {#2} } \NewDocumentCommand \njusetup { o m } { \tl_if_novalue:nTF {#1} @@ -756,12 +752,12 @@ \sys_if_engine_xetex:T { \RequirePackage { xeCJKfntef } - \NewDocumentCommand \njuline { m } { \CJKunderline{#1} } + \cs_new_eq:NN \njuline \CJKunderline } \sys_if_engine_luatex:T { \RequirePackage { lua-ul } - \NewDocumentCommand \njuline { m } { \underLine{#1} \__nju_null: } + \NewDocumentCommand \njuline { m } { \underLine {#1} \__nju_null: } } \cs_new:Npn \__nju_check_pkg_version:nnn #1#2#3 { @@ -878,11 +874,6 @@ { \__nju_quad: \g__nju_info_supvii_en_tl } } } -\bool_if:NT \g__nju_opt_anon_bool - { - \tl_clear:N \l__nju_name_nju_tl - \tl_clear:N \l__nju_name_nju_en_tl - } \tl_const:Nn \c__nju_path_macoffice_tl { /Applications/Microsoft~ Word.app/Contents/Resources/DFonts/ } \sys_if_platform_windows:TF @@ -970,7 +961,7 @@ \setCJKfamilyfont { zhhei } { SimHei } [#1] \setCJKfamilyfont { zhfs } { FangSong } [#1] \setCJKfamilyfont { zhkai } { KaiTi } [#1] - \__nju_stzhongs:n {#1} + \__nju_define_stzhongs:nn { STZhongsong } {#1} } \cs_new:Npn \__nju_loadfont_cjk_win: { \__nju_loadfont_cjk_win:N \c__nju_name_fakebold_tl } @@ -999,7 +990,7 @@ \setCJKfamilyfont { zhhei } { SimHei.ttf } [#1] \setCJKfamilyfont { zhfs } { Fangsong.ttf } [#1] \setCJKfamilyfont { zhkai } { Kaiti.ttf } [#1] - \__nju_stzhongs:nn { STZHONGS.ttf } {#1} + \__nju_define_stzhongs:nn { STZHONGS.ttf } {#1} } \cs_new:Npn \__nju_loadfont_cjk_macoffice: { @@ -1093,20 +1084,27 @@ ItalicFeatures = FakeSlant, BoldItalicFeatures = FakeSlant } -\cs_new:Npn \__nju_stzhongs:nn #1#2 - { \newCJKfontfamily \__nju_stzhongs: {#1} [#2] } -\cs_new:Npn \__nju_stzhongs:n { \__nju_stzhongs:nn { 华文中宋 } } -\cs_new_protected:Npn \__nju_loadfont_stzhongs: +\tl_new:N \l__nju_name_stzhongsopts_tl +\tl_set_eq:NN \l__nju_name_stzhongsopts_tl \c__nju_name_fakebold_tl +\cs_new:Npn \__nju_define_stzhongs:nn #1#2 { - \cs_if_exist_use:NF \__nju_stzhongs: + \tl_set:Nn \l__nju_name_stzhongsfile_tl {#1} + \tl_set:Nn \l__nju_name_stzhongsopts_tl {#2} + } +\cs_new:Npn \__nju_loadfont_stzhongs: + { \__nju_loadfont_stzhongs:V \l__nju_name_stzhongsfile_tl } +\cs_new_protected:Npn \__nju_loadfont_stzhongs:n #1 + { + \fontspec_font_if_exist:nTF {#1} { - \fontspec_font_if_exist:nTF { 华文中宋 } - { \__nju_stzhongs:n { \c__nju_name_fakebold_tl } } + \newCJKfontfamily \__nju_stzhongs: {#1} + [ \l__nju_name_stzhongsopts_tl ] + } { \bool_if:NTF \g__nju_font_path_bool { - \__nju_stzhongs:nn { \l__nju_name_stzhongsfile_tl } - { Path = \g__nju_font_path_tl, \c__nju_name_fakebold_tl } + \newCJKfontfamily \__nju_stzhongs: {#1} + [ Path = \g__nju_font_path_tl, \c__nju_name_fakebold_tl ] } { \cs_set_eq:NN \__nju_stzhongs: \rmfamily @@ -1114,7 +1112,7 @@ } } } - } +\cs_generate_variant:Nn \__nju_loadfont_stzhongs:n { V } \cs_new:Npn \__nju_define_math_font:nn #1#2 { \cs_new:cpn { __nju_loadfont_math_ #1 : } @@ -1817,11 +1815,6 @@ \msg_warning:nn { njuthesis } { missing-image } \RequirePackage { njuvisual } } - \bool_if:NT \g__nju_opt_anon_bool - { - \RenewDocumentCommand \njuemblem { o m m } { } - \RenewDocumentCommand \njuname { o m m } { } - } } \RenewDocumentCommand \maketitle { } { @@ -1909,22 +1902,47 @@ { \__nju_chapter:V \l__nju_name_preface_tl #1 } { \cleardoublepage } \NewDocumentEnvironment { acknowledgement } { +b } + { \__nju_acknowledgement:n {#1} } + { \cleardoublepage } +\cs_new:Npn \__nju_acknowledgement:n + { \__nju_chapter:V \l__nju_name_acknowledgement_tl \use:n } +\cs_new:Npn \__nju_acknowledgement_anon:n + { \__nju_bookmark_toc:V \l__nju_name_acknowledgementa_tl \use_none:n } +\cs_new:Npn \__nju_anon_paperlist_setup: { - \bool_if:NTF \g__nju_opt_anon_bool - { \__nju_bookmark_toc:V \l__nju_name_acknowledgementa_tl } - { \__nju_chapter:V \l__nju_name_acknowledgement_tl #1 } + \ctex_at_end_package:nn { biblatex } + { + \DeclareBibliographyDriver { anonymous } + { + \usebibmacro { begentry } + \usebibmacro { journal },~ + \usebibmacro { date } + \usebibmacro { finentry } + } + } } - { \cleardoublepage } -\NewDocumentCommand \njupaperlist - { O { \l__nju_name_paperlist_tl } m } +\cs_new:Npn \__nju_paperlist_anon:nn #1#2 + { + \group_begin: + \newrefsection + \nocite {#2} + \printbiblist + [ title = #1, driver = anonymous, env = bibliography, + heading = subbibliography ] { anonymous } + \endrefsection + \group_end: + } + +\cs_new:Npn \__nju_paperlist:nn #1#2 { \group_begin: + \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} } \RenewDocumentCommand \mkbibdateshort { m m m } { \textbf { \thefield {##1} } } \newrefsection @@ -1933,6 +1951,44 @@ \endrefsection \group_end: } +\NewDocumentCommand \njupaperlist + { O { \l__nju_name_paperlist_tl } m } { \__nju_paperlist:nn {#1} {#2} } +\keys_define:nn { nju / anonymous-mode } + { + no-nju .bool_gset:N = \g__nju_opt_nonju_bool, + no-nju .initial:n = false + } +\bool_if:NT \g__nju_opt_anon_bool + { + \bool_gset_false:N \g__nju_opt_decl_bool + \keys_set:nn { nju / info } + { + author = \__nju_name:n { anonymous a }, + author* = \__nju_name:n { anonymous a }, + supervisor = + { \__nju_name:n { anonymous a }, \__nju_name:n { anonymous b } }, + supervisor* = + { \__nju_name:n { anonymous c } \__nju_quad: \__nju_name:n { anonymous a } }, + supervisor-ii = , + supervisor-ii* = + } + \__nju_anon_paperlist_setup: + \cs_gset_eq:NN \__nju_paperlist:nn \__nju_paperlist_anon:nn + \cs_gset_eq:NN \__nju_keys_set:nn \__nju_keys_set_anon:nn + \cs_gset_eq:NN \__nju_acknowledgement:n \__nju_acknowledgement_anon:n + } +\ctex_at_end_preamble:n + { + \bool_lazy_and:nnT + { \g__nju_opt_anon_bool } { \g__nju_opt_nonju_bool } + { + \tl_clear:N \l__nju_name_nju_tl + \tl_clear:N \l__nju_name_nju_en_tl + \tl_gclear:N \g__nju_info_code_tl + \RenewDocumentCommand \njuemblem { o m m } { } + \RenewDocumentCommand \njuname { o m m } { } + } + } \cs_new_protected:Npn \__nju_notation_label:n #1 { #1 \tex_hfil:D } \cs_new_protected:Npn \__nju_make_notation:nn #1#2 { -- cgit v1.2.3