I'm submitting a paper and am required to use a provided document class which defines its own theorem environments, so I can't use packages like amsthm
or ntheorem
. The class doesn't define a 'Definition' theorem environment, so I defined my own. I'm trying to get the body text not to be in italic, just like \theoremstyle{definition}
does. Is there a way to do it?
1 Answer
Ad-hoc restyling can be done using \normalfont
at the start of the definition
:
\documentclass{article}
\newtheorem{definition}{Definition}
\begin{document}
\begin{definition}
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Sed eu eros dignissim mi ultricies varius in ac purus.
Mauris et massa turpis. Aenean egestas fringilla odio,
in placerat leo vestibulum non.
\end{definition}
\begin{definition}
\normalfont Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Sed eu eros dignissim mi ultricies varius in ac purus.
Mauris et massa turpis. Aenean egestas fringilla odio,
in placerat leo vestibulum non.
\end{definition}
\end{document}
The above solution would hold for journals where you're not allowed to include other packages. If they don't mind and your definition
theorem environment is defined very simply, you could use something like:
\newtheorem{definition}{Definition}
\let\olddefinition\definition
\renewcommand{\definition}{\olddefinition\normalfont}
to modify the start of the environment to always use \normalfont
. This would then be a global change to the definition
theorem environment. Of course, you need not use a theorem-style to create the definition
environment in the first place. However, without much knowledge over the context and use, it would be hard to speculate on how you want it to look.
The above redefinition doesn't allow the use of an optional argument for the definition
environment. If you want this, you can use
\newtheorem{definition}{Definition}
\usepackage{xparse}
\let\olddefinition\definition
\RenewDocumentCommand{\definition}{o}{%
\IfNoValueTF{#1}
{\olddefinition}
{\olddefinition[#1]}%
\normalfont
}
instead. The above uses xparse
to capture and examine the possibility of an optional argument, and using it if it exists, before inserting the \normalfont
override.
-
-
But your answer doesn't work if some of your
definition
environments have optional arguments (e.g.,\begin{definition}[nonrigorous]
), does it?– MSCJan 15, 2015 at 20:02 -
1
definition
environment look like? Edit your question and include this detail.\documentclass
and the appropriate packages. In this case the problem is related to your specific definition so without that it is difficult to help.