[Tex/LaTex] Label equations arbitrarily

equationslabels

When I have equations, as in

\begin{equation} ... \end{equation}

Can I arbitrarily assign the numbers to the equations? Instead of the usual order (1), (2), (3), …, I'd like something like (1), (2.1), (2.2), (2.3), (3.1), (3.2), (4), …

Best Answer

Yes, absolutely, using the amsmath package and its \tag command.

A little example

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\begin{equation}
  y=mx+b\tag{1.2}
\end{equation}
or
\begin{equation}
  y=mx+b\tag{duck}
\end{equation}
\end{document}

After reading your comment, if you want the equation number to inherit the theorem number, then you can use, for example,

\newtheorem{mytheorem}{Theorem}
\numberwithin{equation}{mytheorem}

and then you don't have to tag equations manually.

Related Question