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.
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.
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.
– egreg
Jun 19 '20 at 21:02
eqnarray.
– Ian Thompson
Jun 19 '20 at 21:04
eqnarray ;-)
– Gabriele
Jun 19 '20 at 22:15