texlive[72832] Master/texmf-dist: keytheorems (12nov24)
commits+karl at tug.org
commits+karl at tug.org
Tue Nov 12 22:25:57 CET 2024
Revision: 72832
https://tug.org/svn/texlive?view=revision&revision=72832
Author: karl
Date: 2024-11-12 22:25:57 +0100 (Tue, 12 Nov 2024)
Log Message:
-----------
keytheorems (12nov24)
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-jlreq-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 2024-11-12 21:25:47 UTC (rev 72831)
+++ trunk/Master/texmf-dist/doc/latex/keytheorems/CHANGELOG.md 2024-11-12 21:25:57 UTC (rev 72832)
@@ -1,5 +1,9 @@
# Changelog for keytheorems package
+## [v0.2.2]
+- fix implementation of `inherit-style` so it can contain thm keys
+- add support for zref-clever in `refname` and `Refname`
+
## [v0.2.1]
- make several commands "long" so keyvals can contain `\par` tokens
- add `leftmargin` and `rightmargin` keys
@@ -49,6 +53,7 @@
## 0.1.0 - 2024-09-04
- First release
+[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
[v0.1.8]: https://github.com/mbertucci47/keytheorems/compare/v0.1.7...v0.1.8
[v0.1.7]: https://github.com/mbertucci47/keytheorems/compare/v0.1.6...v0.1.7
Modified: trunk/Master/texmf-dist/doc/latex/keytheorems/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/keytheorems/README.md 2024-11-12 21:25:47 UTC (rev 72831)
+++ trunk/Master/texmf-dist/doc/latex/keytheorems/README.md 2024-11-12 21:25:57 UTC (rev 72832)
@@ -65,7 +65,7 @@
## Documentation
There is a list of commands and keys offered by the package
-[here](https://github.com/mbertucci47/keytheorems/blob/main/doc/keytheorems-doc.pdf).
+[here](https://github.com/mbertucci47/keytheorems/blob/develop/doc/keytheorems-doc.pdf).
More of a reference document than documentation.
## Differences with thmtools
@@ -643,7 +643,7 @@
## 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/main/keytheorems-ideas.md)
+- 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 2024-11-12 21:25:47 UTC (rev 72831)
+++ trunk/Master/texmf-dist/doc/latex/keytheorems/keytheorems-doc.tex 2024-11-12 21:25:57 UTC (rev 72832)
@@ -6,10 +6,7 @@
\geometry{margin=1.5in}
\usepackage{tcolorbox}
\tcbuselibrary{documentation,minted,breakable,hooks}
-\tcbset{
- listing engine=minted,
- minted language=latex,
- }
+
\ifTUTeX
\usepackage{newcomputermodern}
\else
@@ -113,17 +110,43 @@
},
docexample/.append style={boxrule=0pt,arc=0pt,after app={\noindent}}
}
+
+\makeatletter % code from muzimuzhi (https://github.com/T-F-S/tcolorbox/issues/298)
\tcbset{
+ before verbatim write app/.code={%
+ \appto\tcb at verbatim@begin at hook{\tcb at iow@write{#1}}},
+ % provided for symmetry, but not used
+ after verbatim write pre/.code={%
+ \preto\tcb at verbatim@end at hook{\tcb at iow@write{#1}}},
+}
+\tcbset{
+ mark preamble/.style={
+ before verbatim write app={\@percentchar\space preamble},
+ },
+ mark document/.style={
+ before verbatim write app={\@percentchar\space document},
+ },
+}
+\tcbset{
+ listing engine=minted,
+ minted language=latex,
withpreamble/.style = {
+ mark document,
before upper = {%
- {\ttfamily\itshape \% preamble}%
- \vspace{-0.7\baselineskip}%
+ % affects both the \tcbsettemplisting and the original upper
+ \setminted{listparameters={\topsep=0pt \partopsep=0pt}}%
\tcbusetemplisting
- \noindent{\ttfamily\itshape \% document}%
- \vspace{-0.7\baselineskip}%
- }
+ \vspace{5pt}%
}
}
+}
+\NewDocumentEnvironment{codepreamble}{}{%
+ \tcbset{mark preamble}%
+ \tcbwritetemp
+}{%
+ \endtcbwritetemp
+}
+\makeatother
\NewTCBListing{keythmscode}{ O{} }
{
@@ -130,15 +153,10 @@
colback=ExampleBack,
arc=0pt,
boxrule=0pt,
-% listing side text,
-% lower separated=false,
skin=bicolor,
colbacklower=ExampleBackLower,
breakable,
parbox=false, % so examples match document with indent, etc.
-% enhanced,
-% segmentation engine=path,
-% segmentation style={solid,gray},
#1
}
\newtcolorbox{notebox}[1][]{enhanced,
@@ -181,7 +199,7 @@
\section{Dependencies}
-The package depends on the \pkg{aliascnt}, \pkg{amsthm}, \pkg{etoolbox}, \pkg{refcount}, \pkg{translations} packages.
+The package depends on the \pkg{aliascnt}, \pkg{amsthm}, \pkg{refcount}, and \pkg{translations} packages.
The \refKey{tcolorbox} and \refKey{tcolorbox-no-titlebar} keys require \pkg{tcolorbox}, and the \refKey[numbered=unless-unique]{numbered} key requires the \pkg{unique} package.
A \LaTeX{} kernel no older than 2023-06-01 is required; if older than 2024-06-01, \pkg{nameref} is required.
@@ -290,9 +308,9 @@
This can be changed with the \refKey{thm/name} key.
All \meta{options} are described in subsections \ref{thm-thmtools-keys} and \ref{thm-added-keys}.
-\begin{tcbwritetemp}
+\begin{codepreamble}
\newkeytheorem{theorem}
-\end{tcbwritetemp}
+\end{codepreamble}
\begin{keythmscode}[withpreamble]
\begin{theorem}
@@ -394,20 +412,20 @@
\getkeytheorem{blub}
\end{keythmscode}
-A theorem given this key \emph{cannot} contain verbatim material or other unexpected catcodes, such as a \pkg{tikz-cd} diagram.
+A theorem given this key \emph{cannot} contain verbatim material or other unexpected catcodes such as a \pkg{tikz-cd} diagram.
The latter issue can be averted with the \texttt{ampersand-replacement} key.
-\begin{tcbwritetemp}
+\begin{codepreamble}
\usepackage{tikz}
\usetikzlibrary{cd}
-\end{tcbwritetemp}
+\end{codepreamble}
\begin{keythmscode}[withpreamble]
\begin{lemma}[store=diagram]
Some commutative diagram:
\[\begin{tikzcd}[ampersand replacement=\&]
-X\times_S Y \ar[r] \ar[d] \& X \ar[d] \\
-Y \ar[r] \& S
+ X\times_S Y \ar[r] \ar[d] \& X \ar[d] \\
+ Y \ar[r] \& S
\end{tikzcd}\]
\end{lemma}
\dots
@@ -440,10 +458,10 @@
Meant only to be used with the \refKey{break} style key for a theorem starting with a list.
Compare:
-\begin{tcbwritetemp}
+\begin{codepreamble}
\newkeytheoremstyle{breaksty}{break}
\newkeytheorem{observation}[style=breaksty]
-\end{tcbwritetemp}
+\end{codepreamble}
\begin{keythmscode}[withpreamble]
\begin{observation}
@@ -480,9 +498,9 @@
{initially title-cased \meta{env name}}
Aliases \docAuxKey{heading} and \docAuxKey{title}.
-\begin{tcbwritetemp}
+\begin{codepreamble}
\newkeytheorem{mythm}[name=Some Name]
-\end{tcbwritetemp}
+\end{codepreamble}
\begin{keythmscode}[withpreamble]
\begin{mythm}
@@ -497,9 +515,9 @@
{default |true|, initially |true|}
For compatibility with \pkg{thmtools}, also accepts the values \docValue*{yes}, \docValue*{no}, and \docValue*{unless unique}.
-\begin{tcbwritetemp}
+\begin{codepreamble}
\newkeytheorem{theorem*}[name=Theorem, numbered=false]
-\end{tcbwritetemp}
+\end{codepreamble}
\begin{keythmscode}[withpreamble]
\begin{theorem*}
@@ -514,9 +532,9 @@
{initially unset}
Aliases \docAuxKey{numberwithin} and \docAuxKey{within}.
-\begin{tcbwritetemp}
+\begin{codepreamble}
\newkeytheorem{conjecture}[parent=section]
-\end{tcbwritetemp}
+\end{codepreamble}
\begin{keythmscode}[withpreamble]
\begin{conjecture}
@@ -529,9 +547,9 @@
\begin{docKey}{sibling}{=\meta{counter}}{initially unset}
Aliases \docAuxKey{numberlike} and \docAuxKey{sharenumber}.
-\begin{tcbwritetemp}
+\begin{codepreamble}
\newkeytheorem{lemma}[sibling=theorem]
-\end{tcbwritetemp}
+\end{codepreamble}
\begin{keythmscode}[withpreamble]
\begin{lemma}
@@ -546,9 +564,9 @@
{initially unset}
Accepts any \meta{style name} defined by \refCom{newkeytheoremstyle}, as well as any of the predefined \pkg{amsthm} styles: \docValue{plain}, \docValue{definition}, and \docValue{remark}.
-\begin{tcbwritetemp}
+\begin{codepreamble}
\newkeytheorem{remark}[style=remark]
-\end{tcbwritetemp}
+\end{codepreamble}
\begin{keythmscode}[withpreamble]
\begin{remark}
@@ -570,7 +588,7 @@
}
Details in \autoref{keythms-hooks}.
-\begin{tcbwritetemp}
+\begin{codepreamble}
\newkeytheorem{test}[
preheadhook=PREHEAD,
postheadhook=POSTHEAD,
@@ -577,7 +595,7 @@
prefoothook=PREFOOT,
postfoothook=POSTFOOT
]
-\end{tcbwritetemp}
+\end{codepreamble}
\begin{keythmscode}[withpreamble]
\begin{test}
@@ -593,10 +611,10 @@
Adds \colOpt{\meta{symbol}} to the end of the theorem body.
If no value is given, the symbol \qedsymbol{} is used.
-\begin{tcbwritetemp}
+\begin{codepreamble}
\newkeytheorem{example}[qed]
\newkeytheorem{solution}[qed=$\clubsuit$]
-\end{tcbwritetemp}
+\end{codepreamble}
\begin{keythmscode}[withpreamble]
\begin{example}
@@ -612,7 +630,7 @@
\begin{docKey}{refname}
{=\meta{ref name} \textrm{or} \brackets{\meta{singular name},\meta{plural name}}}
{initially \meta{display name}}
-If a single string, then the name used by \pkg{hyperref}'s \cs{autoref} and \pkg{cleveref}'s \cs{cref}.
+If a single string, then the name used by \pkg{hyperref}'s \cs{autoref}, \pkg{cleveref}'s \cs{cref}, and \pkg{zref-clever}'s \cs{zcref}.
If two strings separated by a comma, then the second string is the plural form used by \cs{cref}.
\end{docKey}
@@ -619,17 +637,17 @@
\begin{docKey}{Refname}
{=\meta{ref name} \textrm{or} \brackets{\meta{singular name},\meta{plural name}}}
{initially \meta{display name}}
-Same as \refKey{refname} but for \docAuxCommand{Autoref} and \cs{Cref}.
+Same as \refKey{refname} but for \docAuxCommand{Autoref}, \cs{Cref}, and \cs{zcref} with any of its capitalizing options.
Note that \cs{Autoref} is defined by \pkg{keytheorems}, but requires \pkg{hyperref} to work.
As with \cs{autoref}, there is also a starred version \docAuxCommand{Autoref*} that suppresses the hyperlink.
-\begin{tcbwritetemp}
+\begin{codepreamble}
\newkeytheorem{prop}[
name=Proposition,
refname={proposition,propositions},
Refname={Proposition,Propositions}
]
-\end{tcbwritetemp}
+\end{codepreamble}
\begin{keythmscode}[withpreamble]
\begin{prop}[label=abc]
@@ -645,6 +663,13 @@
\end{docKey}
+\begin{notebox}
+The \refPkg{cleveref} package has not been updated since 2018 and contains several incompatibilities with the \LaTeX{} kernel.
+These are often patched by the \LaTeX{} team, but further incompatibilities are likely to arise with each future update.
+For this reason, I recommend moving to \refPkg{zref-clever}.
+It offers all the same features as \pkg{cleveref} and is actively maintained.
+\end{notebox}
+
\subsection{Keys added by \pkg{keytheorems}} \label{thm-added-keys}
\begin{docKeys}[doc parameter={=\meta{length}}]
@@ -653,12 +678,12 @@
{ doc name=rightmargin },
}
Sets the left (respectively, right) margin of the theorem relative to the text width.
-This sets the theorem apart from the text, similar to a block quote. Code adapted from Enrico Gregorio's \TeX{} Stack Exchange answers:
+This sets the theorem apart from the text, similar to a block quote. The code was adapted from Enrico Gregorio's \TeX{} Stack Exchange answers:
\begin{itemize}
\item \href{https://tex.stackexchange.com/a/67251/208544}{How to change margins in enunciation (theorem-like environment)?}
\item \href{https://tex.stackexchange.com/a/236407/208544}{A theoremstyle with complete indentation using amsthm}
\end{itemize}
-\begin{tcbwritetemp}
+\begin{codepreamble}
\newcommand{\marginthmtext}{%
We need some text to show off theorems with margins. }
\newkeytheorem{quotethm}[
@@ -665,7 +690,7 @@
name=Quote Theorem,
leftmargin=1cm, rightmargin=1cm]
\newkeytheorem{indentedthm}[name=Indented Theorem, leftmargin=1cm]
-\end{tcbwritetemp}
+\end{codepreamble}
\newcommand{\marginthmtext}{We need some text to show off theorems with margins. }
\begin{keythmscode}[withpreamble]
@@ -690,7 +715,7 @@
This key specifies that the theorem be placed inside a tcolorbox environment with \colOpt{\meta{options}}.
The theorem head is typeset as a tcolorbox title; to avoid this see \refKey{tcolorbox-no-titlebar}.
-\begin{tcbwritetemp}
+\begin{codepreamble}
\tcbset{
defstyle/.style={
arc=0mm,
@@ -700,7 +725,7 @@
}
\newkeytheorem{corollary}[tcolorbox]
\newkeytheorem{definition}[style=definition, tcolorbox={defstyle}]
-\end{tcbwritetemp}
+\end{codepreamble}
\begin{keythmscode}[withpreamble]
\begin{corollary}
@@ -718,12 +743,12 @@
{initially unset}
Same usage as \refKey{tcolorbox} but the theorem head is typeset as usual, not as a tcolorbox title.
-\begin{tcbwritetemp}
+\begin{codepreamble}
\newkeytheorem{boxcor}[
tcolorbox-no-titlebar={colback=red!10},
name=Corollary, sibling=corollary
]
-\end{tcbwritetemp}
+\end{codepreamble}
\begin{keythmscode}[withpreamble]
\begin{boxcor}
@@ -735,7 +760,7 @@
\pkg{tcolorbox} offers its own comprehensive \texttt{theorems} library. If all of your theorems are to be tcolorboxes, I highly recommend using it instead of this package! However, if only some of your theorems will use a tcolorbox, you may want to replicate the styles of \cs{NewTcbTheorem}. Here is an example that emulates \pkg{tcolorbox}'s \texttt{standard} theorem style.
-\begin{tcbwritetemp}
+\begin{codepreamble}
\tcbset{
thmstyle/.style={
colback=green!5,
@@ -752,7 +777,7 @@
\newkeytheorem{mytheo}[
name=My Theorem,
style=tcb-standard]
-\end{tcbwritetemp}
+\end{codepreamble}
\begin{keythmscode}[withpreamble]
\begin{mytheo}[This is my title]
@@ -1232,7 +1257,7 @@
\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/main/tests/tagged-keytheorems-amsthmtest.tex}{\texttt{tagged-keytheorems-amsthmtest.tex}}.
+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}
@@ -1258,7 +1283,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/main/tests/keytheorems-amsthmtest.tex}{\texttt{keytheorems-amsthmtest.tex}}.
+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}}.
%\section{Implementation}
%\inputminted[linenos,style=bw]{latex}{../keytheorems.sty}
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-11-12 21:25:47 UTC (rev 72831)
+++ trunk/Master/texmf-dist/tex/latex/keytheorems/class-support/keythms-amsart-support.tex 2024-11-12 21:25:57 UTC (rev 72832)
@@ -6,13 +6,11 @@
\__keythms_support_AMSshared_code:
-\keys_define:nn { keytheorems/thmstyle }
+% redefine inherit-style=remark
+\tl_gset:Nn \g__keythms_thmstyle_remark_metakeys_tl
{
- inherit-style / remark .meta:n =
- {
- bodyfont = \normalfont,
- headfont = \itshape,
- }
+ bodyfont = \normalfont,
+ headfont = \itshape,
}
\bool_case:nF
@@ -28,16 +26,14 @@
notefont = \@acmplainnotefont,
postheadspace = .5em,
}
- \keys_define:nn { keytheorems/thmstyle }
+ \tl_new:N \g__keythms_thmstyle_acmplain_metakeys_tl
+ \tl_new:N \g__keythms_thmstyle_acmdefinition_metakeys_tl
+ \tl_gset:Nn \g__keythms_thmstyle_acmdefinition_metakeys_tl
{
- inherit-style / acmplain .meta:n = {},
- inherit-style / acmdefinition .meta:n =
- {
- bodyfont = \@acmdefinitionbodyfont,
- headindent = \@acmdefinitionindent,
- headfont = \@acmdefinitionheadfont,
- notefont = \@acmdefinitionnotefont,
- },
+ bodyfont = \@acmdefinitionbodyfont,
+ headindent = \@acmdefinitionindent,
+ headfont = \@acmdefinitionheadfont,
+ notefont = \@acmdefinitionnotefont,
}
}
{ \__keythms_if_classloaded_p:n { aomart } }
@@ -52,29 +48,26 @@
spaceabove = 0.5\linespacing,
spacebelow = 0.5\linespacing,
}
- \keys_define:nn { keytheorems/thmstyle }
+ \tl_gset:Nn \g__keythms_thmstyle_definition_metakeys_tl
{
- 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,
- },
+ bodyfont = \upshape,
+ headfont = \sishape,
+ headindent = \parindent,
+ notefont = \normalfont,
+ postheadspace = 0.5em,
+ spaceabove = 0.5\linespacing,
+ spacebelow = 0.5\linespacing,
}
+ \tl_gset:Nn \g__keythms_thmstyle_remark_metakeys_tl
+ {
+ bodyfont = \upshape,
+ headfont = \sishape,
+ headindent = \parindent,
+ notefont = \normalfont,
+ postheadspace = 0.5em,
+ spaceabove = 0.5\linespacing,
+ spacebelow = 0.5\linespacing,
+ }
}
}
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-11-12 21:25:47 UTC (rev 72831)
+++ trunk/Master/texmf-dist/tex/latex/keytheorems/class-support/keythms-amsbook-support.tex 2024-11-12 21:25:57 UTC (rev 72832)
@@ -12,9 +12,7 @@
headindent = \parindent,
}
-\keys_define:nn { keytheorems/thmstyle }
- {
- inherit-style / remark .meta:n = { bodyfont = \normalfont },
- }
+% redefine inherit-style=remark
+\tl_gset:Nn \g__keythms_thmstyle_remark_metakeys_tl { 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-11-12 21:25:47 UTC (rev 72831)
+++ trunk/Master/texmf-dist/tex/latex/keytheorems/class-support/keythms-amsproc-support.tex 2024-11-12 21:25:57 UTC (rev 72832)
@@ -12,9 +12,7 @@
headindent = \parindent,
}
-\keys_define:nn { keytheorems/thmstyle }
- {
- inherit-style / remark .meta:n = { bodyfont = \normalfont },
- }
+% redefine inherit-style=remark
+\tl_gset:Nn \g__keythms_thmstyle_remark_metakeys_tl { 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-11-12 21:25:47 UTC (rev 72831)
+++ trunk/Master/texmf-dist/tex/latex/keytheorems/class-support/keythms-beamer-support.tex 2024-11-12 21:25:57 UTC (rev 72832)
@@ -17,13 +17,11 @@
% besides above, do nothing if noamsthm loaded
\IfClassLoadedWithOptionsT{ beamer }{ noamsthm }{ \file_input_stop: }
-\keys_define:nn { keytheorems/thmstyle }
+\tl_new:N \g__keythms_thmstyle_example_metakeys_tl
+\tl_gset:Nn \g__keythms_thmstyle_example_metakeys_tl
{
- inherit-style / example .meta:n =
- {
- bodyfont = \normalfont,
- preheadhook = \def\inserttheoremblockenv{exampleblock},
- }
+ bodyfont = \normalfont,
+ headfont = \def\inserttheoremblockenv{exampleblock},
}
\cs_set_protected:Npn \__keythms_thm_tcbcode:nn #1#2
Modified: 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 2024-11-12 21:25:47 UTC (rev 72831)
+++ trunk/Master/texmf-dist/tex/latex/keytheorems/class-support/keythms-jlreq-support.tex 2024-11-12 21:25:57 UTC (rev 72832)
@@ -23,7 +23,7 @@
\dimexpr\prop_item:Nn \g__jlreq_complements_theorem_prop { beforeafter_space } \relax,
}
-\keys_define:nn { keytheorems/thmstyle } { inherit-style / jlreq .meta:n = {} }
+\tl_new:N \g__keythms_thmstyle_jlreq_metakeys_tl
\keys_define:nn { keytheorems/listof }
{
Modified: trunk/Master/texmf-dist/tex/latex/keytheorems/keytheorems.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/keytheorems/keytheorems.sty 2024-11-12 21:25:47 UTC (rev 72831)
+++ trunk/Master/texmf-dist/tex/latex/keytheorems/keytheorems.sty 2024-11-12 21:25:57 UTC (rev 72832)
@@ -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{2024-11-05}
-\def\@keythms at version{0.2.1}
+\def\@keythms at date{2024-11-11}
+\def\@keythms at version{0.2.2}
\ProvidesExplPackage{keytheorems}{\@keythms at date}{\@keythms at version}
{l3keys interface to amsthm}
@@ -15,6 +15,7 @@
\cs_generate_variant:Nn \keys_set:nn { ne }
\cs_generate_variant:Nn \msg_warning:nnn { nne }
\cs_generate_variant:Nn \tl_put_right:Nn { Ne }
+ \cs_generate_variant:Nn \tl_gput_right:Nn { ce }
\ProvideDocumentCommand \IfPackageLoadedT { m +m }
{ \IfPackageLoadedTF{#1}{#2}{ } }
\ProvideDocumentCommand \IfPackageLoadedF { m +m }
@@ -98,6 +99,10 @@
Theorem~style~'#1'~already~defined.~
Use~\protect\renewkeytheoremstyle\space instead.
}
+\msg_new:nnn { keytheorems } { inherit-thmstyle-undefined }
+ {
+ Theorem~style~'#1'~undefined.
+ }
\msg_new:nnn { keytheorems } { thm-undefined }
{
Command~\c_backslash_str #1~undefined.~
@@ -173,7 +178,7 @@
\cs_gset:Npn \thekeythms_unnumbered_dummyctr { }
\cs_generate_variant:Nn \hook_gput_code:nnn { nnv }
-\cs_generate_variant:Nn \keys_precompile:nnN { ne, nv, nnc, nVc }
+\cs_generate_variant:Nn \keys_precompile:nnN { ne, nVc }
\cs_generate_variant:Nn \prop_set_from_keyval:Nn { Ne }
%%%%%%%%%%%%%%
@@ -236,15 +241,14 @@
}
},
headstyle / unknown .cs_set:Np = \keythms_thmstyle_headcmd:nnn #1#2#3,
- inherit-style .choice:,
- inherit-style / plain .meta:n = {},
- inherit-style / definition .meta:n = { bodyfont = \normalfont },
- inherit-style / remark .meta:n =
+ inherit-style .code:n =
{
- bodyfont = \normalfont,
- headfont = \itshape,
- spaceabove = 0.5\topsep,
- spacebelow = 0.5\topsep,
+ \tl_if_exist:cTF { g__keythms_thmstyle_#1_metakeys_tl }
+ {
+ \keys_set:nv { keytheorems/thmstyle }
+ { g__keythms_thmstyle_#1_metakeys_tl }
+ }
+ { \msg_error:nnn { keytheorems } { inherit-thmstyle-undefined } { #1 } }
},
notebraces .code:n = \exp_after:wN \__keythms_thmstyle_setbraces:nn #1,
notefont .tl_set:N = \l__keythms_thmstyle_notefont_tl,
@@ -380,7 +384,9 @@
{ \exp_not:V \l__keythms_thmstyle_noteseparator_tl
\group_begin: % group so notefont doesn't affect headpunct
\exp_not:V \l__keythms_thmstyle_notefont_tl
- \l__keythms_thmstyle_lnotebrace_tl ####3 \l__keythms_thmstyle_rnotebrace_tl
+ \l__keythms_thmstyle_lnotebrace_tl
+ ####3
+ \l__keythms_thmstyle_rnotebrace_tl
\group_end:
}
}
@@ -397,11 +403,8 @@
\l__keythms_thmstyle_postheadspace_tl
{ \text_expand:n { \keythms_thmstyle_headcmd:nnn{##1}{##2}{##3} } }
% Define inherit-style key
- \tl_clear_new:c { l__keythms_thmstyle_#1_metakeys_tl }
- \keys_precompile:nnc { keytheorems/thmstyle } { #2 } % use precompile instead of meta key
- { l__keythms_thmstyle_#1_metakeys_tl } % because that's sensitive to hashes
- \keys_define:nn { keytheorems/thmstyle } % and we want to allow both # and ##
- { inherit-style / #1 .code:n = \tl_use:c { l__keythms_thmstyle_#1_metakeys_tl } }
+ \tl_gclear_new:c { g__keythms_thmstyle_#1_metakeys_tl }
+ \tl_gset:cn { g__keythms_thmstyle_#1_metakeys_tl } { #2 }
\tl_clear_new:c { l__keythms_thmstyle_#1_savedthmkeys_tl }
\keys_precompile:nVc { keytheorems/thm }
\l__keythms_thmstyle_savedkeys_clist
@@ -423,6 +426,19 @@
\cs_undefine:N \NOTE
}
+% set up plain, definition, and remark for inherit-style
+\tl_new:N \g__keythms_thmstyle_plain_metakeys_tl
+\tl_new:N \g__keythms_thmstyle_definition_metakeys_tl
+\tl_new:N \g__keythms_thmstyle_remark_metakeys_tl
+\tl_gset:Nn \g__keythms_thmstyle_definition_metakeys_tl { bodyfont=\normalfont }
+\tl_gset:Nn \g__keythms_thmstyle_remark_metakeys_tl
+ {
+ bodyfont = \normalfont,
+ headfont = \itshape,
+ spaceabove = 0.5\topsep,
+ spacebelow = 0.5\topsep,
+ }
+
%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Defining Theorems %%%
%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -440,6 +456,12 @@
{ \crefname{#1}{#2}{\textbf{??~(pl.~#2)}} }
{ \crefname{#1}{#2}{#3} }
}
+ \IfPackageLoadedT { zref-clever }
+ {
+ \tl_if_novalue:nTF { #3 }
+ { \zcRefTypeSetup{#1}{ name-sg=#2 } }
+ { \zcRefTypeSetup{#1}{ name-sg=#2, name-pl=#3 } }
+ }
}
\cs_generate_variant:Nn \keythms_thm_setrefnames:nn { nV }
@@ -455,6 +477,12 @@
{ \Crefname{#1}{#2}{\textbf{??~(pl.~#2)}} }
{ \Crefname{#1}{#2}{#3} }
}
+ \IfPackageLoadedT { zref-clever }
+ {
+ \tl_if_novalue:nTF { #3 }
+ { \zcRefTypeSetup{#1}{ Name-sg=#2 } }
+ { \zcRefTypeSetup{#1}{ Name-sg=#2, Name-pl=#3 } }
+ }
}
\cs_generate_variant:Nn \keythms_thm_setRefnames:nn { nV }
@@ -575,7 +603,6 @@
\tl_gclear_new:c { g__keythms_thm_postheadfromkeys_#1_tl }
\tl_gclear_new:c { g__keythms_thm_prefootfromkeys_#1_tl }
\tl_gclear_new:c { g__keythms_thm_postfootfromkeys_#1_tl }
- \tl_gclear_new:c { g__keythms_thm_tcbpatch_#1_tl }
% Make unless-unique false by default (can't precompile this)
\bool_set_false:N \l__keythms_thm_unlessunique_bool
% Set default keys
@@ -744,7 +771,7 @@
{ g__keythms_thm_##1fromkeys_#1_tl }
}
}
- \tl_use:c { g__keythms_thm_tcbpatch_#1_tl }
+ \use:c { g__keythms_thm_tcbpatch_#1_tl }
}
\cs_set_eq:NN \__keythms_thm_origtrivlist: \trivlist % for margin code below
}
@@ -790,6 +817,7 @@
}
\bool_if:NT \l__keythms_thm_numbered_bool
{
+ \tl_gclear_new:c { g__keythms_thm_tcbpatch_#1_tl }
\tl_gset:cn { g__keythms_thm_tcbpatch_#1_tl }
{
\IfPackageLoadedF { cleveref }
@@ -1267,8 +1295,8 @@
}
\hook_use:n { keytheorems/#1/prehead }
\hook_use:n { keytheorems/allthms/prehead }
- \tl_if_exist:cT { g__keythms_thm_#1_tcbprehead_tl }
- { \tl_use:c { g__keythms_thm_#1_tcbprehead_tl } }
+ % \use:c instead of \tl_use:c so doesn't error if tl doesn't exist
+ \use:c { g__keythms_thm_#1_tcbprehead_tl }
}
\cs_new_protected:Npn \__keythms_thm_posthead_code:n #1
{ % #1 = theorem name
@@ -1294,8 +1322,7 @@
}
\cs_new_protected:Npn \__keythms_thm_postfoot_code:n #1
{ % #1 = theorem name
- \tl_if_exist:cT { g__keythms_thm_#1_tcbpostfoot_tl }
- { \tl_use:c { g__keythms_thm_#1_tcbpostfoot_tl } }
+ \use:c { g__keythms_thm_#1_tcbpostfoot_tl }
\hook_use:n { keytheorems/allthms/postfoot }
\hook_use:n { keytheorems/#1/postfoot }
}
More information about the tex-live-commits
mailing list.