18

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?

3
  • What does the current definition of your definition environment look like? Edit your question and include this detail.
    – Werner
    Jun 10, 2012 at 5:31
  • Welcome to TeX.SE. As Werner suggests, It is always best to compose a fully compilable MWE that illustrates the problem including the \documentclass and the appropriate packages. In this case the problem is related to your specific definition so without that it is difficult to help. Jun 10, 2012 at 5:39
  • Werner, your answer will do. I don't have so many definitions that it's inconvenient for me to use this ad-hoc trick. Thanks!
    – user18063
    Jun 10, 2012 at 5:50

1 Answer 1

36

Ad-hoc restyling can be done using \normalfont at the start of the definition:

enter image description here

\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.

3
  • \upshape is another possibility.
    – Werner
    Nov 7, 2013 at 0:16
  • But your answer doesn't work if some of your definition environments have optional arguments (e.g., \begin{definition}[nonrigorous]), does it?
    – MSC
    Jan 15, 2015 at 20:02
  • 1
    @MSC: True. In those instances you'll have to capture the optional argument first, then process it before inserting \normalfont. I've added that to the answer. You could do something more hack-y, but xparse allows for a clean interpretation of the optional argument.
    – Werner
    Jan 15, 2015 at 20:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .