Text Formattingamsthm | All Text after Theorem italicized

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
helasraizam
Posts: 2
Joined: Sat Mar 10, 2012 9:52 am

amsthm | All Text after Theorem italicized

Post by helasraizam »

Hi all,

I have come across a very curious phenomenon in LaTeX; below is a minimal working example. All text after the \theorem{Hello} is still italicized!

Code: Select all

\documentclass{article}
\usepackage{amsthm}

\begin{document}

\newtheorem{theorem}{Theorem}[section]

Hello

\theorem{Hello}

hi

\end{document}
The output is:
Hello

Theorem 0.1. Hello
hi
Instead of
Hello

Theorem 0.1. Hello
hi
What am I doing wrong? Thanks for your help.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

amsthm | All Text after Theorem italicized

Post by localghost »

Where did you get this strange code from? It uses the theorem environment in a completely wrong way.

Code: Select all

\documentclass[11pt]{article}
\usepackage[T1]{fontenc}
\usepackage{amsthm}

\newtheorem{theorem}{Theorem}[section]

\begin{document}
  \section{Foo}
    Hello

    \begin{theorem}[Hello]
      Theorem text.
    \end{theorem}

    hi
\end{document}
For details refer to the amsthm manual.


Best regards and welcome to the board
Thorsten
helasraizam
Posts: 2
Joined: Sat Mar 10, 2012 9:52 am

Re: amsthm | All Text after Theorem italicized

Post by helasraizam »

Thank you very much, that solves it!
Post Reply