# Create Beamer-Theorem like boxes

I would like to create frames / boxes for equations or text like in the Beamer class:

outisde of the beamer documentclass, for example in the article class. Is there any package or trick to do this?

thanks

• Take a look at the mdframed package. Does that look like what you want? – Loop Space Sep 10 '13 at 11:22

tcolorbox has also a beamer skin:

\documentclass{article}
\usepackage{tcolorbox}
\tcbuselibrary{skins}

\colorlet{xlightblue}{blue!5}

\newtcolorbox{beamerlikethm}[1]{
title=#1,
beamer,
colback=xlightblue,
colframe=blue!30,
fonttitle=\bfseries,
left=1mm,
right=1mm,
top=1mm,
bottom=1mm,
middle=1mm
}

\begin{document}

\begin{beamerlikethm}{Theorem (Pythagoras)}
$a^2 + b^2 = c^2$
\end{beamerlikethm}

\end{document}


As Gonzalo suggested, could happen that your box necessitate of being split on different pages. The library breakable of the package deal with this problem.

An example:

\documentclass{article}
\usepackage{tcolorbox}
\tcbuselibrary{breakable,skins}

\usepackage{lipsum}

\colorlet{xlightblue}{blue!5}

\newtcolorbox{beamerlikethm}[1]{
title=#1,
beamer,
colback=xlightblue,
colframe=blue!30,
fonttitle=\bfseries,
left=1mm,
right=1mm,
top=1mm,
bottom=1mm,
middle=1mm,
breakable,
}

\begin{document}

\begin{beamerlikethm}{Theorem (Pythagoras)}
$a^2 + b^2 = c^2$
\end{beamerlikethm}

\lipsum[1-4]

\begin{beamerlikethm}{Something}
\lipsum[5]
\end{beamerlikethm}

\end{document}


• Perhaps you might want to add the breakable option so the box admits page breaks. – Gonzalo Medina Sep 10 '13 at 12:43
• @GonzaloMedina: that's absolutely right. I'll add a reference on this. – Claudio Fiandrino Sep 10 '13 at 12:56
• Just some hints for adjusting the vertical spacing of the formula in the example: the additional loading of the amsmath package corrects the spacing before the equation. Alternatively, the tcolorbox library theorems could be used (which loads amsmath). For multiline formulas, the library has special support for the spacing at the begin of the box, e.g. see the option 'ams nodisplayskip'. :-) – Thomas F. Sturm Sep 11 '13 at 6:45
• @ThomasF.Sturm: thank you very much for the suggestion. I will modify the answer accordingly. :) – Claudio Fiandrino Sep 11 '13 at 7:00

Another approach with the »tcolorbox« package and its theorems library.

\documentclass[11pt]{article}
\usepackage[T1]{fontenc}
\usepackage[most]{tcolorbox}

\newtcbtheorem{corollary}{Corollary}{%
breakable,
colback=blue!10,
colframe=blue!25,
fonttitle=\bfseries
}{cor}

\begin{document}
\begin{corollary}{Title}{dummy}
$x+y=y+x$
\end{corollary}
\end{document}


• Perhaps you might want to add the breakable option so the box admits page breaks. – Gonzalo Medina Sep 10 '13 at 12:43
• @GonzaloMedina: You forgot to mention that the breakable option needs the breakable library. Since it was not asked here for boxes which allow page breaks, there was no necessity to add it. But as you mention that now, the OP is aware of it. – Thorsten Donig Sep 10 '13 at 12:53
• Right, I didn't mention the library since I always load tcolorbox using \usepackage[most]{tcolorbox}, so I don't have to worry about loading the libraries explicitly. – Gonzalo Medina Sep 10 '13 at 12:57
• @GonzaloMedina: That is a good option. – Thorsten Donig Sep 10 '13 at 12:58

tcolorbox package might be helpful.

\documentclass{article}
\usepackage{tcolorbox}
\begin{document}

\begin{tcolorbox}[colback=blue!5,colframe=blue!40!black,title=Theorem (Pythagoras)]
$a^2 + b^2 = c^2$
\end{tcolorbox}

\end{document}


The similar question was asked here.

• Perhaps you might want to add the breakable option so the box admits page breaks. – Gonzalo Medina Sep 10 '13 at 12:44