[Tex/LaTex] box around theorem statement

framedpackagestheorems

Is there an easy way to put a box around a theorem in LaTeX? For example to state an important theorem.

I tried using page 20 of the ntheorem documentation,
but I do not know how to use the package.

Best Answer

You can use \newmdtheoremenv from the mdframed package:

\documentclass{article}
\usepackage{mdframed}
\usepackage{lipsum}

\newmdtheoremenv{theo}{Theorem}

\begin{document}

\begin{theo}
\lipsum*[1]
\end{theo}

\end{document}

enter image description here

If you only want to frame some theorems, then you can define a new environment using the mdframed environment and some previously defined theorem-like environment:

\documentclass{article}
\usepackage{mdframed}
\usepackage{lipsum}

\newtheorem{theo}{Theorem}
\newenvironment{ftheo}
  {\begin{mdframed}\begin{theo}}
  {\end{theo}\end{mdframed}}

\begin{document}

\begin{ftheo}
\lipsum*[1]
\end{ftheo}

\begin{theo}
\lipsum*[1]
\end{theo}

\end{document}