2

I have this preamble

\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[left=1in, right=1in, top=1.3in, bottom=0.8in]{geometry}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage[utf8]{inputenc}

\newtheorem{theorem}{Theorem}
\newtheorem{corollary}[theorem]{Corollary}
\theoremstyle{definition}
\newtheorem{definition}[theorem]{Definition}
\newtheorem{example}[theorem]{Example}
\newtheorem{remark}[theorem]{Remark}
\newtheorem{examples}[theorem]{Examples}
\newtheorem{problem}[theorem]{Problem}
\theoremstyle{plain} 
\newtheorem{proposition}[theorem]{Proposition}
\newtheorem{lemma}[theorem]{Lemma}

\DeclareMathOperator{\End}{\text{End}}
\DeclareMathOperator{\Hom}{\text{Hom}}

\begin{document}

\begin{lemma}
 \End(M_R)
\end{lemma}

\end{document}

My question is: how to keep the commands \End and \Hom (which create the two words "End" and "Hom") non-italic in the theorem, lemma, corollary, proposition environments ?!. I just need these two words to be non-italic whereas the rest italic as it is.

Note. Outside of the aforementioned environments, the words are normal (as it's intended to be).

Thanks in advance.

7
  • 1
    \DeclareMathOperator{\End}{\mathrm{End}} might work?
    – Marijn
    Dec 2, 2022 at 12:16
  • 1
    Never ever use \text for this, it is not what that macro is for. Additionally always write math in math mode, Thus $\End(M_R)$
    – daleif
    Dec 2, 2022 at 12:17
  • @Marijn I don't think there is any need to use \mathrm in your case it is the default.
    – daleif
    Dec 2, 2022 at 12:17
  • Thanks @Marijn . This is so great. Dec 2, 2022 at 12:20
  • @daleif -- But if these are being set in italic within theorems, then their definition should account for that. So \mathrm or \textup would fix it. Dec 2, 2022 at 16:01

1 Answer 1

4

Remove \text:

\DeclareMathOperator{\End}{End}
\DeclareMathOperator{\Hom}{Hom}

Also it should be

\begin{lemma}
The endomorphism ring $\End(M_R)$ of the simple module $M_R$ is a division ring.
\end{lemma}

Math formulas need to be in math mode. And you should never use \text for something inherently math; its purpose is to insert textual parts in formulas.

You must log in to answer this question.

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