如何檢查定理樣式參數的目前值?

如何檢查定理樣式參數的目前值?

我想改變簡單的定理樣式,以便它使用\slshape而不是\itshape.我知道我可以透過定義我自己的樣式,\newtheoremstyle但我不知道如何檢查(可能在運行時)樣式參數的當前值,因此我可以只更改我需要的內容,而無需理會其餘部分。

答案1

amsthm.sty您可以在發行版某處的文件中看到它

\thm@style{plain}
\newtoks\thm@bodyfont  \thm@bodyfont{\itshape}
\newtoks\thm@headfont  \thm@headfont{\bfseries}
\newtoks\thm@notefont  \thm@notefont{}
\newtoks\thm@headpunct \thm@headpunct{.}
\newskip\thm@preskip \newskip\thm@postskip
\def\thm@space@setup{%
  \thm@preskip=\topsep \thm@postskip=\thm@preskip
}

這是使用者等級的排便版本,\newtheoremstyle指令更加清晰。我不建議擺弄已經定義的樣式,但如果我們從頭開始做,我們就會有(雖然沒有檢查)

\newtheoremstyle{plain}{\topsep}{\topsep}{\itshape}{}{\bfseries}{.}{.5em}{}%

答案2

看來最簡單的方法是\def \th@plain {\slshape}或更好:\def \th@slanted {\slshape}然後使用\theoremstyle{slanted}.還有/曾經也有專門\theorembodyfont用於此目的的宏,但我不確定它位於哪個包中。

相關內容