summaryrefslogtreecommitdiff
path: root/tex/context/base/supp-mat.tex
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/supp-mat.tex')
-rw-r--r--tex/context/base/supp-mat.tex15
1 files changed, 12 insertions, 3 deletions
diff --git a/tex/context/base/supp-mat.tex b/tex/context/base/supp-mat.tex
index d35dc52d3..5b2305f8b 100644
--- a/tex/context/base/supp-mat.tex
+++ b/tex/context/base/supp-mat.tex
@@ -49,15 +49,24 @@
\long\def\displaymath#1{\relax\ifmmode#1\else$$#1$$\fi}
\long\def\inlinemath #1{\relax\ifmmode#1\else $#1$\fi}
-\def\startmathmode
- {\ifmmode
+\let\stopmathmode\relax
+
+\def\startmathmode % cannot be used nested
+ {\relax\ifmmode
\let\stopmathmode\relax
\else
$\def\stopmathmode{$}% \let\stopmathmode=$
\fi}
+\def\startmathmode % nested variant
+ {\relax\ifmmode
+ \begingroup\let\stopmathmode\endgroup
+ \else
+ $\let\stopmathmode$%
+ \fi}
+
\def\nomathematics#1%
- {\ifmmode\hbox{#1}\else#1\fi}
+ {\relax\ifmmode\hbox{#1}\else#1\fi}
\let\math\mathematics