如何更改环境,使文档中显示的\begin{proof}
单词不显示斜体?我尝试更改,但这只会更改显示的文本,而不会更改样式。Proof
\proofname
答案1
我假设你正在谈论proof
所定义的amsthm
。该命令\itshape
在环境的定义中是硬连线的。
我建议修补它,以便它使用您可以随意重新定义的“通用”命令:
\usepackage{amsthm}
\usepackage{xpatch}
\xpatchcmd{\proof}{\itshape}{\normalfont\proofnamefont}{}{}
\newcommand{\proofnamefont}{} % add nothing
完整示例。\renewcommand
仅用于测试。
\documentclass{article}
\usepackage{amsthm}
\usepackage{xpatch}
\xpatchcmd{\proof}{\itshape}{\normalfont\proofnamefont}{}{}
\newcommand{\proofnamefont}{}
\begin{document}
\begin{proof}
Obvious, isn't it?
\end{proof}
\renewcommand{\proofnamefont}{\bfseries}
\begin{proof}[Proof in boldface]
Test for boldface and the optional argument.
\end{proof}
\end{document}
只是为了澄清一下:如果你想要粗体,代码应该是
\documentclass{article}
\usepackage{amsthm}
\usepackage{xpatch}
\xpatchcmd{\proof}{\itshape}{\normalfont\proofnamefont}{}{}
\newcommand{\proofnamefont}{\bfseries}
\begin{document}
\begin{proof}
Obvious, isn't it?
\end{proof}
\end{document}