texlive[70020] Master/texmf-dist: create-theorem (20feb24)

commits+karl at tug.org commits+karl at tug.org
Tue Feb 20 22:05:57 CET 2024


Revision: 70020
          https://tug.org/svn/texlive?view=revision&revision=70020
Author:   karl
Date:     2024-02-20 22:05:57 +0100 (Tue, 20 Feb 2024)
Log Message:
-----------
create-theorem (20feb24)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/create-theorem/README.md
    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/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/create-theorem/README.md	2024-02-20 21:05:47 UTC (rev 70019)
+++ trunk/Master/texmf-dist/doc/latex/create-theorem/README.md	2024-02-20 21:05:57 UTC (rev 70020)
@@ -1,4 +1,4 @@
-<!-- Copyright (C) 2021-2023 by Jinwen XU -->
+<!-- Copyright (C) 2021-2024 by Jinwen XU -->
 
 # `create-theorem` - Initializing and configuring theorem-like environments, with multilingual support
 

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	2024-02-20 21:05:47 UTC (rev 70019)
+++ trunk/Master/texmf-dist/doc/latex/create-theorem/create-theorem-doc.tex	2024-02-20 21:05:57 UTC (rev 70020)
@@ -107,13 +107,13 @@
 
 \begin{document}
 
-\def\PackageVersion{2023/07/23}
+\def\PackageVersion{2024/02/20}
 \def\PackageSubVersion{}
 
 \title{\createtheorempackage{}\\\smallskip\itshape Initializing and configuring theorem-like environments, with multilingual support}
 \author{Jinwen XU}
 \thanks{Corresponding to: \texttt{\createtheorempackage{} \PackageVersion\PackageSubVersion}}
-\date{\TheDate{\PackageVersion}[only-year-month], in Beijing}
+\date{\TheDate{\PackageVersion}[only-year-month], in Paris}
 
 \maketitle
 
@@ -725,7 +725,9 @@
 \section{Known issues}
 
 \begin{itemize}
-    \item \createtheorempackage{} modifies some undocumented internal macros of \textsf{cleveref}, so the behaviour might not be stable if \textsf{cleveref} gets updated.
+    \item \createtheorempackage{} modifies some undocumented internal macros of \textsf{cleveref}, so the behavior might not be stable if \textsf{cleveref} gets updated one day.
+    \item The current naming mechanism for theorems essentially follows the syntax of \textsf{cleveref}. The configuration may look somewhat redundant. In a future version, a new mechanism is planed to be introduced, which would be similar to the method used by \textsf{zref-clever}.
+    \item It is current not possible to temporarily change the referencing type when referencing, which makes it difficult to reference a \textquote{\texttt{namedtheorem}}, or if you have both the singular and plural form of an environment, say \textquote{\texttt{example}} and \textquote{\texttt{examples}}, they would be referred to as two separate types.
     \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}

Modified: trunk/Master/texmf-dist/tex/latex/create-theorem/create-theorem.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/create-theorem/create-theorem.sty	2024-02-20 21:05:47 UTC (rev 70019)
+++ trunk/Master/texmf-dist/tex/latex/create-theorem/create-theorem.sty	2024-02-20 21:05:57 UTC (rev 70020)
@@ -1,5 +1,5 @@
 %%
-%% Copyright (C) 2021-2023 by Jinwen XU
+%% Copyright (C) 2021-2024 by Jinwen XU
 %% ------------------------------------
 %%
 %% This file may be distributed and/or modified under the conditions of
@@ -12,7 +12,7 @@
 \NeedsTeXFormat{LaTeX2e}[2022-06-01]
 \ProvidesExplPackage
   {create-theorem}
-  {2023/07/23} {}
+  {2024/02/20} {}
   {Initializing theorem-like environments with multilingual support}
 
 \keys_define:nn { create-theorem }
@@ -346,7 +346,8 @@
       }
 
     % Redefine the cref formats so that definite articles are placed outside the hyperlinks
-    \crthm_define_format_short_version:nnnn { #2 } { #4 ref@ #1 @format }
+    \crthm_modify_format_according_to_nameinlink:nnn
+      { \crthm_define_format_short_version:nnnn { #2 } { #4 ref@ #1 @format } }
       { \tl_use:c { g_crthm_name_ #4 ref_article_singular_ #2 _ #3 _tl } }
       {
         \bool_if:NTF \g__crefthe_has_prep_bool
@@ -357,7 +358,8 @@
             \tl_use:c { g_crthm_name_ #4 ref_singular_ #2 _ #3 _tl }
           }
       }
-    \crthm_define_format_short_version:nnnn { #2 } { #4 ref@ #1 @format at first }
+    \crthm_modify_format_according_to_nameinlink:nnn
+      { \crthm_define_format_short_version:nnnn { #2 } { #4 ref@ #1 @format at first } }
       { \tl_use:c { g_crthm_name_ #4 ref_article_plural_ #2 _ #3 _tl } }
       {
         \bool_if:NTF \g__crefthe_has_prep_bool
@@ -390,7 +392,8 @@
         \group_end:
       }
 
-    \crthm_define_format_long_version:nnnn { #2 } { #4 refrange@ #1 @format }
+    \crthm_modify_format_according_to_nameinlink:nnn
+      { \crthm_define_format_long_version:nnnn { #2 } { #4 refrange@ #1 @format } }
       { \tl_use:c { g_crthm_name_ #4 ref_article_plural_ #2 _ #3 _tl } }
       {
         \bool_if:NTF \g__crefthe_has_prep_bool
@@ -401,7 +404,8 @@
             \tl_use:c { g_crthm_name_ #4 ref_plural_ #2 _ #3 _tl }
           }
       }
-    \crthm_define_format_long_version:nnnn { #2 } { #4 refrange@ #1 @format at first }
+    \crthm_modify_format_according_to_nameinlink:nnn
+      { \crthm_define_format_long_version:nnnn { #2 } { #4 refrange@ #1 @format at first } }
       { \tl_use:c { g_crthm_name_ #4 ref_article_plural_ #2 _ #3 _tl } }
       {
         \bool_if:NTF \g__crefthe_has_prep_bool
@@ -507,11 +511,26 @@
       }
   }
 
+\cs_new:Nn \crthm_modify_format_according_to_nameinlink:nnn
+  % #1 = the macro (and argument) to be used
+  % #2 = content always before the hyperlink beginning mark
+  % #3 = content before or after the hyperlink beginning mark, depending on whether nameinlink=true
+  {
+    \bool_if:NTF \l__crthm_nameinlink_bool
+      {
+        #1 { #2 } { #3 }
+      }
+      {
+        #1 { #2 #3 \nobreakspace } { }
+      }
+  }
+
 \cs_new:Nn \crthm_define_format_short_version:nnnn
-  { % #1 = name of the environment
-    % #2 = name of the format command
-    % #3 = content before the hyperlink beginning mark
-    % #4 = content after the hyperlink beginning mark
+  % #1 = name of the environment
+  % #2 = name of the format command
+  % #3 = content before the hyperlink beginning mark
+  % #4 = content after the hyperlink beginning mark
+  {
     \cs_if_exist:cF { crthm_format_ #2 :nnn }
       {
         \cs_new:cn { crthm_format_ #2 :nnn }
@@ -524,10 +543,11 @@
       }
   }
 \cs_new:Nn \crthm_define_format_long_version:nnnn
-  { % #1 = name of the environment
-    % #2 = name of the format command
-    % #3 = content before the hyperlink beginning mark
-    % #4 = content after the hyperlink beginning mark
+  % #1 = name of the environment
+  % #2 = name of the format command
+  % #3 = content before the hyperlink beginning mark
+  % #4 = content after the hyperlink beginning mark
+  {
     \cs_if_exist:cF { crthm_format_ #2 :nnnnnn }
       {
         \cs_new:cn { crthm_format_ #2 :nnnnnn }
@@ -939,6 +959,8 @@
   { The~theorem-like~environment~"#1"~cannot~be~created,~you~have~to~name~it~before~initialization. }
 
 \cs_new:Nn \crthm_create_theorem:nn
+  % #1 = env name
+  % #2 = options
   {
     \tl_set:Nn \l__crthm_current_env_tl { #1 }
     \bool_set_false:N \l__crthm_creating_apply_style_bool



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