# Questions about latex formula numbering(counter)

I want get the formula number like the first picture

but when I use the code:

\begin{aligned} \alpha_{i}^{2}&=\beta^{2}=1\\ \alpha_{i} \alpha_{j}&=-\alpha_{j} \alpha_{i}\\ \alpha_{i} \beta&=-\beta \alpha_{i} \end{aligned}


I can only get the formula number like the second picture:

What should I do to get the formula number I want?

## 1 Answer

Instead of nesting an aligned environment inside an equation environment, you should nest an align environment inside a subequations environment.

\documentclass{article}

\usepackage{amsmath} % for 'align' and 'subequations' environments
\counterwithin{equation}{section}
\begin{document}
\setcounter{section}{2} % just for this example
\setcounter{equation}{1}

\begin{subequations}
\begin{align}
\alpha_{i}^{2}&=\beta^{2}=1\\
\alpha_{i} \alpha_{j}&=-\alpha_{j} \alpha_{i}\\
\alpha_{i} \beta&=-\beta \alpha_{i}
\end{align}
\end{subequations}

\end{document}

• Oh thank you, the problem has been solved perfectly. – Terrell Jan 17 at 12:38
• @user248841 - Glad you found my answer useful. If you feel like, do please click the check-mark symbol next to the vote count "button" to accept this answer. ;-) – Mico Jan 17 at 13:25