summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/create-theorem
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2022-04-03 20:55:18 +0000
committerKarl Berry <karl@freefriends.org>2022-04-03 20:55:18 +0000
commitb5b4196c736056d495a404ed6e98c3d8b8451bea (patch)
tree4ef9526422c4f24e4b8b9937f001a3a1d7aecd8e /Master/texmf-dist/tex/latex/create-theorem
parentb6bf9cdd2f6809a19627da22f310f7490a89bd78 (diff)
create-theorem (3apr22)
git-svn-id: svn://tug.org/texlive/trunk@62892 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/create-theorem')
-rw-r--r--Master/texmf-dist/tex/latex/create-theorem/create-theorem.sty105
1 files changed, 50 insertions, 55 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 b86af841ee7..2156f23ecd8 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/03/18} {}
+ {2022/04/02} {}
{Initializing theorem-like environments with multilingual support}
\keys_define:nn { create-theorem }
@@ -611,20 +611,6 @@
\cs_new:Nn \crthm_create_theorem:nn
{
- \cs_if_exist:cTF { #1 }
- {
- \bool_if:NF \l__crthm_creating_quiet_bool
- {
- \msg_warning:nnn { create-theorem } { env-not-created } { #1 }
- }
- }
- {
- \__crthm_create_theorem:nn { #1 } { #2 }
- }
- }
-
-\cs_new:Nn \__crthm_create_theorem:nn
- {
\tl_set:Nn \l__crthm_current_env_tl { #1 }
\bool_set_false:N \l__crthm_creating_apply_style_bool
\bool_set_false:N \l__crthm_creating_numberless_bool
@@ -633,72 +619,81 @@
\keys_set:nn { create-theorem-creating } { #2 }
\bool_if:NTF \l__crthm_creating_copy_existed_bool
{
- \__crthm_define_env:en { #1 } { \l__crthm_creating_copy_existed_tl }
+ \__crthm_copy_env:ee { \l__crthm_current_env_tl } { \l__crthm_creating_copy_existed_tl }
\bool_if:NT \l__crthm_creating_create_starred_bool
{
- \__crthm_define_env:en { #1 * } { \l__crthm_creating_copy_existed_tl * }
+ \__crthm_copy_env:ee { \l__crthm_current_env_tl * } { \l__crthm_creating_copy_existed_tl * }
}
}
{
- \cs_if_exist:cTF { c@ #1 }
+ \cs_if_exist:cTF { #1 }
{
- \group_begin:
- \bool_if:NTF \l__crthm_creating_apply_style_bool
+ \bool_if:NF \l__crthm_creating_quiet_bool
{
- \exp_args:No \theoremstyle { \l__crthm_creating_apply_style_tl }
+ \msg_warning:nnn { create-theorem } { env-not-created } { #1 }
}
+ }
+ {
+ \cs_if_exist:cTF { c@ #1 }
{
- \tl_if_exist:cT { c_crthm_theorem_style_preset_ #1 _tl }
+ \group_begin:
+ \bool_if:NTF \l__crthm_creating_apply_style_bool
{
- \exp_args:Nv \theoremstyle { c_crthm_theorem_style_preset_ #1 _tl }
+ \exp_args:No \theoremstyle { \l__crthm_creating_apply_style_tl }
}
- }
- \bool_if:NTF \l__crthm_creating_numberless_bool
- {
- \newtheorem*{ #1 _crthm_regional } { \tl_use:c { g_crthm_name_heading_ #1 _ \languagename _tl } }
- }
- {
- \newtheorem { #1 _crthm_regional } [#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"
- % while in "originalref" mode, the counter received is "#1 _crthm_original_\languagename"
- {
- \tl_if_blank:eTF { ##1 }
{
- \begin{ #1 _crthm_regional }
+ \tl_if_exist:cT { c_crthm_theorem_style_preset_ #1 _tl }
+ {
+ \exp_args:Nv \theoremstyle { c_crthm_theorem_style_preset_ #1 _tl }
+ }
}
+ \bool_if:NTF \l__crthm_creating_numberless_bool
{
- \begin{ #1 _crthm_regional }[##1]
+ \newtheorem*{ #1 _crthm_regional } { \tl_use:c { g_crthm_name_heading_ #1 _ \languagename _tl } }
}
- \bool_if:NF \l__crthm_regionalref_bool
- {
- \addtocounter { #1 _crthm_original_\languagename } { -1 }
- \refstepcounter { #1 _crthm_original_\languagename }
- }
- }
- {
- \end{ #1 _crthm_regional }
+ {
+ \newtheorem { #1 _crthm_regional } [#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"
+ % while in "originalref" mode, the counter received is "#1 _crthm_original_\languagename"
+ {
+ \tl_if_blank:eTF { ##1 }
+ {
+ \begin{ #1 _crthm_regional }
+ }
+ {
+ \begin{ #1 _crthm_regional }[##1]
+ }
+ \bool_if:NF \l__crthm_regionalref_bool
+ {
+ \addtocounter { #1 _crthm_original_\languagename } { -1 }
+ \refstepcounter { #1 _crthm_original_\languagename }
+ }
+ }
+ {
+ \end{ #1 _crthm_regional }
+ }
+ \bool_if:NT \l__crthm_creating_create_starred_bool
+ {
+ \newtheorem*{ #1 * } { \tl_use:c { g_crthm_name_heading_ #1 _ \languagename _tl } }
+ }
+ \keys_set:nn { create-theorem-creating / counter-management } { #2 }
}
- \bool_if:NT \l__crthm_creating_create_starred_bool
{
- \newtheorem*{ #1 * } { \tl_use:c { g_crthm_name_heading_ #1 _ \languagename _tl } }
+ \msg_error:nnn { create-theorem } { env-not-named } { #1 }
}
- \keys_set:nn { create-theorem-creating / counter-management } { #2 }
- }
- {
- \msg_error:nnn { create-theorem } { env-not-named } { #1 }
}
}
}
-\cs_new:Nn \__crthm_define_env:nn
+\cs_new:Nn \__crthm_copy_env:nn
{
\cs_set_eq:cc { #1 } { #2 }
\cs_set_eq:cc { end #1 } { end #2 }
}
-\cs_generate_variant:Nn \__crthm_define_env:nn { en }
+\cs_generate_variant:Nn \__crthm_copy_env:nn { ee }
\cs_new:Nn \crthm_counter_within:nn
{