1

I was wondering if there's a way to remove italic text format in environment created with \newtheorem command.

Here is my code:

\newtheorem{teorema}{Teorema}[subsection]

In \begin{document}:

\begin{teorema}
    This is a new theorem.
\end{teorema}

This is the result:

enter image description here

The problem is that I don't want the text to be italic. How can I achieve that?

2 Answers2

1

It's fairly easy if you use amsthm.

\documentclass[a4paper]{article}
\usepackage{amsmath}
\usepackage{amsthm}

\theoremstyle{definition} \newtheorem{teorema}{Teorema}[subsection]


I can't recommend numbering theorems according to subsections, for a couple of reasons. First, you are compelled to use subsections, which is not always necessary; second, if the class has chapters, you end up with theorems with four numbers.

I can't recommend using upright type either, because italics give a visual clue for finding the statements more easily.

egreg
  • 1,121,712
0

The way in which \newtheorem works and in which environments defined in terms of \newtheorem can be patched depends on the documentclass and the packages in use.

Using the article-class and no packages, you can do something like this:

\documentclass{article}

\newtheorem{teorema}{Teorema}[subsection] \makeatletter @ifdefinable\Oldteorema{\let\Oldteorema=\teorema}% \renewcommand\teorema{@ifnextchar[{\teoremaopt}{\Oldteorema\normalfont}}% \newcommand\teoremaopt[1][]{\Oldteorema[{#1}]\normalfont}% \makeatother

\begin{document}

\begin{teorema} This is a new theorem. \end{teorema}

\begin{teorema}[someone] This is a new theorem. \end{teorema}

\end{document}

I give no warranties that this works with other documentclasses, e.g., beamer.

Did you consider using the amsthm-package with its \newtheoremstyle/\theoremstyle-commands?

Ulrich Diez
  • 28,770