texlive[72516] Master/texmf-dist: keytheorems (10oct24)

commits+karl at tug.org commits+karl at tug.org
Thu Oct 10 21:42:32 CEST 2024


Revision: 72516
          https://tug.org/svn/texlive?view=revision&revision=72516
Author:   karl
Date:     2024-10-10 21:42:31 +0200 (Thu, 10 Oct 2024)
Log Message:
-----------
keytheorems (10oct24)

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-amsart-support.tex
    trunk/Master/texmf-dist/tex/latex/keytheorems/class-support/keythms-amsbook-support.tex
    trunk/Master/texmf-dist/tex/latex/keytheorems/class-support/keythms-amsproc-support.tex
    trunk/Master/texmf-dist/tex/latex/keytheorems/class-support/keythms-beamer-support.tex
    trunk/Master/texmf-dist/tex/latex/keytheorems/class-support/keythms-memoir-support.tex
    trunk/Master/texmf-dist/tex/latex/keytheorems/keytheorems.sty

Added Paths:
-----------
    trunk/Master/texmf-dist/tex/latex/keytheorems/class-support/keythms-IEEEtran-support.tex
    trunk/Master/texmf-dist/tex/latex/keytheorems/class-support/keythms-jlreq-support.tex

Modified: trunk/Master/texmf-dist/doc/latex/keytheorems/CHANGELOG.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/keytheorems/CHANGELOG.md	2024-10-10 19:42:15 UTC (rev 72515)
+++ trunk/Master/texmf-dist/doc/latex/keytheorems/CHANGELOG.md	2024-10-10 19:42:31 UTC (rev 72516)
@@ -1,5 +1,9 @@
 # Changelog for keytheorems package
 
+## [v0.1.7]
+- add support for aomart class
+- add support for Michael Sharpe's font packages that change plain style
+
 ## [v0.1.6]
 - add `\renewkeytheorem`, `\providekeytheorem`, and `\declarekeytheorem`
 - tcolorbox theorems no longer error with beamer
@@ -36,6 +40,7 @@
 ## 0.1.0 - 2024-09-04
 - First release
 
+[unreleased]: https://github.com/mbertucci47/keytheorems/compare/v0.1.6...develop
 [v0.1.6]: https://github.com/mbertucci47/keytheorems/compare/v0.1.5...v0.1.6
 [v0.1.5]: https://github.com/mbertucci47/keytheorems/compare/v0.1.4...v0.1.5
 [v0.1.4]: https://github.com/mbertucci47/keytheorems/compare/v0.1.3...v0.1.4

Modified: trunk/Master/texmf-dist/doc/latex/keytheorems/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/keytheorems/README.md	2024-10-10 19:42:15 UTC (rev 72515)
+++ trunk/Master/texmf-dist/doc/latex/keytheorems/README.md	2024-10-10 19:42:31 UTC (rev 72516)
@@ -434,6 +434,46 @@
 \end{document}
 ```
 
+### [beamer theorem syntax not fully supported #57](https://github.com/muzimuzhi/thmtools/issues/57)
+Fixed in keytheorems.
+```tex
+\documentclass{beamer}
+\setbeamertemplate{theorems}[numbered]
+\usepackage{keytheorems}
+
+\newkeytheorem{MyTheorem}
+
+\begin{document}
+
+\begin{frame}
+\begin{MyTheorem}[name=bla]
+first text
+\end{MyTheorem}
+\begin{MyTheorem}<2->[name=bla]
+second text
+\end{MyTheorem}
+\begin{MyTheorem}[name=bla]<3->
+third text
+\end{MyTheorem}
+\end{frame}
+
+% Compare:
+
+\begin{frame}
+\begin{theorem}[bla]
+first text
+\end{theorem}
+\begin{theorem}<2->[bla]
+second text
+\end{theorem}
+\begin{theorem}[bla]<3->
+third text
+\end{theorem}
+\end{frame}
+
+\end{document}
+```
+
 ### [restate key incompatible with beamer #58](https://github.com/muzimuzhi/thmtools/issues/58)
 ```tex
 \documentclass{beamer}

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	2024-10-10 19:42:15 UTC (rev 72515)
+++ trunk/Master/texmf-dist/doc/latex/keytheorems/keytheorems-doc.tex	2024-10-10 19:42:31 UTC (rev 72516)
@@ -22,11 +22,13 @@
 \usepackage{keytheorems}
 \usepackage{cleveref}
 
-\def\version{0.1.6}
+\makeatletter
+\newcommand\keythmsversion{\@keythms at version}
+\makeatother
 
 \title{%
   \pkg{keytheorems} package \\[1ex]
-  \large version \version \\[1ex]
+  \large version \keythmsversion \\[1ex]
   \href{https://github.com/mbertucci47/keytheorems}
     {\texttt{github.com/mbertucci47/keytheorems}}
   }
@@ -705,6 +707,7 @@
 \end{keythmscode}
 
 \section{Theorem styles}
+\label{thmstyles}
 
 \begin{docCommand}{newkeytheoremstyle}
   {\marg{name}\marg{options}}
@@ -718,7 +721,7 @@
 \end{docCommand}
 
 \begin{notebox}
-For the AMS classes \cls{amsart}, \cls{amsbook}, and \cls{amsproc}, as well as the \cls{amsart}-based \cls{acmart}, the initial key values are slightly different than what's below in order to match those class's defaults.
+For the AMS classes \cls{amsart}, \cls{amsbook}, and \cls{amsproc}, as well as the \cls{amsart}-based \cls{acmart} and \cls{aomart}, the initial key values are slightly different than what's below in order to match those class's defaults. See \autoref{class-support} for details.
 \end{notebox}
 
 \subsection{Keys also defined in \pkg{thmtools}}
@@ -870,6 +873,7 @@
 \end{docCommands}
 
 \section{Listing theorems}
+\label{listingthms}
 
 \begin{docCommand}{listofkeytheorems}
   {\oarg{options}}
@@ -887,7 +891,7 @@
 \listofkeytheorems
 \end{keythmscode}
 
-\subsection{Keys inherited from \pkg{thmtools}}
+\subsection{Keys also defined in \pkg{thmtools}}
 
 \begin{docKey}{ignore}
   {=\marg{comma-list of env names}}
@@ -1136,6 +1140,17 @@
 
 User feedback is necessary to make this code fully compatible. Please report issues on the \href{https://github.com/mbertucci47/keytheorems/issues}{Github page}!
 
+\subsection{Support for other classes}
+\label{class-support}
+
+As mentioned in \autoref{thmstyles}, the initial style key values set by \pkg{keytheorems} are adjusted for the AMS classes \cls{amsart}, \cls{amsbook}, and \cls{amsproc}, as well as the \cls{amsart}-based \cls{acmart} and \cls{aomart}. You can find the exact changed values in the support files \texttt{keythms-\meta{class}-support.tex}.
+
+These class support files also contain code to adapt to class' formatting of lists-of as mentioned in \autoref{listingthms}; changes are made for the AMS classes, \cls{memoir}, \cls{IEEEtran}, and \cls{jlreq}.
+
+\subsection{Support for font packages}
+
+Some font packages, all by Michael Sharpe, offer a |theoremfont| option that redefines the |plain| style body font to have italic text with upright figures, punctuation, and delimiters. \pkg{keytheorems} detects this option and sets its initial style values accordingly. The supported packages are \pkg{baskervillef}, \pkg{cochineal}, \pkg{libertinust1math}, \pkg{newpxtext}, \pkg{newtxtext}, \pkg{scholax}, and \pkg{XCharter}.
+ 
 \subsection{Public coding interfaces}
 
 \begin{itemize}

Added: trunk/Master/texmf-dist/tex/latex/keytheorems/class-support/keythms-IEEEtran-support.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/keytheorems/class-support/keythms-IEEEtran-support.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/keytheorems/class-support/keythms-IEEEtran-support.tex	2024-10-10 19:42:31 UTC (rev 72516)
@@ -0,0 +1,15 @@
+% Maintained by Matthew Bertucci, 2024-present
+% 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
+\ProvidesExplFile{keythms-IEEEtran-support}{\@keythms at date}{\@keythms at version}
+  {keytheorems~support~for~the~IEEEtran~class}
+
+\keys_define:nn { keytheorems/listof }
+  {
+    indent   .initial:n = 0pt,
+    numwidth .initial:n = 2.75em,
+  }
+
+% IEEEtran has it's own way of doing theorems that amsthm overwrites.
+% Not sure if we should attempt to copy its style.
+\file_input_stop:
\ No newline at end of file


Property changes on: trunk/Master/texmf-dist/tex/latex/keytheorems/class-support/keythms-IEEEtran-support.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/tex/latex/keytheorems/class-support/keythms-amsart-support.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/keytheorems/class-support/keythms-amsart-support.tex	2024-10-10 19:42:15 UTC (rev 72515)
+++ trunk/Master/texmf-dist/tex/latex/keytheorems/class-support/keythms-amsart-support.tex	2024-10-10 19:42:31 UTC (rev 72516)
@@ -1,37 +1,87 @@
 % Maintained by Matthew Bertucci, 2024-present
 % 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
-\ProvidesExplFile{keythms-amsart-support}{2024-10-05}{0.1.6}
+\ProvidesExplFile{keythms-amsart-support}{\@keythms at date}{\@keythms at version}
   {keytheorems~support~for~the~amsart~class}
 
 \__keythms_support_AMSshared_code:
 
-\IfClassLoadedTF { acmart }
-  { % acmart loads amsart
-    \keytheoremset{overload} % since acmart predefines several theorems
-    \prop_gput_from_keyval:Nn \g__keythms_thmstyle_defaultkeys_prop
+\keys_define:nn { keytheorems/thmstyle }
+  {
+    inherit-style / remark .meta:n =
       {
-        bodyfont      = \@acmplainbodyfont,
-        headfont      = \@acmplainheadfont,
-        headindent    = \@acmplainindent,
-        notefont      = \@acmplainnotefont,
-        postheadspace = .5em,
-        spaceabove    = .5\baselineskip plus .2\baselineskip minus .2\baselineskip,
-        spacebelow    = .5\baselineskip plus .2\baselineskip minus .2\baselineskip,
+        bodyfont = \normalfont,
+        headfont = \itshape,
       }
-    \keys_define:nn { keytheorems/thmstyle }
+  }
+
+\bool_case:nF
+  {
+    { \__keythms_if_classloaded_p:n { acmart } }
       {
-        inherit-style / acmplain      .meta:n = {},
-        inherit-style / acmdefinition .meta:n =
+        \keytheoremset{overload} % since acmart predefines several theorems at begindocument
+        \prop_gput_from_keyval:Nn \g__keythms_thmstyle_defaultkeys_prop
           {
-            bodyfont   = \@acmdefinitionbodyfont,
-            headindent = \@acmdefinitionindent,
-            headfont   = \@acmdefinitionheadfont,
-            notefont   = \@acmdefinitionnotefont,
-          },
+            bodyfont      = \@acmplainbodyfont,
+            headfont      = \@acmplainheadfont,
+            headindent    = \@acmplainindent,
+            notefont      = \@acmplainnotefont,
+            postheadspace = .5em,
+            spaceabove    =
+              .5\baselineskip plus .2\baselineskip minus .2\baselineskip,
+            spacebelow    =
+              .5\baselineskip plus .2\baselineskip minus .2\baselineskip,
+          }
+        \keys_define:nn { keytheorems/thmstyle }
+          {
+            inherit-style / acmplain      .meta:n = {},
+            inherit-style / acmdefinition .meta:n =
+              {
+                bodyfont   = \@acmdefinitionbodyfont,
+                headindent = \@acmdefinitionindent,
+                headfont   = \@acmdefinitionheadfont,
+                notefont   = \@acmdefinitionnotefont,
+              },
+          }
       }
+    { \__keythms_if_classloaded_p:n { aomart } }
+      {
+        \prop_gput_from_keyval:Nn \g__keythms_thmstyle_defaultkeys_prop
+          {
+            bodyfont      = \sishape,
+            headfont      = \scshape,
+            headindent    = \parindent,
+            notefont      = \normalfont,
+            postheadspace = 0.5em,
+            spaceabove    = 0.5\linespacing,
+            spacebelow    = 0.5\linespacing,
+          }
+        \keys_define:nn { keytheorems/thmstyle }
+          {
+            inherit-style / definition .meta:n =
+              {
+                bodyfont      = \upshape,
+                headfont      = \sishape,
+                headindent    = \parindent,
+                notefont      = \normalfont,
+                postheadspace = 0.5em,
+                spaceabove    = 0.5\linespacing,
+                spacebelow    = 0.5\linespacing,
+              },
+            inherit-style / remark .meta:n =
+              {
+                bodyfont      = \upshape,
+                headfont      = \sishape,
+                headindent    = \parindent,
+                notefont      = \normalfont,
+                postheadspace = 0.5em,
+                spaceabove    = 0.5\linespacing,
+                spacebelow    = 0.5\linespacing,
+              },
+          }
+      }
   }
-  {
+  { % the amsart defaults
     \prop_gput_from_keyval:Nn \g__keythms_thmstyle_defaultkeys_prop
       {
         spaceabove = .5\baselineskip plus .2\baselineskip minus .2\baselineskip,
@@ -39,13 +89,4 @@
       }
   }
 
-\keys_define:nn { keytheorems/thmstyle }
-  {
-    inherit-style / remark .meta:n =
-      {
-        bodyfont = \normalfont,
-        headfont = \itshape,
-      }
-  }
-
 \file_input_stop:
\ No newline at end of file

Modified: trunk/Master/texmf-dist/tex/latex/keytheorems/class-support/keythms-amsbook-support.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/keytheorems/class-support/keythms-amsbook-support.tex	2024-10-10 19:42:15 UTC (rev 72515)
+++ trunk/Master/texmf-dist/tex/latex/keytheorems/class-support/keythms-amsbook-support.tex	2024-10-10 19:42:31 UTC (rev 72516)
@@ -1,7 +1,7 @@
 % Maintained by Matthew Bertucci, 2024-present
 % 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
-\ProvidesExplFile{keythms-amsbook-support}{2024-10-05}{0.1.6}
+\ProvidesExplFile{keythms-amsbook-support}{\@keythms at date}{\@keythms at version}
   {keytheorems~support~for~the~amsbook~class}
 
 \__keythms_support_AMSshared_code:
@@ -16,10 +16,7 @@
 
 \keys_define:nn { keytheorems/thmstyle }
   {
-    inherit-style / remark .meta:n =
-      {
-        bodyfont = \normalfont,
-      },
+    inherit-style / remark .meta:n = { bodyfont = \normalfont },
   }
 
 \file_input_stop:
\ No newline at end of file

Modified: trunk/Master/texmf-dist/tex/latex/keytheorems/class-support/keythms-amsproc-support.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/keytheorems/class-support/keythms-amsproc-support.tex	2024-10-10 19:42:15 UTC (rev 72515)
+++ trunk/Master/texmf-dist/tex/latex/keytheorems/class-support/keythms-amsproc-support.tex	2024-10-10 19:42:31 UTC (rev 72516)
@@ -1,7 +1,7 @@
 % Maintained by Matthew Bertucci, 2024-present
 % 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
-\ProvidesExplFile{keythms-amsproc-support}{2024-10-05}{0.1.6}
+\ProvidesExplFile{keythms-amsproc-support}{\@keythms at date}{\@keythms at version}
   {keytheorems~support~for~the~amsproc~class}
 
 \__keythms_support_AMSshared_code:
@@ -16,10 +16,7 @@
 
 \keys_define:nn { keytheorems/thmstyle }
   {
-    inherit-style / remark .meta:n =
-      {
-        bodyfont = \normalfont,
-      },
+    inherit-style / remark .meta:n = { bodyfont = \normalfont },
   }
 
 \file_input_stop:
\ No newline at end of file

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	2024-10-10 19:42:15 UTC (rev 72515)
+++ trunk/Master/texmf-dist/tex/latex/keytheorems/class-support/keythms-beamer-support.tex	2024-10-10 19:42:31 UTC (rev 72516)
@@ -1,7 +1,7 @@
 % Maintained by Matthew Bertucci, 2024-present
 % 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
-\ProvidesExplFile{keythms-beamer-support}{2024-10-05}{0.1.6}
+\ProvidesExplFile{keythms-beamer-support}{\@keythms at date}{\@keythms at version}
   {keytheorems~support~for~the~beamer~class}
 
 % do nothing if noamsthm loaded
@@ -11,8 +11,8 @@
   {
     inherit-style / example .meta:n =
       {
-        bodyfont=\normalfont,
-        preheadhook=\def\inserttheoremblockenv{exampleblock},
+        bodyfont    = \normalfont,
+        preheadhook = \def\inserttheoremblockenv{exampleblock},
       }
   }
 \keys_define:nn { keytheorems/thm }
@@ -127,11 +127,6 @@
              \msg_warning:nne { keytheorems } { store-reversed-not-got }
                { \l__keythms_thmuse_storereversed_tl }
            }
-        \renewcommand\label[2][]{} % disable \label (opt arg in case cleveref loaded)
-        \cs_set_eq:NN \ltx at label \use_none:n % disable \ltx at label
-        \cs_set_eq:NN \property_record:nn \use_none:nn % disable \RecordProperties
-        \cs_set_eq:NN \setuniqmark \use_none:n % work with numbered=unless-unique
-        % QUESTION: also disable \hyper@@anchor? \MakeLinkTarget?
         \hook_use:n { keytheorems/#1/restated }
         \hook_use:n { keytheorems/allthms/restated }
         \__keythms_thm_prehead_code:n { #1 }
@@ -159,6 +154,7 @@
       %       This is the price of on-the-fly redefining the env to grab body
       \RenewDocumentEnvironment { #1 } { D<>{} ={note} O{} D<>{} }
         {
+          \tl_set:Nn \l_keythms_thmuse_envname_tl { #1 }
           \keys_set:nn { keytheorems/thmuse } { ##2 }
           \tl_if_empty:NF \l__keythms_thmuse_store_tl
             {

Added: trunk/Master/texmf-dist/tex/latex/keytheorems/class-support/keythms-jlreq-support.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/keytheorems/class-support/keythms-jlreq-support.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/keytheorems/class-support/keythms-jlreq-support.tex	2024-10-10 19:42:31 UTC (rev 72516)
@@ -0,0 +1,34 @@
+% Maintained by Matthew Bertucci, 2024-present
+% 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
+\ProvidesExplFile{keythms-jlreq-support}{\@keythms at date}{\@keythms at version}
+  {keytheorems~support~for~the~jlreq~class}
+
+\prop_gput_from_keyval:Nn \g__keythms_thmstyle_defaultkeys_prop
+  {
+    bodyfont      = \prop_item:Nn \g__jlreq_complements_theorem_prop { font },
+    headfont      =
+      \prop_item:Nn \g__jlreq_complements_theorem_prop { label_font },
+    headindent    =
+      \dimexpr\prop_item:Nn \g__jlreq_complements_theorem_prop { indent },
+    headpunct     = {},
+    postheadspace = 1\jlreq at zw,
+    notebraces    = {(}{)},
+    notefont      =
+      \prop_item:Nn \g__jlreq_complements_theorem_prop { label_font },
+    noteseparator = {},
+    spaceabove    =
+      \dimexpr\prop_item:Nn \g__jlreq_complements_theorem_prop { beforeafter_space } \relax,
+    spacebelow    =
+      \dimexpr\prop_item:Nn \g__jlreq_complements_theorem_prop { beforeafter_space } \relax,
+  }
+
+\keys_define:nn { keytheorems/thmstyle } { inherit-style / jlreq .meta:n = {} }
+
+\keys_define:nn { keytheorems/listof }
+  {
+    indent   .initial:n = 0\jlreq at gol,
+    numwidth .initial:n = 2\jlreq at gol,
+  }
+
+\file_input_stop:
\ No newline at end of file


Property changes on: trunk/Master/texmf-dist/tex/latex/keytheorems/class-support/keythms-jlreq-support.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/tex/latex/keytheorems/class-support/keythms-memoir-support.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/keytheorems/class-support/keythms-memoir-support.tex	2024-10-10 19:42:15 UTC (rev 72515)
+++ trunk/Master/texmf-dist/tex/latex/keytheorems/class-support/keythms-memoir-support.tex	2024-10-10 19:42:31 UTC (rev 72516)
@@ -1,7 +1,7 @@
 % Maintained by Matthew Bertucci, 2024-present
 % 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
-\ProvidesExplFile{keythms-memoir-support}{2024-10-05}{0.1.6}
+\ProvidesExplFile{keythms-memoir-support}{\@keythms at date}{\@keythms at version}
   {keytheorems~support~for~the~memoir~class}
 
 \bool_new:N \l__keythms_support_titlecode_bool

Modified: trunk/Master/texmf-dist/tex/latex/keytheorems/keytheorems.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/keytheorems/keytheorems.sty	2024-10-10 19:42:15 UTC (rev 72515)
+++ trunk/Master/texmf-dist/tex/latex/keytheorems/keytheorems.sty	2024-10-10 19:42:31 UTC (rev 72516)
@@ -2,7 +2,10 @@
 % 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]
-\ProvidesExplPackage{keytheorems}{2024-10-05}{0.1.6}{l3keys interface to amsthm}
+\def\@keythms at date{2024-10-10}
+\def\@keythms at version{0.1.7}
+\ProvidesExplPackage{keytheorems}{\@keythms at date}{\@keythms at version}
+  {l3keys interface to amsthm}
 
 \IfFormatAtLeastTF { 2024-06-01 } { }
   {
@@ -20,6 +23,8 @@
       { \IfClassLoadedTF{#1}{#2}{ } }
     \ProvideDocumentCommand \IfClassLoadedWithOptionsT { m m m }
       { \IfClassLoadedWithOptionsTF{#1}{#2}{#3}{ } }
+    \ProvideDocumentCommand \IfPackageLoadedWithOptionsT { m m m }
+      { \IfPackageLoadedWithOptionsTF{#1}{#2}{#3}{ } }
   }
 \RequirePackage{aliascnt}
 \RequirePackage{amsthm} % ams classes have way of ignoring this
@@ -197,7 +202,7 @@
     break         .meta:n   = { postheadspace = \newline }, % add error if postheadspace set
     break         .value_forbidden:n = true,
     headfont      .tl_set:N = \l__keythms_thmstyle_headfont_tl,
-    headformat    .meta:n   = { headstyle = #1 },
+    headformat    .meta:n   = { headstyle = {#1} }, % extra braces are necessary! Otherwise breaks if #1 contains comma
     headindent    .tl_set:N = \l__keythms_thmstyle_headindent_tl,
     headpunct     .tl_set:N = \l__keythms_thmstyle_headpunct_tl,
     headstyle     .choice:,
@@ -238,7 +243,19 @@
     postheadhook          .code:n = \keythms_thmstyle_savethmkey_reqval:n { #1 },
     prefoothook           .code:n = \keythms_thmstyle_savethmkey_reqval:n { #1 },
     preheadhook           .code:n = \keythms_thmstyle_savethmkey_reqval:n { #1 },
-    qed                   .code:n = \keythms_thmstyle_savethmkey_optval:n { #1 },
+    qed                   .code:n =
+      { % qed needs special treatment to distinguish qed from qed={}
+        \exp_args:No \tl_if_novalue:nTF { #1 }
+          {
+            \clist_put_right:No \l__keythms_thmstyle_savedkeys_clist
+              { \l_keys_key_str }
+          }
+          {
+            \clist_put_right:No \l__keythms_thmstyle_savedkeys_clist
+              { \l_keys_key_str = { #1 } }
+          }
+      },
+    qed                   .default:n = \c_novalue_tl,
     sharenumber           .code:n = \keythms_thmstyle_savethmkey_reqval:n { #1 },
     sibling               .code:n = \keythms_thmstyle_savethmkey_reqval:n { #1 },
     tcolorbox             .code:n = \keythms_thmstyle_savethmkey_optval:n { #1 },
@@ -412,7 +429,7 @@
 
 \keys_define:nn { keytheorems/thm }
   {
-    heading        .meta:n    = { name = #1 },
+    heading        .meta:n    = { name = {#1} },
     name           .tl_set:N  = \l__keythms_thm_name_tl,
     numbered       .choice:,
     numbered       .default:n = true,
@@ -425,8 +442,8 @@
       },
     numbered / unless~unique .meta:n = { numbered = unless-unique },
     numbered / yes .meta:n    = { numbered = true },
-    numberlike     .meta:n    = { sibling = #1 },
-    numberwithin   .meta:n    = { parent = #1 },
+    numberlike     .meta:n    = { sibling = {#1} },
+    numberwithin   .meta:n    = { parent = {#1} },
     parent         .tl_set:N  = \l__keythms_thm_parent_tl,
     postfoothook   .tl_set:N  = \l__keythms_thm_postfoothook_tl,
     postheadhook   .tl_set:N  = \l__keythms_thm_postheadhook_tl,
@@ -437,7 +454,7 @@
     % ^ distinguish between 'qed' and 'qed={}'
     refname        .tl_set:N  = \l__keythms_thm_refname_tl,
     Refname        .tl_set:N  = \l__keythms_thm_Refname_tl,
-    sharenumber    .meta:n    = { sibling = #1 },
+    sharenumber    .meta:n    = { sibling = {#1} },
     sibling        .tl_set:N  = \l__keythms_thm_sibling_tl,
     style          .tl_set:N  = \l__keythms_thm_style_tl,
     style          .groups:n  = { style-comes-first },
@@ -456,8 +473,8 @@
           }
       },
     tcolorbox-no-titlebar .default:n = {},
-    title          .meta:n    = { name = #1 },
-    within         .meta:n    = { parent = #1 },
+    title          .meta:n    = { name = {#1} },
+    within         .meta:n    = { parent = {#1} },
   }
 
 % what below is unnecessary? I really don't understand this code.
@@ -471,7 +488,7 @@
     \addvspace\@topsep
     \addvspace{-\parskip}
     \fi
-    % \global\@inlabeltrue % MY COMMENT: if this is uncommented then spacing after sections is wrong
+    % \global\@inlabeltrue % MB: if this is uncommented then spacing after sections is wrong
     \everypar\dth at everypar
     \cs_set:Npn \__keythms_thm_tcboxtemphead: { \normalfont #1 }
     \ignorespaces
@@ -906,12 +923,12 @@
     listhack / true .code:n = \bool_set_true:N \l__keythms_thmuse_listhack_bool,
     listhack / false .code:n = \bool_set_false:N \l__keythms_thmuse_listhack_bool,
     listhack   .initial:n = false,
-    name       .meta:n   = { note = #1 },
+    name       .meta:n   = { note = {#1} },
     % ^ for compatibility. "name" is ambiguous and doesn't match amsthm language
     note       .tl_set:N = \l__keythms_thmuse_note_tl,
     note       .initial:n = {},
-    restate    .meta:n   = { store = #1 }, % thmtools compatibility
-    restate*   .meta:n   = { store* = #1 },
+    restate    .meta:n   = { store = {#1} }, % thmtools compatibility
+    restate*   .meta:n   = { store* = {#1} },
     restate-keys .clist_set:N = \l__keythms_thmuse_restatekeys_clist,
     seq        .code:n = {},
     short-note .code:n   = {}, % these do nothing at point of use
@@ -982,11 +999,6 @@
              \msg_warning:nne { keytheorems } { store-reversed-not-got }
                { \l__keythms_thmuse_storereversed_tl }
            }
-        \renewcommand\label[2][]{} % disable \label (opt arg in case cleveref loaded)
-        \cs_set_eq:NN \ltx at label \use_none:n % disable \ltx at label
-        \cs_set_eq:NN \property_record:nn \use_none:nn % disable \RecordProperties
-        \cs_set_eq:NN \setuniqmark \use_none:n % work with numbered=unless-unique
-        % QUESTION: also disable \hyper@@anchor? \MakeLinkTarget?
         \hook_use:n { keytheorems/#1/restated }
         \hook_use:n { keytheorems/allthms/restated }
         \__keythms_thm_prehead_code:n { #1 }
@@ -1012,6 +1024,7 @@
       %       This is the price of on-the-fly redefining the env to grab body
       \RenewDocumentEnvironment { #1 } { ={note} O{} }
         {
+          \tl_set:Nn \l_keythms_thmuse_envname_tl { #1 }
           \keys_set:nn { keytheorems/thmuse } { ##1 }
           \tl_if_empty:NF \l__keythms_thmuse_store_tl
             {
@@ -1116,7 +1129,6 @@
 
 \cs_new_protected:Npn \__keythms_thm_prehead_code:n #1
   { % #1 = theorem name
-    \tl_set:Nn \l_keythms_thmuse_envname_tl { #1 }
     \hook_use:n { keytheorems/#1/prehead }
     \hook_use:n { keytheorems/allthms/prehead }
   }
@@ -1227,8 +1239,8 @@
 
 \keys_define:nn { keytheorems/storeatbegin }
   {
-    restate  .meta:n      = { store=#1 },
-    restate* .meta:n      = { store*=#1 },
+    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
@@ -1323,6 +1335,15 @@
 \NewDocumentCommand \IfRestatingT { } { \keythms_if_restating:T }
 \NewDocumentCommand \IfRestatingF { } { \keythms_if_restating:F }
 
+\hook_gput_code:nnn { keytheorems/allthms/restated } { . }
+  { % code to disable things in restated theorems
+    \renewcommand\label[2][]{} % opt arg in case cleveref loaded
+    \cs_set_eq:NN \ltx at label \use_none:n % thmtools does this; why?
+    \cs_set_eq:NN \property_record:nn \use_none:nn
+    \cs_set_eq:NN \setuniqmark \use_none:n % work with numbered=unless-unique
+    % QUESTION: also disable \hyper@@anchor? \MakeLinkTarget?
+  }
+
 \cs_new_protected:Npn \__keythms_getthm_theorem:nnnnn #1#2#3#4#5
   { % #1 = name, #2 = number, #3 = restate counters, #4 = keys, #5 = theorem body
     \group_begin:
@@ -1349,11 +1370,7 @@
         % WRONG: needed to make numbering correct after restated theorem.
         % not sure about theH. <- this is needed to prevent duplicate anchors
       }
-    \renewcommand\label[2][]{} % disable \label (opt arg in case cleveref loaded)
-    \cs_set_eq:NN \ltx at label \use_none:n % disable \ltx at label
-    \cs_set_eq:NN \property_record:nn \use_none:nn % disable \RecordProperties
-    \cs_set_eq:NN \setuniqmark \use_none:n % work with numbered=unless-unique
-    % QUESTION: also disable \hyper@@anchor? \MakeLinkTarget?
+    \tl_set:Nn \l_keythms_thmuse_envname_tl { #1 }
     \keys_set:nn { keytheorems/thmuse } { #4 }
     \keys_set:no { keytheorems/thmuse } { \l__keythms_thmuse_restatekeys_clist }
     \hook_use:n { keytheorems/#1/restated }
@@ -1390,9 +1407,6 @@
           { \use:c { the ##1 } . \theHkeythms_restate_dummyctr }
       }
     \refstepcounter{keythms_restate_dummyctr}
-    \renewcommand\label[2][]{} % disable \label (opt arg in case cleveref loaded)
-    \cs_set_eq:NN \ltx at label \use_none:n % disable \ltx at label
-    \cs_set_eq:NN \property_record:nn \use_none:nn % disable \RecordProperties
     \hook_use:n { keytheorems/#1/restated }
     \hook_use:n { keytheorems/allthms/restated }
     #2
@@ -1408,6 +1422,7 @@
   { % #1 = envname, #2 = keys, #3 = theorem body
     \group_begin:
     \bool_set_false:N \l__keythms_thmuse_restating_bool
+    \tl_set:Nn \l_keythms_thmuse_envname_tl { #1 }
     \keys_set:nn { keytheorems/thmuse } { #2 }
     \keys_set:no { keytheorems/thmuse } { \l__keythms_thmuse_restatekeys_clist }
     \__keythms_thm_prehead_continues_code:n { #1 }
@@ -1727,13 +1742,13 @@
               { note = \l__keythms_tmpa_tl }
           }
       },
-    name         .meta:n      = { note = #1 },
+    name         .meta:n      = { note = {#1} },
     note         .tl_set:N    = \l__keythms_listofheading_note_tl,
-    restate*     .meta:n      = { store*=#1 },
+    restate*     .meta:n      = { store* = {#1} },
     restate-keys .clist_set:N = \l__keythms_listofheading_restatekeys_clist,
     seq          .tl_set:N    = \l__keythms_listofheading_seq_tl,
     short-note   .tl_set:N    = \l__keythms_listofheading_shortnote_tl,
-    short-name   .meta:n      = { short-note = #1 },
+    short-name   .meta:n      = { short-note = {#1} },
     store*       .code:n      =
       {
         \bool_set_true:N \l__keythms_listofheading_storereversed_bool
@@ -1813,7 +1828,7 @@
     \cs_set_protected:Npn \KeyThmsContentsLine ##1 { ##1 }
     \bool_if:NF \l__keythms_listof_nochapskip_bool
       {
-        \cs_set_eq:NN \KeyThmsAddvspace \addvspace
+        \cs_set_protected:Npn \KeyThmsAddvspace { \addvspace }
       }
     \bool_if:NF \l__keythms_listof_notitle_bool
       {
@@ -1857,25 +1872,22 @@
 \cs_new_protected:Npn \KeyThmsAddvspace #1 { } % initially no-op, redefined where needed
 \int_new:N \g_keythms_listof_prevchapter_int
 \int_gset:Nn \g_keythms_listof_prevchapter_int { 1 }
-% ^ if this is zero, bad things happen if title-code is changed; anyways don't
-%   need addvspace at top
+% ^ if this is zero, bad things happen if title-code is changed;
+%   anyways don't need addvspace at top
 \cs_new_protected:Npn \keythms_listof_chaptervspacehack: { }
 \cs_if_exist:cT { c at chapter }
   {
-    \cs_if_eq:NNF \c at chapter \relax
+    \cs_set_protected:Npn \keythms_listof_chaptervspacehack:
       {
-        \cs_set_protected:Npn \keythms_listof_chaptervspacehack:
+        \int_compare:nNnF
+          { \value{chapter} } = { \g_keythms_listof_prevchapter_int }
           {
-            \int_compare:nNnF
-              { \value{chapter} } = { \g_keythms_listof_prevchapter_int }
+            \addtocontents{ thlist }
               {
-                \addtocontents{ thlist }
-                  {
-                    \KeyThmsAddvspace
-                      { \keythms at listof@chaptervspace at dim }
-                  }
-                \int_gset:Nn \g_keythms_listof_prevchapter_int { \value{chapter} }
+                \KeyThmsAddvspace
+                  { \keythms at listof@chaptervspace at dim }
               }
+            \int_gset:Nn \g_keythms_listof_prevchapter_int { \value{chapter} }
           }
       }
   }
@@ -2427,7 +2439,7 @@
         \cs_set_protected:Npn \KeyThmsContentsLine ####1 { ####1 }
         \bool_if:NF \l__keythms_listof_nochapskip_bool
           {
-            \cs_set_eq:NN \KeyThmsAddvspace \addvspace
+            \cs_set_protected:Npn \KeyThmsAddvspace { \addvspace }
           }
         \legacy_if_set_false:n { @filesw }
         \bool_if:NTF \l__keythms_listof_notitle_bool
@@ -2451,16 +2463,60 @@
     \cs_set_eq:NN \keythms_listof_tocline: \__keythms_listof_ams_tocline:
   }
 
-\cs_new_protected:Npn \keythms_support_check:n #1
+\prg_new_conditional:Npnn \__keythms_if_classloaded:n #1 { p }
   {
-    \IfClassLoadedT { #1 } { \file_input:n { class-support/keythms-#1-support } }
+    \IfClassLoadedTF { #1 } { \prg_return_true: } { \prg_return_false: }
   }
 
-% acmart defaults also handled in amsart support file
-\keythms_support_check:n { amsart }
-\keythms_support_check:n { amsbook }
-\keythms_support_check:n { amsproc }
-\keythms_support_check:n { beamer }
-\keythms_support_check:n { memoir }
+\cs_new_protected:Npn \__keythms_support_input:n #1
+  {
+    \file_input:n { class-support/keythms-#1-support }
+  }
 
+% acmart and aomart defaults also handled in amsart support file
+\bool_case:n
+  {
+    { \__keythms_if_classloaded_p:n { amsart } }
+      { \__keythms_support_input:n { amsart } }
+    { \__keythms_if_classloaded_p:n { amsbook } }
+      { \__keythms_support_input:n { amsbook } }
+    { \__keythms_if_classloaded_p:n { amsproc } }
+      { \__keythms_support_input:n { amsproc } }
+    { \__keythms_if_classloaded_p:n { beamer } }
+      { \__keythms_support_input:n { beamer } }
+    { \__keythms_if_classloaded_p:n { IEEEtran } }
+      { \__keythms_support_input:n { IEEEtran } }
+    { \__keythms_if_classloaded_p:n { jlreq } }
+      { \__keythms_support_input:n { jlreq } }
+    { \__keythms_if_classloaded_p:n { memoir } }
+      { \__keythms_support_input:n { memoir } }
+  }
+
+% now deal with font packages that change plain style
+\cs_new_protected:Npn \__keythms_support_fontpkg:nn #1#2
+  {
+    \clist_map_inline:nn { #1 }
+      {
+        \hook_gput_code:nnn { package/##1/after } { . }
+          {
+            \IfPackageLoadedWithOptionsT { ##1 } { theoremfont }
+              {
+                \prop_gput_from_keyval:Nn \g__keythms_thmstyle_defaultkeys_prop { #2 }
+                \keys_precompile:neN { keytheorems/thmstyle }
+                  { \prop_to_keyval:N \g__keythms_thmstyle_defaultkeys_prop }
+                  \l__keythms_thmstyle_defaultkeys_tl
+              }
+          }
+      }
+  }
+
+\__keythms_support_fontpkg:nn { baskervillef,cochineal } { bodyfont = \slshape }
+\__keythms_support_fontpkg:nn { libertinust1math,newpxtext,newtxtext,XCharter }
+  {
+    bodyfont   = \thfamily,
+    spaceabove = \medskipamount,
+    spacebelow = \medskipamount,
+  }
+\__keythms_support_fontpkg:nn { scholax } { bodyfont = \thfamily }
+
 \file_input_stop:
\ No newline at end of file



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