texlive[62348] branches/branch2021.final/Master/texmf-dist:

commits+karl at tug.org commits+karl at tug.org
Wed Mar 2 22:36:30 CET 2022


Revision: 62348
          http://tug.org/svn/texlive?view=revision&revision=62348
Author:   karl
Date:     2022-03-02 22:36:29 +0100 (Wed, 02 Mar 2022)
Log Message:
-----------
create-theorem (2mar22) (branch)

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

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

Modified: branches/branch2021.final/Master/texmf-dist/doc/latex/create-theorem/create-theorem-doc.tex
===================================================================
--- branches/branch2021.final/Master/texmf-dist/doc/latex/create-theorem/create-theorem-doc.tex	2022-03-02 21:36:20 UTC (rev 62347)
+++ branches/branch2021.final/Master/texmf-dist/doc/latex/create-theorem/create-theorem-doc.tex	2022-03-02 21:36:29 UTC (rev 62348)
@@ -89,8 +89,8 @@
 
 \title{\createtheorempackage{}\\\smallskip\itshape Initializing theorem-like environments with multilingual support}
 \author{Jinwen XU}
-\thanks{Corresponding to: \texttt{\createtheorempackage{} 2022/02/27}}
-\date{February 2022, in Paris}
+\thanks{Corresponding to: \texttt{\createtheorempackage{} 2022/03/01}}
+\date{March 2022, in Paris}
 
 \maketitle
 
@@ -208,7 +208,7 @@
 
 The syntax of \lstinline|\CreateTheorem| is as follows:
 \begin{code}
-\CreateTheorem{(*\meta{name of environment}*)}{(*\meta{key-value configuration}*)}
+\CreateTheorem{(*\meta{list of the name of environments}*)}{(*\meta{key-value configuration}*)}
 \end{code}
 
 Supported keys are:
@@ -265,8 +265,17 @@
 
 \medskip
 
-Please note that, by default, an normal environment \meta{env} and its starred relative \meta{env}\texttt{*} do not share the same set of names, for the sake of generality. However, with proper usage of \commandoption{create starred version} and \commandoption{copy existed}, you are already able to produce all of the following combinations that shares the same set of names: 1$)$ numbered \meta{env}, numbered \meta{env}\texttt{*} ; 2$)$ numbered \meta{env}, unnumbered \meta{env}\texttt{*} ; 3$)$ unnumbered \meta{env}, numbered \meta{env}\texttt{*} ; and 4$)$ unnumbered \meta{env}, unnumbered \meta{env}\texttt{*}. I left it as an easy exercise for you ;-)
+Please note that, by default, an normal environment \meta{env} and its starred relative \meta{env}\texttt{*} do \emph{not} share the same set of names, for the sake of generality. However, with proper usage of \commandoption{create starred version} and \commandoption{copy existed}, you are already able to produce all of the following combinations that shares the same set of names: 1$)$ numbered \meta{env}, numbered \meta{env}\texttt{*} ; 2$)$ numbered \meta{env}, unnumbered \meta{env}\texttt{*} ; 3$)$ unnumbered \meta{env}, numbered \meta{env}\texttt{*} ; and 4$)$ unnumbered \meta{env}, unnumbered \meta{env}\texttt{*}. I left it as an easy exercise for you ;-)
 
+% \subsection[Configuring theorem-like environments]{Configuring theorem-like environments with \texttt{\textbackslash\textcolor{maintheme}{SetTheorem}}}
+
+% Even after defining the environments, you can still configure them with \lstinline|\SetTheorem|. The syntax of which is as follows:
+
+% \begin{code}
+% \SetTheorem{(*\meta{list of the name of environments}*)}{(*\meta{key-value configuration}*)}
+% \end{code}
+
+
 \section{Examples}
 
 \subsection{The environment \texttt{idea}}
@@ -319,7 +328,7 @@
 
 \subsection{Let's play with numbering}
 
-Remember the exercise I left to you at the end of the previous section? Let's do this together.
+Remember the exercise I left you at the end of the previous section? Let's do it together now.
 
 \subsubsection{Numbered \texttt{idea} and numbered \texttt{idea*}}
 

Modified: branches/branch2021.final/Master/texmf-dist/tex/latex/create-theorem/create-theorem.sty
===================================================================
--- branches/branch2021.final/Master/texmf-dist/tex/latex/create-theorem/create-theorem.sty	2022-03-02 21:36:20 UTC (rev 62347)
+++ branches/branch2021.final/Master/texmf-dist/tex/latex/create-theorem/create-theorem.sty	2022-03-02 21:36:29 UTC (rev 62348)
@@ -13,7 +13,7 @@
 \RequirePackage{l3keys2e}
 \ProvidesExplPackage
   {create-theorem}
-  {2022/02/27} {}
+  {2022/03/01} {}
   {Initializing theorem-like environments with multilingual support}
 
 \keys_define:nn { create-theorem }
@@ -280,7 +280,7 @@
       { % Patch the cref formats so that definite articles are placed outside the hyperlinks
         \bool_if:NT \l__crthm_nameinlink_bool
           { % Use the definite article of the original language, with name's casing depends on the preposition and the article
-            \crefthe_patch_format:nnnnn { 2 } { #4 ref@ #1 @format } { #4 ref@ #1 @name }
+            \crefthe_patch_format:nnnn { #4 ref@ #1 @format } { #4 ref@ #1 @name }
               { \tl_use:c { g_crthm_name_ #4 ref_article_singular_ #2 _ #3 _tl } }
               {
                 \bool_if:NTF \g__crefthe_has_prep_bool
@@ -291,7 +291,7 @@
                     \tl_use:c { g_crthm_name_ #4 ref_singular_ #2 _ #3 _tl }
                   }
               }
-            \crefthe_patch_format:nnnnn { 2 } { #4 ref@ #1 @format at first } { #4 ref@ #1 @name at plural }
+            \crefthe_patch_format:nnnn { #4 ref@ #1 @format at first } { #4 ref@ #1 @name at plural }
               { \tl_use:c { g_crthm_name_ #4 ref_article_plural_ #2 _ #3 _tl } }
               {
                 \bool_if:NTF \g__crefthe_has_prep_bool
@@ -302,7 +302,7 @@
                     \tl_use:c { g_crthm_name_ #4 ref_plural_ #2 _ #3 _tl }
                   }
               }
-            \crefthe_patch_format:nnnnn { 3 } { #4 refrange@ #1 @format } { #4 ref@ #1 @name at plural }
+            \crefthe_patch_format:nnnn { #4 refrange@ #1 @format } { #4 ref@ #1 @name at plural }
               { \tl_use:c { g_crthm_name_ #4 ref_article_plural_ #2 _ #3 _tl } }
               {
                 \bool_if:NTF \g__crefthe_has_prep_bool
@@ -313,7 +313,7 @@
                     \tl_use:c { g_crthm_name_ #4 ref_plural_ #2 _ #3 _tl }
                   }
               }
-            \crefthe_patch_format:nnnnn { 3 } { #4 refrange@ #1 @format at first } { #4 ref@ #1 @name at plural }
+            \crefthe_patch_format:nnnn { #4 refrange@ #1 @format at first } { #4 ref@ #1 @name at plural }
               { \tl_use:c { g_crthm_name_ #4 ref_article_plural_ #2 _ #3 _tl } }
               {
                 \bool_if:NTF \g__crefthe_has_prep_bool
@@ -325,29 +325,29 @@
                   }
               }
             %% Use the definite article of the original language, with name's casing correspond to the article
-            % \crefthe_patch_format:nnnnn { 2 } { #4 ref@ #1 @format } { #4 ref@ #1 @name }
+            % \crefthe_patch_format:nnnn { #4 ref@ #1 @format } { #4 ref@ #1 @name }
             %   { \tl_use:c { g_crthm_name_ #4 ref_article_singular_ #2 _ #3 _tl } }
             %   { \tl_use:c { g_crthm_name_ #4 ref_singular_ #2 _ #3 _tl } }
-            % \crefthe_patch_format:nnnnn { 2 } { #4 ref@ #1 @format at first } { #4 ref@ #1 @name at plural }
+            % \crefthe_patch_format:nnnn { #4 ref@ #1 @format at first } { #4 ref@ #1 @name at plural }
             %   { \tl_use:c { g_crthm_name_ #4 ref_article_plural_ #2 _ #3 _tl } }
             %   { \tl_use:c { g_crthm_name_ #4 ref_plural_ #2 _ #3 _tl } }
-            % \crefthe_patch_format:nnnnn { 3 } { #4 refrange@ #1 @format } { #4 ref@ #1 @name at plural }
+            % \crefthe_patch_format:nnnn { #4 refrange@ #1 @format } { #4 ref@ #1 @name at plural }
             %   { \tl_use:c { g_crthm_name_ #4 ref_article_plural_ #2 _ #3 _tl } }
             %   { \tl_use:c { g_crthm_name_ #4 ref_plural_ #2 _ #3 _tl } }
-            % \crefthe_patch_format:nnnnn { 3 } { #4 refrange@ #1 @format at first } { #4 ref@ #1 @name at plural }
+            % \crefthe_patch_format:nnnn { #4 refrange@ #1 @format at first } { #4 ref@ #1 @name at plural }
             %   { \tl_use:c { g_crthm_name_ #4 ref_article_plural_ #2 _ #3 _tl } }
             %   { \tl_use:c { g_crthm_name_ #4 ref_plural_ #2 _ #3 _tl } }
             %% Use the definite article of the current language, with name's casing correspond to the article
-            % \crefthe_patch_format:nnnnn { 2 } { #4 ref@ #1 @format } { #4 ref@ #1 @name }
+            % \crefthe_patch_format:nnnn { #4 ref@ #1 @format } { #4 ref@ #1 @name }
             %   { \tl_use:c { g_crthm_name_ #4 ref_article_singular_ #2 _ \languagename _tl } }
             %   { \tl_use:c { g_crthm_name_ #4 ref_singular_ #2 _ #3 _tl } }
-            % \crefthe_patch_format:nnnnn { 2 } { #4 ref@ #1 @format at first } { #4 ref@ #1 @name at plural }
+            % \crefthe_patch_format:nnnn { #4 ref@ #1 @format at first } { #4 ref@ #1 @name at plural }
             %   { \tl_use:c { g_crthm_name_ #4 ref_article_plural_ #2 _ \languagename _tl } }
             %   { \tl_use:c { g_crthm_name_ #4 ref_plural_ #2 _ #3 _tl } }
-            % \crefthe_patch_format:nnnnn { 3 } { #4 refrange@ #1 @format } { #4 ref@ #1 @name at plural }
+            % \crefthe_patch_format:nnnn { #4 refrange@ #1 @format } { #4 ref@ #1 @name at plural }
             %   { \tl_use:c { g_crthm_name_ #4 ref_article_plural_ #2 _ \languagename _tl } }
             %   { \tl_use:c { g_crthm_name_ #4 ref_plural_ #2 _ #3 _tl } }
-            % \crefthe_patch_format:nnnnn { 3 } { #4 refrange@ #1 @format at first } { #4 ref@ #1 @name at plural }
+            % \crefthe_patch_format:nnnn { #4 refrange@ #1 @format at first } { #4 ref@ #1 @name at plural }
             %   { \tl_use:c { g_crthm_name_ #4 ref_article_plural_ #2 _ \languagename _tl } }
             %   { \tl_use:c { g_crthm_name_ #4 ref_plural_ #2 _ #3 _tl } }
           }
@@ -356,6 +356,11 @@
 
 \NewDocumentCommand \NameTheorem { m m }
   {
+    \crthm_name_theorem:nn { #1 } { #2 }
+  }
+
+\cs_new:Nn \crthm_name_theorem:nn
+  {
     \tl_set:Nn \l__crthm_current_env_tl { #1 }
     \newcounter { #1 }
     \keys_set:nn { create-theorem-naming } { #2 }
@@ -428,6 +433,14 @@
 
 \NewDocumentCommand \CreateTheorem { m m }
   {
+    \clist_map_inline:nn { #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



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