Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

This question is related to this one.

I want to have theorem headers alone on a line like this:

Theorem 1.
some text...

In the amsthm documentation, they suggest doing this:

\newtheoremstyle{mystyle}{3pt}{3pt}{}{0pt}{\bfseries}{.}{\newline}{}
\theoremstyle{mystyle}

And it works... as long as the text of the theorem doesn't start with an itemize or an enumeration.

How can I make it work with amsthm in this case?

And... why does this work this (strange) way?

Here is a minimal example to show the problem:

\documentclass{article}
\usepackage{amsthm}

\newtheoremstyle{mystyle} % Name
  {3pt}                   % Space above
  {3pt}                   % Space below
  {}                      % Body font
  {0pt}                   % Indent amount
  {\bfseries}             % Theorem head font
  {.}                     % Punctuation after theorem head
  {\newline}              % Space after theorem head
  {}                      % Theorem head spec (can be left empty, meaning 'normal')

\theoremstyle{mystyle}
\newtheorem{Example}{Example}


\begin{document}

\begin{Example}
  This is on the next line.
\end{Example}

\begin{Example}
  \begin{itemize}
    \item But this isn't!
    \item \ldots
  \end{itemize}
\end{Example}

\begin{Example}~
  \begin{itemize}
    \item And now, there is too much vertical space above
    \item \ldots
  \end{itemize}
\end{Example}

\end{document}
share|improve this question
    
see the solution given here tex.stackexchange.com/questions/46357/… –  David Carlisle Mar 23 '12 at 21:18
add comment

2 Answers

up vote 4 down vote accepted

Theorem assumes you start the body with a sentence, not with a list. The following workaround is available: you may start a bogus paragraph and then backtrack a line up:

\begin{Example}\leavevmode\vspace{-\baselineskip}
  \begin{itemize}
    \item This works
    \item \ldots
  \end{itemize}
\end{Example}
share|improve this answer
add comment

The answer by Boris didn't actually solve my problem, when I had the same. The spacing between the Example X text and the list number wasn't right.

But I realized that I could simply write something like this:

\begin{Example} $ $
  \begin{itemize}
    \item This works
    \item \ldots
  \end{itemize}
\end{Example}

Remark the empty math environment which forces LaTeX the think that there is a text block right after the Example X text.

I just wanted to share my solution, since I wasn't satisfied with the answer provided - I hope it helps somebody.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.