diff options
author | Karl Berry <karl@freefriends.org> | 2022-06-15 20:11:04 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2022-06-15 20:11:04 +0000 |
commit | f62f32d2479ec59421e3622f2b7352e3ca3190cb (patch) | |
tree | f9832065ad8ffbc1c45fe6a718bf673fd1dd766f /Master/texmf-dist/tex | |
parent | 2cdeb208b2d178d850a41eb9dad210d3b14526e6 (diff) |
create-theorem (15jun22)
git-svn-id: svn://tug.org/texlive/trunk@63605 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r-- | Master/texmf-dist/tex/latex/create-theorem/create-theorem.sty | 49 |
1 files changed, 38 insertions, 11 deletions
diff --git a/Master/texmf-dist/tex/latex/create-theorem/create-theorem.sty b/Master/texmf-dist/tex/latex/create-theorem/create-theorem.sty index 35b07ffd323..44ba44d9a4b 100644 --- a/Master/texmf-dist/tex/latex/create-theorem/create-theorem.sty +++ b/Master/texmf-dist/tex/latex/create-theorem/create-theorem.sty @@ -13,7 +13,7 @@ \RequirePackage{l3keys2e} \ProvidesExplPackage {create-theorem} - {2022/06/01} {} + {2022/06/15} {} {Initializing theorem-like environments with multilingual support} \keys_define:nn { create-theorem } @@ -39,8 +39,6 @@ } \ProcessKeysOptions { create-theorem } -\RequirePackage { aliascnt } - \bool_if:NT \l__crthm_nameinlink_bool { \PassOptionsToPackage { nameinlink } { cleveref } @@ -244,7 +242,7 @@ {% "originalref" mode \tl_if_exist:cF { c@ #1 _crthm_original_ #2 } { - \newaliascnt { #1 _crthm_original_ #2 } { #1 } + \crthm_counter_alias:nn { #1 _crthm_original_ #2 } { #1 } \hook_gput_code:nnn { begindocument/before } { crthm } { \cs_set_eq:cc { the #1 _crthm_original_ #2 } { the #1 } @@ -704,6 +702,11 @@ , qed .code:n = { \exp_args:Nx \hook_gput_code:nnn { env/ \l__crthm_current_env_tl /begin } { crthm } { \cs_set:Npn \qedsymbol { \ensuremath { #1 } } \pushQED{\qed} } \exp_args:Nx \hook_gput_code:nnn { env/ \l__crthm_current_env_tl /end } { crthm } { \popQED } + \bool_if:NT \l__crthm_creating_create_starred_bool + { + \exp_args:Nx \hook_gput_code:nnn { env/ \l__crthm_current_env_tl * /begin } { crthm } { \cs_set:Npn \qedsymbol { \ensuremath { #1 } } \pushQED{\qed} } + \exp_args:Nx \hook_gput_code:nnn { env/ \l__crthm_current_env_tl * /end } { crthm } { \popQED } + } } , qed .default:n = \c_crthm_original_qedsymbol_tl , qed~symbol .meta:n = { qed = #1 } @@ -822,6 +825,10 @@ { \crthm_newtheorem:w { #1 _crthm_regional } [#1] { \tl_use:c { g_crthm_name_heading_ #1 _ \languagename _tl } } } + \bool_if:NT \l__crthm_creating_create_starred_bool + { + \crthm_newtheorem:w*{ #1 * } { \tl_use:c { g_crthm_name_heading_ #1 _ \languagename _tl } } + } \group_end: \NewDocumentEnvironment { #1 } { O{} } % In "regionalref" mode, the counter received by the referencing system is "#1 _crthm_regional" @@ -843,10 +850,6 @@ { \end{ #1 _crthm_regional } } - \bool_if:NT \l__crthm_creating_create_starred_bool - { - \crthm_newtheorem:w*{ #1 * } { \tl_use:c { g_crthm_name_heading_ #1 _ \languagename _tl } } - } \keys_set:nn { create-theorem-creating / counter-management } { #2 } } { @@ -871,8 +874,17 @@ \cs_new:Nn \crthm_counter_alias:nn { - \cs_set_eq:cc { c@ #1 } { c@ #2 } - \cs_set_eq:cc { the #1 } { the #2 } + \cs_if_exist:cTF { c@ #2 } + { + \cs_gset_eq:cc { c@ #1 } { c@ #2 } + \cs_gset_eq:cc { the #1 } { the #2 } + \cs_gset_eq:cc { theH #1 } { theH #2 } + \cs_gset_eq:cc { p@ #1 } { p@ #2 } + \cs_gset_eq:cc { cl@ #1 } { cl@ #2 } + } + { + \@nocounterr { #2 } + } } \cs_generate_variant:Nn \crthm_counter_alias:nn { en } @@ -929,11 +941,26 @@ { \clist_map_inline:nn { #1 } { - \tl_set:Nn \l__crthm_current_env_tl { ##1 } + \prop_if_in:NnTF \l_crthm_binding_prop { ##1 } + { + \prop_get:NnN \l_crthm_binding_prop { ##1 } \l__crthm_current_env_tl + } + { + \tl_set:Nn \l__crthm_current_env_tl { ##1 } + } \keys_set:nn { create-theorem-setting } { #2 } } } +\prop_new:N \l_crthm_binding_prop +\NewDocumentCommand \SetTheoremBinding { m m } + { + \clist_map_inline:nn { #1 } + { + \prop_put:Nxx \l_crthm_binding_prop { ##1 } { #2 } + } + } + \bool_if:NF \l__crthm_presetname_bool { \endinput } |