diff options
author | Karl Berry <karl@freefriends.org> | 2024-09-17 19:55:16 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2024-09-17 19:55:16 +0000 |
commit | 20121128c321ffa90b9eec1e202acda01550a716 (patch) | |
tree | 29c72d3f7f890c9311ba6ab2640a593a94dcbd91 /Master | |
parent | 3ac84ad79b7efd8cc2384769d19890215ab07228 (diff) |
keytheorems (17sep24)
git-svn-id: svn://tug.org/texlive/trunk@72310 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
9 files changed, 420 insertions, 243 deletions
diff --git a/Master/texmf-dist/doc/latex/keytheorems/CHANGELOG.md b/Master/texmf-dist/doc/latex/keytheorems/CHANGELOG.md new file mode 100644 index 00000000000..053436ddb74 --- /dev/null +++ b/Master/texmf-dist/doc/latex/keytheorems/CHANGELOG.md @@ -0,0 +1,18 @@ +# Changelog for keytheorems package + +## [v0.1.2] +- Move support for memoir and AMS classes to dedicated files +- document `headformat` key +- add Italian translations +- add `indent` list key +- add `no-toc` list key +- documentation improvements + +## [v0.1.1] - 2024-09-09 +- First CTAN release + +## 0.1.0 - 2024-09-04 +- First release + +[v0.1.2]: https://github.com/mbertucci47/keytheorems/compare/v0.1.1...v0.1.2 +[v0.1.1]: https://github.com/mbertucci47/keytheorems/compare/v0.1.0...v0.1.1
\ No newline at end of file diff --git a/Master/texmf-dist/doc/latex/keytheorems/README.md b/Master/texmf-dist/doc/latex/keytheorems/README.md index 205c7aab8b5..baf8506c2df 100644 --- a/Master/texmf-dist/doc/latex/keytheorems/README.md +++ b/Master/texmf-dist/doc/latex/keytheorems/README.md @@ -5,6 +5,8 @@ with a key-value interface. Meant to emulate most of the functionality of [`thmtools`](https://www.ctan.org/pkg/thmtools) but written in expl3. If you find a bug please open an issue or pull request. +The package is maintained by Matthew Bertucci. + ## Sample document ```tex \documentclass{article} 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 935d96b6cf3..79acb6371a3 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 e63783a70f7..b285f5f8401 100644 --- a/Master/texmf-dist/doc/latex/keytheorems/keytheorems-doc.tex +++ b/Master/texmf-dist/doc/latex/keytheorems/keytheorems-doc.tex @@ -20,7 +20,7 @@ \usepackage{cleveref} \usepackage{amssymb} -\def\version{0.1.1} +\def\version{0.1.2} \title{% \pkg{keytheorems} package \\[1ex] @@ -129,14 +129,16 @@ \maketitle \begin{abstract} -An \pkg{expl3}-implementation of a key-value interface to \pkg{amsthm}, implementing most of the functionality provided by \pkg{thmtools}. Several issues encountered with \pkg{thmtools} are avoided (see the README for a list) and a few new features are added. +An \pkg{expl3}-implementation of a key-value interface to \pkg{amsthm}, implementing most of the functionality provided by \pkg{thmtools}. +Several issues encountered with \pkg{thmtools} are avoided (see the README for a list) and a few new features are added. \end{abstract} \tableofcontents \section{Dependencies} -Without using the \refKey{tcolorbox} or \refKey{tcolorbox-no-titlebar} options, the package loads the \pkg{aliascnt}, \pkg{amsthm}, \pkg{refcount}, and \pkg{translations} packages. A \LaTeX{} kernel no older than 2023-06-01 is required; if older than 2024-06-01, \pkg{nameref} is required. +Without using the \refKey{tcolorbox} or \refKey{tcolorbox-no-titlebar} options, the package loads the \pkg{aliascnt}, \pkg{amsthm}, \pkg{refcount}, and \pkg{translations} packages. +A \LaTeX{} kernel no older than 2023-06-01 is required; if older than 2024-06-01, \pkg{nameref} is required. \section{Global Options} @@ -148,13 +150,16 @@ Every key in this section can be given as a package option with \cs{usepackage}\ \begin{docKey}{overload} {} {initially unset} -Redefines \cs{newtheorem} to internally use the \pkg{keytheorems} machinery. The syntax remains the same. This is automatically set by \refKey{thmtools-compat}. +Redefines \cs{newtheorem} to internally use the \pkg{keytheorems} machinery. The syntax remains the same. +This is automatically set by \refKey{thmtools-compat}. \end{docKey} \begin{docKey}{thmtools-compat} {} {initially unset} -For compatibility with \pkg{thmtools} syntax. Currently defines the commands in the left column below. The right column lists the corresponding \pkg{keytheorems} replacement that should be used in new documents. +For compatibility with \pkg{thmtools} syntax. +Currently defines the commands in the left column below. +The right column lists the corresponding \pkg{keytheorems} replacement that should be used in new documents. \begin{center} \begin{tabular}{cc} \pkg{thmtools} command & \pkg{keytheorems} replacement \\ @@ -177,21 +182,23 @@ Also defined are the \docAuxKey*{shaded} and \docAuxKey*{thmbox} keys, implement \begin{docKey}{store-all} {} {initially unset} -Tells \pkg{keytheorems} to grab the body of each theorem so it can later be -printed with the \refKey{print-body} option of \refCom{listofkeytheorems}. Note that this means a theorem body -\emph{cannot} contain verbatim material. +Tells \pkg{keytheorems} to grab the body of each theorem so it can later be printed with the \refKey{print-body} option of \refCom{listofkeytheorems}. +Note that this means a theorem body \emph{cannot} contain verbatim material. \end{docKey} \begin{docKey}{restate-counters} {=\marg{comma-list of counters}} {initially \ttbraces{equation}} -Additional counters whose values are preserved when a theorem is restated. This key does not reset the list, so you don't need to include |equation| in \meta{comma-list}. +Additional counters whose values are preserved when a theorem is restated. +This key does not reset the list, so you don't need to include |equation| in \meta{comma-list}. \end{docKey} \begin{docKey}{continues-code} {=\meta{code with \textup{\texttt{\#1}}}} {initially \cs{GetTranslation}\ttbraces{keythms\string_continues}\cs{pageref}\ttbraces{\#1}} -The code used to typeset the note produced by the \refKey{continues} key. If English or an unknown language is used, defaults to \texttt{continuing from p.}\cs{,}\cs{pageref}\ttbraces{\#1}. Currently (likely inaccurate!) translations exist for French, German, and Spanish. +The code used to typeset the note produced by the \refKey{continues} key. +If English or an unknown language is used, defaults to \texttt{continuing from p.}\cs{,}\cs{pageref}\ttbraces{\#1}. +Currently (likely inaccurate!) translations exist for French, German, Italian, and Spanish. \end{docKey} \begin{docKey}{qed-symbol} @@ -203,16 +210,20 @@ Redefines \cs{qedsymbol} to be \meta{symbol}. \begin{docKey}{auto-translate} {\colOpt{=true\textbar false}} {default |true|, initially |true|} -If |false|, \pkg{keytheorems} does not automatically translate the title text for \refCom{listofkeytheorems} and the note produced by the \refKey{continues} key. These texts can be manually customized with the \refKey{title} and \refKey{continues-code} keys, respectively. +If |false|, \pkg{keytheorems} does not automatically translate the title text for \refCom{listofkeytheorems} and the note produced by the \refKey{continues} key. +These texts can be manually customized with the \refKey{title} and \refKey{continues-code} keys, respectively. \end{docKey} \section{Defining Theorems} \begin{docCommand}{newkeytheorem} {\marg{env name}\oarg{options}} -Defines a theorem environment \meta{env name} which itself takes a few options (see \autoref{in-doc-keys}). You can also declare multiple theorems at once by replacing \meta{env name} with a comma-list of names, e.g. \cs{newkeytheorem}\ttbraces{theorem,lemma,proposition}\bracks{\meta{options}}. +Defines a theorem environment \meta{env name} which itself takes a few options (see \autoref{in-doc-keys}). +You can also declare multiple theorems at once by replacing \meta{env name} with a comma-list of names, e.g. \cs{newkeytheorem}\ttbraces{theorem,lemma,proposition}\bracks{\meta{options}}. -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}. +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}. \end{docCommand} \begin{tcbwritetemp} @@ -240,7 +251,9 @@ Alternatively, the optional argument may contain any of the following keys. \begin{docKey}{note} {=\meta{text}} {initially unset} -Alias \docAuxKey[][doc label=thmuse/name]{name}. This is the key-value equivalent of the optional argument described above. This syntax, however, allows the argument to contain other keys. +Alias \docAuxKey[][doc label=thmuse/name]{name}. +This is the key-value equivalent of the optional argument described above. +This syntax, however, allows the argument to contain other keys. \begin{keythmscode}[] \begin{theorem}[some heading] @@ -256,7 +269,8 @@ Some more text \begin{docKey}{short-note} {=\meta{text}} {initially unset} -Alias \docAuxKey{short-name}. This replaces the value of \refKey{note} when displayed in \refCom{listofkeytheorems}. +Alias \docAuxKey{short-name}. +This replaces the value of \refKey{note} when displayed in \refCom{listofkeytheorems}. \end{docKey} \begin{docKey}{label} @@ -276,7 +290,10 @@ Some text \begin{docKey}{continues} {\sarg=\meta{label name}} {initially unset} -Pick up a theorem where you left off. The theorem number remains the same. The printed text can be customized with the \refKey{continues-code} option. The starred version also copies the theorem note, if it exists. +Pick up a theorem where you left off. +The theorem number remains the same. +The printed text can be customized with the \refKey{continues-code} option. +The starred version also copies the theorem note, if it exists. \begin{keythmscode}[] \begin{theorem}[continues=foo] @@ -289,7 +306,8 @@ Pick up a theorem where you left off. The theorem number remains the same. The p \begin{docKey}{store} {=\meta{tag}} {initially unset} -Alias \docAuxKey{restate}. Stores the the theorem to be restated at any point in the document with \refCom{getkeytheorem}. +Alias \docAuxKey{restate}. +Stores the the theorem to be restated at any point in the document with \refCom{getkeytheorem}. \begin{keythmscode}[] \begin{theorem}[store=blub] @@ -299,7 +317,8 @@ 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. The latter issue can be averted with the \texttt{ampersand-replacement} key. +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} \usepackage{tikz} @@ -323,7 +342,8 @@ Y \ar[r] \& S \begin{docKey}{listhack} {=\docValue*{true}\textbar\docValue*{false}} {initially |false|} -Meant only to be used with the \refKey{break} style key for a theorem starting with a list. Compare: +Meant only to be used with the \refKey{break} style key for a theorem starting with a list. +Compare: \begin{tcbwritetemp} \newkeytheoremstyle{breaksty}{break} @@ -350,12 +370,15 @@ Note that the value |true| must be explicitly set so that |listhack| is not inte \begin{docKey}[][doc label=thm/seq]{seq} {=\meta{name}} {initially unset} -Adds the theorem to a custom sequence \meta{name} that can then be listed with \cs{listofkeytheorems}\bracks{seq=\meta{name}}. See \refKey{listof/seq} for more details. +Adds the theorem to a custom sequence \meta{name} that can then be listed with \cs{listofkeytheorems}\bracks{seq=\meta{name}}. +See \refKey{listof/seq} for more details. \end{docKey} \subsection{Keys inherited from \pkg{thmtools}} \label{thm-thmtools-keys} -These are the \oarg{options} available to \cs{newkeytheorem}. Except for \refKey{thm/name} and \refKey{style}, each key below can also be used in \refCom{newkeytheoremstyle}. For more description, see the \href{https://ctan.org/pkg/thmtools}{\pkg{thmtools}} package. +These are the \oarg{options} available to \cs{newkeytheorem}. +Except for \refKey{thm/name} and \refKey{style}, each key below can also be used in \refCom{newkeytheoremstyle}. +For more description, see the \href{https://ctan.org/pkg/thmtools}{\pkg{thmtools}} package. \begin{docKey}[][doc label=thm/name]{name} {=\meta{display name}} @@ -475,13 +498,16 @@ Some 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 two strings separated by a comma, then the second string is the plural form used by \cs{cref}. +If a single string, then the name used by \pkg{hyperref}'s \cs{autoref} and \pkg{cleveref}'s \cs{cref}. +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}. Note that \cs{Autoref} is defined by \pkg{keytheorems}, but requires \pkg{hyperref} to work. +Same as \refKey{refname} but for \docAuxCommand{Autoref} and \cs{Cref}. +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} \newkeytheorem{prop}[ @@ -509,7 +535,8 @@ Consider \cref{abc,def}. \begin{docKey}{qed} {\colOpt{=\meta{symbol}}} {default \cs{openbox}, initially unset} -Adds \colOpt{\meta{symbol}} to the end of the theorem body. If no value is given, the symbol \openbox\ is used. +Adds \colOpt{\meta{symbol}} to the end of the theorem body. +If no value is given, the symbol \openbox\ is used. \begin{tcbwritetemp} \newkeytheorem{example}[qed] @@ -587,7 +614,11 @@ Some text \begin{docCommand}{newkeytheoremstyle} {\marg{name}\marg{options}} -This is \pkg{keytheorems}' version of \pkg{thmtools}' \cs{declaretheoremstyle}\bracks{\meta{options}}\marg{name}. Since it makes little sense to define a style with no keys, we've made the \meta{options} argument mandatory. Note that unlike \pkg{amsthm}'s \cs{newtheoremstyle}, this command will error if a style has already been defined. To overwrite an existing style, there is the analogous \docAuxCommand{renewkeytheoremstyle}. For completeness, there is also \docAuxCommand{declarekeytheoremstyle} and \docAuxCommand{providekeytheoremstyle}. +This is \pkg{keytheorems}' version of \pkg{thmtools}' \cs{declaretheoremstyle}\bracks{\meta{options}}\marg{name}. +Since it makes little sense to define a style with no keys, we've made the \meta{options} argument mandatory. +Note that unlike \pkg{amsthm}'s \cs{newtheoremstyle}, this command will error if a style has already been defined. +To overwrite an existing style, there is the analogous \docAuxCommand{renewkeytheoremstyle}. +For completeness, there is also \docAuxCommand{declarekeytheoremstyle} and \docAuxCommand{providekeytheoremstyle}. \end{docCommand} \begin{notebox} @@ -596,7 +627,8 @@ For the AMS classes \cls{amsart}, \cls{amsbook}, and \cls{amsproc}, as well as t \subsection{Keys inherited from \pkg{thmtools}} -The following keys have the same meaning and syntax as the corresponding \pkg{thmtools} keys. In addition to the list below, most of the keys available to \refCom{newkeytheorem} can be used in \cs{newkeytheoremstyle}. +The following keys have the same meaning and syntax as the corresponding \pkg{thmtools} keys. +In addition to the list below, most of the keys available to \refCom{newkeytheorem} can be used in \cs{newkeytheoremstyle}. \begin{docKey}{spaceabove} {=\meta{length}} @@ -658,7 +690,7 @@ Do not use this with the \refKey{postheadspace} key. \end{docKey} -\begin{docKey}{headstyle} +\begin{docKey}{headformat} {=\docValue{margin}\textbar\docValue{swapnumber}\textbar\meta{code using \cs{NAME}, \cs{NUMBER}, and \cs{NOTE}}} {} Alias \docAuxKey{headstyle}. Within \meta{code}, the commands \docAuxCommand{NAME}, \docAuxCommand{NUMBER}, and \docAuxCommand{NOTE} correspond to the formatted parts of the theorem head. @@ -669,16 +701,20 @@ Alias \docAuxKey{headstyle}. Within \meta{code}, the commands \docAuxCommand{NAM \begin{docKey}{inherit-style} {=\meta{style name}} {initially unset} -Inherit the keys of any style declared with \refCom{newkeytheoremstyle}. Additionally, the three styles predefined by \pkg{amsthm} are possible values: \docValue{plain}, \docValue{definition}, and \docValue{remark}. +Inherit the keys of any style declared with \refCom{newkeytheoremstyle}. +Additionally, the three styles predefined by \pkg{amsthm} are possible values: \docValue{plain}, \docValue{definition}, and \docValue{remark}. \end{docKey} \section{Restating Theorems} -When a theorem is given the \refKey{store} key, the contents of the theorem are saved and written to a |.thlist| file. At the start of the next run, this file is input at the beginning of the document and allows you to retrieve the stored theorems at any point, before or after the original theorem. +When a theorem is given the \refKey{store} key, the contents of the theorem are saved and written to a |.thlist| file. +At the start of the next run, this file is input at the beginning of the document and allows you to retrieve the stored theorems at any point, before or after the original theorem. \begin{docCommand}{getkeytheorem} {\oarg{property}\marg{tag}} -Retrieves the theorem given the key |store=|\meta{tag}. An optional \meta{property} can be given to retrieve only the corresponding part of the theorem. Currently only the property |body| is implemented, which retrieves the (unformatted) body of the theorem. +Retrieves the theorem given the key |store=|\meta{tag}. +An optional \meta{property} can be given to retrieve only the corresponding part of the theorem. +Currently only the property |body| is implemented, which retrieves the (unformatted) body of the theorem. \begin{keythmscode}[] \getkeytheorem{mytag} @@ -712,7 +748,9 @@ example! \begin{docCommand}{listofkeytheorems} {\oarg{options}} - +Similar to \cs{listoffigures} or \cs{listoftables} but for theorems. +For \cls{memoir} and the AMS classes, \pkg{keytheorems} tries to copy the formatting of these commands as defined by the class. +For other classes, manual adjustments to \refKey{numwidth} and \refKey{indent} may be necessary. \end{docCommand} \begin{docCommand}{keytheoremlistset} @@ -729,7 +767,7 @@ example! \begin{docKey}{numwidth} {=\meta{length}} {initially |2.3em|} - +For the AMS classes, this is initially |1.5pc|. \end{docKey} \begin{docKey}{ignore} @@ -773,7 +811,9 @@ example! \begin{docKey}{title} {=\meta{text}} {initially \cs{GetTranslation}\ttbraces{keythms\string_listof\string_title}} -Defaults to ``List of Theorems'' if English or an unknown language is used. Currently French, German, and Spanish have (likely inaccurate!) translations. A translation can be added with a GitHub pull request or manually with \cs{DeclareTranslation}\marg{lang}\ttbraces{keythms\string_listof\string_title}\marg{text}. +Defaults to ``List of Theorems'' if English or an unknown language is used. +Currently French, German, Italian, and Spanish have (likely inaccurate!) translations. +A translation can be added with a GitHub pull request or manually with \cs{DeclareTranslation}\marg{lang}\ttbraces{keythms\string_listof\string_title}\marg{text}. \end{docKey} \begin{docKey}{swapnumber} @@ -784,28 +824,40 @@ Defaults to ``List of Theorems'' if English or an unknown language is used. Curr \subsection{Keys added by \pkg{keytheorems}} +\begin{docKey}{indent} + {=\meta{length}} + {initially |1.5em|} +Sets the left indent of items in the list of theorems. +For \cls{memoir} and the AMS classes, the indent is initially |0pt|. +It is not recommended to change this unless your class has different defaults not already covered. +\end{docKey} + \begin{docKey}{onlynumbered} {\colOpt{=\marg{comma-list of env names}}} {initially unset} -Similar to \refKey{onlynamed}, but lists only those theorems which are numbered. This is useful if you'd like to exclude things like unnumbered definitions and remarks from the list of theorems. +Similar to \refKey{onlynamed}, but lists only those theorems which are numbered. +This is useful if you'd like to exclude things like unnumbered definitions and remarks from the list of theorems. \end{docKey} \begin{docKey}[][doc label=listof/seq]{seq} {=\meta{name}} {initially unset} -Used to list only the theorems added to the custom sequence \meta{name} with the \refKey{thm/seq} theorem key. This is the only way to fully customize which theorems appear in the list of theorems. Unlike with \refKey{show}, you do not need to use \refKey{ignoreall} to prevent theorems not in \meta{name} from being printed. +Used to list only the theorems added to the custom sequence \meta{name} with the \refKey{thm/seq} theorem key. +This is the only way to fully customize which theorems appear in the list of theorems. +Unlike with \refKey{show}, you do not need to use \refKey{ignoreall} to prevent theorems not in \meta{name} from being printed. \end{docKey} \begin{docKey}{title-code} {=\meta{code with \textup{\texttt{\#1}}}} {initially \cs{section*}\ttbraces{\#1}} -If \cs{chapter} is defined, then initially this is instead \cs{chapter*}\ttbraces{\#1}. +If \cs{chapter} is defined, then initially this is instead \cs{chapter*}\ttbraces{\#1}. This key has no effect if used with an AMS class because these classes hard-code the section heading into \cs{@starttoc}. \end{docKey} \begin{docKey}{no-title} - {} - {initially unset} -Suppresses the title of the list of theorems. Useful for custom ordering of the list. + {\colOpt{=true\textbar false}} + {initially |false|} +Suppresses the title of the list of theorems. +Useful for custom ordering of the list. \begin{keythmscode}[] \keytheoremlistset{ignoreall} @@ -824,7 +876,8 @@ Formats the optional note in the list of theorems. \begin{docKey}{print-body} {} {initially unset} -Instead of listing the theorem headings, the theorems are restated with their body text. Not very useful without the \refKey{store-all} load-time option. +Instead of listing the theorem headings, the theorems are restated with their body text. +Not very useful without the \refKey{store-all} load-time option. \end{docKey} \begin{docKey}{no-continues} @@ -836,7 +889,8 @@ Suppresses the printing of theorems given the \refKey{continues} key in the list \begin{docKey}{no-chapter-skip} {\colOpt{=true\textbar false}} {initially |false|} -By default a small vertical space is inserted between each chapter's chunk of theorems. Setting this key to |true| removes this space. +By default a small vertical space is inserted between each chapter's chunk of theorems. +Setting this key to |true| removes this space. \end{docKey} \begin{docKey}{chapter-skip-length} @@ -845,15 +899,18 @@ By default a small vertical space is inserted between each chapter's chunk of th Controls the amount of space inserted between chunks. \end{docKey} +\begin{docKey}{no-toc} + {\colOpt{=true\textbar false}} + {initially false} +With the standard classes, lists of figures/tables are not added to the table of contents by default. The same is true for \cs{listofkeytheorems}, and with those classes this key does nothing. However some classes, notably \cls{memoir} and the AMS classes, do add lists to the table of contents. With these classes, this key suppresses the addition of the list of theorems to the table of contents. +\end{docKey} + \subsection{Adding code to list of theorems} -There are analogous commands to \cs{addcontentsline} and \cs{addtocontents} for -adding entries or arbitrary code to the list of theorems. +There are analogous commands to \cs{addcontentsline} and \cs{addtocontents} for adding entries or arbitrary code to the list of theorems. \begin{notebox} -You \emph{must} use these commands rather than the aforementioned because the -|.thlist| file is also used to define restated theorems and cannot contain -unexpected code. +You \emph{must} use these commands rather than the aforementioned because the |.thlist| file is also used to define restated theorems and cannot contain unexpected code. \end{notebox} \begin{docCommand}{addtheoremcontentsline} @@ -870,7 +927,9 @@ unexpected code. \begin{docCommand}{addtotheoremhook} {\oarg{env name}\marg{hook name}\marg{code}} -\meta{hook name} can be \hook{prehead}, \hook{posthead}, \hook{prefoot}, \hook{postfoot}, or \hook{restated}. If no \meta{env name} is given, the \meta{code} is added to the ``generic'' hook, i.e. applied to all theorems. As in \pkg{thmtools}, the order of hooks is as follows: +\meta{hook name} can be \hook{prehead}, \hook{posthead}, \hook{prefoot}, \hook{postfoot}, or \hook{restated}. +If no \meta{env name} is given, the \meta{code} is added to the ``generic'' hook, i.e. applied to all theorems. +As in \pkg{thmtools}, the order of hooks is as follows: \begin{center} \tcbset{ @@ -898,7 +957,8 @@ unexpected code. \tcbox{generic\\ \hook{postfoot}} \tcbox{\meta{env name}\\ \hook{postfoot}} \end{center} -The \hook{restated} hook is applied at the start of theorems retrieved with \cs{getkeytheorem}, before the \hook{prehead} hook. This can be useful for disabling commands such as \cs{footnote} in the restated theorems, e.g. +The \hook{restated} hook is applied at the start of theorems retrieved with \cs{getkeytheorem}, before the \hook{prehead} hook. +This can be useful for disabling commands such as \cs{footnote} in the restated theorems, e.g. \begin{dispListing} \addtotheoremhook{restated}{% \renewcommand\footnote[2][]{}% @@ -911,16 +971,24 @@ In \pkg{thmtools}, the \hook{prefoot} and \hook{postfoot} hooks always prepend c \addtotheorempostfoothook{A} \addtotheorempostfoothook{B} \end{dispListing} -results in |BA| after the theorem. With \pkg{keytheorems}, code is added in the order declared, meaning +results in |BA| after the theorem. +With \pkg{keytheorems}, code is added in the order declared, meaning \begin{dispListing} \addtotheoremhook{postfoot}{A} \addtotheoremhook{postfoot}{B} \end{dispListing} -results in |AB| after the theorem. This is the behavior of the \LaTeX{} kernel hooks that \pkg{keytheorems} uses under the hood. +results in |AB| after the theorem. +This is the behavior of the \LaTeX{} kernel hooks that \pkg{keytheorems} uses under the hood. -Right now, code added using the hook keys \refKey{preheadhook}, etc. is outermost, meaning executed first in \hook{prehead} and \hook{posthead} and last in \hook{prefoot} and \hook{postfoot}. This may change if I think of good reasons to do so\dots +Right now, code added using the hook keys \refKey{preheadhook}, etc. is outermost, meaning executed first in \hook{prehead} and \hook{posthead} and last in \hook{prefoot} and \hook{postfoot}. +This may change if I think of good reasons to do so\dots \end{docCommand} +\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}}. + %\section{Implementation} %\inputminted[linenos,style=bw]{latex}{../keytheorems.sty} diff --git a/Master/texmf-dist/tex/latex/keytheorems/class-support/keythms-amsart-support.tex b/Master/texmf-dist/tex/latex/keytheorems/class-support/keythms-amsart-support.tex new file mode 100644 index 00000000000..36f89461d22 --- /dev/null +++ b/Master/texmf-dist/tex/latex/keytheorems/class-support/keythms-amsart-support.tex @@ -0,0 +1,61 @@ +% 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-09-16}{0.1.2} + {keytheorems~support~for~the~amsart~class} + +\__keythms_support_AMSshared_code: + +\IfClassLoadedTF { acmart } + { % acmart loads amsart + \keytheoremset{overload} % since acmart predefines several theorems + \keythms_thmstyle_setdefaultkeys:n + { + spaceabove = .5\baselineskip plus .2\baselineskip minus .2\baselineskip, + spacebelow = .5\baselineskip plus .2\baselineskip minus .2\baselineskip, + bodyfont = \@acmplainbodyfont, + headindent = \@acmplainindent, + headfont = \@acmplainheadfont, + headpunct = {.}, + postheadspace = .5em, + notefont = \@acmplainnotefont, + notebraces = {(}{)}, + headstyle = \keythms_thmstyle_headcmd_default:nnn{#1}{#2}{#3}, + } + \keys_define:nn { keytheorems/thmstyle } + { + inherit-style / acmplain .meta:n = {}, + inherit-style / acmdefinition .meta:n = + { + bodyfont = \@acmdefinitionbodyfont, + headindent = \@acmdefinitionindent, + headfont = \@acmdefinitionheadfont, + notefont = \@acmdefinitionnotefont, + }, + } + % TODO: define inherit-style=acmdefinition/acmplain + } + { + \keythms_thmstyle_setdefaultkeys:n + { + spaceabove = .5\baselineskip plus .2\baselineskip minus .2\baselineskip, + spacebelow = .5\baselineskip plus .2\baselineskip minus .2\baselineskip, + bodyfont = \itshape, + headindent = 0pt, + headfont = \bfseries, + headpunct = {.}, + postheadspace = 5pt plus 1pt minus 1pt, + notefont = \fontseries\mddefault\upshape, + notebraces = {(}{)}, + headstyle = \keythms_thmstyle_headcmd_default:nnn{#1}{#2}{#3}, + } + } + +\keys_define:nn { keytheorems/thmstyle } + { + inherit-style / remark .meta:n = + { + headfont = \itshape, + bodyfont = \normalfont, + } + }
\ No newline at end of file diff --git a/Master/texmf-dist/tex/latex/keytheorems/class-support/keythms-amsbook-support.tex b/Master/texmf-dist/tex/latex/keytheorems/class-support/keythms-amsbook-support.tex new file mode 100644 index 00000000000..e7e83ea1cbe --- /dev/null +++ b/Master/texmf-dist/tex/latex/keytheorems/class-support/keythms-amsbook-support.tex @@ -0,0 +1,29 @@ +% 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-09-16}{0.1.2} + {keytheorems~support~for~the~amsbook~class} + +\__keythms_support_AMSshared_code: + +\keythms_thmstyle_setdefaultkeys:n + { + spaceabove = .5\baselineskip plus .2\baselineskip minus .2\baselineskip, + spacebelow = .5\baselineskip plus .2\baselineskip minus .2\baselineskip, + bodyfont = \itshape, + headindent = \parindent, + headfont = \scshape, + headpunct = {.}, + postheadspace = 5pt plus 1pt minus 1pt, + notefont = \fontseries\mddefault\upshape, + notebraces = {(}{)}, + headstyle = \keythms_thmstyle_headcmd_default:nnn{#1}{#2}{#3}, + } + +\keys_define:nn { keytheorems/thmstyle } + { + inherit-style / remark .meta:n = + { + bodyfont = \normalfont, + }, + }
\ No newline at end of file diff --git a/Master/texmf-dist/tex/latex/keytheorems/class-support/keythms-amsproc-support.tex b/Master/texmf-dist/tex/latex/keytheorems/class-support/keythms-amsproc-support.tex new file mode 100644 index 00000000000..a3bb1d65b96 --- /dev/null +++ b/Master/texmf-dist/tex/latex/keytheorems/class-support/keythms-amsproc-support.tex @@ -0,0 +1,29 @@ +% 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-09-16}{0.1.2} + {keytheorems~support~for~the~amsproc~class} + +\__keythms_support_AMSshared_code: + +\keythms_thmstyle_setdefaultkeys:n + { + spaceabove = .5\baselineskip plus .2\baselineskip minus .2\baselineskip, + spacebelow = .5\baselineskip plus .2\baselineskip minus .2\baselineskip, + bodyfont = \itshape, + headindent = \parindent, + headfont = \scshape, + headpunct = {.}, + postheadspace = 5pt plus 1pt minus 1pt, + notefont = \fontseries\mddefault\upshape, + notebraces = {(}{)}, + headstyle = \keythms_thmstyle_headcmd_default:nnn{#1}{#2}{#3}, + } + +\keys_define:nn { keytheorems/thmstyle } + { + inherit-style / remark .meta:n = + { + bodyfont = \normalfont, + }, + }
\ No newline at end of file diff --git a/Master/texmf-dist/tex/latex/keytheorems/class-support/keythms-memoir-support.tex b/Master/texmf-dist/tex/latex/keytheorems/class-support/keythms-memoir-support.tex new file mode 100644 index 00000000000..4fa28040426 --- /dev/null +++ b/Master/texmf-dist/tex/latex/keytheorems/class-support/keythms-memoir-support.tex @@ -0,0 +1,48 @@ +% 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-09-16}{0.1.2} + {keytheorems~support~for~the~memoir~class} + +\bool_new:N \l__keythms_support_titlecode_bool + +\keys_define:nn { keytheorems/listof } + { + indent .initial:n = 0pt, + title-code .code:n = + { + \bool_set_true:N \l__keythms_support_titlecode_bool + \cs_set:Npn \__keythms_listof_titlecmd:n ##1 { #1 } + }, + } + +% use memoir's list function; not using \newlistentry, though +\newlistof{ keythms_support_memoir_listof:w }{ thlist } + { \l__keythms_listof_title_tl } + +\RenewDocumentCommand \listofkeytheorems { O{} } + { + \bool_gset_true:N \g__keythms_listof_writefile_bool + \group_begin: + \keys_set:nn { keytheorems/listof } { #1 } + \bool_if:NT \l__keythms_listof_nochapskip_bool + { + \cs_set_eq:NN \KeyThmsAddvspace \use_none:n + } + \bool_if:NTF \l__keythms_listof_notitle_bool + { + \cs_set:Npn \@thlistmaketitle {} + \keythms_support_memoir_listof:w* + } + { + \bool_if:NT \l__keythms_support_titlecode_bool + { + \cs_set:Npn \@thlistmaketitle + { \__keythms_listof_titlecmd:n { \l__keythms_listof_title_tl } } + } + \bool_if:NTF \l__keythms_listof_notoc_bool + { \keythms_support_memoir_listof:w* } + { \keythms_support_memoir_listof:w } + } + \group_end: + }
\ No newline at end of file diff --git a/Master/texmf-dist/tex/latex/keytheorems/keytheorems.sty b/Master/texmf-dist/tex/latex/keytheorems/keytheorems.sty index 540a2ca800b..28c485083e9 100644 --- a/Master/texmf-dist/tex/latex/keytheorems/keytheorems.sty +++ b/Master/texmf-dist/tex/latex/keytheorems/keytheorems.sty @@ -1,5 +1,8 @@ +% 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 \NeedsTeXFormat{LaTeX2e}[2023-06-01] -\ProvidesExplPackage{keytheorems}{2024-09-09}{0.1.1}{l3keys interface to amsthm} +\ProvidesExplPackage{keytheorems}{2024-09-16}{0.1.2}{l3keys interface to amsthm} \IfFormatAtLeastTF { 2024-06-01 } { } { @@ -10,6 +13,8 @@ \cs_generate_variant:Nn \tl_put_right:Nn { Ne } \ProvideDocumentCommand \IfPackageLoadedT { m m } { \IfPackageLoadedTF{#1}{#2}{ } } + \ProvideDocumentCommand \IfClassLoadedT { m m } + { \IfClassLoadedTF{#1}{#2}{ } } } \RequirePackage{aliascnt} % for sibling theorems \RequirePackage{amsthm} @@ -65,6 +70,10 @@ Theorem~style~'#1'~already~defined.~ Use~\protect\renewkeytheoremstyle\space instead. } +\msg_new:nnn { keytheorems } { title-code-with-AMS } + { + The~'title-code'~key~has~no~effect~with~an~AMS~class. + } % Error if thmtools loaded since compilation hangs. % If thmtools loaded after, produce warning. @@ -201,19 +210,19 @@ spacebelow = 0.5\topsep, }, % thm keys that are saved for later - numbered .code:n = \keythms_thmstyle_savethmkey_optval:n { #1 }, - parent .code:n = \keythms_thmstyle_savethmkey_reqval:n { #1 }, - numberwithin .code:n = \keythms_thmstyle_savethmkey_reqval:n { #1 }, - within .code:n = \keythms_thmstyle_savethmkey_reqval:n { #1 }, - sibling .code:n = \keythms_thmstyle_savethmkey_reqval:n { #1 }, - numberlike .code:n = \keythms_thmstyle_savethmkey_reqval:n { #1 }, - sharenumber .code:n = \keythms_thmstyle_savethmkey_reqval:n { #1 }, - preheadhook .code:n = \keythms_thmstyle_savethmkey_reqval:n { #1 }, - postheadhook .code:n = \keythms_thmstyle_savethmkey_reqval:n { #1 }, - prefoothook .code:n = \keythms_thmstyle_savethmkey_reqval:n { #1 }, - postfoothook .code:n = \keythms_thmstyle_savethmkey_reqval:n { #1 }, - qed .code:n = \keythms_thmstyle_savethmkey_optval:n { #1 }, - tcolorbox .code:n = \keythms_thmstyle_savethmkey_optval:n { #1 }, + numbered .code:n = \keythms_thmstyle_savethmkey_optval:n { #1 }, + parent .code:n = \keythms_thmstyle_savethmkey_reqval:n { #1 }, + numberwithin .code:n = \keythms_thmstyle_savethmkey_reqval:n { #1 }, + within .code:n = \keythms_thmstyle_savethmkey_reqval:n { #1 }, + sibling .code:n = \keythms_thmstyle_savethmkey_reqval:n { #1 }, + numberlike .code:n = \keythms_thmstyle_savethmkey_reqval:n { #1 }, + sharenumber .code:n = \keythms_thmstyle_savethmkey_reqval:n { #1 }, + preheadhook .code:n = \keythms_thmstyle_savethmkey_reqval:n { #1 }, + postheadhook .code:n = \keythms_thmstyle_savethmkey_reqval:n { #1 }, + prefoothook .code:n = \keythms_thmstyle_savethmkey_reqval:n { #1 }, + postfoothook .code:n = \keythms_thmstyle_savethmkey_reqval:n { #1 }, + qed .code:n = \keythms_thmstyle_savethmkey_optval:n { #1 }, + tcolorbox .code:n = \keythms_thmstyle_savethmkey_optval:n { #1 }, tcolorbox-no-titlebar .code:n = \keythms_thmstyle_savethmkey_optval:n { #1 }, } @@ -252,21 +261,14 @@ } } -%%% <SURELY A BETTER WAY> -\cs_new_protected:Npn \__keythms_thmstyle_definekeylist:nn #1#2 - { - \clist_const:cn { c__keythms_thmstyle_defaultkeys_ #1 _clist } { #2 } - } - -\cs_new_protected:Npn \__keythms_thmstyle_setdefaultkeys:n #1 +\cs_new_protected:Npn \keythms_thmstyle_setdefaultkeys:n #1 { - \keys_precompile:nvN { keytheorems/thmstyle } - { c__keythms_thmstyle_defaultkeys_ #1 _clist } + \keys_precompile:nnN { keytheorems/thmstyle } + { #1 } \l__keythms_thmstyle_defaultkeys_tl } - -\__keythms_thmstyle_definekeylist:nn { default } - { +\keythms_thmstyle_setdefaultkeys:n + { % support files may overwrite these defaults spaceabove = \topsep, spacebelow = \topsep, bodyfont = \itshape, @@ -278,105 +280,6 @@ notebraces = {(}{)}, headstyle = \keythms_thmstyle_headcmd_default:nnn{#1}{#2}{#3}, } -\__keythms_thmstyle_definekeylist:nn { amsart } - { - spaceabove = .5\baselineskip plus .2\baselineskip minus .2\baselineskip, - spacebelow = .5\baselineskip plus .2\baselineskip minus .2\baselineskip, - bodyfont = \itshape, - headindent = 0pt, - headfont = \bfseries, - headpunct = {.}, - postheadspace = 5pt plus 1pt minus 1pt, - notefont = \fontseries\mddefault\upshape, - notebraces = {(}{)}, - headstyle = \keythms_thmstyle_headcmd_default:nnn{#1}{#2}{#3}, - } -\__keythms_thmstyle_definekeylist:nn { amsproc } - { - spaceabove = .5\baselineskip plus .2\baselineskip minus .2\baselineskip, - spacebelow = .5\baselineskip plus .2\baselineskip minus .2\baselineskip, - bodyfont = \itshape, - headindent = \parindent, - headfont = \scshape, - headpunct = {.}, - postheadspace = 5pt plus 1pt minus 1pt, - notefont = \fontseries\mddefault\upshape, - notebraces = {(}{)}, - headstyle = \keythms_thmstyle_headcmd_default:nnn{#1}{#2}{#3}, - } -\__keythms_thmstyle_definekeylist:nn { amsbook } - { - spaceabove = .5\baselineskip plus .2\baselineskip minus .2\baselineskip, - spacebelow = .5\baselineskip plus .2\baselineskip minus .2\baselineskip, - bodyfont = \itshape, - headindent = \parindent, - headfont = \scshape, - headpunct = {.}, - postheadspace = 5pt plus 1pt minus 1pt, - notefont = \fontseries\mddefault\upshape, - notebraces = {(}{)}, - headstyle = \keythms_thmstyle_headcmd_default:nnn{#1}{#2}{#3}, - } -\__keythms_thmstyle_definekeylist:nn { acmart } - { - spaceabove = .5\baselineskip plus .2\baselineskip minus .2\baselineskip, - spacebelow = .5\baselineskip plus .2\baselineskip minus .2\baselineskip, - bodyfont = \@acmplainbodyfont, - headindent = \@acmplainindent, - headfont = \@acmplainheadfont, - headpunct = {.}, - postheadspace = .5em, - notefont = \@acmplainnotefont, - notebraces = {(}{)}, - headstyle = \keythms_thmstyle_headcmd_default:nnn{#1}{#2}{#3}, - } - -\IfClassLoadedTF { amsart } - { - \IfClassLoadedTF { acmart } % acmart loads amsart - { - \__keythms_thmstyle_setdefaultkeys:n { acmart } - } - { - \__keythms_thmstyle_setdefaultkeys:n { amsart } - \keys_define:nn { keytheorems/thmstyle } - { - inherit-style / remark .meta:n = - { - headfont = \itshape, - bodyfont = \normalfont, - } - } - } - } - { - \IfClassLoadedTF { amsbook } - { - \__keythms_thmstyle_setdefaultkeys:n { amsbook } - \keys_define:nn { keytheorems/thmstyle } - { - inherit-style / remark .meta:n = - { - bodyfont = \normalfont, - }, - } - } - { - \IfClassLoadedTF { amsproc } - { - \__keythms_thmstyle_setdefaultkeys:n { amsproc } - \keys_define:nn { keytheorems/thmstyle } - { - inherit-style / remark .meta:n = - { - bodyfont = \normalfont, - }, - } - } - { \__keythms_thmstyle_setdefaultkeys:n { default } } - } - } -%%% </SURELY A BETTER WAY> \NewDocumentCommand \newkeytheoremstyle { m m } { @@ -730,6 +633,8 @@ \exp_args:Nno \__keythms_thm_tcboxcode:nn { #1 } { \l__keythms_thm_tcbkeys_tl } } + % Set up list-of definition + \cs_set_eq:cN { l@ #1 } \keythms_listof_tocline: % Set default list-of display command \__keythms_listof_show_aux:n { #1 } % Set theorem style back to original state if needed @@ -1319,6 +1224,8 @@ { numwidth .dim_set:N = \l__keythms_listof_numwidth_dim, numwidth .initial:n = 2.3em, + indent .dim_set:N = \l__keythms_listof_indent_dim, + indent .initial:n = 1.5em, ignore .code:n = { \hook_gput_code:nnn { begindocument/before } { keytheorems } @@ -1386,6 +1293,8 @@ no-chapter-skip .initial:n = false, chapter-skip-length .dim_set:N = \keythms@listof@chaptervspace@dim, chapter-skip-length .initial:n = 10pt, + no-toc .bool_set:N = \l__keythms_listof_notoc_bool, + no-toc .initial:n = false, % false does not mean "to-toc" for standard classes } \hook_gput_code:nnn { begindocument } { . } % redefine these keys at begindocument @@ -1605,79 +1514,32 @@ { \cs_set_protected:Npn \__keythms_listof_titlecmd:n #1 { \chapter*{#1} } } { \cs_set_protected:Npn \__keythms_listof_titlecmd:n #1 { \section*{#1} } } -\hook_gput_code:nnn { begindocument } { . } - { % try to detect ams classes - \keythms_if_amsclass:TF - { - \prop_map_inline:Nn \g__keythms_thmnames_prop - { - \cs_set:cpn { l@ #1 } - { - \@tocline{ 0 }{ 3pt plus 2pt }{ 0pt } - { \l__keythms_listof_numwidth_dim }{ } - } - } - } - { - \prop_map_inline:Nn \g__keythms_thmnames_prop - { - \cs_set:cpn { l@ #1 } - { - \@dottedtocline{ 1 }{ 1.5em } - { \l__keythms_listof_numwidth_dim } - } - } - } - } +\cs_new_protected:Npn \__keythms_listof_default_tocline: + { + \@dottedtocline{ 1 }{ \l__keythms_listof_indent_dim } + { \l__keythms_listof_numwidth_dim } + } +\cs_new_eq:NN \keythms_listof_tocline: \__keythms_listof_default_tocline: -\keythms_if_amsclass:TF +\NewDocumentCommand \listofkeytheorems { O{} } { - \keys_define:nn { keytheorems/listof } % adjust to class + \bool_gset_true:N \g__keythms_listof_writefile_bool + \group_begin: + \keys_set:nn { keytheorems/listof } { #1 } + \bool_if:NT \l__keythms_listof_nochapskip_bool { - numwidth .initial:n = 1.5pc, - } - \NewDocumentCommand \listofkeytheorems { O{} } - { % title command not customizable here - \bool_gset_true:N \g__keythms_listof_writefile_bool - \group_begin: - \keys_set:nn { keytheorems/listof } { #1 } - \bool_if:NT \l__keythms_listof_nochapskip_bool - { - \cs_set_eq:NN \KeyThmsAddvspace \use_none:n - } - \legacy_if_set_false:n { @filesw } - \bool_if:NTF \l__keythms_listof_notitle_bool - { - \@starttoc{ thlist }{ } - } - { % ams classes don't expand title enough - \protected@edef \l__keythms_tmpa_tl { \l__keythms_listof_title_tl } - \@starttoc{ thlist }{ \l__keythms_tmpa_tl } - } - \group_end: + \cs_set_eq:NN \KeyThmsAddvspace \use_none:n } - } - { - \NewDocumentCommand \listofkeytheorems { O{} } + \bool_if:NF \l__keythms_listof_notitle_bool { - \bool_gset_true:N \g__keythms_listof_writefile_bool - \group_begin: - \keys_set:nn { keytheorems/listof } { #1 } - \bool_if:NT \l__keythms_listof_nochapskip_bool - { - \cs_set_eq:NN \KeyThmsAddvspace \use_none:n - } - \bool_if:NF \l__keythms_listof_notitle_bool - { - \__keythms_listof_titlecmd:n { \l__keythms_listof_title_tl } - \@mkboth % QUESTION: should this go in titlecmd ? - { \MakeUppercase \l__keythms_listof_title_tl } - { \MakeUppercase \l__keythms_listof_title_tl } - } - \legacy_if_set_false:n { @filesw } - \@starttoc{ thlist } - \group_end: + \__keythms_listof_titlecmd:n { \l__keythms_listof_title_tl } + \@mkboth % QUESTION: should this go in titlecmd ? + { \MakeUppercase \l__keythms_listof_title_tl } + { \MakeUppercase \l__keythms_listof_title_tl } } + \legacy_if_set_false:n { @filesw } + \@starttoc{ thlist } + \group_end: } % ^ unlike thmtools we don't use the class's style of \listoffigures because % we want control over title-code, no-title, etc. But this means we have to guess @@ -2174,6 +2036,8 @@ \ProvideTranslation { French } { keythms_continues } { suite~de~la~p.\, } \ProvideTranslation { German } { keythms_listof_title } { Liste~der~Theoreme } \ProvideTranslation { German } { keythms_continues } { weiter~von~Seite~ } + \ProvideTranslation { Italian } { keythms_listof_title } { Elenco~dei~teoremi } + \ProvideTranslation { Italian } { keythms_continues } { continua~da~p.\, } \ProvideTranslation { Spanish } { keythms_listof_title } { Lista~de~teoremas } \ProvideTranslation { Spanish } { keythms_continues } { continĂșa~de~la~p.\, } } @@ -2181,4 +2045,62 @@ \ProcessKeyOptions[keytheorems] +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%% Support for non-default classes %%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\cs_new_protected:Npn \__keythms_support_AMSshared_code: + { + \keys_define:nn { keytheorems/listof } % adjust to AMS classes + { + numwidth .initial:n = 1.5pc, + indent .initial:n = 0pt, + title-code .code:n = + { % warn but set titlecmd just in case + \msg_warning:nn { keytheorems } { title-code-with-AMS } + \cs_set_protected:Npn \__keythms_listof_titlecmd:n ####1 { ##1 } + }, + } + \RenewDocumentCommand \listofkeytheorems { O{} } + { % title command not customizable here + \bool_gset_true:N \g__keythms_listof_writefile_bool + \group_begin: + \keys_set:nn { keytheorems/listof } { ##1 } + \bool_if:NT \l__keythms_listof_nochapskip_bool + { + \cs_set_eq:NN \KeyThmsAddvspace \use_none:n + } + \legacy_if_set_false:n { @filesw } + \bool_if:NTF \l__keythms_listof_notitle_bool + { % hacky! + \cs_set_eq:NN \@startsection \use_none:nnnnnnn + \@starttoc{ thlist }{ } + } + { % ams classes don't expand title enough + \protected@edef \l__keythms_tmpa_tl { \l__keythms_listof_title_tl } + \bool_if:NT \l__keythms_listof_notoc_bool + { \cs_set_eq:NN \addcontentsline \use_none:nnn } % hacky! + \@starttoc{ thlist }{ \l__keythms_tmpa_tl } + } + \group_end: + } + \cs_new:Npn \__keythms_listof_ams_tocline: + { + \@tocline{ 0 }{ 3pt plus 2pt }{ \l__keythms_listof_indent_dim } + { \l__keythms_listof_numwidth_dim }{ } + } + \cs_set_eq:NN \keythms_listof_tocline: \__keythms_listof_ams_tocline: + } + +\cs_new_protected:Npn \keythms_support_check:n #1 + { + \IfClassLoadedT { #1 } { \file_input:n { class-support/keythms-#1-support } } + } + +% 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 { memoir } + \file_input_stop:
\ No newline at end of file |