0

Is it possible to get \newtheorem to keep the "title" on the same line as the numbering? And give the title and the body different styles?

I would like to do something like this:

\begin{theorem}[Bayes' Theorem]
Poopy Stoopy
\end{theorem}

And have it show as:

Theorem 1.1 - Bayes' Theorem
Poopy Stoopy

With "Theorem 1.1" in bold, "Bayes' Theorem" in italics, and "Poopy Stoopy" in normal

1

2 Answers 2

0

You can use \theoremseparator

enter image description here

The code :

\documentclass{report}
\usepackage[utf8]{inputenc}
\usepackage[ thmmarks, thref]{ntheorem}

\theoremstyle{plain}
\theoremseparator{.~---}

\newtheorem{thm}{Theorem}[chapter]


\begin{document}
\chapter{}
\section{Introduction}
\begin{thm}\label{testthm}
Bayes' Theorem
\end{thm}
Poopy Stoopy.


\begin{thm}\label{testthm}
Some theorem
\end{thm}
Some text.

\end{document}
1
  • That's good but I was hoping for something more compact (see original question). Where does the style - italic/bold - come from? Thanks!
    – GuyMatz
    Apr 6 at 1:08
0

Use an appropriately defined theorem style.

\documentclass{article}
\usepackage{amsthm}

\newtheoremstyle{guymatz}
  {\topsep}     % ABOVESPACE
  {\topsep}     % BELOWSPACE
  {\normalfont} % BODYFONT
  {0pt}         % INDENT (empty value is the same as 0pt)
  {\bfseries}   % HEADFONT
  {}            % HEADPUNCT
  {\newline} % HEADSPACE
  {\thmname{#1}\thmnumber{ #2}\thmnote{\textnormal{ -- \textit{#3}}}} % CUSTOM-HEAD-SPEC

\theoremstyle{guymatz}
\newtheorem{theorem}{Theorem}[section]

\begin{document}

\section{Basics}

\begin{theorem}[Bayes' Theorem]
Poopy stoopy.
\end{theorem}

\begin{theorem}
Poopy stoopy.
\end{theorem}

\end{document}

enter image description here

You must log in to answer this question.

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