![\newtheorem 打印输出为空白?](https://linux22.com/image/470912/%5Cnewtheorem%20%E6%89%93%E5%8D%B0%E8%BE%93%E5%87%BA%E4%B8%BA%E7%A9%BA%E7%99%BD%EF%BC%9F.png)
在 \newtheorem{prg}{Printed output}[Theorem] 中,我可以写一些东西来代替 Printed output,以确保输出为空白,以便在写入 \begin{prg} \end{prg} 后只剩下计数的数字?
答案1
定义你自己的定理风格(见这里为标准参数)。
\documentclass{article}
\usepackage{amsthm}
\newtheoremstyle{blank}
{\topsep} % ABOVESPACE
{\topsep} % BELOWSPACE
{\itshape} % BODYFONT
{0pt} % INDENT (empty value is the same as 0pt)
{\bfseries} % HEADFONT
{.} % HEADPUNCT
{5pt plus 1pt minus 1pt} % HEADSPACE
{\thmnumber{#2}\thmnote{ (#3)}} % CUSTOM-HEAD-SPEC
\newtheorem{theorem}{Theorem}
\theoremstyle{blank}
\newtheorem{prg}{}[theorem]
\begin{document}
\begin{theorem}
This is a theorem.
\end{theorem}
\begin{prg}
This has just the number.
\end{prg}
\begin{prg}[Foo]
This has the number and the annotation.
\end{prg}
\begin{theorem}
This is another theorem.
\end{theorem}
\begin{prg}
This has just the number.
\end{prg}
\begin{prg}[Foo]
This has the number and the annotation.
\end{prg}
\end{document}