我目前在序言中使用它:
\theoremstyle{plain}% default
\newtheorem{thm}{Theorem}[section]
\newtheorem{lem}[thm]{Lemma}
\newtheorem{prop}[thm]{Proposition}
\newtheorem*{cor}{Corollary}
\theoremstyle{definition}
\newtheorem{defn}{Definition}[section]
\newtheorem{conj}{Conjecture}[section]
\newtheorem{exmp}{Example}[section]
\theoremstyle{remark}
\newtheorem*{rem}{Remark}
\newtheorem*{note}{Note}
\newtheorem{case}{Case}
总体而言,这完全符合我的要求。但是对于证明中的案例,我希望每个定理中的编号再次从 1 开始:例如,它应该是:
Thm 1: blah blah
Proof:
Case 1:
Case 2:
Thm 2: blah blah blah
Proof:
Case 1:
Case 2:
而不是第二定理中从 3 开始的情况,这是目前发生的情况。
谷歌建议使用与之相关的东西numbered_within
,但我还没有设法获得正确的格式以使其工作。有什么想法吗?
答案1
我有一个简单的解决方案,其中包含ntheorem
包及其\theorempostwork
命令:case
计数器在环境结束时重置proof
。但是,proof symbol
如果证明在案例环境中结束,则必须手动设置:
\documentclass[11pt,a4paper]{book}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{fourier}
\usepackage{amsmath}
\usepackage[thmmarks, thref, amsmath]{ntheorem}
\theoremstyle{plain}
\newtheorem{thm}{Theorem}
\theoremheaderfont{\itshape}
\theorembodyfont{\upshape}
\newtheorem{case}{Case}
\theoremstyle{nonumberplain}
\theoremheaderfont{\scshape}
\theorembodyfont{\upshape}
\theoremsymbol{\scshape Q. E. D.}% or\ensuremath{ _{\Box}}, also add \usepackage{amssymb}
% or O. E. \ensuremath{\Delta} % for Euclid's ὅπερ ἔδει δεῖξαι
\theorempostwork{\setcounter{case}{0}}
\newtheorem{proof}{Proof}
\begin{document}
\begin{thm}
Once upon a time…
\end{thm}
\begin{proof}
Fiddle dee dee!
\begin{case}
First case of this proof
\end{case}
And now:
\begin{case}
Second case of this proof .\proofSymbol
\end{case}
\end{proof}
\begin{thm}
Once upon another time…
\end{thm}
\begin{proof}
Fiddle dee dee!
\begin{case}
First case of this proof
\end{case}
And now:
\begin{case}
Second case of this proof
\end{case}
This ends the proof of the theorem.
\end{proof}
\end{document}