编辑:现在我已将解决方案添加为问题的最后一部分。
在默认的定理风格中,即\theoremstyle{theorem}
,我有这样一个句子
\documentclass{article}
\usepackage{amsthm}
\theoremstyle{plain}
\newtheorem{theorem}{Theorem}
\begin{document}
\begin{theorem}
(1) This is a test.
\end{theorem}
\end{document}
我想将数字“(1)”改为罗马格式。我发现的一种方法是
\documentclass{article}
\usepackage{amsthm}
\theoremstyle{plain}
\newtheorem{theorem}{Theorem}
\begin{document}
\begin{theorem}
$\mathrm{(1)}$ This is a test.
\end{theorem}
\end{document}
还有其他方法吗?我尝试过用 替换,$\mathrm{(1)}$
但这\textrm{(1)}
没有效果,并且\normalfont{(1)}
将整个定理更改为罗马字体样式。
感谢 David Carlisle 的建议,一种方法是
\documentclass{article}
\usepackage{amsthm}
\theoremstyle{plain}
\newtheorem{theorem}{Theorem}
\begin{document}
\begin{theorem}
\textnormal{(1)} This is a test.
\end{theorem}
\end{document}
用户 Teepeemm 还建议
\documentclass{article}
\usepackage{amsthm}
\usepackage{enumitem}
\theoremstyle{plain}
\newtheorem{theorem}{Theorem}
\begin{document}
\begin{theorem}
{\normalfont (1)} This is a test.
\end{theorem}
\end{document}
David 还建议我看一下enumitem
这个包。这是一个使用该包生成罗马字体数字的解决方案:
\documentclass{article}
\usepackage{amsthm}
\usepackage{enumitem}
\theoremstyle{plain}
\newtheorem{theorem}{Theorem}
\begin{document}
\begin{theorem}
\begin{enumerate}[label=\textnormal{(\arabic*)}]
\item This is a test.
\end{enumerate}
\end{theorem}
\end{document}
答案1
没有“违约\theoremstyle{theorem}
”,事实上,我收到了警告
Package amsthm Warning: Unknown theoremstyle `theorem' on input line 5.
你也应该这么做。amsthm
启动时会调用默认样式plain
,无需调用。
我建议,为您的应用程序定义您自己的环境:
\documentclass{article}
\usepackage{amsthm}
\usepackage{enumitem}
\newtheorem{theorem}{Theorem}
\newlist{roster}{enumerate}{1}
\setlist[roster]{
topsep=0.5ex plus 0.2ex, % vertical space around the list
itemsep=0pt, % no space between items
parsep=0pt,
label=\upshape(\arabic*), % the label in upright type
}
\begin{document}
\begin{theorem}
The following conditions are equivalent:
\begin{roster}
\item some condition,
\item another condition,
\item a final condition,
\end{roster}
If these conditions are satisfied, we're very happy.
\end{theorem}
\end{document}
调整参数以适合您的口味。