我遇到了一个问题,即使在网站上查看了一段时间后也无法解决。
很简单,我确实喜欢以下 MWE 在间距方面的样子,但我希望每个证明中的声明从 1 开始编号。
\documentclass{article}
\usepackage{amsmath}%
\usepackage{amsthm}%
\usepackage{amsfonts}%
\usepackage{amssymb}%
\theoremstyle{plain}
\newtheorem{theorem}{Theorem}
\theoremstyle{remark}
\newtheorem{claim}{Claim}
\begin{document}
\begin{theorem}
Bla
\end{theorem}
\begin{proof} There are some claims.
\begin{claim}
Bla
\end{claim}
\begin{claim}
Bla bla
\end{claim}
\end{proof}
\begin{theorem}
Bla
\end{theorem}
\begin{proof} There are some claims.
\begin{claim}
Bla
\end{claim}
\begin{claim}
Bla bla
\end{claim}
\end{proof}
\end{document}
问题是我发现的所有解决方案都以某种方式修改了对象之间的现有间距,这是默认外观。
是否有可能避免这种情况?
感谢您的时间。
答案1
这也许就是你想要的。
\usepackage{etoolbox}
\AtEndEnvironment{proof}{\setcounter{claim}{0}}
这里我们claim
在每个proof
环境之后重置计数器。
\documentclass{article}
\usepackage{amsmath}%
\usepackage{amsthm}%
\usepackage{amsfonts}%
\usepackage{amssymb}%
\theoremstyle{plain}
\newtheorem{theorem}{Theorem}
\theoremstyle{remark}
\newtheorem{claim}{Claim}
%\numberwithin{claim}{theorem} %% <-- This is another alternative if you like little difference.
\usepackage{etoolbox}
\AtEndEnvironment{proof}{\setcounter{claim}{0}}
\begin{document}
\begin{theorem}
Bla
\end{theorem}
\begin{proof} There are some claims.
\begin{claim}
Bla
\end{claim}
\begin{claim}
Bla bla
\end{claim}
\end{proof}
\begin{theorem}
Bla
\end{theorem}
\begin{proof} There are some claims.
\begin{claim}
Bla
\end{claim}
\begin{claim}
Bla bla
\end{claim}
\end{proof}
\end{document}