Here我问如何在LaTeX中识别小节和定理计数器。事实证明,出于我的目的,我还必须确定方程式和小节计数器。建议作为该问题答案的方法不起作用。如果可以的话,请帮帮我。非常感谢你。

最佳答案

不确定是否正是您要寻找的东西,但是这里的示例显示了一种将方程式编号添加到以前的解决方案中的方法。它确实涉及使用用户定义的“等式”环境而不是“等式”环境:

\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}

关于latex - 如何在LaTeX中识别方程式和分段计数器?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/3208691/

10-09 03:03