以下代码运行良好
\begin{theorem}[Euler] Blah
\end{theorem}
但每当我尝试在描述中使用方括号时,都会出现错误。
\begin{theorem}[The set $[0, 1]$ is compact] Blah
\end{theorem}
有人能告诉我如何避免这个错误吗?
答案1
\documentclass[paper=a4,12pt]{scrbook}
\usepackage{amsmath}%
\usepackage{amsthm}%
\newtheorem{MyTheorem}{Brontosaurs}
\begin{document}
\begin{MyTheorem}[The set {$[0,1]$} is compact]
\end{MyTheorem}
\begin{MyTheorem}[By Ann Elk {[Misses]}]
\par
Brontosaurs are thin at one end, thick in the middle and thin again at the other end.
\end{MyTheorem}
\end{document}