我正在尝试用数字和字母对定理进行编号,其中每组字母的大小不同。这些定理是相互联系的,我想在文本中展示它。我使用 ntheorem 包,但不了解如何更改默认编号顺序。
\documentclass{article}
\usepackage{ntheorem}
\newtheorem{theorem}{Hypothesis}
\begin{document}
\begin{theorem}
This is theorem 1 (should be 1a)
\end{theorem}
\begin{theorem}
This is theorem 2 (should be 1b)
\end{theorem}
\begin{theorem}
This is theorem 2 (should be 2a)
\end{theorem}
\end{document}
答案1
这是一个可能的解决方案。
每次您想要增加数字时,您都必须发出命令\theoremgroup
。
代码:
\documentclass{article}
\usepackage{ntheorem}
\newtheorem{theorem}{Hypothesis}
\usepackage{chngcntr}
\newcounter{pretheorem}
\counterwithin{theorem}{pretheorem}
\renewcommand\thetheorem{\arabic{pretheorem}\alph{theorem}}
\newcommand{\theoremgroup}{\refstepcounter{pretheorem}}
\begin{document}
\theoremgroup
\begin{theorem}
This is theorem 1a
\end{theorem}
\begin{theorem}
This is theorem 1b
\end{theorem}
\theoremgroup
\begin{theorem}
This is theorem 2a
\end{theorem}
\end{document}
输出: