我正在使用 thmtools 来指定定理和证明环境。出现的问题是我希望我的定理用斜体表示,而我的证明用非斜体表示。以下是我的初始设置:
\documentclass{report}
\usepackage{amsfonts, amssymb, amsthm}
\usepackage{mathtools}
\usepackage{undertilde}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{hyperref}
\usepackage{thmtools}
\declaretheoremstyle[
spaceabove=-6pt,
spacebelow=6pt,
headfont=\normalfont\bfseries,
bodyfont = \normalfont,
postheadspace=1em,
qed=$\blacksquare$,
headpunct={:}]{mystyle}
\declaretheorem[name={Proof}, style=mystyle, unnumbered]{Proof}
\declaretheoremstyle[
spaceabove=6pt,
spacebelow=6pt,
headfont=\normalfont\bfseries,
notefont=\mdseries\bfseries,
notebraces={(}{)},
bodyfont=\normalfont\itshape,
postheadspace=1em,
headpunct={:}]{mystyle}
\declaretheorem[name={Theorem}, style=mystyle,numberwithin=section]{thm}
和正文字体一样,我将定理陈述声明为斜体。我没有对证明这样做,尽管如此,定理和证明都以斜体表示。
答案1
您声明了两次样式mystyle
,一次是 ,Proof
第二次是Theorem
。只有最后一个被记住。您必须更改其中一个样式名称,然后将更改应用到相应的\declaretheorem
定义中。
\documentclass{report}
\usepackage{amsfonts, amssymb, amsthm}
\usepackage{mathtools}
\usepackage{undertilde}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{hyperref}
\usepackage{thmtools}
\declaretheoremstyle[
spaceabove=-6pt,
spacebelow=6pt,
headfont=\normalfont\bfseries,
bodyfont = \normalfont,
postheadspace=1em,
qed=$\blacksquare$,
headpunct={:}]{myproofstyle} %<---- change this name
\declaretheorem[name={Proof}, style=myproofstyle, unnumbered]{Proof}
\declaretheoremstyle[
spaceabove=6pt,
spacebelow=6pt,
headfont=\normalfont\bfseries,
notefont=\mdseries\bfseries,
notebraces={(}{)},
bodyfont=\normalfont\itshape,
postheadspace=1em,
headpunct={:}]{mystyle}
\declaretheorem[name={Theorem}, style=mystyle,numberwithin=section]{thm}
\begin{document}
\begin{thm}
Body of my first theorem
\end{thm}
\begin{Proof}
This proves my first theorem
\end{Proof}
\end{document}