diff options
author | Karl Berry <karl@freefriends.org> | 2024-10-10 19:42:31 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2024-10-10 19:42:31 +0000 |
commit | add95d6be47ecbac0f09495c7ffe7cf86cfb5db9 (patch) | |
tree | 3f1a3177fcdac5969d80f26dba6b3f0f88d8a06c /Master/texmf-dist/tex | |
parent | c480fd1dd5b17382f14a520147c509b6a0b48948 (diff) |
keytheorems (10oct24)
git-svn-id: svn://tug.org/texlive/trunk@72516 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
8 files changed, 239 insertions, 103 deletions
diff --git a/Master/texmf-dist/tex/latex/keytheorems/class-support/keythms-IEEEtran-support.tex b/Master/texmf-dist/tex/latex/keytheorems/class-support/keythms-IEEEtran-support.tex new file mode 100644 index 00000000000..503850bef7b --- /dev/null +++ b/Master/texmf-dist/tex/latex/keytheorems/class-support/keythms-IEEEtran-support.tex @@ -0,0 +1,15 @@ +% Maintained by Matthew Bertucci, 2024-present +% Please report all issues and feature requests at https://github.com/mbertucci47/keytheorems +% This work is licensed under the LPPL version 1.3c or later: https://www.latex-project.org/lppl.txt +\ProvidesExplFile{keythms-IEEEtran-support}{\@keythms@date}{\@keythms@version} + {keytheorems~support~for~the~IEEEtran~class} + +\keys_define:nn { keytheorems/listof } + { + indent .initial:n = 0pt, + numwidth .initial:n = 2.75em, + } + +% IEEEtran has it's own way of doing theorems that amsthm overwrites. +% Not sure if we should attempt to copy its style. +\file_input_stop:
\ No newline at end of file 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 index c54a347a34a..69d70e3149d 100644 --- 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 @@ -1,37 +1,87 @@ % Maintained by Matthew Bertucci, 2024-present % Please report all issues and feature requests at https://github.com/mbertucci47/keytheorems % This work is licensed under the LPPL version 1.3c or later: https://www.latex-project.org/lppl.txt -\ProvidesExplFile{keythms-amsart-support}{2024-10-05}{0.1.6} +\ProvidesExplFile{keythms-amsart-support}{\@keythms@date}{\@keythms@version} {keytheorems~support~for~the~amsart~class} \__keythms_support_AMSshared_code: -\IfClassLoadedTF { acmart } - { % acmart loads amsart - \keytheoremset{overload} % since acmart predefines several theorems - \prop_gput_from_keyval:Nn \g__keythms_thmstyle_defaultkeys_prop +\keys_define:nn { keytheorems/thmstyle } + { + inherit-style / remark .meta:n = + { + bodyfont = \normalfont, + headfont = \itshape, + } + } + +\bool_case:nF + { + { \__keythms_if_classloaded_p:n { acmart } } { - bodyfont = \@acmplainbodyfont, - headfont = \@acmplainheadfont, - headindent = \@acmplainindent, - notefont = \@acmplainnotefont, - postheadspace = .5em, - spaceabove = .5\baselineskip plus .2\baselineskip minus .2\baselineskip, - spacebelow = .5\baselineskip plus .2\baselineskip minus .2\baselineskip, + \keytheoremset{overload} % since acmart predefines several theorems at begindocument + \prop_gput_from_keyval:Nn \g__keythms_thmstyle_defaultkeys_prop + { + bodyfont = \@acmplainbodyfont, + headfont = \@acmplainheadfont, + headindent = \@acmplainindent, + notefont = \@acmplainnotefont, + postheadspace = .5em, + spaceabove = + .5\baselineskip plus .2\baselineskip minus .2\baselineskip, + spacebelow = + .5\baselineskip plus .2\baselineskip minus .2\baselineskip, + } + \keys_define:nn { keytheorems/thmstyle } + { + inherit-style / acmplain .meta:n = {}, + inherit-style / acmdefinition .meta:n = + { + bodyfont = \@acmdefinitionbodyfont, + headindent = \@acmdefinitionindent, + headfont = \@acmdefinitionheadfont, + notefont = \@acmdefinitionnotefont, + }, + } } - \keys_define:nn { keytheorems/thmstyle } + { \__keythms_if_classloaded_p:n { aomart } } { - inherit-style / acmplain .meta:n = {}, - inherit-style / acmdefinition .meta:n = + \prop_gput_from_keyval:Nn \g__keythms_thmstyle_defaultkeys_prop + { + bodyfont = \sishape, + headfont = \scshape, + headindent = \parindent, + notefont = \normalfont, + postheadspace = 0.5em, + spaceabove = 0.5\linespacing, + spacebelow = 0.5\linespacing, + } + \keys_define:nn { keytheorems/thmstyle } { - bodyfont = \@acmdefinitionbodyfont, - headindent = \@acmdefinitionindent, - headfont = \@acmdefinitionheadfont, - notefont = \@acmdefinitionnotefont, - }, + inherit-style / definition .meta:n = + { + bodyfont = \upshape, + headfont = \sishape, + headindent = \parindent, + notefont = \normalfont, + postheadspace = 0.5em, + spaceabove = 0.5\linespacing, + spacebelow = 0.5\linespacing, + }, + inherit-style / remark .meta:n = + { + bodyfont = \upshape, + headfont = \sishape, + headindent = \parindent, + notefont = \normalfont, + postheadspace = 0.5em, + spaceabove = 0.5\linespacing, + spacebelow = 0.5\linespacing, + }, + } } } - { + { % the amsart defaults \prop_gput_from_keyval:Nn \g__keythms_thmstyle_defaultkeys_prop { spaceabove = .5\baselineskip plus .2\baselineskip minus .2\baselineskip, @@ -39,13 +89,4 @@ } } -\keys_define:nn { keytheorems/thmstyle } - { - inherit-style / remark .meta:n = - { - bodyfont = \normalfont, - headfont = \itshape, - } - } - \file_input_stop:
\ No newline at end of file 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 index 2ec0d09ee21..262e41db1b0 100644 --- 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 @@ -1,7 +1,7 @@ % Maintained by Matthew Bertucci, 2024-present % Please report all issues and feature requests at https://github.com/mbertucci47/keytheorems % This work is licensed under the LPPL version 1.3c or later: https://www.latex-project.org/lppl.txt -\ProvidesExplFile{keythms-amsbook-support}{2024-10-05}{0.1.6} +\ProvidesExplFile{keythms-amsbook-support}{\@keythms@date}{\@keythms@version} {keytheorems~support~for~the~amsbook~class} \__keythms_support_AMSshared_code: @@ -16,10 +16,7 @@ \keys_define:nn { keytheorems/thmstyle } { - inherit-style / remark .meta:n = - { - bodyfont = \normalfont, - }, + inherit-style / remark .meta:n = { bodyfont = \normalfont }, } \file_input_stop:
\ No newline at end of file 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 index 2883efc0403..e941bf6c081 100644 --- 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 @@ -1,7 +1,7 @@ % Maintained by Matthew Bertucci, 2024-present % Please report all issues and feature requests at https://github.com/mbertucci47/keytheorems % This work is licensed under the LPPL version 1.3c or later: https://www.latex-project.org/lppl.txt -\ProvidesExplFile{keythms-amsproc-support}{2024-10-05}{0.1.6} +\ProvidesExplFile{keythms-amsproc-support}{\@keythms@date}{\@keythms@version} {keytheorems~support~for~the~amsproc~class} \__keythms_support_AMSshared_code: @@ -16,10 +16,7 @@ \keys_define:nn { keytheorems/thmstyle } { - inherit-style / remark .meta:n = - { - bodyfont = \normalfont, - }, + inherit-style / remark .meta:n = { bodyfont = \normalfont }, } \file_input_stop:
\ No newline at end of file diff --git a/Master/texmf-dist/tex/latex/keytheorems/class-support/keythms-beamer-support.tex b/Master/texmf-dist/tex/latex/keytheorems/class-support/keythms-beamer-support.tex index 30d817086f3..7e68b4306f5 100644 --- a/Master/texmf-dist/tex/latex/keytheorems/class-support/keythms-beamer-support.tex +++ b/Master/texmf-dist/tex/latex/keytheorems/class-support/keythms-beamer-support.tex @@ -1,7 +1,7 @@ % Maintained by Matthew Bertucci, 2024-present % Please report all issues and feature requests at https://github.com/mbertucci47/keytheorems % This work is licensed under the LPPL version 1.3c or later: https://www.latex-project.org/lppl.txt -\ProvidesExplFile{keythms-beamer-support}{2024-10-05}{0.1.6} +\ProvidesExplFile{keythms-beamer-support}{\@keythms@date}{\@keythms@version} {keytheorems~support~for~the~beamer~class} % do nothing if noamsthm loaded @@ -11,8 +11,8 @@ { inherit-style / example .meta:n = { - bodyfont=\normalfont, - preheadhook=\def\inserttheoremblockenv{exampleblock}, + bodyfont = \normalfont, + preheadhook = \def\inserttheoremblockenv{exampleblock}, } } \keys_define:nn { keytheorems/thm } @@ -127,11 +127,6 @@ \msg_warning:nne { keytheorems } { store-reversed-not-got } { \l__keythms_thmuse_storereversed_tl } } - \renewcommand\label[2][]{} % disable \label (opt arg in case cleveref loaded) - \cs_set_eq:NN \ltx@label \use_none:n % disable \ltx@label - \cs_set_eq:NN \property_record:nn \use_none:nn % disable \RecordProperties - \cs_set_eq:NN \setuniqmark \use_none:n % work with numbered=unless-unique - % QUESTION: also disable \hyper@@anchor? \MakeLinkTarget? \hook_use:n { keytheorems/#1/restated } \hook_use:n { keytheorems/allthms/restated } \__keythms_thm_prehead_code:n { #1 } @@ -159,6 +154,7 @@ % This is the price of on-the-fly redefining the env to grab body \RenewDocumentEnvironment { #1 } { D<>{} ={note} O{} D<>{} } { + \tl_set:Nn \l_keythms_thmuse_envname_tl { #1 } \keys_set:nn { keytheorems/thmuse } { ##2 } \tl_if_empty:NF \l__keythms_thmuse_store_tl { diff --git a/Master/texmf-dist/tex/latex/keytheorems/class-support/keythms-jlreq-support.tex b/Master/texmf-dist/tex/latex/keytheorems/class-support/keythms-jlreq-support.tex new file mode 100644 index 00000000000..9c887e00d30 --- /dev/null +++ b/Master/texmf-dist/tex/latex/keytheorems/class-support/keythms-jlreq-support.tex @@ -0,0 +1,34 @@ +% Maintained by Matthew Bertucci, 2024-present +% Please report all issues and feature requests at https://github.com/mbertucci47/keytheorems +% This work is licensed under the LPPL version 1.3c or later: https://www.latex-project.org/lppl.txt +\ProvidesExplFile{keythms-jlreq-support}{\@keythms@date}{\@keythms@version} + {keytheorems~support~for~the~jlreq~class} + +\prop_gput_from_keyval:Nn \g__keythms_thmstyle_defaultkeys_prop + { + bodyfont = \prop_item:Nn \g__jlreq_complements_theorem_prop { font }, + headfont = + \prop_item:Nn \g__jlreq_complements_theorem_prop { label_font }, + headindent = + \dimexpr\prop_item:Nn \g__jlreq_complements_theorem_prop { indent }, + headpunct = {}, + postheadspace = 1\jlreq@zw, + notebraces = {(}{)}, + notefont = + \prop_item:Nn \g__jlreq_complements_theorem_prop { label_font }, + noteseparator = {}, + spaceabove = + \dimexpr\prop_item:Nn \g__jlreq_complements_theorem_prop { beforeafter_space } \relax, + spacebelow = + \dimexpr\prop_item:Nn \g__jlreq_complements_theorem_prop { beforeafter_space } \relax, + } + +\keys_define:nn { keytheorems/thmstyle } { inherit-style / jlreq .meta:n = {} } + +\keys_define:nn { keytheorems/listof } + { + indent .initial:n = 0\jlreq@gol, + numwidth .initial:n = 2\jlreq@gol, + } + +\file_input_stop:
\ 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 index 52ee578e06f..27992798e41 100644 --- 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 @@ -1,7 +1,7 @@ % Maintained by Matthew Bertucci, 2024-present % Please report all issues and feature requests at https://github.com/mbertucci47/keytheorems % This work is licensed under the LPPL version 1.3c or later: https://www.latex-project.org/lppl.txt -\ProvidesExplFile{keythms-memoir-support}{2024-10-05}{0.1.6} +\ProvidesExplFile{keythms-memoir-support}{\@keythms@date}{\@keythms@version} {keytheorems~support~for~the~memoir~class} \bool_new:N \l__keythms_support_titlecode_bool diff --git a/Master/texmf-dist/tex/latex/keytheorems/keytheorems.sty b/Master/texmf-dist/tex/latex/keytheorems/keytheorems.sty index 00781a8e143..f1e33f14d9b 100644 --- a/Master/texmf-dist/tex/latex/keytheorems/keytheorems.sty +++ b/Master/texmf-dist/tex/latex/keytheorems/keytheorems.sty @@ -2,7 +2,10 @@ % Please report all issues and feature requests at https://github.com/mbertucci47/keytheorems % This work is licensed under the LPPL version 1.3c or later: https://www.latex-project.org/lppl.txt \NeedsTeXFormat{LaTeX2e}[2023-06-01] -\ProvidesExplPackage{keytheorems}{2024-10-05}{0.1.6}{l3keys interface to amsthm} +\def\@keythms@date{2024-10-10} +\def\@keythms@version{0.1.7} +\ProvidesExplPackage{keytheorems}{\@keythms@date}{\@keythms@version} + {l3keys interface to amsthm} \IfFormatAtLeastTF { 2024-06-01 } { } { @@ -20,6 +23,8 @@ { \IfClassLoadedTF{#1}{#2}{ } } \ProvideDocumentCommand \IfClassLoadedWithOptionsT { m m m } { \IfClassLoadedWithOptionsTF{#1}{#2}{#3}{ } } + \ProvideDocumentCommand \IfPackageLoadedWithOptionsT { m m m } + { \IfPackageLoadedWithOptionsTF{#1}{#2}{#3}{ } } } \RequirePackage{aliascnt} \RequirePackage{amsthm} % ams classes have way of ignoring this @@ -197,7 +202,7 @@ break .meta:n = { postheadspace = \newline }, % add error if postheadspace set break .value_forbidden:n = true, headfont .tl_set:N = \l__keythms_thmstyle_headfont_tl, - headformat .meta:n = { headstyle = #1 }, + headformat .meta:n = { headstyle = {#1} }, % extra braces are necessary! Otherwise breaks if #1 contains comma headindent .tl_set:N = \l__keythms_thmstyle_headindent_tl, headpunct .tl_set:N = \l__keythms_thmstyle_headpunct_tl, headstyle .choice:, @@ -238,7 +243,19 @@ postheadhook .code:n = \keythms_thmstyle_savethmkey_reqval:n { #1 }, prefoothook .code:n = \keythms_thmstyle_savethmkey_reqval:n { #1 }, preheadhook .code:n = \keythms_thmstyle_savethmkey_reqval:n { #1 }, - qed .code:n = \keythms_thmstyle_savethmkey_optval:n { #1 }, + qed .code:n = + { % qed needs special treatment to distinguish qed from qed={} + \exp_args:No \tl_if_novalue:nTF { #1 } + { + \clist_put_right:No \l__keythms_thmstyle_savedkeys_clist + { \l_keys_key_str } + } + { + \clist_put_right:No \l__keythms_thmstyle_savedkeys_clist + { \l_keys_key_str = { #1 } } + } + }, + qed .default:n = \c_novalue_tl, sharenumber .code:n = \keythms_thmstyle_savethmkey_reqval:n { #1 }, sibling .code:n = \keythms_thmstyle_savethmkey_reqval:n { #1 }, tcolorbox .code:n = \keythms_thmstyle_savethmkey_optval:n { #1 }, @@ -412,7 +429,7 @@ \keys_define:nn { keytheorems/thm } { - heading .meta:n = { name = #1 }, + heading .meta:n = { name = {#1} }, name .tl_set:N = \l__keythms_thm_name_tl, numbered .choice:, numbered .default:n = true, @@ -425,8 +442,8 @@ }, numbered / unless~unique .meta:n = { numbered = unless-unique }, numbered / yes .meta:n = { numbered = true }, - numberlike .meta:n = { sibling = #1 }, - numberwithin .meta:n = { parent = #1 }, + numberlike .meta:n = { sibling = {#1} }, + numberwithin .meta:n = { parent = {#1} }, parent .tl_set:N = \l__keythms_thm_parent_tl, postfoothook .tl_set:N = \l__keythms_thm_postfoothook_tl, postheadhook .tl_set:N = \l__keythms_thm_postheadhook_tl, @@ -437,7 +454,7 @@ % ^ distinguish between 'qed' and 'qed={}' refname .tl_set:N = \l__keythms_thm_refname_tl, Refname .tl_set:N = \l__keythms_thm_Refname_tl, - sharenumber .meta:n = { sibling = #1 }, + sharenumber .meta:n = { sibling = {#1} }, sibling .tl_set:N = \l__keythms_thm_sibling_tl, style .tl_set:N = \l__keythms_thm_style_tl, style .groups:n = { style-comes-first }, @@ -456,8 +473,8 @@ } }, tcolorbox-no-titlebar .default:n = {}, - title .meta:n = { name = #1 }, - within .meta:n = { parent = #1 }, + title .meta:n = { name = {#1} }, + within .meta:n = { parent = {#1} }, } % what below is unnecessary? I really don't understand this code. @@ -471,7 +488,7 @@ \addvspace\@topsep \addvspace{-\parskip} \fi - % \global\@inlabeltrue % MY COMMENT: if this is uncommented then spacing after sections is wrong + % \global\@inlabeltrue % MB: if this is uncommented then spacing after sections is wrong \everypar\dth@everypar \cs_set:Npn \__keythms_thm_tcboxtemphead: { \normalfont #1 } \ignorespaces @@ -906,12 +923,12 @@ listhack / true .code:n = \bool_set_true:N \l__keythms_thmuse_listhack_bool, listhack / false .code:n = \bool_set_false:N \l__keythms_thmuse_listhack_bool, listhack .initial:n = false, - name .meta:n = { note = #1 }, + name .meta:n = { note = {#1} }, % ^ for compatibility. "name" is ambiguous and doesn't match amsthm language note .tl_set:N = \l__keythms_thmuse_note_tl, note .initial:n = {}, - restate .meta:n = { store = #1 }, % thmtools compatibility - restate* .meta:n = { store* = #1 }, + restate .meta:n = { store = {#1} }, % thmtools compatibility + restate* .meta:n = { store* = {#1} }, restate-keys .clist_set:N = \l__keythms_thmuse_restatekeys_clist, seq .code:n = {}, short-note .code:n = {}, % these do nothing at point of use @@ -982,11 +999,6 @@ \msg_warning:nne { keytheorems } { store-reversed-not-got } { \l__keythms_thmuse_storereversed_tl } } - \renewcommand\label[2][]{} % disable \label (opt arg in case cleveref loaded) - \cs_set_eq:NN \ltx@label \use_none:n % disable \ltx@label - \cs_set_eq:NN \property_record:nn \use_none:nn % disable \RecordProperties - \cs_set_eq:NN \setuniqmark \use_none:n % work with numbered=unless-unique - % QUESTION: also disable \hyper@@anchor? \MakeLinkTarget? \hook_use:n { keytheorems/#1/restated } \hook_use:n { keytheorems/allthms/restated } \__keythms_thm_prehead_code:n { #1 } @@ -1012,6 +1024,7 @@ % This is the price of on-the-fly redefining the env to grab body \RenewDocumentEnvironment { #1 } { ={note} O{} } { + \tl_set:Nn \l_keythms_thmuse_envname_tl { #1 } \keys_set:nn { keytheorems/thmuse } { ##1 } \tl_if_empty:NF \l__keythms_thmuse_store_tl { @@ -1116,7 +1129,6 @@ \cs_new_protected:Npn \__keythms_thm_prehead_code:n #1 { % #1 = theorem name - \tl_set:Nn \l_keythms_thmuse_envname_tl { #1 } \hook_use:n { keytheorems/#1/prehead } \hook_use:n { keytheorems/allthms/prehead } } @@ -1227,8 +1239,8 @@ \keys_define:nn { keytheorems/storeatbegin } { - restate .meta:n = { store=#1 }, - restate* .meta:n = { store*=#1 }, + restate .meta:n = { store = {#1} }, + restate* .meta:n = { store* = {#1} }, store .tl_set:N = \l__keythms_storeatbegin_store_tl, store* .tl_set:N = \l__keythms_storeatbegin_storereversed_tl, unknown .code:n = { } % do nothing with unknown keys @@ -1323,6 +1335,15 @@ \NewDocumentCommand \IfRestatingT { } { \keythms_if_restating:T } \NewDocumentCommand \IfRestatingF { } { \keythms_if_restating:F } +\hook_gput_code:nnn { keytheorems/allthms/restated } { . } + { % code to disable things in restated theorems + \renewcommand\label[2][]{} % opt arg in case cleveref loaded + \cs_set_eq:NN \ltx@label \use_none:n % thmtools does this; why? + \cs_set_eq:NN \property_record:nn \use_none:nn + \cs_set_eq:NN \setuniqmark \use_none:n % work with numbered=unless-unique + % QUESTION: also disable \hyper@@anchor? \MakeLinkTarget? + } + \cs_new_protected:Npn \__keythms_getthm_theorem:nnnnn #1#2#3#4#5 { % #1 = name, #2 = number, #3 = restate counters, #4 = keys, #5 = theorem body \group_begin: @@ -1349,11 +1370,7 @@ % WRONG: needed to make numbering correct after restated theorem. % not sure about theH. <- this is needed to prevent duplicate anchors } - \renewcommand\label[2][]{} % disable \label (opt arg in case cleveref loaded) - \cs_set_eq:NN \ltx@label \use_none:n % disable \ltx@label - \cs_set_eq:NN \property_record:nn \use_none:nn % disable \RecordProperties - \cs_set_eq:NN \setuniqmark \use_none:n % work with numbered=unless-unique - % QUESTION: also disable \hyper@@anchor? \MakeLinkTarget? + \tl_set:Nn \l_keythms_thmuse_envname_tl { #1 } \keys_set:nn { keytheorems/thmuse } { #4 } \keys_set:no { keytheorems/thmuse } { \l__keythms_thmuse_restatekeys_clist } \hook_use:n { keytheorems/#1/restated } @@ -1390,9 +1407,6 @@ { \use:c { the ##1 } . \theHkeythms_restate_dummyctr } } \refstepcounter{keythms_restate_dummyctr} - \renewcommand\label[2][]{} % disable \label (opt arg in case cleveref loaded) - \cs_set_eq:NN \ltx@label \use_none:n % disable \ltx@label - \cs_set_eq:NN \property_record:nn \use_none:nn % disable \RecordProperties \hook_use:n { keytheorems/#1/restated } \hook_use:n { keytheorems/allthms/restated } #2 @@ -1408,6 +1422,7 @@ { % #1 = envname, #2 = keys, #3 = theorem body \group_begin: \bool_set_false:N \l__keythms_thmuse_restating_bool + \tl_set:Nn \l_keythms_thmuse_envname_tl { #1 } \keys_set:nn { keytheorems/thmuse } { #2 } \keys_set:no { keytheorems/thmuse } { \l__keythms_thmuse_restatekeys_clist } \__keythms_thm_prehead_continues_code:n { #1 } @@ -1727,13 +1742,13 @@ { note = \l__keythms_tmpa_tl } } }, - name .meta:n = { note = #1 }, + name .meta:n = { note = {#1} }, note .tl_set:N = \l__keythms_listofheading_note_tl, - restate* .meta:n = { store*=#1 }, + restate* .meta:n = { store* = {#1} }, restate-keys .clist_set:N = \l__keythms_listofheading_restatekeys_clist, seq .tl_set:N = \l__keythms_listofheading_seq_tl, short-note .tl_set:N = \l__keythms_listofheading_shortnote_tl, - short-name .meta:n = { short-note = #1 }, + short-name .meta:n = { short-note = {#1} }, store* .code:n = { \bool_set_true:N \l__keythms_listofheading_storereversed_bool @@ -1813,7 +1828,7 @@ \cs_set_protected:Npn \KeyThmsContentsLine ##1 { ##1 } \bool_if:NF \l__keythms_listof_nochapskip_bool { - \cs_set_eq:NN \KeyThmsAddvspace \addvspace + \cs_set_protected:Npn \KeyThmsAddvspace { \addvspace } } \bool_if:NF \l__keythms_listof_notitle_bool { @@ -1857,25 +1872,22 @@ \cs_new_protected:Npn \KeyThmsAddvspace #1 { } % initially no-op, redefined where needed \int_new:N \g_keythms_listof_prevchapter_int \int_gset:Nn \g_keythms_listof_prevchapter_int { 1 } -% ^ if this is zero, bad things happen if title-code is changed; anyways don't -% need addvspace at top +% ^ if this is zero, bad things happen if title-code is changed; +% anyways don't need addvspace at top \cs_new_protected:Npn \keythms_listof_chaptervspacehack: { } \cs_if_exist:cT { c@chapter } { - \cs_if_eq:NNF \c@chapter \relax + \cs_set_protected:Npn \keythms_listof_chaptervspacehack: { - \cs_set_protected:Npn \keythms_listof_chaptervspacehack: + \int_compare:nNnF + { \value{chapter} } = { \g_keythms_listof_prevchapter_int } { - \int_compare:nNnF - { \value{chapter} } = { \g_keythms_listof_prevchapter_int } + \addtocontents{ thlist } { - \addtocontents{ thlist } - { - \KeyThmsAddvspace - { \keythms@listof@chaptervspace@dim } - } - \int_gset:Nn \g_keythms_listof_prevchapter_int { \value{chapter} } + \KeyThmsAddvspace + { \keythms@listof@chaptervspace@dim } } + \int_gset:Nn \g_keythms_listof_prevchapter_int { \value{chapter} } } } } @@ -2427,7 +2439,7 @@ \cs_set_protected:Npn \KeyThmsContentsLine ####1 { ####1 } \bool_if:NF \l__keythms_listof_nochapskip_bool { - \cs_set_eq:NN \KeyThmsAddvspace \addvspace + \cs_set_protected:Npn \KeyThmsAddvspace { \addvspace } } \legacy_if_set_false:n { @filesw } \bool_if:NTF \l__keythms_listof_notitle_bool @@ -2451,16 +2463,60 @@ \cs_set_eq:NN \keythms_listof_tocline: \__keythms_listof_ams_tocline: } -\cs_new_protected:Npn \keythms_support_check:n #1 +\prg_new_conditional:Npnn \__keythms_if_classloaded:n #1 { p } + { + \IfClassLoadedTF { #1 } { \prg_return_true: } { \prg_return_false: } + } + +\cs_new_protected:Npn \__keythms_support_input:n #1 + { + \file_input:n { class-support/keythms-#1-support } + } + +% acmart and aomart defaults also handled in amsart support file +\bool_case:n { - \IfClassLoadedT { #1 } { \file_input:n { class-support/keythms-#1-support } } + { \__keythms_if_classloaded_p:n { amsart } } + { \__keythms_support_input:n { amsart } } + { \__keythms_if_classloaded_p:n { amsbook } } + { \__keythms_support_input:n { amsbook } } + { \__keythms_if_classloaded_p:n { amsproc } } + { \__keythms_support_input:n { amsproc } } + { \__keythms_if_classloaded_p:n { beamer } } + { \__keythms_support_input:n { beamer } } + { \__keythms_if_classloaded_p:n { IEEEtran } } + { \__keythms_support_input:n { IEEEtran } } + { \__keythms_if_classloaded_p:n { jlreq } } + { \__keythms_support_input:n { jlreq } } + { \__keythms_if_classloaded_p:n { memoir } } + { \__keythms_support_input:n { memoir } } } -% acmart defaults also handled in amsart support file -\keythms_support_check:n { amsart } -\keythms_support_check:n { amsbook } -\keythms_support_check:n { amsproc } -\keythms_support_check:n { beamer } -\keythms_support_check:n { memoir } +% now deal with font packages that change plain style +\cs_new_protected:Npn \__keythms_support_fontpkg:nn #1#2 + { + \clist_map_inline:nn { #1 } + { + \hook_gput_code:nnn { package/##1/after } { . } + { + \IfPackageLoadedWithOptionsT { ##1 } { theoremfont } + { + \prop_gput_from_keyval:Nn \g__keythms_thmstyle_defaultkeys_prop { #2 } + \keys_precompile:neN { keytheorems/thmstyle } + { \prop_to_keyval:N \g__keythms_thmstyle_defaultkeys_prop } + \l__keythms_thmstyle_defaultkeys_tl + } + } + } + } + +\__keythms_support_fontpkg:nn { baskervillef,cochineal } { bodyfont = \slshape } +\__keythms_support_fontpkg:nn { libertinust1math,newpxtext,newtxtext,XCharter } + { + bodyfont = \thfamily, + spaceabove = \medskipamount, + spacebelow = \medskipamount, + } +\__keythms_support_fontpkg:nn { scholax } { bodyfont = \thfamily } \file_input_stop:
\ No newline at end of file |