From fab56043e93edbbf9eeb73c5f7475ad7106c37e8 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 | 42 +++++++++++++++++--------------------- 1 file changed, 19 insertions(+), 23 deletions(-) diff --git a/sjtutex/source/sjtutex.dtx b/sjtutex/source/sjtutex.dtx index c98ea059..d72e32a7 100644 --- a/sjtutex/source/sjtutex.dtx +++ b/sjtutex/source/sjtutex.dtx @@ -3844,14 +3844,19 @@ 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 } , co-supervisor .tl_set:c = l_@@_info_co_supervisor_ #1 _tl , + co-supervisor .groups:n = { sensitive } , 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 , } @@ -3864,7 +3869,10 @@ % \begin{macrocode} \tl_new:N \l_@@_info_id_zh_tl \keys_define:nn { sjtu / info } - { id .tl_set:N = \l_@@_info_id_zh_tl } + { + id .tl_set:N = \l_@@_info_id_zh_tl , + id .groups:n = { sensitive } + } % \end{macrocode} % \end{variable} % @@ -3872,27 +3880,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} % @@ -5440,8 +5427,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} %