diff options
author | Karl Berry <karl@freefriends.org> | 2023-01-06 21:59:09 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2023-01-06 21:59:09 +0000 |
commit | 0492ea456b7eb88005d12623552eb08bdcaaeee9 (patch) | |
tree | 8a03db43b92f81942f8fedb4ae5be0dd569c0054 /Master/texmf-dist/source | |
parent | 4dbe788ef60909b4540d038a5bd5ce450b3ba868 (diff) |
jxu (6jan23)
git-svn-id: svn://tug.org/texlive/trunk@65475 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source')
-rw-r--r-- | Master/texmf-dist/source/latex/projlib/ProjLib.dtx | 183 |
1 files changed, 120 insertions, 63 deletions
diff --git a/Master/texmf-dist/source/latex/projlib/ProjLib.dtx b/Master/texmf-dist/source/latex/projlib/ProjLib.dtx index 4b9f8d3aecf..6123adab0cf 100644 --- a/Master/texmf-dist/source/latex/projlib/ProjLib.dtx +++ b/Master/texmf-dist/source/latex/projlib/ProjLib.dtx @@ -19,84 +19,84 @@ %<*ProjLib> \ProvidesExplPackage {ProjLib} - {2023/01/03} {} + {2023/01/05} {} {Collective interface of the ProjLib toolkit} %</ProjLib> % %<*projlib-author> \ProvidesExplPackage {projlib-author} - {2023/01/03} {} + {2023/01/05} {} {Enhanced author information block} %</projlib-author> % %<*projlib-datetime> \ProvidesExplPackage {projlib-datetime} - {2023/01/03} {} + {2023/01/05} {} {Convert numeric date-time string to natural language} %</projlib-datetime> % %<*projlib-draft> \ProvidesExplPackage {projlib-draft} - {2023/01/03} {} + {2023/01/05} {} {Useful commands during draft stage} %</projlib-draft> % %<*projlib-font> \ProvidesExplPackage {projlib-font} - {2023/01/03} {} + {2023/01/05} {} {Font selection and configuration} %</projlib-font> % %<*projlib-language> \ProvidesExplPackage {projlib-language} - {2023/01/03} {} + {2023/01/05} {} {Multi-language configuration} %</projlib-language> % %<*projlib-logo> \ProvidesExplPackage {projlib-logo} - {2023/01/03} {} + {2023/01/05} {} {The ProjLib logo} %</projlib-logo> % %<*projlib-math> \ProvidesExplPackage {projlib-math} - {2023/01/03} {} + {2023/01/05} {} {Efficient math setup} %</projlib-math> % %<*projlib-paper> \ProvidesExplPackage {projlib-paper} - {2023/01/03} {} + {2023/01/05} {} {Configuration of the paper style} %</projlib-paper> % %<*projlib-text> \ProvidesExplPackage {projlib-text} - {2023/01/03} {} + {2023/01/05} {} {Text-related commands} %</projlib-text> % %<*projlib-theorem> \ProvidesExplPackage {projlib-theorem} - {2023/01/03} {} + {2023/01/05} {} {Configuration of theorem-like environments} %</projlib-theorem> % %<*projlib-titlepage> \ProvidesExplPackage {projlib-titlepage} - {2023/01/03} {} + {2023/01/05} {} {Commands for rendering the title page} %</projlib-titlepage> @@ -556,8 +556,10 @@ \NewDocumentCommand \ProjLibSetDatetimeInputFormat { m } { - \projlib_datetime_set_input_format:n { #1 } + \tl_set:Nn \l_tmpa_tl { \exp_args:Ne \tl_trim_spaces:n { #1 } } + \exp_args:Ne \projlib_datetime_set_input_format:n { \l_tmpa_tl } } +\ProvideDocumentCommand \SetDatetimeInputFormat {} { \ProjLibSetDatetimeInputFormat } \seq_new:N \l__projlib_datetime_date_seq @@ -694,7 +696,7 @@ \regex_match:nnTF { \A \d{1,2}-\d{1,2}-\d{4} \Z } { #1 } { \seq_set_split:Nnn \l__projlib_datetime_date_seq { - } { #1 } - \cs_if_exist_use:c { projlib_datetime_display_month_day_year #2 _ \languagename :nnn } + \cs_if_exist_use:c { projlib_datetime_display_year_month_day #2 _ \languagename :nnn } { \int_eval:n { \seq_item:Nn \l__projlib_datetime_date_seq { 3 } } } % year { \int_eval:n { \seq_item:Nn \l__projlib_datetime_date_seq { 1 } } } % month { \int_eval:n { \seq_item:Nn \l__projlib_datetime_date_seq { 2 } } } % day @@ -739,7 +741,7 @@ \regex_match:nnTF { \A \d{1,2}-\d{1,2}-\d{4} \Z } { #1 } { \seq_set_split:Nnn \l__projlib_datetime_date_seq { - } { #1 } - \cs_if_exist_use:c { projlib_datetime_display_day_month_year #2 _ \languagename :nnn } + \cs_if_exist_use:c { projlib_datetime_display_year_month_day #2 _ \languagename :nnn } { \int_eval:n { \seq_item:Nn \l__projlib_datetime_date_seq { 3 } } } % year { \int_eval:n { \seq_item:Nn \l__projlib_datetime_date_seq { 2 } } } % month { \int_eval:n { \seq_item:Nn \l__projlib_datetime_date_seq { 1 } } } % day @@ -783,6 +785,7 @@ } } } +\cs_generate_variant:Nn \__projlib_datetime_date_parse_year_month_day:n { e } \cs_new_protected:Nn \__projlib_datetime_date_parse_month_day_year:n { @@ -800,6 +803,7 @@ } } } +\cs_generate_variant:Nn \__projlib_datetime_date_parse_month_day_year:n { e } \cs_new_protected:Nn \__projlib_datetime_date_parse_day_month_year:n { @@ -817,6 +821,7 @@ } } } +\cs_generate_variant:Nn \__projlib_datetime_date_parse_day_month_year:n { e } \cs_new:Nn \__projlib_datetime_input_format_to_str: { @@ -830,7 +835,9 @@ \cs_new_protected:Nn \__projlib_datetime_display_date_according_to_format:nn { - \cs_if_exist_use:c { __projlib_datetime_date_parse_ \__projlib_datetime_input_format_to_str: :n } { #1 } + \tl_set:Nx \l_tmpa_tl { #1 } + \regex_replace_all:nnN { \D } { - } \l_tmpa_tl + \cs_if_exist_use:c { __projlib_datetime_date_parse_ \__projlib_datetime_input_format_to_str: :e } { \l_tmpa_tl } \str_case_e:nnF { \l__projlib_datetime_output_format_tl } { { only-year-month } @@ -973,7 +980,9 @@ \cs_new_protected:Nn \projlib_datetime_calculate_week_according_to_format:n { - \cs_if_exist_use:c { __projlib_datetime_date_parse_ \__projlib_datetime_input_format_to_str: :n } { #1 } + \tl_set:Nx \l_tmpa_tl { #1 } + \regex_replace_all:nnN { \D } { - } \l_tmpa_tl + \cs_if_exist_use:c { __projlib_datetime_date_parse_ \__projlib_datetime_input_format_to_str: :e } { \l_tmpa_tl } \__projlib_datetime_calculate_day_of_week_with_year_month_day:nnn { \int_eval:n { \seq_item:Nn \l__projlib_datetime_date_seq { 1 } } } { \int_eval:n { \seq_item:Nn \l__projlib_datetime_date_seq { 2 } } } @@ -3168,27 +3177,49 @@ } \msg_new:nnn { projlib-language } - { language-not-support } + { language-not-supported } { The~language~"#1"~is~not~supported. } +\msg_new:nnn { projlib-language } + { language-not-enabled } + { The~language~"#1"~is~not~enabled. } \cs_new:Nn \projlib_language_use_language_locally:nn { - \cs_if_exist_use:cF { projlib_language_apply_settings_locally_ \projlib_language_str_to_languagename:n { #1 } :n } + \cs_if_exist:cTF { projlib_language_apply_settings_locally_ \projlib_language_str_to_languagename:n { #1 } :n } { - \msg_warning:nnn { projlib-language } { language-not-support } { #1 } + \bool_if:cTF { g__projlib_language_enabled_ \projlib_language_str_to_languagename:n { #1 } _bool } + { + \use:c { projlib_language_apply_settings_locally_ \projlib_language_str_to_languagename:n { #1 } :n } { #2 } + } + { + \msg_warning:nnn { projlib-language } { language-not-enabled } { #1 } + #2 + } + } + { + \msg_warning:nnn { projlib-language } { language-not-supported } { #1 } + #2 } - { #2 } } \cs_generate_variant:Nn \projlib_language_use_language_locally:nn { e } \cs_new:Nn \projlib_language_use_language:n { - \cs_if_exist_use:cF { projlib_language_apply_settings_globally_ \projlib_language_str_to_languagename:n { #1 } : } + \cs_if_exist:cTF { projlib_language_apply_settings_globally_ \projlib_language_str_to_languagename:n { #1 } : } + { + \bool_if:cTF { g__projlib_language_enabled_ \projlib_language_str_to_languagename:n { #1 } _bool } + { + \use:c { projlib_language_apply_settings_globally_ \projlib_language_str_to_languagename:n { #1 } : } + \cs_if_exist_use:c { g_projlib_language_linespacing_ \projlib_language_str_to_languagetype:n { #1 } _tl } + \cs_if_exist_use:c { g_projlib_language_parindent_ \projlib_language_str_to_languagetype:n { #1 } _tl } + } + { + \msg_warning:nnn { projlib-language } { language-not-enabled } { #1 } + } + } { - \msg_warning:nnn { projlib-language } { language-not-support } { #1 } + \msg_warning:nnn { projlib-language } { language-not-supported } { #1 } } - \cs_if_exist_use:c { g_projlib_language_linespacing_ \projlib_language_str_to_languagetype:n { #1 } _tl } - \cs_if_exist_use:c { g_projlib_language_parindent_ \projlib_language_str_to_languagetype:n { #1 } _tl } } \cs_generate_variant:Nn \projlib_language_use_language:n { e } @@ -3768,43 +3799,50 @@ %<*projlib-theorem> \keys_define:nn { projlib-theorem } { - , no-theorems .bool_set:N = \l__projlib_theorem_no_theorems_bool - , no-theorems .initial:n = { false } - , no~theorems .bool_set:N = \l__projlib_theorem_no_theorems_bool - , no theorems .bool_set:N = \l__projlib_theorem_no_theorems_bool - , nothms .bool_set:N = \l__projlib_theorem_no_theorems_bool - , no-theorem-numbering .bool_set:N = \l__projlib_theorem_no_theorem_numbering_bool - , no-theorem-numbering .initial:n = { false } - , no~theorem~numbering .bool_set:N = \l__projlib_theorem_no_theorem_numbering_bool - , no theorem numbering .bool_set:N = \l__projlib_theorem_no_theorem_numbering_bool - , nothmnum .bool_set:N = \l__projlib_theorem_no_theorem_numbering_bool - , theorem-numbering .tl_set:N = \l__projlib_theorem_theorem_numbering_tl - , theorem-numbering .default:n = { * } - , theorem~numbering .tl_set:N = \l__projlib_theorem_theorem_numbering_tl - , theorem~numbering .default:n = { * } - , theorem numbering .tl_set:N = \l__projlib_theorem_theorem_numbering_tl - , theorem numbering .default:n = { * } - , thmnum .tl_set:N = \l__projlib_theorem_theorem_numbering_tl - , thmnum .default:n = { * } - , theorem-style .tl_set:N = \l__projlib_theorem_theorem_style_tl - , theorem-style .initial:n = { } - , theorem-style .value_required:n = true - , theorem~style .tl_set:N = \l__projlib_theorem_theorem_style_tl - , theorem~style .value_required:n = true - , theorem style .tl_set:N = \l__projlib_theorem_theorem_style_tl - , theorem style .value_required:n = true - , complex-name .bool_set:N = \l__projlib_theorem_complexname_bool - , complex-name .initial:n = { true } - , complex~name .bool_set:N = \l__projlib_theorem_complexname_bool - , complex name .bool_set:N = \l__projlib_theorem_complexname_bool - , simple-name .bool_set_inverse:N = \l__projlib_theorem_complexname_bool - , simple~name .bool_set_inverse:N = \l__projlib_theorem_complexname_bool - , simple name .bool_set_inverse:N = \l__projlib_theorem_complexname_bool - , no-preset-names .bool_set_inverse:N = \l__projlib_theorem_presetname_bool - , no-preset-names .initial:n = { false } - , no~preset~names .bool_set_inverse:N = \l__projlib_theorem_presetname_bool - , no preset names .bool_set_inverse:N = \l__projlib_theorem_presetname_bool - , unknown .code:n = { \PassOptionsToPackage { \CurrentOption } { create-theorem } } + , no-theorems .bool_set:N = \l__projlib_theorem_no_theorems_bool + , no-theorems .initial:n = { false } + , no~theorems .bool_set:N = \l__projlib_theorem_no_theorems_bool + , no theorems .bool_set:N = \l__projlib_theorem_no_theorems_bool + , nothms .bool_set:N = \l__projlib_theorem_no_theorems_bool + , no-theorem-numbering .bool_set:N = \l__projlib_theorem_no_theorem_numbering_bool + , no-theorem-numbering .initial:n = { false } + , no~theorem~numbering .bool_set:N = \l__projlib_theorem_no_theorem_numbering_bool + , no theorem numbering .bool_set:N = \l__projlib_theorem_no_theorem_numbering_bool + , nothmnum .bool_set:N = \l__projlib_theorem_no_theorem_numbering_bool + , theorem-numbering .tl_set:N = \l__projlib_theorem_theorem_numbering_tl + , theorem-numbering .default:n = { * } + , theorem~numbering .tl_set:N = \l__projlib_theorem_theorem_numbering_tl + , theorem~numbering .default:n = { * } + , theorem numbering .tl_set:N = \l__projlib_theorem_theorem_numbering_tl + , theorem numbering .default:n = { * } + , thmnum .tl_set:N = \l__projlib_theorem_theorem_numbering_tl + , thmnum .default:n = { * } + , separate-theorem-numbering .bool_set:N = \l__projlib_theorem_separate_theorem_numbering_bool + , separate-theorem-numbering .initial:n = { false } + , separate~theorem~numbering .bool_set:N = \l__projlib_theorem_separate_theorem_numbering_bool + , separate theorem numbering .bool_set:N = \l__projlib_theorem_separate_theorem_numbering_bool + , number-theorems-separately .bool_set:N = \l__projlib_theorem_separate_theorem_numbering_bool + , number~theorems~separately .bool_set:N = \l__projlib_theorem_separate_theorem_numbering_bool + , number theorems separately .bool_set:N = \l__projlib_theorem_separate_theorem_numbering_bool + , theorem-style .tl_set:N = \l__projlib_theorem_theorem_style_tl + , theorem-style .initial:n = { } + , theorem-style .value_required:n = true + , theorem~style .tl_set:N = \l__projlib_theorem_theorem_style_tl + , theorem~style .value_required:n = true + , theorem style .tl_set:N = \l__projlib_theorem_theorem_style_tl + , theorem style .value_required:n = true + , complex-name .bool_set:N = \l__projlib_theorem_complexname_bool + , complex-name .initial:n = { true } + , complex~name .bool_set:N = \l__projlib_theorem_complexname_bool + , complex name .bool_set:N = \l__projlib_theorem_complexname_bool + , simple-name .bool_set_inverse:N = \l__projlib_theorem_complexname_bool + , simple~name .bool_set_inverse:N = \l__projlib_theorem_complexname_bool + , simple name .bool_set_inverse:N = \l__projlib_theorem_complexname_bool + , no-preset-names .bool_set_inverse:N = \l__projlib_theorem_presetname_bool + , no-preset-names .initial:n = { false } + , no~preset~names .bool_set_inverse:N = \l__projlib_theorem_presetname_bool + , no preset names .bool_set_inverse:N = \l__projlib_theorem_presetname_bool + , unknown .code:n = { \PassOptionsToPackage { \CurrentOption } { create-theorem } } } \ProcessKeyOptions [ projlib-theorem ] @@ -3917,22 +3955,41 @@ \cs_if_exist:cTF { c@chapter } { % with \chapter \CreateTheorem { theorem } { parent counter = chapter, create starred version } + \bool_if:NT \l__projlib_theorem_separate_theorem_numbering_bool + { + \exp_args:Nv \CreateTheorem { c_projlib_theorem_supported_clist } { parent counter = chapter, create starred version } + } } { % without \chapter \CreateTheorem { theorem } { parent counter = section, create starred version } + \bool_if:NT \l__projlib_theorem_separate_theorem_numbering_bool + { + \exp_args:Nv \CreateTheorem { c_projlib_theorem_supported_clist } { parent counter = section, create starred version } + } } } { \tl_if_eq:NnTF \l__projlib_theorem_theorem_numbering_tl { * } { \CreateTheorem { theorem } { create starred version } + \bool_if:NT \l__projlib_theorem_separate_theorem_numbering_bool + { + \exp_args:Nv \CreateTheorem { c_projlib_theorem_supported_clist } { create starred version } + } } { \CreateTheorem { theorem } { parent counter = \l__projlib_theorem_theorem_numbering_tl, create starred version } + \bool_if:NT \l__projlib_theorem_separate_theorem_numbering_bool + { + \exp_args:Nv \CreateTheorem { c_projlib_theorem_supported_clist } { parent counter = \l__projlib_theorem_theorem_numbering_tl, create starred version } + } } } - \exp_args:Nv \CreateTheorem { c_projlib_theorem_supported_clist } { shared counter = theorem, create starred version, quiet } + \bool_if:NF \l__projlib_theorem_separate_theorem_numbering_bool + { + \exp_args:Nv \CreateTheorem { c_projlib_theorem_supported_clist } { shared counter = theorem, create starred version, quiet } + } } } |