Subnumbering of Equations in LaTeX — align environment and subequations environment

May. 16, 2025 • Updated May. 16, 2025

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
\documentclass{article}
\usepackage{amsmath}
\usepackage[colorlinks, linkcolor=blue]{hyperref}

\begin{document}

\begin{align}
x &= t+\cos t +1 \label{eq1-1}\\
y &= 2\sin t \label{eq1-2}
\end{align}
Sub-equations $\eqref{eq1-1}$ and $\eqref{eq1-2}$.

\begin{subequations}\label{eq2}
\begin{align}
x &= t+\cos t +1 \label{eq2-1}\\
y &= 2\sin t \label{eq2-2}
\end{align}
\end{subequations}
Equation $\eqref{eq2}$ includes sub-equations $\eqref{eq2-1}$ and $\eqref{eq2-2}$.

\end{document}

image-20250516132448783

Besides, if we want to change the subnumbering format, for the convenience of use we can define a new environment mysubeq, because the subnumbering format should be set internally in the subequations environment. For example:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
\documentclass{article}
\usepackage{amsmath}
\usepackage[colorlinks, linkcolor=blue]{hyperref}

\newenvironment{mysubeqn}%
	{\begin{subequations}
	\renewcommand\theequation{\theparentequation-\roman{equation}}}%
	{\end{subequations}}

\begin{document}

\begin{align}
x &= t+\cos t +1 \label{eq1-1}\\
y &= 2\sin t \label{eq1-2}
\end{align}
Sub-equations $\eqref{eq1-1}$ and $\eqref{eq1-2}$.

\begin{subequations}\label{eq2}
\begin{align}
x &= t+\cos t +1 \label{eq2-1}\\
y &= 2\sin t \label{eq2-2}
\end{align}
\end{subequations}
Equation $\eqref{eq2}$ includes sub-equations $\eqref{eq2-1}$ and $\eqref{eq2-2}$.

\begin{mysubeqn}\label{eq3}
\begin{align}
x &= t+\cos t +1 \label{eq3-1}\\
y &= 2\sin t \label{eq3-2}
\end{align}
\end{mysubeqn}
Equation $\eqref{eq3}$ includes sub-equations $\eqref{eq3-1}$ and $\eqref{eq3-2}$.

\end{document}

image-20250516140227484


References