\documentclass{article}
\usepackage{amsmath,amssymb}
\newtheorem{defn}{Definition}
\newtheorem{pro}{Problem}
\newtheorem{thm}{Theorem}
\begin{document}
\begin{defn}
This is the first definition
\end{defn}
\begin{thm}
This is the first theorem
\end{thm}
\end{document}
当我得到输出时,定义、定理的主体是斜体。我能以正常字母形式获得这些环境吗?
答案1
无需任何与定理相关的包(使用etoolbox
修补 LaTeX 内核):
\documentclass{article}
\usepackage{etoolbox}
\makeatletter
\patchcmd{\@begintheorem}{\itshape}{}{}{}
\patchcmd{\@opargbegintheorem}{\itshape}{}{}{}
\makeatother
\newtheorem{pro}{Problem}
\begin{document}
\begin{pro}
This is the first problem.
\end{pro}
\end{document}
和amsthm
:
\documentclass{article}
\usepackage{amsthm}
\theoremstyle{definition}
\newtheorem{pro}{Problem}
\begin{document}
\begin{pro}
This is the first problem.
\end{pro}
\end{document}
和ntheorem
:
\documentclass{article}
\usepackage{ntheorem}
\theorembodyfont{\normalfont}
\newtheorem{pro}{Problem}
\begin{document}
\begin{pro}
This is the first problem.
\end{pro}
\end{document}
加上amsthm
thmtools
前端(也可以与一起使用ntheorem
):
\documentclass{article}
\usepackage{amsthm}
\usepackage{thmtools}
\declaretheoremstyle[bodyfont=\normalfont]{normalbody}
\declaretheorem[style=normalbody,name=Problem]{pro}
\begin{document}
\begin{pro}
This is the first problem.
\end{pro}
\end{document}