4

This question already has an answer here:

I want to make a theorem's header stands in a separated line like (as style break in ntheorem)

Examples 1
  (1) GL(n)
  (2) SL(n)

I copied the solution from Theorem formatting, but it doesn't work if I begin the theorem by \begin{enumerate}.

\documentclass[12pt, a4paper]{amsart} %a minimal example
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\newtheoremstyle{mystyle}% name
  {3pt}%Space above
  {3pt}%Space below
  {\normalfont}%Body font
  {0pt}%Indent amount
  {\itshape}% Theorem head font
  {.}%Punctuation after theorem head
  {\newline}%Space after theorem head 2
  {}%Theorem head spec (can be left empty, meaning ‘normal’)
\theoremstyle{mystyle}
\newtheorem{exam}{Examples}

\begin{document}
\begin{exam}
\begin{enumerate} %If I begin with enumerate, the results are not good
  \item $GL(n)$
  \item $SL(n)$
\end{enumerate}
\end{exam}

\begin{exam}
Groups % if I begin with normal text, it works.
\begin{enumerate}
  \item $GL(n)$
  \item $SL(n)$
\end{enumerate}
\end{exam}

\end{document}

marked as duplicate by Joseph Wright Aug 18 '13 at 7:03

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.