如果定理是第 x 节(某章)中的第 y 个编号,我希望在报告中用 xy 对该定理进行编号,而不使用章节编号。换句话说,我希望该定理按 进行编号\newtheorem{theorem}{Theorem}[section]
,但不使用章节编号。我知道这可能很容易,而且有一些重复,但我没有找到任何重复。
这是我希望的一个例子,每个定理的内容就是我所规划的数字应该是什么样的。
\documentclass{report}
\usepackage{amsthm}
\newtheorem{theorem}{Theorem}[section]
\begin{document}
\chapter{chapter 1}
\section{section 1.1}
\begin{theorem}
I hope this will be thm 1.1.
\end{theorem}
\subsection{A}
\begin{theorem}
I hope this will be thm 1.2.
\end{theorem}
\section{1.2}
\begin{theorem}
Theorem 2.1.
\end{theorem}
\chapter{chapter 2}
\section{section 2.1}
\begin{theorem}
Theorem 1.1.
\end{theorem}
\end{document}
答案1
您可以执行类似操作https://tex.stackexchange.com/a/16283/277964\arabic{section}.
,但在计数器前添加例如theorem
:
\documentclass{report}
\usepackage{amsthm}
\newtheorem{theorem}{Theorem}[section]
\renewcommand*{\thetheorem}{\arabic{section}.\arabic{theorem}}
\begin{document}
\chapter{chapter 1}
\section{section 1.1}
\begin{theorem}
I hope this will be thm 1.1.
\end{theorem}
\subsection{A}
\begin{theorem}
I hope this will be thm 1.2.
\end{theorem}
\section{1.2}
\begin{theorem}
Theorem 2.1.
\end{theorem}
\chapter{chapter 2}
\section{section 2.1}
\begin{theorem}
Theorem 1.1.
\end{theorem}
\end{document}