Hello,
I would like to ask you following question:
I would like to have example covered with box. I am using amsthm package, but inserting its example definition into \framebox is not possible. Do you know some way how to do this?
Thanks a lot.
Libor
Math & Science ⇒ amsthm example covered with box
NEW: TikZ book now 40% off at Amazon.com for a short time.

amsthm example covered with box
Hi,
you can use the ntheorem package instead of amsthm. There's a predefined framed theorem style if the heading and the body of the example should be boxed. If only the heading should be boxed, then you could easily define a new theorem style:
you can use the ntheorem package instead of amsthm. There's a predefined framed theorem style if the heading and the body of the example should be boxed. If only the heading should be boxed, then you could easily define a new theorem style:
Code: Select all
\documentclass{article}
\usepackage{ntheorem}
\makeatletter
\newtheoremstyle{myframe}%
{\item[\rlap{\vbox{\hbox{\hskip\labelsep \theorem@headerfont
\fbox{##1\ ##2}\theorem@separator}\hbox{\strut}}}]\normalfont}%
{\item[\rlap{\vbox{\hbox{\hskip\labelsep \theorem@headerfont
\fbox{##1\ ##2\ (##3)}\theorem@separator}\hbox{\strut}}}]\normalfont}
\makeatother
\theoremstyle{myframe}
\newtheorem{exam}{Example}
\begin{document}
\begin{exam}
Test
\end{exam}
\end{document}
1,1,2,3,5,8,13,21,34,55,89,144,233,...