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.
Best Answer
You could define your own
shortthm
environment: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.