# Want theorem and equation numbering linked under section

Similar questions have been answered but the solutions didn't seem to give what I need.

I would like theorems and equations both to proceed as follows within each section.

Say we've begun Section 6. If I started with a theorem, it'd be Theorem 6.1. Then if I next used an equation, it would show up with numbering (6.2). The next equation or theorem (whichever is first) would be 6.3, and so on.

• Welcome to TeX.SE. It would be helpful if you composed a fully compilable MWE including \documentclass and the appropriate packages that sets up the problem. While solving problems can be fun, setting them up is not. Then, those trying to help can simply cut and paste your MWE and get started on solving the problem. And sometimes the solutions depend on the packages being used. May 8, 2014 at 2:01

Using

\numberwithin{equation}{section}


(requires amsmath) makes the section counter to be used as prefix for equations, and then

\newtheorem{theorem}[equation]{Theorem}


makes theorem share the equation counter. A complete example

\documentclass{article}
\usepackage{amsthm}
\usepackage{amsmath}

\numberwithin{equation}{section}
\newtheorem{theorem}[equation]{Theorem}

\begin{document}

\section{Test section}
\begin{theorem}
test theorem
\end{theorem}

$$a=b$$

\begin{theorem}
test theorem
\end{theorem}

\begin{align}
a &= b \\
&= c
\end{align}

\end{document}