summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex')
-rw-r--r--Master/texmf-dist/tex/latex/create-theorem/create-theorem.sty71
1 files changed, 68 insertions, 3 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 fefe7a6119c..8e9ab307ce5 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/04/23} {}
+ {2022/05/22} {}
{Initializing theorem-like environments with multilingual support}
\keys_define:nn { create-theorem }
@@ -401,6 +401,69 @@
{ ##3 } { ##4 } { ##5 } { ##6 }
\group_end:
}
+
+ % Redefine the labelcref formats to match the numbering format
+ \cs_set:cpn { labelcref@ #1 @format } ##1##2##3
+ {
+ \group_begin:
+ \crthm_format_short_generic:nnn { \tl_use:c { g_crthm_number_style_ #2 _tl } { ##1 } } { ##2 } { ##3 }
+ \group_end:
+ }
+ \cs_set_eq:cc { labelcref@ #1 @format@first } { labelcref@ #1 @format }
+ \cs_set:cpn { labelcref@ #1 @format@second } ##1##2##3
+ {
+ \crefpairconjunction
+ \group_begin:
+ \crthm_format_short_generic:nnn { \tl_use:c { g_crthm_number_style_ #2 _tl } { ##1 } } { ##2 } { ##3 }
+ \group_end:
+ }
+ \cs_set:cpn { labelcref@ #1 @format@middle } ##1##2##3
+ {
+ \crefmiddleconjunction
+ \group_begin:
+ \crthm_format_short_generic:nnn { \tl_use:c { g_crthm_number_style_ #2 _tl } { ##1 } } { ##2 } { ##3 }
+ \group_end:
+ }
+ \cs_set:cpn { labelcref@ #1 @format@last } ##1##2##3
+ {
+ \creflastconjunction
+ \group_begin:
+ \crthm_format_short_generic:nnn { \tl_use:c { g_crthm_number_style_ #2 _tl } { ##1 } } { ##2 } { ##3 }
+ \group_end:
+ }
+
+ \crthm_define_format_long_version:nnnn { #2 } { labelcrefrange@ #1 @format } {} {}
+ \crthm_define_format_long_version:nnnn { #2 } { labelcrefrange@ #1 @format@first } {} {}
+ \cs_set:cpn { labelcrefrange@ #1 @format@second } ##1##2##3##4##5##6
+ {
+ \crefpairconjunction
+ \group_begin:
+ \crthm_format_long_generic:nnnnnn
+ { \tl_use:c { g_crthm_number_style_ #2 _tl } { ##1 } }
+ { \tl_use:c { g_crthm_number_style_ #2 _tl } { ##2 } }
+ { ##3 } { ##4 } { ##5 } { ##6 }
+ \group_end:
+ }
+ \cs_set:cpn { labelcrefrange@ #1 @format@middle } ##1##2##3##4##5##6
+ {
+ \crefmiddleconjunction
+ \group_begin:
+ \crthm_format_long_generic:nnnnnn
+ { \tl_use:c { g_crthm_number_style_ #2 _tl } { ##1 } }
+ { \tl_use:c { g_crthm_number_style_ #2 _tl } { ##2 } }
+ { ##3 } { ##4 } { ##5 } { ##6 }
+ \group_end:
+ }
+ \cs_set:cpn { labelcrefrange@ #1 @format@last } ##1##2##3##4##5##6
+ {
+ \creflastconjunction
+ \group_begin:
+ \crthm_format_long_generic:nnnnnn
+ { \tl_use:c { g_crthm_number_style_ #2 _tl } { ##1 } }
+ { \tl_use:c { g_crthm_number_style_ #2 _tl } { ##2 } }
+ { ##3 } { ##4 } { ##5 } { ##6 }
+ \group_end:
+ }
}
\cs_new:Nn \crthm_define_format_short_version:nnnn
@@ -412,7 +475,9 @@
{
\cs_new:cn { crthm_format_ #2 :nnn }
{
- { #3 } ##2 { #4 } \nobreakspace { \tl_use:c { g_crthm_number_style_ #1 _tl } { ##1 } } ##3
+ { #3 } ##2 { #4 }
+ \tl_if_blank:nF { #4 } { \nobreakspace }
+ { \tl_use:c { g_crthm_number_style_ #1 _tl } { ##1 } } ##3
}
\cs_set_eq:cc { #2 } { crthm_format_ #2 :nnn }
}
@@ -427,7 +492,7 @@
\cs_new:cn { crthm_format_ #2 :nnnnnn }
{
{ #3 } ##3 { #4 }
- \nobreakspace \crefrangepreconjunction
+ \tl_if_blank:nF { #4 } { \nobreakspace } \crefrangepreconjunction
{ \tl_use:c { g_crthm_number_style_ #1 _tl } { ##1 } }
##4 \crefrangeconjunction
##5 { \tl_use:c { g_crthm_number_style_ #1 _tl } { ##2 } } ##6