Reputation:
Here I asked how to identify the subsection and theorem counters in LaTeX. It turns out that I must also identify the equation and subsection counters for my purposes. The methods suggested as answers to that question won't work. Please help me out, if you can. Thank you very much.
Upvotes: 3
Views: 1179
Reputation: 22256
Not sure if it's exactly what you're looking for, but here's example showing one way to add equation numbering to your previous solution. It does involve use of a user-defined 'myequation' environment instead of 'equation' environment:
\documentclass{article}
\newtheorem{theorem}[subsection]{Theorem}
\newenvironment{myequation}
{\setcounter{equation}{\value{subsection}}\begin{equation}}
{\stepcounter{subsection}\end{equation}}
\renewcommand{\theequation}{\mbox{\arabic{section}.\arabic{equation}}}
\begin{document}
\section{My Section}
\subsection{A subsection}
\begin{theorem}adfadfadf
\end{theorem}
\begin{myequation}abcdefg
\end{myequation}
\begin{myequation}abcdefg
\end{myequation}
\subsection{A subsection}
\begin{theorem}adfadfadf
\end{theorem}
\begin{theorem}adfadfadf
\end{theorem}
\begin{myequation}abcdefg
\end{myequation}
\end{document}
Upvotes: 2