0

This question already has an answer here:

I am using a book style file and in the preamble I defined some theorem environment. But in the Definition and Lemma part I want nonitalic content. Please suggest. My preamble are

\newtheorem{theorem}{Theorem}[chapter]
\newtheorem{exercise}{Exercise}[chapter]
\newtheorem{example}{Example}[chapter]
\newtheorem{definition}{Definition}[chapter]
\newtheorem{lemma}{Lemma}[chapter]

marked as duplicate by egreg, Maarten Dhondt, Troy, user31729, TeXnician Jun 15 '17 at 8:51

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 1
    After so many years being a user of TeX.SE you have neither learned of a MWE nor how to format posts :-( And you mean book class file, most likely) – user31729 Jun 15 '17 at 7:09
  • Mr. Christian Hupfer ! Sorry I am not an expert of TeX like you, so I am asking for help. – Deepesh Patel Jun 15 '17 at 9:43
0

Below suggestion is not good but it works...

\newtheorem{odefinition}{Definition}[chapter]
\newenvironment{definition}{\begin{odefinition}\rm}\end{odefinition}}

\newtheorem{olemma}{Lemma}[chapter]
\newenvironment{lemma}{\begin{olemma}\rm}\end{olemma}}
  • Yes, it works - no it is not good style. Much better is to use the amsthm package. – Andrew Swann Jun 15 '17 at 7:40
  • 1
    \rm has been obsolete and deprecated for more than 20 years. – egreg Jun 15 '17 at 8:04
  • Dear Andrew Swann ! As you suggested above, both are not working. When I am using amsthm then it is giving error already defined. – Deepesh Patel Jun 15 '17 at 9:40
0

You can use the ntheorem package:

\documentclass{book}
\usepackage{ntheorem}
\newtheorem{tm}{Theorem}[chapter]
\theorembodyfont{\upshape}
\newtheorem{lm}{Lemma}[chapter]
\newtheorem{defi}{Definition}
\begin{document}
  \begin{tm}It happens that $2+2=4$\end{tm}
  \begin{lm}Why not?\end{lm}
\end{document}
  • Dear Sir ! This ntheorem is also not working. Actually, I am using a class file of a book given by the publisher. – Deepesh Patel Jun 16 '17 at 5:19
  • @DeepeshPatel Can you please explain in which way it is not working? – José Carlos Santos Jun 16 '17 at 6:16

Not the answer you're looking for? Browse other questions tagged or ask your own question.