Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I was experimenting with the use of breqn for a few unwieldy formulas, but wonder how to maintain the equation number coloring I'd been using, based on the following questions:

Changing the apperance of equation numbers with amsmath

Coloured equation number (without changing colour of reference using hyperref)

The following sample shows the color'ing commands that I used based on answer text in the links above (which I don't understand, so am not able to modify)

\documentclass[12pt]{scrreprt}
\usepackage{amsmath}
\usepackage[svgnames]{xcolor}
\usepackage{hyperref}
\hypersetup{colorlinks=true}
\usepackage{breqn}

\makeatletter
\let\mytagform@=\tagform@
\def\tagform@#1{\maketag@@@{\color{Red}(#1)}}
\makeatother

\begin{document}

\begin{dmath}
s = 1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17
+18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33
+34 +35 +36 +37 +38 +39 +40
\end{dmath}

\begin{equation}
a
=
b + c
\end{equation}

\end{document}

producing the following

red color on equation.  default color on dmath

I see in the breqn docs that there is a \eqnumcolor variable, but am not sure how to use it for this purpose?

share|improve this question
add comment

1 Answer

up vote 6 down vote accepted

You can use \renewcommand in the preamble to change it:

\renewcommand{\eqnumcolor}{\color{red}}

enter image description here

Code:

\documentclass[12pt]{scrreprt}
\usepackage{amsmath}
\usepackage[svgnames]{xcolor}
\usepackage{hyperref}
\hypersetup{colorlinks=true}
\usepackage{breqn}

\makeatletter
\let\mytagform@=\tagform@
\def\tagform@#1{\maketag@@@{\color{Red}(#1)}}
\makeatother

\renewcommand{\eqnumcolor}{\color{red}}

\begin{document}

\begin{dmath}
s = 1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17
+18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33
+34 +35 +36 +37 +38 +39 +40
\end{dmath}

\begin{equation}
a
=
b + c
\end{equation}
\end{document}
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.