Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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.

share|improve this question
    
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. –  Peter Grill May 8 at 2:01
    
Thanks for the guidelines! –  Andy 121 May 8 at 2:22

1 Answer 1

up vote 7 down vote accepted

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}

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

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

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

\end{document}

enter image description here

share|improve this answer
    
Works perfectly, thank you! –  Andy 121 May 8 at 2:21

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.