summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/stex/tex/etc/stexthm.sty
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/stex/tex/etc/stexthm.sty')
-rw-r--r--macros/latex/contrib/stex/tex/etc/stexthm.sty69
1 files changed, 36 insertions, 33 deletions
diff --git a/macros/latex/contrib/stex/tex/etc/stexthm.sty b/macros/latex/contrib/stex/tex/etc/stexthm.sty
index 16931b514a..c81b6358df 100644
--- a/macros/latex/contrib/stex/tex/etc/stexthm.sty
+++ b/macros/latex/contrib/stex/tex/etc/stexthm.sty
@@ -4,51 +4,53 @@
\RequirePackage{amsthm}
\RequirePackage{thmtools}
+\ExplSyntaxOn
+
\declaretheorem[parent=section]{theorem}
\stexpatchassertion[theorem]
-{\ifx\sassertiontitle\@empty\begin{theorem}\else\begin{theorem}[\sassertiontitle]\fi}
+{\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\begin{observation}[\sassertiontitle]\fi}
+{\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\begin{corollary}[\sassertiontitle]\fi}
+{\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\begin{lemma}[\sassertiontitle]\fi}
+{\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\begin{axiom}[\sassertiontitle]\fi}
+{\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\begin{remark}[\sassertiontitle]\fi}
+{\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\begin{remark}[\sparagraphtitle]\fi}
+{\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\begin{example}[\sexampletitle]\fi}
+{\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\begin{definition}[\sdefinitiontitle]\fi}
+{\ifx\sdefinitiontitle\@empty\begin{definition}\else\exp_args:Nno\use:nn{\begin{definition}[}\sdefinitiontitle]\fi}
{\end{definition}}
-
-\RequirePackage{pdfcomment}
+\ExplSyntaxOff
+
\RequirePackage{xcolor}
\def\compemph#1{\ifcsname textcolor\endcsname\textcolor{blue}{#1}\else#1\fi}
@@ -56,31 +58,32 @@
\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}
+\RequirePackage{pdfcomment}
\protected\def\compemph@uri#1#2{%
- \pdftooltip{%
- \srefsymuri{#2}{\compemph{#1}}%
- }{%
- URI:~\detokenize{#2}%
- }%
+ \pdftooltip{%
+ \srefsymuri{#2}{\compemph{#1}}%
+ }{%
+ URI:~\detokenize{#2}%
+ }%
}
\protected\def\symrefemph@uri#1#2{%
- \pdftooltip{%
- \srefsymuri{#2}{\symrefemph{#1}}%
- }{%
- URI:~\detokenize{#2}%
- }%
-}
+ \pdftooltip{%
+ \srefsymuri{#2}{\symrefemph{#1}}%
+ }{%
+ URI:~\detokenize{#2}%
+ }%
+ }
\protected\def\defemph@uri#1#2{%
- \pdftooltip{%
- \defemph{#1}%
- }{%
- URI:~\detokenize{#2}%
- }%
+ \pdftooltip{%
+ \defemph{#1}%
+ }{%
+ URI:~\detokenize{#2}%
+ }%
}
\protected\def\varemph@uri#1#2{%
- \pdftooltip{%
- \varemph{#1}%
- }{%
- Variable~\detokenize{#2}%
- }%
-} \ No newline at end of file
+ \pdftooltip{%
+ \varemph{#1}%
+ }{%
+ Variable~\detokenize{#2}%
+ }%
+}