3

I have the following document:

\documentclass{article}
\usepackage{amsmath}
\usepackage{amsfonts}
\newtheorem{thm}{Theorem}[section]
\newtheorem{cor}[thm]{Corollary}
\newtheorem{lem}[thm]{Lemma}
\newtheorem{prop}[thm]{Proposition}
\newtheorem{defn}[thm]{Definition}
\newtheorem{rem}[thm]{Remark}
\newtheorem{proof}{Proof}
\numberwithin{equation}{section}
\begin{document}
\section{Section 1}
\begin{thm}
Theorem.
\end{thm}
\begin{rem}
Remark.
\end{rem}
\begin{lem}
Lemma
\end{lem}
\begin{prop}
Proposition.
\end{prop}
\begin{cor}
Corollary.
\end{cor}
\begin{defn}
Definition.
\end{defn}
\begin{thm}
Theorem.
\end{thm}
\begin{proof}
Proof.
\end{proof}
\end{document}

which provides the following:

enter image description here

How do I remove \textit from the content of the proof (in my example that is: some proof here), definition and remark? I have tried to change the \newtheorem command but it didn't work.

Mico
  • 506,678
Alezigl
  • 375
  • 1
    I'm afraid a statement such as "I have tried to change the \newtheorem command but it didn't work" isn't actionable. It would be very helpful if you provided some information about what you tried in terms of modifying \newtheorem. Anyway, please see the answer I posted for a solution which (a) modifes the \newtheorem command and (b) works. :-) – Mico Nov 18 '23 at 12:55
  • Thank you very much! I don't have much experience with LaTeX so I cannot fix some things by myself. – Alezigl Nov 18 '23 at 15:55

2 Answers2

4

Just load amsthm and use \theoremstyle{definition} for those environments in which you don't want italics.

\documentclass{article}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amsthm}

\newtheorem{thm}{Theorem}[section] \newtheorem{cor}[thm]{Corollary} \newtheorem{lem}[thm]{Lemma} \newtheorem{prop}[thm]{Proposition}

\theoremstyle{definition} \newtheorem{defn}[thm]{Definition} \newtheorem{rem}[thm]{Remark} %\newtheorem{proof}{Proof}

\numberwithin{equation}{section}

\begin{document} \section{Section 1} \begin{thm} Theorem. \end{thm} \begin{rem} Remark. \end{rem} \begin{lem} Lemma \end{lem} \begin{prop} Proposition. \end{prop} \begin{cor} Corollary. \end{cor} \begin{defn} Definition. \end{defn} \begin{thm} Theorem. \end{thm} \begin{proof} Proof. \end{proof} \end{document}

enter image description here

egreg
  • 1,121,712
3

(I modified my answer after realizing that the OP desires to change the body font of just a few, but not all, theorem-like environments.)

I suggest you load the ntheorem package and issue the instruction \theorembodyfont{\upshape} right before \newtheorem{defn}[thm]{Definition}. That way, only the final three \newtheorem declarations will be affected by the font change.

enter image description here

\documentclass{article}
\usepackage{amsmath}
\usepackage{amssymb} % 'amssymb' loads 'amsfonts' automatically

\usepackage{ntheorem} % for '\theorembodyfont' macro

\newtheorem{thm}{Theorem}[section] \newtheorem{cor}[thm]{Corollary} \newtheorem{lem}[thm]{Lemma} \newtheorem{prop}[thm]{Proposition}

\theorembodyfont{\upshape} \newtheorem{defn}[thm]{Definition} \newtheorem{rem}[thm]{Remark} \newtheorem{proof}{Proof}

\begin{document}

\section{Introduction}

\begin{thm} Theorem. \end{thm} \begin{rem} Remark. \end{rem} \begin{lem} Lemma. \end{lem} \begin{prop} Proposition. \end{prop} \begin{cor} Corollary. \end{cor} \begin{defn} Definition. \end{defn} \begin{thm} Theorem. \end{thm} \begin{proof} Proof. \end{proof}

\end{document}

Mico
  • 506,678
  • 1
    Is it possible to make \begin{proof} Proof. \end{proof} without proof numbering (Proof 1, Proof 2, ...)? – Alezigl Nov 18 '23 at 16:06
  • 1
    @Alezigl - Sure. Just change \newtheorem{proof}{Proof} to \newtheorem*{proof}{Proof} – Mico Nov 18 '23 at 17:04
  • Thank you very much! – Alezigl Nov 18 '23 at 17:46
  • @Alezigl - Just out of idle curiosity: I thought that the only thing that you wanted to change about the appearance of the defn, rem, and proof environments was the font shape, from italic to upright; that's why I suggested using the ntheorem package. I've noticed that you accepted the other answer, which adds periods (aka "full stops") after the number of the theorem-like environments. (This happens because the other answer employs the amsthm package.) Question, not at all meant to pressure you: Was my assumption that you wouldn't want these extra periods simply unwarranted? – Mico Nov 19 '23 at 10:01
  • 1
    No, not at all. Both answers are very useful. I thought, namely, that I accepted both, but now I realized that this is not possible, so I voted up for both. Some academic journals require the form of: Theorem 1.1, and some require the form of:Theorem 1.1., so both answers work for me. Thank you. – Alezigl Nov 19 '23 at 10:45
  • 1
    @Alezigl - Many thanks for you follow-up. – Mico Nov 19 '23 at 11:30