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}
4
  • 1
    Welcome to TeX SX! This is not clear at all. What would you like to have, precisely?
    – Bernard
    Commented Jan 22, 2019 at 19:47
  • Welcome to TeX.SX! As Bernard says it is not at all clear what you want to do. Further, can you please expand the code snippet that you have posted to a full minimal working example. A MWE should compile and be as small as possible to demonstrate your problem. it's much easier to help you if we have full working code to start from.
    – user30471
    Commented Jan 22, 2019 at 21:17
  • environment subequations from asmath package is your friend
    – Zarko
    Commented Jan 23, 2019 at 0:44
  • Possible duplicate: How to reference equations using letters and numbers (due to the accepted answer)
    – Werner
    Commented Jan 23, 2019 at 1:28

1 Answer 1

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}
2
  • That's exactly what I needed! Commented Jan 23, 2019 at 5:35
  • 1
    @DimitriosSykias, than you can accept this answer with clicking on check mark at top left side of answer :-)
    – Zarko
    Commented Jan 23, 2019 at 9:32

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .