我怎样才能拥有一个 amsmath 定理环境,其中环境名称作为参数传递?
例如
\begin{note}[Name of the Theorem]
Lorem ipsum dolor sit amet, consetetur sadipscing elitr,
sed diam nonumy eirmod tempor invidunt ut labore et dolore
magna aliquyam erat, sed diam voluptua.
\end{note}
\begin{note}[A different name]
Lorem ipsum dolor sit amet, consetetur sadipscing elitr,
sed diam nonumy eirmod tempor invidunt ut labore et dolore
magna aliquyam erat, sed diam voluptua.
\end{note}
提前致谢!
编辑:为清楚起见,添加了第二个示例
答案1
请参阅关于勾股定理的教程这一页。
您可以使用括号添加定理标题:
\begin{theorem}[Pythagorean theorem]
编辑:这是一个例子,但我不确定这是否是你正在寻找的。
\documentclass{report}
\usepackage{amsmath}
\newtheorem{theorem}{Theorem}
\newtheorem{theoremApple}{Apple}
\newtheorem{theoremBanana}{Banana}
\begin{document}
\begin{theorem}[Apple]
The apple is red.
\end{theorem}
\begin{theorem}[Banana]
The banana is yellow.
\end{theorem}
\begin{theoremApple}
The apple is red.
\end{theoremApple}
\begin{theoremBanana}
The banana is yellow.
\end{theoremBanana}
\begin{theoremApple}
Actually, the apple is green.
\end{theoremApple}
\end{document}
导致