summaryrefslogtreecommitdiff
path: root/macros/latex-dev/required/graphics/mathcolor.dtx
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2022-03-16 03:01:05 +0000
committerNorbert Preining <norbert@preining.info>2022-03-16 03:01:05 +0000
commit725ce6a3e602c7516d471df841ea433b8c5bcd9d (patch)
tree6cc54f5bd90984b9b63976a0386ae2681a08b7cb /macros/latex-dev/required/graphics/mathcolor.dtx
parentd6f947fa36ed3b76d36a8dfad4e9247319b4d622 (diff)
CTAN sync 202203160301
Diffstat (limited to 'macros/latex-dev/required/graphics/mathcolor.dtx')
-rw-r--r--macros/latex-dev/required/graphics/mathcolor.dtx16
1 files changed, 13 insertions, 3 deletions
diff --git a/macros/latex-dev/required/graphics/mathcolor.dtx b/macros/latex-dev/required/graphics/mathcolor.dtx
index 6ed53f8f61..2341e71e28 100644
--- a/macros/latex-dev/required/graphics/mathcolor.dtx
+++ b/macros/latex-dev/required/graphics/mathcolor.dtx
@@ -14,8 +14,8 @@
%%% From File: mathcolor.dtx
%
% \begin{macrocode}
-\def\mathcolorversion{v1.0a}
-\def\mathcolordate{2022/01/07}
+\def\mathcolorversion{v1.0b}
+\def\mathcolordate{2022/01/28}
% \end{macrocode}
%<*driver>
\documentclass{l3doc}
@@ -165,7 +165,17 @@
% \begin{macrocode}
\DeclareDocumentCommand \mathcolor { o m m } {
% \end{macrocode}
-% First action is to save the current color value on a stack
+% The \cs{mathcolor} is only supported in math mode because in text
+% mode it has problems scanning away a space after it, for example.
+% We therefore raise an error if it executes
+% anywhere else. The \LaTeXe{} error command is a
+% bit strangely named, because in the kernel it is only used for
+% math alphabets, but the message it gives is fine.
+% \changes{v1.0b}{2022/01/28}{Restrict command to math mode}
+% \begin{macrocode}
+ \mode_if_math:F { \non@alpherr {\mathcolor\space} }
+% \end{macrocode}
+% First real action is to save the current color value on a stack
% (needed if the command is nested or contains some further color
% changes with \cs{color} inside).
% \begin{macrocode}