数定理 1a 1b 2a 2b 2c

数定理 1a 1b 2a 2b 2c

我正在尝试用数字和字母对定理进行编号,其中每组字母的大小不同。这些定理是相互联系的,我想在文本中展示它。我使用 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} 

输出:

在此处输入图片描述

相关内容