# Label equations arbitrarily

When I have equations, as in

$$...$$


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), ...

-
Is there some logic behind the numbering, or is it purely arbitrary? –  Werner Feb 8 '13 at 3:56
@Werner Thanks for your question. They are the equations under Theorem 1, Theorem 2, and so on. Is there a convenient way to do the numbering? –  Paul S. Feb 8 '13 at 4:06
@PaulS. see my update :) –  cmhughes Feb 8 '13 at 4:11

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

A little example

\documentclass{article}
\usepackage{amsmath}

\begin{document}

$$y=mx+b\tag{1.2}$$
or
$$y=mx+b\tag{duck}$$
\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.

-
Yes, thank you! –  Paul S. Feb 8 '13 at 4:06