From 5756a2576d914cf1c7f9d04572e5b403b7a8a1c3 Mon Sep 17 00:00:00 2001 From: Alexara Wu Date: Thu, 9 Jan 2025 05:39:44 +0800 Subject: [PATCH] refactor: filter sensitive information by key gourps --- sjtutex/source/sjtutex.dtx | 40 ++++++++++++++++---------------------- 1 file changed, 17 insertions(+), 23 deletions(-) diff --git a/sjtutex/source/sjtutex.dtx b/sjtutex/source/sjtutex.dtx index d04f4a97..c7c9f8a3 100644 --- a/sjtutex/source/sjtutex.dtx +++ b/sjtutex/source/sjtutex.dtx @@ -4332,16 +4332,21 @@ subject .tl_set:c = { l_@@_info_subject_ #1 _tl } , keywords .clist_set:c = { l_@@_info_keywords_ #1 _clist } , author .tl_set:c = { l_@@_info_author_ #1 _tl } , + author .groups:n = { sensitive } , id .meta:nn = { sjtu / info } { id = {##1} } , supervisor .tl_set:c = { l_@@_info_supervisor_ #1 _tl } , + supervisor .groups:n = { sensitive } , assoc-supervisor .tl_set:c = { l_@@_info_assoc_supervisor_ #1 _tl } , + assoc-supervisor .groups:n = { sensitive } , assoc_supervisor .meta:n = { assoc-supervisor = {##1} } , co-supervisor .tl_set:c = { l_@@_info_co_supervisor_ #1 _tl } , + co-supervisor .groups:n = { sensitive } , co_supervisor .meta:n = { co-supervisor = {##1} } , degree .tl_set:c = { l_@@_info_degree_ #1 _tl } , department .tl_set:c = { l_@@_info_department_ #1 _tl } , major .tl_set:c = { l_@@_info_major_ #1 _tl } , fund .clist_set:c = { l_@@_info_fund_ #1 _clist } , + fund .groups:n = { sensitive } , date .meta:nn = { sjtu / info } { date = {##1} } , display-date .tl_set:c = { l_@@_info_date_ #1 _tl } , show .clist_set:c = { l_@@_info_show_ #1 _clist } @@ -4359,7 +4364,8 @@ { \clist_map_inline:Nn \g_@@_lang_clist { \tl_set:cn { l_@@_info_id_ ##1 _tl } {#1} } - } + } , + id .groups:n = { sensitive } } % \end{macrocode} % \end{macro} @@ -4368,27 +4374,6 @@ % \begin{macrocode} \clist_map_inline:Nn \g_@@_lang_clist { \@@_info_keys_define:n {#1} } -% \end{macrocode} -% -% 盲审模式下隐藏作者、导师姓名等信息。 -% \begin{macrocode} -\AddToHook { begindocument / before } - { - \bool_if:NT \g_@@_review_bool - { - \clist_map_inline:Nn \g_@@_lang_clist - { - \clist_map_inline:nn - { author, supervisor } - { \tl_clear:c { l_@@_info_ ##1 _ #1 _tl } } - \clist_map_inline:nn - { assoc_supervisor, co_supervisor } - { \tl_set_eq:cN { l_@@_info_ ##1 _ #1 _tl } \c_novalue_tl } - \clist_clear:c { l_@@_info_fund_ #1 _clist } - } - \tl_clear:N \l_@@_info_id_zh_tl - } - } % % \end{macrocode} % @@ -5412,8 +5397,17 @@ % % \begin{macro}{\sjtusetup} % 用户设置接口。 +% 盲审模式下不会设置敏感信息。 % \begin{macrocode} -\NewDocumentCommand \sjtusetup { } { \keys_set:nn { sjtu } } +%\NewDocumentCommand \sjtusetup { } { \keys_set:nn { sjtu } } +%<*thesis> +\exp_args:NNne \NewDocumentCommand \sjtusetup { } + { + \bool_if:NTF \g_@@_review_bool + { \exp_not:N \keys_set_exclude_groups:nnn { sjtu } { sensitive } } + { \exp_not:N \keys_set:nn { sjtu } } + } +% % \end{macrocode} % \end{macro} %