I have a file that compiles fine. It uses nath
and color
packages:
\documentclass[10pt,a4paper]{article}
\usepackage{color}
\usepackage{nath}
\delimgrowth=1
\begin{document}
\begin{equation}
A \Rightarrow (B)
\end{equation}
\end{document}
But as soon as I try to color (B)
, I get an error extra {
. The complete file (which does not compile) is:
\documentclass[10pt,a4paper]{article}
\usepackage{color}
\usepackage{nath}
\delimgrowth=1
\begin{document}
\begin{equation}
A \Rightarrow {\color{red}(B)}
\end{equation}
\end{document}
Removing the nath
package and \delimgrowth
command fixes the error.
The following code compiles fine.
\documentclass[10pt,a4paper]{article}
\usepackage{color}
\begin{document}
\begin{equation}
A \Rightarrow {\color{red}(B)}
\end{equation}
\end{document}
Also, If I remove the braces around B
, the error is gone. The following code compiles fine:
\documentclass[10pt,a4paper]{article}
\usepackage{color}
\usepackage{nath}
\delimgrowth=1
\begin{document}
\begin{equation}
A \Rightarrow {\color{red}B}
\end{equation}
\end{document}
Thanks to @egreg for pointing out that nath
does not like paretheses hidden away inside braces. The following code also does not compile:
\documentclass[10pt,a4paper]{article}
\usepackage{nath}
\delimgrowth=1
\begin{document}
\begin{equation}
A \Rightarrow {(B)}
\end{equation}
\end{document}
So, my question is: Is there a way to have colored equations in a file that uses nath
to automatically resize nested parentheses?
I learned about the nath
package from automatic size adjustment for nested parentheses.
\textcolor{red}{(B)}
instead of{\color{red}(B)}
A \Rightarrow {(B)}
and without loadingcolor
. So this is a problem ofnath
that doesn't like parentheses hidden by braces.