diff options
Diffstat (limited to 'macros/latex/contrib/stex/tex/etc/stexthm.sty')
-rw-r--r-- | macros/latex/contrib/stex/tex/etc/stexthm.sty | 122 |
1 files changed, 45 insertions, 77 deletions
diff --git a/macros/latex/contrib/stex/tex/etc/stexthm.sty b/macros/latex/contrib/stex/tex/etc/stexthm.sty index c81b6358df..4b89af5b39 100644 --- a/macros/latex/contrib/stex/tex/etc/stexthm.sty +++ b/macros/latex/contrib/stex/tex/etc/stexthm.sty @@ -1,4 +1,4 @@ -\ProvidesExplPackage{stexthm}{2022/02/24}{3.0.0}{Default Typesetting for sTeX Statements} +\ProvidesExplPackage{stexthm}{2023/03/19}{3.3.0}{Default Typesetting for sTeX Statements} \RequirePackage{stex} \RequirePackage{amsthm} @@ -6,84 +6,52 @@ \ExplSyntaxOn -\declaretheorem[parent=section]{theorem} -\stexpatchassertion[theorem] -{\ifx\sassertiontitle\@empty\begin{theorem}\else\exp_args:Nno\use:nn{\begin{theorem}[}\sassertiontitle]\fi} -{\end{theorem}} - -\declaretheorem[sibling=theorem]{observation} -\stexpatchassertion[observation] -{\ifx\sassertiontitle\@empty\begin{observation}\else\exp_args:Nno\use:nn{\begin{observation}[}\sassertiontitle]\fi} -{\end{observation}} - -\declaretheorem[sibling=theorem]{corollary} -\stexpatchassertion[corollary] -{\ifx\sassertiontitle\@empty\begin{corollary}\else\exp_args:Nno\use:nn{\begin{corollary}[}\sassertiontitle]\fi} -{\end{corollary}} - -\declaretheorem[sibling=theorem]{lemma} -\stexpatchassertion[lemma] -{\ifx\sassertiontitle\@empty\begin{lemma}\else\exp_args:Nno\use:nn{\begin{lemma}[}\sassertiontitle]\fi} -{\end{lemma}} - -\declaretheorem[sibling=theorem]{axiom} -\stexpatchassertion[axiom] -{\ifx\sassertiontitle\@empty\begin{axiom}\else\exp_args:Nno\use:nn{\begin{axiom}[}\sassertiontitle]\fi} -{\end{axiom}} - -\declaretheorem[sibling=theorem,style=remark]{remark} -\stexpatchassertion[remark] -{\ifx\sassertiontitle\@empty\begin{remark}\else\exp_args:Nno\use:nn{\begin{remark}[}\sassertiontitle]\fi} -{\end{remark}} -\stexpatchparagraph[remark] -{\ifx\sparagraphtitle\@empty\begin{remark}\else\exp_args:Nno\use:nn{\begin{remark}[}\sparagraphtitle]\fi} -{\end{remark}} - -\declaretheorem[sibling=theorem,style=definition]{example} -\stexpatchexample -{\ifx\sexampletitle\@empty\begin{example}\else\exp_args:Nno\use:nn{\begin{example}[}\sexampletitle]\fi} -{\end{example}} - -\declaretheorem[sibling=theorem,style=definition]{definition} -\stexpatchdefinition -{\ifx\sdefinitiontitle\@empty\begin{definition}\else\exp_args:Nno\use:nn{\begin{definition}[}\sdefinitiontitle]\fi} - {\end{definition}} - -\ExplSyntaxOff - -\RequirePackage{xcolor} +\cs_new_protected:Nn \_@@_stex_patch_env:nnn { + \cs_if_exist:cF {#1}{ + \declaretheorem[#2]{#1} + } + \clist_map_inline:nn{#3}{ + \use:c{stexstyle##1}[#1]{ + \tl_if_empty:NTF\thistitle{ + \begin{#1} + }{ + \begin{#1}[\thistitle] + } + }{ \end{#1} } + } +} -\def\compemph#1{\ifcsname textcolor\endcsname\textcolor{blue}{#1}\else#1\fi} -\def\symrefemph#1{\ifcsname textcolor\endcsname\textcolor{blue}{#1}\else#1\fi} -\def\defemph#1{\ifcsname textcolor\endcsname\textcolor{blue}{\textbf{#1}}\else\textbf{#1}\fi} -\def\varemph#1{\ifcsname textcolor\endcsname\textcolor{gray}{#1}\else#1\fi} +\_@@_stex_patch_env:nnn{theorem}{parent=section}{assertion} +\_@@_stex_patch_env:nnn{observation}{sibling=theorem}{assertion} +\_@@_stex_patch_env:nnn{corollary}{sibling=theorem}{assertion} +\_@@_stex_patch_env:nnn{lemma}{sibling=theorem}{assertion} +\_@@_stex_patch_env:nnn{axiom}{sibling=theorem}{assertion} +\_@@_stex_patch_env:nnn{remark}{sibling=theorem}{assertion,paragraph} -\RequirePackage{pdfcomment} -\protected\def\compemph@uri#1#2{% - \pdftooltip{% - \srefsymuri{#2}{\compemph{#1}}% - }{% - URI:~\detokenize{#2}% - }% +\cs_if_exist:cF {example}{ + \declaretheorem[sibling=theorem,style=definition]{example} } -\protected\def\symrefemph@uri#1#2{% - \pdftooltip{% - \srefsymuri{#2}{\symrefemph{#1}}% - }{% - URI:~\detokenize{#2}% - }% - } -\protected\def\defemph@uri#1#2{% - \pdftooltip{% - \defemph{#1}% - }{% - URI:~\detokenize{#2}% - }% +\stexstyleexample{ + \tl_if_empty:NTF\thistitle{ + \begin{example} + }{ + \begin{example}[\thistitle] + } +}{ + \end{example} } -\protected\def\varemph@uri#1#2{% - \pdftooltip{% - \varemph{#1}% - }{% - Variable~\detokenize{#2}% - }% + +\cs_if_exist:cF {definition}{ + \declaretheorem[sibling=theorem,style=definition]{definition} } +\stexstyledefinition{ + \tl_if_empty:NTF\thistitle{ + \begin{definition} + }{ + \begin{definition}[\thistitle] + } +}{ + \end{definition} +} + +\ExplSyntaxOff
\ No newline at end of file |