texlive[62803] Master/texmf-dist: create-theorem (19mar22) (branch)

commits+karl at tug.org commits+karl at tug.org
Sat Mar 19 21:00:30 CET 2022


Revision: 62803
          http://tug.org/svn/texlive?view=revision&revision=62803
Author:   karl
Date:     2022-03-19 21:00:30 +0100 (Sat, 19 Mar 2022)
Log Message:
-----------
create-theorem (19mar22) (branch)

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-03-19 19:34:24 UTC (rev 62802)
+++ trunk/Master/texmf-dist/doc/latex/create-theorem/create-theorem-doc.tex	2022-03-19 20:00:30 UTC (rev 62803)
@@ -85,7 +85,7 @@
 
 \begin{document}
 
-\def\PackageVersion{2022/03/11}
+\def\PackageVersion{2022/03/18}
 
 \title{\createtheorempackage{}\\\smallskip\itshape Initializing theorem-like environments with multilingual support}
 \author{Jinwen XU}
@@ -311,7 +311,7 @@
 Supported keys are:
 \vspace{-.2\baselineskip}
 \begin{itemize}
-    \item \commandoption{name style}\lstinline| = |\meta{configuration}
+    \item \commandoption{name}\lstinline| = |\meta{configuration} and \commandoption{name style}\lstinline| = |\meta{configuration}
         \begin{itemize}
             \item Same as \lstinline|\NameTheorem{|\meta{name of environment}\lstinline|}{|\meta{configuration}\lstinline|}|.
             \item Note that this configuration can overwrite those already specified in \lstinline|\NameTheorem|.
@@ -435,12 +435,11 @@
 \section{Known issues}
 
 \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 later versions so as to support the various situations in German.
-    \item If the option ``\packageoption{name in link}'' is enabled, the ``\packageoption{name as is}'' mode shall take longer time to produce the final result, for the current implementation uses \lstinline|\regexpatchcmd| to patch some of the referencing formats, which is not very efficient.
+    \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 There may be inaccuracies in the translation of those preset names.
 \end{itemize}
 
-% \medskip
+\medskip
 If you run into any issues or have ideas for improvement, feel free to discuss on:
 \begin{center}
     \url{https://github.com/Jinwen-XU/create-theorem/issues}

Modified: trunk/Master/texmf-dist/tex/latex/create-theorem/create-theorem.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/create-theorem/create-theorem.sty	2022-03-19 19:34:24 UTC (rev 62802)
+++ trunk/Master/texmf-dist/tex/latex/create-theorem/create-theorem.sty	2022-03-19 20:00:30 UTC (rev 62803)
@@ -13,7 +13,7 @@
 \RequirePackage{l3keys2e}
 \ProvidesExplPackage
   {create-theorem}
-  {2022/03/11} {}
+  {2022/03/18} {}
   {Initializing theorem-like environments with multilingual support}
 
 \keys_define:nn { create-theorem }
@@ -605,6 +605,10 @@
   { env-not-created }
   { The~theorem-like~environment~"#1"~cannot~be~created,~an~environment~with~the~same~name~has~already~existed. }
 
+\msg_new:nnn { create-theorem }
+  { env-not-named }
+  { The~theorem-like~environment~"#1"~cannot~be~created,~you~have~to~name~it~before~initialization. }
+
 \cs_new:Nn \crthm_create_theorem:nn
   {
     \cs_if_exist:cTF { #1 }
@@ -636,44 +640,56 @@
           }
       }
       {
-        \group_begin:
-        \bool_if:NT \l__crthm_creating_apply_style_bool
+        \cs_if_exist:cTF { c@ #1 }
           {
-            \exp_after:wN \theoremstyle \exp_after:wN { \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 }
+            \group_begin:
+            \bool_if:NTF \l__crthm_creating_apply_style_bool
               {
-                \begin{ #1 _crthm_regional }
+                \exp_args:No \theoremstyle { \l__crthm_creating_apply_style_tl }
               }
               {
-                \begin{ #1 _crthm_regional }[##1]
+                \tl_if_exist:cT { c_crthm_theorem_style_preset_ #1 _tl }
+                  {
+                    \exp_args:Nv \theoremstyle { c_crthm_theorem_style_preset_ #1 _tl }
+                  }
               }
-              \bool_if:NF \l__crthm_regionalref_bool
-                {
-                  \addtocounter   { #1 _crthm_original_\languagename } { -1 }
-                  \refstepcounter { #1 _crthm_original_\languagename }
-                }
+            \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 }
+                  }
+                  {
+                    \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 }
           }
           {
-            \end{ #1 _crthm_regional }
+            \msg_error:nnn  { create-theorem } { env-not-named } { #1 }
           }
-        \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 }
       }
   }
 



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