summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/projlib/projlib-theorem.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/projlib/projlib-theorem.sty')
-rw-r--r--Master/texmf-dist/tex/latex/projlib/projlib-theorem.sty82
1 files changed, 65 insertions, 17 deletions
diff --git a/Master/texmf-dist/tex/latex/projlib/projlib-theorem.sty b/Master/texmf-dist/tex/latex/projlib/projlib-theorem.sty
index 5f528352904..45fed9d1393 100644
--- a/Master/texmf-dist/tex/latex/projlib/projlib-theorem.sty
+++ b/Master/texmf-dist/tex/latex/projlib/projlib-theorem.sty
@@ -15,11 +15,11 @@
%% and version 1.3c or later is part of all distributions of LaTeX version
%% 2005/12/01 or later.
%%
-\NeedsTeXFormat{LaTeX2e}[2020-10-01]
+\NeedsTeXFormat{LaTeX2e}[2022-06-01]
\RequirePackage{l3keys2e}
\ProvidesExplPackage
{projlib-theorem}
- {2022/04/24} {}
+ {2022/06/15} {}
{Configuration of theorem-like environments}
\keys_define:nn { projlib-theorem }
@@ -105,13 +105,13 @@
\bool_set_true:N \l__projlib_theorem_no_theorem_numbering_bool
\bool_if:NF \l__projlib_theorem_no_theorems_bool
{
- \cs_undefine:c { theorem }
- \cs_undefine:c { lemma }
- \cs_undefine:c { corollary }
- \cs_undefine:c { definition }
- \cs_undefine:c { fact }
- \cs_undefine:c { example }
- \cs_undefine:c { problem }
+ \cs_undefine:c { theorem } \cs_undefine:c { endtheorem }
+ \cs_undefine:c { lemma } \cs_undefine:c { endlemma }
+ \cs_undefine:c { corollary } \cs_undefine:c { endcorollary }
+ \cs_undefine:c { definition } \cs_undefine:c { enddefinition }
+ \cs_undefine:c { fact } \cs_undefine:c { endfact }
+ \cs_undefine:c { example } \cs_undefine:c { endexample }
+ \cs_undefine:c { problem } \cs_undefine:c { endproblem }
}
} {}
@@ -120,7 +120,17 @@
\cs_new_protected:Nn \projlib_theorem_preset_theorem_style:nn
{
- \tl_const:cn { c_crthm_theorem_style_preset_ #1 _tl } { #2 }
+ \str_case:nnTF { #1 }
+ {
+ { theorem-with-name } { }
+ { proof } { }
+ }
+ {
+ \tl_const:cn { c_crthm_theorem_style_preset_ #1 _inner _tl } { #2 }
+ }
+ {
+ \tl_const:cn { c_crthm_theorem_style_preset_ #1 _tl } { #2 }
+ }
}
\cs_generate_variant:Nn \keyval_parse:nnn { nno }
@@ -129,6 +139,11 @@
{ \projlib_theorem_preset_theorem_style:nn }
{ \l__projlib_theorem_theorem_style_tl }
+\cs_if_exist:cF { c_crthm_theorem_style_preset_ proof_inner _tl }
+ {
+ \tl_const:cn { c_crthm_theorem_style_preset_ proof_inner _tl } { remark }
+ }
+
\RequirePackage { amsthm }
\RequirePackage { create-theorem }
@@ -142,23 +157,23 @@
\exp_args:Nv \CreateTheorem { c_projlib_theorem_supported_clist } { numberless, create starred version }
}
{
- \tl_if_blank:eTF \l__projlib_theorem_theorem_numbering_tl
+ \tl_if_blank:oTF \l__projlib_theorem_theorem_numbering_tl
{
\cs_if_exist:cTF { c@chapter }
{ % with \chapter
- \CreateTheorem {theorem} { parent counter = chapter, create starred version }
+ \CreateTheorem { theorem } { parent counter = chapter, create starred version }
}
{ % without \chapter
- \CreateTheorem {theorem} { parent counter = section, create starred version }
+ \CreateTheorem { theorem } { parent counter = section, create starred version }
}
}
{
\tl_if_eq:NnTF \l__projlib_theorem_theorem_numbering_tl { * }
{
- \CreateTheorem {theorem} { create starred version }
+ \CreateTheorem { theorem } { create starred version }
}
{
- \CreateTheorem {theorem} { parent counter = \l__projlib_theorem_theorem_numbering_tl, create starred version }
+ \CreateTheorem { theorem } { parent counter = \l__projlib_theorem_theorem_numbering_tl, create starred version }
}
}
@@ -166,8 +181,12 @@
}
}
+\newcounter { theorem-with-name }
+\newcounter { proof }
+\crthm_counter_alias:nn { theorem-with-name } { theorem }
+
\tl_new:N \l_projlib_theorem_name_of_theorem_with_name_tl
-\CreateTheorem { theorem-with-name_inner } { name = { heading = { \l_projlib_theorem_name_of_theorem_with_name_tl } }, create-starred-version }
+\CreateTheorem { theorem-with-name_inner } { name = { heading = { \l_projlib_theorem_name_of_theorem_with_name_tl } }, create-starred-version, shared-counter=theorem-with-name }
\NewDocumentEnvironment { theorem-with-name } { m O{} }
{
@@ -186,6 +205,35 @@
\end { theorem-with-name_inner* }
}
+\SetTheoremBinding { theorem-with-name } { theorem-with-name_inner }
+\SetTheoremBinding { theorem-with-name* } { theorem-with-name_inner* }
+
+\tl_new:N \l_projlib_theorem_name_of_proof_tl
+\CreateTheorem { proof_inner } { name = { heading = { \l_projlib_theorem_name_of_proof_tl } }, create-starred-version, qed, shared-counter = proof }
+
+\cs_undefine:c { proof }
+\cs_undefine:c { endproof }
+
+\NewDocumentEnvironment { proof } { O{\proofname} }
+ {
+ \tl_set:Nn \l_projlib_theorem_name_of_proof_tl { #1 }
+ \begin { proof_inner }
+ }
+ {
+ \end { proof_inner }
+ }
+\NewDocumentEnvironment { proof* } { O{\proofname} }
+ {
+ \tl_set:Nn \l_projlib_theorem_name_of_proof_tl { #1 }
+ \begin { proof_inner* }
+ }
+ {
+ \end { proof_inner* }
+ }
+
+\SetTheoremBinding { proof } { proof_inner }
+\SetTheoremBinding { proof* } { proof_inner* }
+
\cs_new_protected:Nn \projlib_theorem_disable_theorem_numbering:n
{
\clist_map_inline:nn { #1 }
@@ -222,7 +270,7 @@
\projlib_theorem_switch_theorem_numbering:n { #1 }
}
-\SwitchTheoremNumbering { theorem-with-name }
+\SwitchTheoremNumbering { theorem-with-name, proof }
\AddLanguageSetting [ schinese ]
{