2

I want equations (2) and (3) to be labeled as (1a) and (1b)

\documentclass[12pt,a4paper,table,usenames, dvipsnames]{book}
\usepackage[table]{xcolor}
\definecolor{def}{RGB}{66,103,178}
\usepackage{empheq}
\usepackage[most]{tcolorbox}
\newtcbox{\mymath}[1][]{%
nobeforeafter, math upper, tcbox raise base,
enhanced, colframe=blue!30!black,
colback=def!20, boxrule=1pt,
#1}

\begin{document}

Some text…
\begin{empheq}[box={\mymath[colback=Bittersweet!20]}]{equation}
(x-x_0)^2+(y-y_0)^2+(z-z_0)^2=R^2
\end{empheq}

Some text…
\begin{empheq}[box={\mymath[colback=Bittersweet!20]}]{equation}
x^2+y^2+z^2+Ax+By+C z=0
\end{empheq}

Some text…
\begin{empheq}[box={\mymath[colback=Bittersweet!20]}]{equation}
x^2+y^2+z^2=R^2
\end{empheq}

\end{document}

1 Answers1

2

see if the following example gives what you looking for:

documentclass[12pt,a4paper,table,usenames, dvipsnames]{book}
\usepackage[table]{xcolor}
\definecolor{def}{RGB}{66,103,178}
\usepackage{empheq}% it call `amsmath
\usepackage[most]{tcolorbox}
\newtcbox{\mymath}[1][]{%
nobeforeafter, math upper, tcbox raise base,
enhanced, colframe=blue!30!black,
colback=def!20, boxrule=1pt,
#1}

\begin{document}

Some text…
\begin{subequations}\label{eq:my equations}  % <---
\begin{empheq}[box={\mymath[colback=Bittersweet!20]}]{equation}
(x-x_0)^2+(y-y_0)^2+(z-z_0)^2=R^2
\end{empheq}

Some text…
\begin{empheq}[box={\mymath[colback=Bittersweet!20]}]{equation}
x^2+y^2+z^2+Ax+By+C z=0
\end{empheq}

Some text…
\begin{empheq}[box={\mymath[colback=Bittersweet!20]}]{equation}
x^2+y^2+z^2=R^2
\end{empheq}
\end{subequations} % <---

\end{document}
Zarko
  • 296,517