答案1
您可以使用\color{red}
并添加一对括号使其成为局部的,或者,如果您不想重复它,可以使用thmtools
新的有色定理进行定义,使用与相同的计数器theorem
:
\documentclass{amsart}
\usepackage{xcolor}
\newtheorem{theorem}{Theorem}
\usepackage{thmtools}
\declaretheorem[sibling = theorem, title =Theorem, preheadhook = \color{blue}]{colourthm}
\begin{document}
Some text.
\begin{theorem}
\end{theorem}
Some more text.
{\color{red}
\begin{theorem}
One has $1 + 1 = 2$.
\end{theorem}}
Some more text.
\begin{colourthm}One has $2 + 2 = 4$.
\end{colourthm}
Some more text.
\end{document}
答案2
使用当前的 LaTeX,你可以用钩子添加颜色:
\documentclass{amsart}
\usepackage{xcolor}
\newtheorem{theorem}{Theorem}
\begin{document}
Some text.
\begin{theorem}
\end{theorem}
Some more text.
\AddToHookNext{env/theorem/begin}{\color{red}}
\begin{theorem}
aa
\end{theorem}
Some more text.
\begin{theorem}
aa
\end{theorem}
\end{document}