[Tex/LaTex] Change the example environment

math-mode

At the moment I use this definition of example:

\theoremstyle{definition}
\newtheorem{example}{Example}

How can I put a line break after in a automatic way after the number of the example (header)? Basically I don't want that my example starts in the same line of the header of the example but on the next line.

Best Answer

I suppose you load amsthm. Hee is a simple code to define an example theorem style:

\documentclass{book}
\usepackage{amsthm} 
\newtheoremstyle{example}{}{}{}{}{\bfseries}{\smallskip}{\newline}{}
\theoremstyle{example}
\newtheorem{example}{Example}
\usepackage{lipsum}

\begin{document}

\lipsum[3]
\begin{example}
    This is an illuminating example. This is an illuminating example. This is an illuminating example. This is an illuminating example.
\end{example}
\lipsum[4]

\end{document} 

enter image description here