TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm using the amsthm package for theorem style setting. I want the style like:

Theorem 1 A triangle ...

Theorem 2 (someone)

A square ...

that is, when the theorem includes a note, the body should begin with a new line after the theorem head.

share|improve this question
\documentclass{article}
\usepackage{ntheorem}
\usepackage{marginnote}
\makeatletter
\newtheoremstyle{optbreak}%
  {\item[\hskip\labelsep \theorem@headerfont ##1\ ##2\theorem@separator]}% from plain style
  {\item[\rlap{\vbox{\hbox{\hskip\labelsep \theorem@headerfont
          ##1\ ##2\ (##3)\theorem@separator}\hbox{\strut}}}]} % from break style
\makeatother
\theoremstyle{optbreak}
\newtheorem{thm}{Theorem}
\begin{document}
\begin{thm}
blah blah
\end{thm}
\begin{thm}[Opt]
blah blah
\end{thm}
\end{document}
share|improve this answer

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.