用数字和字母列举定理

用数字和字母列举定理

我希望我的定理环境能够使用数字和字母进行枚举。目前我有这个:

\documentclass{article}
\usepackage{amsthm}
\newtheorem{theorem}{Theorem}[section]
\begin{document}
\setcounter{section}{1}
\begin{theorem}
    This enumerates as ``1.1." but I want ``1.1.a."
\end{theorem}
\begin{theorem}
    Then this one would be ``1.1.b"
\end{theorem}
\end{document}

我知道我可以使用

\renewcommand*{\thetheorem}{\alph{theorem}}

用字母来列举,但我不确定如何将其应用于这种情况。

答案1

如果你想在section subsection数字到定理“数字”(此处:小写字母),您需要用\newtheorem{theorem}{Theorem}[section]替换\newtheorem{theorem}{Theorem}[subsection]

在此处输入图片描述

\documentclass{article}
\usepackage{amsthm} % for '\newtheorem' macro
\newtheorem{theorem}{Theorem}[subsection]
\renewcommand\thetheorem{\thesubsection.\alph{theorem}}

\begin{document}
\setcounter{section}{1}
\setcounter{subsection}{1}

\begin{theorem}
    I want ``1.1.a.'' -- check!
\end{theorem}
\begin{theorem}
    This one should be ``1.1.b.'' -- check!
\end{theorem}
\end{document}

相关内容