[Tex/LaTex] Theorem formatting

formattingtheorems

\theoremstyle{remark} \newtheorem{example}{Example}

Then:

\begin{example}
Some text
\end{example}

Output is:

Example 1. Some text

What is the way to automatically obtain without indent:

Example 1.
Some text

?

I tried to write:

\begin{example}
\\Some text
\end{example}

But there are two drawbacks, first it must be done every-time, second drawback is that it doesn't compile and Latex error is:

./doc.tex:60:There's no line here to end.\\S

Best Answer

Here's an example of the required new style definition using amsthm:

\documentclass{article}
\usepackage{amsthm}

\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}{Example}

\begin{document}

\begin{exam}
Test exam
\end{exam}

\end{document}

Here's an example using now the predefined break style from the ntheorem package:

\documentclass{article}
\usepackage{ntheorem}

\theoremstyle{break}
\theoremheaderfont{\normalfont\itshape}
\theorembodyfont{\normalfont}
\theoremseparator{.}
\newtheorem{exam}{Example}

\begin{document}

\begin{exam}
Test exam
\end{exam}

\end{document}

Finally, here's an example using thmtools and amsthm as its backend:

\documentclass{article}
\usepackage{amsthm}
\usepackage{thmtools}

\declaretheoremstyle[
spaceabove=3pt, spacebelow=3pt,
headfont=\normalfont\itshape,
notefont=\normalfont, notebraces={(}{)},
bodyfont=\normalfont,
postheadspace=\newline,
qed=\qedsymbol
]{mystyle}
\declaretheorem[style=mystyle]{example}

\begin{document}

\begin{example}
Test exam
\end{example}

\end{document}