diff options
author | Karl Berry <karl@freefriends.org> | 2024-11-12 21:25:57 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2024-11-12 21:25:57 +0000 |
commit | e453b3444183813d6a425ef2442ecd6fa4294d91 (patch) | |
tree | ba64d9a2d28b8b43d402e988ca3161f4d7aaa91b /Master/texmf-dist/doc/latex/keytheorems | |
parent | 9336966db6df31e1c6a1b1d74ad1cbe5c354e599 (diff) |
keytheorems (12nov24)
git-svn-id: svn://tug.org/texlive/trunk@72832 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/latex/keytheorems')
-rw-r--r-- | Master/texmf-dist/doc/latex/keytheorems/CHANGELOG.md | 5 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/keytheorems/README.md | 4 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/keytheorems/keytheorems-doc.pdf | bin | 160412 -> 161806 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/keytheorems/keytheorems-doc.tex | 131 |
4 files changed, 85 insertions, 55 deletions
diff --git a/Master/texmf-dist/doc/latex/keytheorems/CHANGELOG.md b/Master/texmf-dist/doc/latex/keytheorems/CHANGELOG.md index 264b5ab0715..48b4f9e29d0 100644 --- a/Master/texmf-dist/doc/latex/keytheorems/CHANGELOG.md +++ b/Master/texmf-dist/doc/latex/keytheorems/CHANGELOG.md @@ -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 diff --git a/Master/texmf-dist/doc/latex/keytheorems/README.md b/Master/texmf-dist/doc/latex/keytheorems/README.md index a28247e596b..3e5d59a9c9c 100644 --- a/Master/texmf-dist/doc/latex/keytheorems/README.md +++ b/Master/texmf-dist/doc/latex/keytheorems/README.md @@ -65,7 +65,7 @@ smooth is a Zariski dense open subset of $(\mathbb{P}_k^n)^*$. ## 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 @@ blub ## 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 diff --git a/Master/texmf-dist/doc/latex/keytheorems/keytheorems-doc.pdf b/Master/texmf-dist/doc/latex/keytheorems/keytheorems-doc.pdf Binary files differindex fba3279b980..8e220a48c88 100644 --- a/Master/texmf-dist/doc/latex/keytheorems/keytheorems-doc.pdf +++ b/Master/texmf-dist/doc/latex/keytheorems/keytheorems-doc.pdf diff --git a/Master/texmf-dist/doc/latex/keytheorems/keytheorems-doc.tex b/Master/texmf-dist/doc/latex/keytheorems/keytheorems-doc.tex index 464d92e2d29..d80d4cd0baa 100644 --- a/Master/texmf-dist/doc/latex/keytheorems/keytheorems-doc.tex +++ b/Master/texmf-dist/doc/latex/keytheorems/keytheorems-doc.tex @@ -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,32 +110,53 @@ }, 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@verbatim@begin@hook{\tcb@iow@write{#1}}}, + % provided for symmetry, but not used + after verbatim write pre/.code={% + \preto\tcb@verbatim@end@hook{\tcb@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{} } { 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 @@ Several issues encountered with \pkg{thmtools} are avoided (see the README for a \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 @@ By default, the theorem's printed name is a title-cased \meta{env name}. 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 @@ More brilliant mathematics. \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 @@ Wow, yet another theorem. 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 @@ For more description, see the \href{https://ctan.org/pkg/thmtools}{\pkg{thmtools {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 @@ Some text {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 @@ An unnumbered theorem. {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 @@ The first number is the section. \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 @@ This shares its counter with \texttt{theorem}. {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,14 +588,14 @@ Some text } Details in \autoref{keythms-hooks}. -\begin{tcbwritetemp} +\begin{codepreamble} \newkeytheorem{test}[ preheadhook=PREHEAD, postheadhook=POSTHEAD, prefoothook=PREFOOT, postfoothook=POSTFOOT ] -\end{tcbwritetemp} +\end{codepreamble} \begin{keythmscode}[withpreamble] \begin{test} @@ -593,10 +611,10 @@ Some text 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,24 +630,24 @@ Some more text \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} \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 @@ Consider \cref{abc,def}. \Autoref{abc} \dots \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,19 +678,19 @@ Consider \cref{abc,def}. \Autoref{abc} \dots { 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}[ 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 sets the theorem apart from the text, similar to a block quote. Code adapte 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 @@ The theorem head is typeset as a tcolorbox title; to avoid this see \refKey{tcol } \newkeytheorem{corollary}[tcolorbox] \newkeytheorem{definition}[style=definition, tcolorbox={defstyle}] -\end{tcbwritetemp} +\end{codepreamble} \begin{keythmscode}[withpreamble] \begin{corollary} @@ -718,12 +743,12 @@ Some more text {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 @@ Some text \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 @@ Some text \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 @@ An example invocation might look like \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 @@ They can be useful with \cs{AddToHookNext} or the kernel's label mechanism for h \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} |