texlive[73559] Master/texmf-dist: keytheorems (22jan25)

commits+karl at tug.org commits+karl at tug.org
Wed Jan 22 22:06:10 CET 2025


Revision: 73559
          https://tug.org/svn/texlive?view=revision&revision=73559
Author:   karl
Date:     2025-01-22 22:06:09 +0100 (Wed, 22 Jan 2025)
Log Message:
-----------
keytheorems (22jan25)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/keytheorems/CHANGELOG.md
    trunk/Master/texmf-dist/doc/latex/keytheorems/README.md
    trunk/Master/texmf-dist/doc/latex/keytheorems/keytheorems-doc.pdf
    trunk/Master/texmf-dist/doc/latex/keytheorems/keytheorems-doc.tex
    trunk/Master/texmf-dist/tex/latex/keytheorems/class-support/keythms-beamer-support.tex
    trunk/Master/texmf-dist/tex/latex/keytheorems/keytheorems.sty

Modified: trunk/Master/texmf-dist/doc/latex/keytheorems/CHANGELOG.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/keytheorems/CHANGELOG.md	2025-01-22 00:41:33 UTC (rev 73558)
+++ trunk/Master/texmf-dist/doc/latex/keytheorems/CHANGELOG.md	2025-01-22 21:06:09 UTC (rev 73559)
@@ -1,5 +1,9 @@
 # Changelog for keytheorems package
 
+## [v0.2.4]
+- fixed issue with too much expansion in `manual-num`
+- fix [\#14](https://github.com/mbertucci47/keytheorems/issues/14)
+
 ## [v0.2.3]
 - add many translations; some missing translation of "continuing from p."
 - add `manual-num` key
@@ -58,6 +62,7 @@
 ## 0.1.0 - 2024-09-04
 - First release
 
+[v0.2.4]: https://github.com/mbertucci47/keytheorems/compare/v0.2.3...v0.2.4
 [v0.2.3]: https://github.com/mbertucci47/keytheorems/compare/v0.2.2...v0.2.3
 [v0.2.2]: https://github.com/mbertucci47/keytheorems/compare/v0.2.1...v0.2.2
 [v0.2.1]: https://github.com/mbertucci47/keytheorems/compare/v0.1.8...v0.2.1

Modified: trunk/Master/texmf-dist/doc/latex/keytheorems/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/keytheorems/README.md	2025-01-22 00:41:33 UTC (rev 73558)
+++ trunk/Master/texmf-dist/doc/latex/keytheorems/README.md	2025-01-22 21:06:09 UTC (rev 73559)
@@ -640,10 +640,5 @@
 \end{document}
 ```
 
-## Things to do
-
-- Clean up the code. Things are out of order, poorly named, etc.
-- For a complete list, see [`keytheorems-ideas.md`](https://github.com/mbertucci47/keytheorems/blob/develop/keytheorems-ideas.md)
-
 ## License
 Released under the LaTeX Project Public License v1.3c or later. See https://www.latex-project.org/lppl.txt.
\ No newline at end of file

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

Modified: trunk/Master/texmf-dist/doc/latex/keytheorems/keytheorems-doc.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/keytheorems/keytheorems-doc.tex	2025-01-22 00:41:33 UTC (rev 73558)
+++ trunk/Master/texmf-dist/doc/latex/keytheorems/keytheorems-doc.tex	2025-01-22 21:06:09 UTC (rev 73559)
@@ -148,6 +148,7 @@
     colbacklower=ExampleBackLower,
     breakable,
     parbox=false, % so examples match document with indent, etc.
+    minted options app={breaksymbolleft={}},
     #1
   }
 \newtcolorbox{notebox}[1][]{enhanced,
@@ -305,7 +306,7 @@
 
 \begin{keythmscode}[withpreamble]
 \begin{theorem}
-Some text
+There are infinitely many prime numbers.
 \end{theorem}
 \end{keythmscode}
 
@@ -327,8 +328,8 @@
 As in \pkg{amsthm}, theorems can take an optional argument that contains a note or heading.
 
 \begin{keythmscode}[]
-\begin{theorem}[some heading]
-Some text
+\begin{theorem}[Bertrand's postulate]
+For every $n\geq 1$, there is a prime number $p$ with $n<p\leq 2n$.
 \end{theorem}
 \end{keythmscode}
 
@@ -342,8 +343,10 @@
 This syntax, however, allows the argument to contain other keys.
 
 \begin{keythmscode}[]
-\begin{theorem}[note=another heading]
-Some more text
+\begin{theorem}[note=Legendre's formula]
+The number $n!$ contains the prime factor $p$ exactly
+  \[ \sum_{k\geq 1} \Bigl\lfloor\frac{n}{p^k}\Bigr\rfloor \]
+times.
 \end{theorem}
 \end{keythmscode}
 
@@ -362,10 +365,10 @@
 This is the key-value equivalent of |\begin{theorem}| \cs{label}\marg{label name}.
 
 \begin{keythmscode}[]
-\begin{theorem}[label=foo]
-Some text
+\begin{theorem}[label=bezout]
+Let $a$ and $b$ be integers. Then there exist integers $x$ and $y$ such that $ax+by=\gcd(a,b)$.
 \end{theorem}
-\ref{foo}
+See \zcref{bezout}.
 \end{keythmscode}
 
 \end{docKey}
@@ -377,8 +380,8 @@
 It is useful for making ``starred'' versions of other theorems, perhaps to represent a reformulated or more difficult version.
 
 \begin{keythmscode}[]
-\begin{theorem}[manual-num=\ref*{foo}*]
-A reformulated version of \zcref[S]{foo}.
+\begin{theorem}[manual-num=\ref*{bezout}*]
+Let $a_1,\dots,a_n$ be integers. Then there exist integers $x_1,\dots,x_n$ such that $a_1x_1+\dots+a_nx_n=\gcd(a_1,\dots,a_n)$.
 \end{theorem}
 \begin{theorem}[manual-num=\faRocket] % requires fontawesome5
 Don't confuse your readers by changing the numbering without good reason.
@@ -395,8 +398,8 @@
 The starred version also copies the theorem note, if it exists.
 
 \begin{keythmscode}[]
-\begin{theorem}[continues=foo]
-\dots and some more text.
+\begin{theorem}[continues=bezout]
+Moreover, the integers of the form $az+bt$ are exactly the multiples of $\gcd(a,b)$.
 \end{theorem}
 \end{keythmscode}
 
@@ -428,15 +431,16 @@
 \end{codepreamble}
 
 \begin{keythmscode}[withpreamble]
-\begin{lemma}[store=diagram]
-Some commutative diagram:
+\begin{lemma}[store=fiberprod]
+For any $S$-schemes $X$ and $Y$, there exists a scheme $X\times_S Y$ with morphisms to $X$ and $Y$ such that the diagram
 \[\begin{tikzcd}[ampersand replacement=\&]
     X\times_S Y \ar[r] \ar[d] \& X \ar[d] \\
     Y \ar[r] \& S
-\end{tikzcd}\]
+  \end{tikzcd}\]
+commutes and is universal with respect to this property.
 \end{lemma}
 \dots
-\getkeytheorem{diagram}
+\getkeytheorem{fiberprod}
 \end{keythmscode}
 
 \end{docKey}
@@ -451,7 +455,8 @@
 \begin{theorem}[
   store=rktest,
   note=ORIGINAL,
-  restate-keys={note=RESTATED}]
+  restate-keys={note=RESTATED}
+  ]
 Wow, yet another theorem.
 \end{theorem}
 \getkeytheorem{rktest}
@@ -474,6 +479,7 @@
 \begin{observation}
 \begin{enumerate}
 \item First item
+\item Second item
 \end{enumerate}
 \end{observation}
 
@@ -480,6 +486,7 @@
 \begin{observation}[listhack=true]
 \begin{enumerate}
 \item First item
+\item Second item
 \end{enumerate}
 \end{observation}
 \end{keythmscode}
@@ -577,7 +584,7 @@
 
 \begin{keythmscode}[withpreamble]
 \begin{remark}
-Some text
+It's nice to distinguish remarks from definitions and theorems.
 \end{remark}
 \end{keythmscode}
 
@@ -601,7 +608,7 @@
   postheadhook=POSTHEAD,
   prefoothook=PREFOOT,
   postfoothook=POSTFOOT
-]
+  ]
 \end{codepreamble}
 
 \begin{keythmscode}[withpreamble]
@@ -625,10 +632,10 @@
 
 \begin{keythmscode}[withpreamble]
 \begin{example}
-Some text
+Some text.
 \end{example}
 \begin{solution}
-Some more text
+Some more text.
 \end{solution}
 \end{keythmscode}
 
@@ -658,14 +665,12 @@
 
 \begin{keythmscode}[withpreamble]
 \begin{prop}[label=abc]
-Some text
+Some text.
 \end{prop}
 \begin{prop}[label=def]
-Some more text
+Some more text.
 \end{prop}
-\begin{theorem}
 Consider \zcref{abc,def}. \Autoref{abc} \dots
-\end{theorem}
 \end{keythmscode}
 
 \end{docKey}
@@ -736,10 +741,10 @@
 
 \begin{keythmscode}[withpreamble]
 \begin{corollary}
-Some text
+Some text.
 \end{corollary}
 \begin{definition}[A nice definition]
-Some more text
+Some more text.
 \end{definition}
 \end{keythmscode}
 
@@ -759,7 +764,7 @@
 
 \begin{keythmscode}[withpreamble]
 \begin{boxcor}
-Some text
+Some text.
 \end{boxcor}
 \end{keythmscode}
 
@@ -783,12 +788,13 @@
   }
 \newkeytheorem{mytheo}[
   name=My Theorem,
-  style=tcb-standard]
+  style=tcb-standard
+  ]
 \end{codepreamble}
 
 \begin{keythmscode}[withpreamble]
 \begin{mytheo}[This is my title]
-Some theorem text
+Some theorem text.
 \end{mytheo}
 \end{keythmscode}
 
@@ -952,9 +958,7 @@
 
 \begin{keythmscode}[]
 \begin{example}[store=hmm]
-I am the
-\IfRestatingTF{restated}{original}
-example!
+I am the \IfRestatingTF{restated}{original} example!
 \end{example}
 
 \getkeytheorem{hmm}
@@ -1263,7 +1267,6 @@
 \end{dispListing}
 
 At a minimum, the |testphase| modules |phase-III| and |firstaid| are required.
-The GitHub tests folder contains an example of a tagged PDF using \pkg{keytheorems}: \href{https://github.com/mbertucci47/keytheorems/blob/develop/tests/tagged-keytheorems-amsthmtest.tex}{\texttt{tagged-keytheorems-amsthmtest.tex}}.
 
 \subsection{Public coding interfaces}
 
@@ -1289,7 +1292,7 @@
 \section{Further examples}
 
 More examples will be added soon -- rather, eventually\dots{}
-For now, you can find a \pkg{keytheorems} adaptation of \pkg{amsthm}'s classic file \href{https://mirrors.ctan.org/macros/latex/required/amscls/doc/thmtest.tex}{\texttt{thmtest.tex}} in the Github \texttt{tests} folder: \href{https://github.com/mbertucci47/keytheorems/blob/develop/tests/keytheorems-amsthmtest.tex}{\texttt{keytheorems-amsthmtest.tex}}.
+For now, you can find a \pkg{keytheorems} adaptation of \pkg{amsthm}'s classic \href{https://mirrors.ctan.org/macros/latex/required/amscls/doc/thmtest.tex}{\texttt{thmtest.tex}} in the Github \texttt{tests} folder: \href{https://github.com/mbertucci47/keytheorems/blob/develop/tests/keytheorems-amsthmtest.tex}{\texttt{keytheorems-amsthmtest.tex}}. There is also a version for tagged PDF: \href{https://github.com/mbertucci47/keytheorems/blob/develop/tests/tagged-keytheorems-amsthmtest.tex}{\texttt{tagged-keytheorems-amsthmtest.tex}}.
 
 %\section{Implementation}
 %\inputminted[linenos,style=bw]{latex}{../keytheorems.sty}

Modified: trunk/Master/texmf-dist/tex/latex/keytheorems/class-support/keythms-beamer-support.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/keytheorems/class-support/keythms-beamer-support.tex	2025-01-22 00:41:33 UTC (rev 73558)
+++ trunk/Master/texmf-dist/tex/latex/keytheorems/class-support/keythms-beamer-support.tex	2025-01-22 21:06:09 UTC (rev 73559)
@@ -253,10 +253,10 @@
                   \cs_new:cpe
                     { __keythms_getthm_ \l__keythms_thmuse_store_tl _body }
                     {
-                      \exp_not:N \__keythms_getthm_body:nn
+                      \exp_not:N \__keythms_getthm_body:nnn
                       \exp_args:No \exp_not:o
                         {
-                          \exp_after:wN \__keythms_use_iii_v_braced:nnnnn
+                          \exp_after:wN \__keythms_use_i_iii_v_braced:nnnnn
                             \g__keythms_thmuse_temprestatedata_tl
                         }
                     }

Modified: trunk/Master/texmf-dist/tex/latex/keytheorems/keytheorems.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/keytheorems/keytheorems.sty	2025-01-22 00:41:33 UTC (rev 73558)
+++ trunk/Master/texmf-dist/tex/latex/keytheorems/keytheorems.sty	2025-01-22 21:06:09 UTC (rev 73559)
@@ -2,8 +2,8 @@
 % Please report all issues and feature requests at https://github.com/mbertucci47/keytheorems
 % This work is licensed under the LPPL version 1.3c or later: https://www.latex-project.org/lppl.txt
 \NeedsTeXFormat{LaTeX2e}[2023-06-01]
-\def\@keythms at date{2025-01-07}
-\def\@keythms at version{0.2.3}
+\def\@keythms at date{2025-01-21}
+\def\@keythms at version{0.2.4}
 \ProvidesExplPackage{keytheorems}{\@keythms at date}{\@keythms at version}
   {l3keys interface to amsthm}
 
@@ -1212,10 +1212,10 @@
                   \cs_new:cpe
                     { __keythms_getthm_ \l__keythms_thmuse_store_tl _body }
                     {
-                      \exp_not:N \__keythms_getthm_body:nn
+                      \exp_not:N \__keythms_getthm_body:nnn
                       \exp_args:No \exp_not:o
                         {
-                          \exp_after:wN \__keythms_use_iii_v_braced:nnnnn
+                          \exp_after:wN \__keythms_use_i_iii_v_braced:nnnnn
                             \g__keythms_thmuse_temprestatedata_tl
                         }
                     }
@@ -1243,7 +1243,7 @@
             }
         }
   }
-\cs_new:Npn \__keythms_use_iii_v_braced:nnnnn #1#2#3#4#5 { {#3}{#5} }
+\cs_new:Npn \__keythms_use_i_iii_v_braced:nnnnn #1#2#3#4#5 { {#1}{#3}{#5} }
 
 % withhooks_begin does not include prehead hook because we want to be able to access note
 \cs_new_protected:Npn \__keythms_withhooks_begin:nnn #1#2#3
@@ -1300,7 +1300,10 @@
       }
     \tl_if_empty:NF \l__keythms_thmuse_manualnum_tl
       {
-        \cs_set:cpn { the #1 } { \l__keythms_thmuse_manualnum_tl }
+        \cs_set:cpn { the #1 }
+          { % prevent expansion for unexpandable tokens in \the<counter>
+            \exp_not:N \exp_not:n { \l__keythms_thmuse_manualnum_tl }
+          }
         \cs_set_eq:cN { c@ #1 } \c at keythms_manualnum_dummyctr
         \cs_set_eq:cN { theH #1 } \theHkeythms_manualnum_dummyctr
       }
@@ -1398,11 +1401,11 @@
 
 \keys_define:nn { keytheorems/storeatbegin }
   {
-    restate  .meta:n      = { store = {#1} },
-    restate* .meta:n      = { store* = {#1} },
-    store    .tl_set:N    = \l__keythms_storeatbegin_store_tl,
-    store*   .tl_set:N    = \l__keythms_storeatbegin_storereversed_tl,
-    unknown  .code:n      = { } % do nothing with unknown keys
+    restate  .meta:n   = { store = {#1} },
+    restate* .meta:n   = { store* = {#1} },
+    store    .tl_set:N = \l__keythms_storeatbegin_store_tl,
+    store*   .tl_set:N = \l__keythms_storeatbegin_storereversed_tl,
+    unknown  .code:n   = { } % do nothing with unknown keys
   }
 
 \cs_new_protected:Npn \KeyThmsContentsLine #1 { }
@@ -1444,7 +1447,7 @@
             \cs_new_protected:cpn
               { __keythms_getthm_ \l__keythms_storeatbegin_store_tl _body }
               {
-                \__keythms_getthm_body:nn {#5}{#7}
+                \__keythms_getthm_body:nnn {#1}{#5}{#7}
               }
           }
         \tl_if_empty:NF \l__keythms_storeatbegin_storereversed_tl
@@ -1458,7 +1461,7 @@
             \cs_new_protected:cpn
               { __keythms_getthm_ \l__keythms_storeatbegin_storereversed_tl _body }
               {
-                \__keythms_getthm_body:nn {#5}{#7}
+                \__keythms_getthm_body:nnn {#1}{#5}{#7}
               }
           }
         \group_end:
@@ -1549,11 +1552,11 @@
     \group_end:
   }
 
-\cs_new_protected:Npn \__keythms_getthm_body:nn #1#2
-  { % #1 = restate counters, #2 = theorem body
+\cs_new_protected:Npn \__keythms_getthm_body:nnn #1#2#3
+  { % #1 = name, #2 = restate counters, #3 = theorem body
     \group_begin:
     \bool_set_true:N \l__keythms_thmuse_restating_bool
-    \prop_set_from_keyval:Nn \l__keythms_restate_counters_prop { #1 }
+    \prop_set_from_keyval:Nn \l__keythms_restate_counters_prop { #2 }
     \prop_map_inline:Nn \l__keythms_restate_counters_prop
       {
         \tl_set:ce { l_keythms_restate_current_##1_tl } { \the\value{##1} }
@@ -1565,9 +1568,9 @@
           { \use:c { the ##1 } . \theHkeythms_restate_dummyctr }
       }
     \refstepcounter{keythms_restate_dummyctr}
-    % \hook_use:n { keytheorems/#1/restated } % FIX!
+    \hook_use:n { keytheorems/#1/restated }
     \hook_use:n { keytheorems/allthms/restated }
-    #2
+    #3
     \prop_map_inline:Nn \l__keythms_restate_counters_prop
       {
         \exp_args:Nnc \setcounter { ##1 }
@@ -1606,10 +1609,10 @@
         \cs_new:cpe
           { __keythms_getthm_ \l__keythms_thmuse_storereversed_tl _body }
           {
-            \exp_not:N \__keythms_getthm_body:nn
+            \exp_not:N \__keythms_getthm_body:nnn
             \exp_args:No \exp_not:o
               {
-                \exp_after:wN \__keythms_use_iii_v_braced:nnnnn
+                \exp_after:wN \__keythms_use_i_iii_v_braced:nnnnn
                   \g__keythms_thmuse_temprestatedata_tl
               }
           }



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