\newtheorem 打印输出为空白?

\newtheorem 打印输出为空白?

在 \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}

在此处输入图片描述

相关内容