14

Q: How do I define a newtheoremstyle which will start the theorem text on a newline after the header even when the theorem text starts with a list, e.g., enumerate? If there's no way of doing this, will any reasonable hacks get the job done?

You can see below in theorem 2.1 that my newtheoremstyle, theorem-break, does as desired when the theorem text does not start with a list environment. But you can see in theorem 2.2. that theorem text starting with a list environment will eat up the \newline. The \mbox{} hack in theorem 2.3 sort of works, but adds an unnecessary blank line (compare with theorem 1.3).

\documentclass{article}
\usepackage{amsthm}
\theoremstyle{plain}
\newtheorem{theorem-plain}{Theorem}[section] 
\newtheoremstyle{break}  % follow `plain` defaults but change HEADSPACE.
  {\topsep}   % ABOVESPACE
  {\topsep}   % BELOWSPACE
  {\itshape}  % BODYFONT
  {0pt}       % INDENT (empty value is the same as 0pt)
  {\bfseries} % HEADFONT
  {.}         % HEADPUNCT
  {\newline}  % HEADSPACE. `plain` default: {5pt plus 1pt minus 1pt}
  {}          % CUSTOM-HEAD-SPEC
\theoremstyle{break}
\newtheorem{theorem-break}{Theorem}[section] 
\begin{document}

  \section{Plain Theorems}

  \begin{theorem-plain}[foo]
    Lorem ipsum sit amet dolor.
  \end{theorem-plain}

  \begin{theorem-plain}[foo]
    \begin{itemize}
      \item foo
      \item bar
    \end{itemize}
    Lorem ipsum sit amet dolor.
  \end{theorem-plain}

  \begin{theorem-plain}[foo]
    \mbox{}
    \begin{itemize}
      \item foo
      \item bar
    \end{itemize}
    Lorem ipsum sit amet dolor.
  \end{theorem-plain}

  \section{Theorems with Linebreaks after header}

  \begin{theorem-break}[foo]
    Lorem ipsum sit amet dolor. 
  \end{theorem-break}

  \begin{theorem-break}[foo]
    \begin{itemize}
      \item foo
      \item bar
    \end{itemize}  
    Lorem ipsum sit amet dolor.
  \end{theorem-break}

  \begin{theorem-break}[foo]
    \mbox{}
    \begin{itemize}
      \item foo
      \item bar
    \end{itemize}
    Lorem ipsum sit amet dolor.
  \end{theorem-break}

\end{document}

theorems

  • Would using ntheorem instead of amsthm be an option? – Gonzalo Medina Apr 12 '12 at 21:37
  • possible duplicate of tex.stackexchange.com/questions/46357/… – David Carlisle Apr 12 '12 at 21:56
  • @GonzaloMedina: I suppose so? I'm going through the documentation. A little difficult for me to understand how to use it. – lowndrul Apr 12 '12 at 22:28
  • @brianjd: see my answer below; ntheorem offers a predefined break style. – Gonzalo Medina Apr 12 '12 at 22:41
8

If using ntheorem instead of amsthm is an option (see Theorem packages: which to use, which conflict?), then you can use the predefined style break:

\documentclass{article}
\usepackage{ntheorem}

\newtheorem{theorem-plain}{Theorem}[section] 
\theoremstyle{break}
\newtheorem{theorem-break}{Theorem}[section] 

\begin{document}

  \section{Plain Theorems}

  \begin{theorem-plain}[foo]
    Lorem ipsum sit amet dolor.
  \end{theorem-plain}

  \begin{theorem-plain}[foo]
    \begin{itemize}
      \item foo
      \item bar
    \end{itemize}
    Lorem ipsum sit amet dolor.
  \end{theorem-plain}

  \section{Theorems with Linebreaks after header}

  \begin{theorem-break}[foo]
    Lorem ipsum sit amet dolor. 
  \end{theorem-break}

  \begin{theorem-break}[foo]
    \begin{itemize}
      \item foo
      \item bar
    \end{itemize}  
    Lorem ipsum sit amet dolor.
  \end{theorem-break}

\end{document}

enter image description here

  • Tried this approach and it worked. I'll probably stick with this. One nice thing about this approach is that it works for environments in paralist as well (the previous makeatletter approach did not). Passing ntheorem the amsthm and thmmarks options and loading ntheorem before amsmath were all critical to getting the output I wanted. – lowndrul Apr 13 '12 at 14:33
11

The code given in How to suppress vertical space between theorem heads and enumitem environments? almost works in this case but amsthm seems to require slightly different space correction otherwise the first item looks too close to the heading to me, try adding this to the preamble after the loading of the packages

\makeatletter
\def\enumfix{%
\if@inlabel
 \noindent \par\nobreak\vskip-\topsep\hrule\@height\z@
\fi}

\let\olditemize\itemize
\def\itemize{\enumfix\olditemize}

\makeatother
  • Thx David. This worked. Although, very mysterious to me. I never understand the internal stuff too well. – lowndrul Apr 12 '12 at 22:30
2

Input an explicit space (\ followed by a space) after header, for example

\documentclass[10pt,a4paper]{article}
\usepackage{amsthm}

\newtheorem{proposition}{Proposition}

\begin{document}
    \begin{proposition}[header]\ 
        \begin{enumerate}
            \item first
            \item second
        \end{enumerate}
    \end{proposition}
\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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