Page LayoutNewline after theorem header

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
spongemonkey
Posts: 2
Joined: Fri Nov 19, 2010 4:19 pm

Newline after theorem header

Post by spongemonkey »

I want the theorem header to be on its own line, which I attempted to achieve using:

Code: Select all

\newtheoremstyle{theorem}
                {10pt}
                {0pt}
                {}
                {}
                {\bfseries}
                {\\}
                {10pt}
                {}
\theoremstyle{theorem}
\newtheorem{thm}{Theorem}[subsection]
which works, except when the first thing in a theorem is an enumeration:

Code: Select all

\begin{thm}
    \begin{enumerate}
        \item For any collection $\left\{G_\alpha\right\}$ of open sets, $\bigcup_\alpha G_\alpha$ is open.
        \item For any collection $\left\{F_\alpha\right\}$ of closed sets, $\bigcap_\alpha F_\alpha$ is closed.
        \item For any finite collection $G_1 , \ldots , G_n$ of open sets, $\bigcap_{i=1}^n G_i$ is open.
        \item For any finite collection $F_1 , \ldots , F_n$ of closed sets, $\bigcup_{i=1}^n F_i$ is closed.
    \end{enumerate}
\end{thm}
For this the first item in the enumeration list is on the same line as the theorem header and indented. How can I get the theorem header to be on its own line in these cases too? (or perhaps my method doesn't need tweaking but scrapping - is there a better way to do this for every instance?)

Thanks,

Chris

Recommended reading 2024:

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

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

gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Newline after theorem header

Post by gmedina »

Hi,

using amsthm, some manual adjustments will be required when lists are used:

Code: Select all

\documentclass{article} 
\usepackage{amsmath,amsthm}

\newtheoremstyle{theorem}
                {10pt}
                {0pt}
                {}
                {}
                {\bfseries}
                {}
                {\newline}
                {}
\theoremstyle{theorem}
\newtheorem{thm}{Theorem}[subsection]

\begin{document} 

\begin{thm}\mbox{}
\vspace*{-\parsep}
\vspace*{-\baselineskip}
\begin{enumerate}
        \item For any collection $\left\{G_\alpha\right\}$ of open sets, $\bigcup_\alpha G_\alpha$ is open.
        \item For any collection $\left\{F_\alpha\right\}$ of closed sets, $\bigcap_\alpha F_\alpha$ is closed.
        \item For any finite collection $G_1 , \ldots , G_n$ of open sets, $\bigcap_{i=1}^n G_i$ is open.
        \item For any finite collection $F_1 , \ldots , F_n$ of closed sets, $\bigcup_{i=1}^n F_i$ is closed.
\end{enumerate}
\end{thm}

\begin{thm}
  A short theorem.
\end{thm}

\end{document} 
An alternative would be to use ntheorem instead:

Code: Select all

\documentclass{article} 
\usepackage{ntheorem}

\theoremstyle{break}
\theorembodyfont{\normalfont}
\newtheorem{thm}{Theorem}[subsection]

\begin{document} 

\begin{thm}
\begin{enumerate}
        \item For any collection $\left\{G_\alpha\right\}$ of open sets, $\bigcup_\alpha G_\alpha$ is open.
        \item For any collection $\left\{F_\alpha\right\}$ of closed sets, $\bigcap_\alpha F_\alpha$ is closed.
        \item For any finite collection $G_1 , \ldots , G_n$ of open sets, $\bigcap_{i=1}^n G_i$ is open.
        \item For any finite collection $F_1 , \ldots , F_n$ of closed sets, $\bigcup_{i=1}^n F_i$ is closed.
\end{enumerate}
\end{thm}

\begin{thm}
  A short theorem.
\end{thm}

\end{document}
1,1,2,3,5,8,13,21,34,55,89,144,233,...
spongemonkey
Posts: 2
Joined: Fri Nov 19, 2010 4:19 pm

Newline after theorem header

Post by spongemonkey »

Trying to get ntheorem to work, using the following source as a test:

Code: Select all

\documentclass[11pt,a4paper,oneside]{amsart}

\usepackage{amsmath,amssymb}
\usepackage[thmmarks,amsmath]{ntheorem}

\theoremstyle{plain}
\theorembodyfont{\normalfont}
\newtheorem{thm}{Theorem}[subsection]

\begin{document}
    
    \section{Topology}
    
    \subsection{Metric Spaces}
    
    \begin{thm}
        Every neighbourhood is an open set.
    \end{thm}
    
    \begin{proof}
        A proof.
    \end{proof}
    
\end{document}
but pdflatex complains:

Code: Select all

(/usr/share/texmf-dist/tex/latex/ntheorem/ntheorem.sty
Style `ntheorem', Version 1.28 <2009/07/01>

! Package ntheorem Error: Theorem style plain already defined.

See the ntheorem package documentation for explanation.
Type  H <return>  for immediate help.
 ...
ntheorem was the first package I installed manually, the .sty .drv and .std files went into /usr/share/texmf-dist/tex/latex/ntheorem, perhaps I've messed that up?

Cheers
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Re: Newline after theorem header

Post by gmedina »

Hi,

the ntheorem package is not comṕatible with the AMS document classes.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
Post Reply