For (copy) editing purposes I'd like to redefine the eqnarray envinronment to render its content in red (or any other colour). How can I do it?
Edit. I'll use this trick to better spot and (eventually) change the instances of eqnarray.
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It only takes a minute to sign up.
Sign up to join this communityFor (copy) editing purposes I'd like to redefine the eqnarray envinronment to render its content in red (or any other colour). How can I do it?
Edit. I'll use this trick to better spot and (eventually) change the instances of eqnarray.
I think etoolbox
can do the trick
\documentclass{article}
\usepackage{xcolor}
\usepackage{etoolbox}
\AtBeginEnvironment{eqnarray*}{\color{red}}
\begin{document}
\begin{eqnarray*}
\dot x &=& v \\
\dot v &=& F(x)
\end{eqnarray*}
\end{document}
Of course, one shouldn't use eqnarray
. A similar approach to the suggestion by @Denys Potapov works with the align
environment from the amsmath package. Note that the equation numbers will be coloured with align
, whereas I don't think they will with eqnarray
.
\documentclass{article}
\usepackage{amsmath}
\usepackage{color}
\let\oldalign\align
\def\align{%
\color{red}\oldalign}
\begin{document}
abc
\begin{align}
a &= b \\
&= c
\end{align}
def
\end{document}
eqnarray
so to be able to change them in the source.
eqnarray
.
Jun 19, 2020 at 21:04
eqnarray
;-)
Jun 19, 2020 at 22:15