TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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

By default, in the amsthm package, when you begin a theorem, LaTeX begins on a new line, and when you end the theorem, it also jumps to a new line. How can you prevent this behavior?

For example, I might want to display something like this.

Example text before theorem. \begin{thm}This is a theorem.\end{thm} Example text after theorem.

In this example, I would like the example text before and after to appear inline with the theorem.

share|improve this question
it is a design decision that theorems in amsthm start a new line; the styling is roughly equivalent to that of \section. modifying this design to allow a theorem to start in the middle of a line would not be trivial. regarding text following the theorem text, this doesn't fit within the ams design paradigm either, but could be accomplished within the scope of the theorem environment using \textup{...} or {\normalfont\upshape ...}. – barbara beeton Oct 16 '12 at 17:09
up vote 3 down vote accepted

You could define your own shortthm environment:

enter image description here

\usepackage{lipsum}% http://ctan.org/pkg/lipsum
\usepackage{amsthm}% http://ctan.org/pkg/amsthm
  {\enskip\refstepcounter{thm}\textbf{Theorem~\thethm.\space}\itshape}% \begin{shortthm}
  {\enskip}% \end{shortthm}
This is a theorem
Example text before theorem. \begin{shortthm}This is a theorem.\end{shortthm} Example text after theorem.

Note that this usage might be confusing to readings, since there is no clear distinction between the theorem body and body text - provided by default when using the line break of amsthm.

The above shortthm is very crude, but could be extended to form part of the creation when issuing \newtheorem{<theorem>}{<title>}. Also, it could also be made a macro, but I kept it in an environment form. The preceding and following text is separated by \enskip; assuming of course that you're not starting a paragraph with it. However, that can also be modified.

share|improve this answer

Your Answer


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.