texlive[63605] Master/texmf-dist: create-theorem (15jun22)

commits+karl at tug.org commits+karl at tug.org
Wed Jun 15 22:11:05 CEST 2022


Revision: 63605
          http://tug.org/svn/texlive?view=revision&revision=63605
Author:   karl
Date:     2022-06-15 22:11:04 +0200 (Wed, 15 Jun 2022)
Log Message:
-----------
create-theorem (15jun22)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/create-theorem/create-theorem-doc.pdf
    trunk/Master/texmf-dist/doc/latex/create-theorem/create-theorem-doc.tex
    trunk/Master/texmf-dist/tex/latex/create-theorem/create-theorem.sty

Modified: trunk/Master/texmf-dist/doc/latex/create-theorem/create-theorem-doc.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/create-theorem/create-theorem-doc.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/create-theorem/create-theorem-doc.tex	2022-06-15 20:10:54 UTC (rev 63604)
+++ trunk/Master/texmf-dist/doc/latex/create-theorem/create-theorem-doc.tex	2022-06-15 20:11:04 UTC (rev 63605)
@@ -97,7 +97,7 @@
 
 \begin{document}
 
-\def\PackageVersion{2022/06/01}
+\def\PackageVersion{2022/06/15}
 
 \title{\createtheorempackage{}\\\smallskip\itshape Initializing theorem-like environments with multilingual support}
 \author{Jinwen XU}
@@ -286,6 +286,7 @@
     \item \commandoption{create starred version}
         \begin{itemize}
             \item Defining a corresponding starred (unnumbered) version of the current environment.
+            \item It must be placed \emph{before} \commandoption{qed} if you want the starred version to have a Q.E.D symbol.
             \item Synonymous names: \commandoption{create-starred-version} \,$|$\, \commandoption{createstarredversion} \,$|$\, \\\phantom{Synonymous names: }\commandoption{create numberless version} \,$|$\, \commandoption{create-numberless-version} \\\phantom{Synonymous names: }\,$|$ \commandoption{createnumberlessversion}
         \end{itemize}
     \item \commandoption{copy existed}\lstinline| = |\meta{existed environment}
@@ -476,7 +477,8 @@
 \begin{itemize}
     \item The current mechanism does not work well for German, a problem originated in the package \textsf{crefthe}. The author plans to adopt a more refined approach in a later version so as to support the various grammatical situations in German.
     \item \createtheorempackage{} modifies some undocumented internal macros of \textsf{cleveref}, so the behaviour might not be stable if \textsf{cleveref} gets updated.
-    \item There may be inaccuracies in the translation of those preset names.
+    \item The counter aliasing function is still not perfect, (sometimes) causing incorrect ordering in the result of \lstinline|\cref|.
+    \item There might be inaccuracies in the translation of those preset names.
 \end{itemize}
 
 \medskip

Modified: trunk/Master/texmf-dist/tex/latex/create-theorem/create-theorem.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/create-theorem/create-theorem.sty	2022-06-15 20:10:54 UTC (rev 63604)
+++ trunk/Master/texmf-dist/tex/latex/create-theorem/create-theorem.sty	2022-06-15 20:11:04 UTC (rev 63605)
@@ -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,12 +941,27 @@
   {
     \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 }
 
 



More information about the tex-live-commits mailing list.