16

I know how to make them do 1, 2, 3....just need to know 1.1, 1.2, 3.2, 3.3 etc

\begin{align}

\end{align}

This will produce 1, 2, 3 etc, I know this but need the other.

Pier Paolo
  • 2,790
OSU_2016
  • 179

2 Answers2

27

The question can also be interpreted that the first number of the composite equation number should be the section number. The other two classes report and book are using composite equation numbers, whose first part is the chapter number. The article class does not have chapters and uses plain equation numbers.

Package amsmath (this is used because of align) provides an easy way to add the section number:

\numberwithin{equation}{section}

Complete example:

\documentclass{article}
\usepackage{amsmath}

\numberwithin{equation}{section}

\begin{document}
  \section{Equation numbering}
  \begin{align}
    a = a\\
    b = b\\
    c = c
  \end{align}

  \section{Second section}
  \begin{gather}
    d = d
  \end{gather}
\end{document}

Result

Heiko Oberdiek
  • 271,626
18

The amsmath package offers you the subequations environment; to get the desired formatting, you can redefine \theequation:

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\begin{subequations}
\begin{align}
y & = d \\
y & = cx+d \\
y & = bx^{2}+cx+d \\
y & = ax^{3}+bx^{2}+cx+d
\end{align}
\end{subequations}

\begin{subequations}
\renewcommand{\theequation}{\theparentequation.\arabic{equation}}
\begin{align}
y & = d \\
y & = cx+d \\
y & = bx^{2}+cx+d \\
y & = ax^{3}+bx^{2}+cx+d
\end{align}
\end{subequations}

\end{document}

enter image description here

Gonzalo Medina
  • 505,128