An elegant aspect for enumerate the equations of a book
The following produces what you're after:
\documentclass{book}
\usepackage{mathtools}
\usepackage[svgnames, dvipsnames, table, x11names]{xcolor}
\usepackage{pifont}
\definecolor{ocre}{RGB}{243,102,25}
%----------------------------------------------------------------------------------
% Change number equations with sections
%----------------------------------------------------------------------------------
\usepackage{chngcntr}
\counterwithin{equation}{section}
\renewcommand{\theequation}{\thesection-\arabic{equation}}
\newcommand{\eqnnumsymbol}{\textcolor{ocre}{\reflectbox{\ding{228}}}}
\makeatletter
\newtagform{bbrackets}% <name>
[\textbf]% Internal style
{(}% Left bracket
{\ifnum\pdfstrcmp{\@currenvir}{equation}=0
\eqnnumsymbol%
\else
\ifnum\pdfstrcmp{\@currenvir}{align}=0
\eqnnumsymbol%
\fi
\fi
)}% Right bracket
\makeatother
\usetagform{bbrackets}
\begin{document}
See both~\eqref{eq:eqn1} and~\eqref{eq:eqn2}. Also see~\eqref{eq:eqn3}.
\begin{equation}
\oint \mathbf{E} \cdot d \mathbf{a} = \int \rho \, \mathrm{d}v \label{eq:eqn1}
\end{equation}
\begin{equation}
\oint \mathbf{B} \cdot d \mathbf{a} = \mathbf{0} \label{eq:eqn2}
\end{equation}
\begin{align}
abc \label{eq:eqn3}
\end{align}
\end{document}
It uses
mathtools
'\newtagform
to establish a new form of tag forequation
s and related environments.A conditional to set the symbol. If inside an
equation
oralign
, the symbol is added, otherwise it's left out. This allows you to use\eqref
. It's not extensively tested, but works in the example provided.
If you want to remove the bold numbering from your reference, you can use the following:
\documentclass{book}
\usepackage{mathtools}
\usepackage[svgnames, dvipsnames, table, x11names]{xcolor}
\usepackage{pifont}
\definecolor{ocre}{RGB}{243,102,25}
%----------------------------------------------------------------------------------
% Change number equations with sections
%----------------------------------------------------------------------------------
\usepackage{chngcntr}
\counterwithin{equation}{section}
\makeatletter
\renewcommand{\theequation}{\thesection-\arabic{equation}}
\newcommand{\eqnumfmt}{%
\ifnum\pdfstrcmp{\@currenvir}{equation}=0
\bfseries
\else
\ifnum\pdfstrcmp{\@currenvir}{align}=0
\bfseries
\fi
\fi}
\newcommand{\eqnnumsymbol}{\textcolor{ocre}{\reflectbox{\ding{228}}}}
\newtagform{bbrackets}% <name>
[\eqnumfmt]% Internal style
{(\bgroup}% Left bracket
{\ifnum\pdfstrcmp{\@currenvir}{equation}=0
\eqnnumsymbol%
\else
\ifnum\pdfstrcmp{\@currenvir}{align}=0
\eqnnumsymbol%
\fi
\fi
\egroup)}% Right bracket
\makeatother
\usetagform{bbrackets}
\begin{document}
See both~\eqref{eq:eqn1} and~\eqref{eq:eqn2}. Also see~\eqref{eq:eqn3}.
\begin{equation}
\oint \mathbf{E} \cdot d \mathbf{a} = \int \rho \, \mathrm{d}v \label{eq:eqn1}
\end{equation}
\begin{equation}
\oint \mathbf{B} \cdot d \mathbf{a} = \mathbf{0} \label{eq:eqn2}
\end{equation}
\begin{align}
abc \label{eq:eqn3}
\end{align}
\end{document}
I propose this other solution, without parentheses, based on the \newtagform
command from mathtools
and the adforn
ornaments package, which has a left-oriented arrow tip. I took the liberty to change its colour, which suits better the black characters (quia gustum meum…). Of course, feel free to choose your own colour if you prefer it:
\documentclass{book}
\usepackage{mathtools}
\usepackage{newtxtext}
\usepackage{newtxmath}
\PassOptionsToPackage{svgnames, dvipsnames, table, x11names}{xcolor}
\usepackage{tikz}
\usepackage{classico}
\usepackage{adforn}
\definecolor{ocre}{RGB}{243,102,25}
%----------------------------------------------------------------------------------
% Change number equations with sections
%----------------------------------------------------------------------------------
\counterwithin{equation}{section}%
\renewcommand{\theequation}{\thesection-\arabic{equation}}
\newtagform{arrowtip}[\bfseries\sffamily]{}{\,\textcolor{IndianRed3}{\Large\adforn{42}}}
\usetagform{arrowtip}
\begin{document}
\setcounter{chapter}{2}
\setcounter{section}{5}
\begin{equation}
\oint \mathbf{E} \cdot d \mathbf{a} = \int \rho \, dv
\end{equation}
\begin{equation}
\oint \mathbf{B} \cdot d \mathbf{a} = \mathbf{0}
\end{equation}
\end{document}