5

I want to have the equations of my document numbered in the same manner as the other newtheorem environments which share the same counter [section]. The usual approach is to use

\numberwithin{equation}{counter}

but this produces a numbering in the form (counter. number of the equation), while I would like it to be simply (counter) as the other environments.

To make an explicit example: my tex file is something along these lines

\documentclass{amsart}
\newtheorem{theorem}{Theorem}[section]
\newtheorem{proposition}[theorem]{Proposition}
\numberwithin{equation}{theorem}
\begin{document}

\section{Section 1}

\begin{theorem} Theorem 1.1 \end{theorem}

\begin{equation} 1+2=3 \end{equation} \begin{proposition} Proposition 1.2 \end{proposition}

\begin{equation} a+b=c \end{equation} \end{document}

Which produces Compiled example

You can see the first equation is labeled (1.1.1) and the second (1.2.1). What I would like is to have the first equation to be enumerated (1.2), the proposition after that (1.3) and the final equation (1.4). That is, I would like the equation numbering to follow the same format as the one for the newtheorem environments, while with numberwithin first I get the last number used when invoking an environment with the [theorem] counter, followed by the number of the equation.

N.B.
  • 173

1 Answers1

6

You want that theorem and proposition share the equation counter.

\documentclass{amsart}

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

\begin{document}

\section{Section 1}

\begin{theorem} Theorem 1.1 \end{theorem}

\begin{equation} 1+2=3 \end{equation} \begin{proposition} Proposition 1.2 \end{proposition}

\begin{equation} a+b=c \end{equation}

\end{document}

enter image description here

egreg
  • 1,121,712