Take the 2-minute tour ×
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.

I use \begin{block} ... \end{block} to describe formalization of some notions, and I want to write some examples under it. I still would like to stick to the structure of a block (one part for title and the other part for the content), but it is desirable to use another color to distinguish the example from the notion.

Could anyone tell me what I could use to embed the example?

share|improve this question
add comment

2 Answers

up vote 11 down vote accepted

How about using the alertblock or the exampleblock environment?

\documentclass{beamer}

\usecolortheme{whale}
\usecolortheme{orchid}

\begin{document}

\begin{frame}{A frame}

\begin{block}{A block environment}
Some text.
\end{block}

\begin{alertblock}{An alertblock environment}
Some text.
\end{alertblock}

\begin{exampleblock}{An exampleblock environment}
Some text.
\end{exampleblock}

\end{frame}

\end{document}

enter image description here

share|improve this answer
add comment

It's probably a bit late to join the party. However...

...the tcolorbox package provides some beautiful and flexible block environments (PGF-based) that specifically support "split boxes" with an upper and a lower half. As of version 1.1 (2012-03-01), there is also a complete English documentation available (previous versions where German only).

\documentclass{beamer}
\usepackage{tcolorbox}

\begin{document}

\begin{frame}{A frame}

\begin{tcolorbox}[colback=blue!5,colframe=blue!75!black,title=My title]
  My cool formalization
  \tcblower
  $\displaystyle\sum\limits_{i=1}^n i = \frac{n(n+1)}{2}$
\end{tcolorbox}

\end{frame}

\end{document}

enter image description here

share|improve this answer
    
I followed your link to ctan and discovered English documentation, too. Thank you, this package looks quite nice! –  mbork Mar 1 '12 at 23:25
2  
@mbork: Thanks, just found it. The English documentation is brand new (from 1st of March), so it seems that you looked at it right in time. I have edited this into the answer. –  Daniel Mar 2 '12 at 21:15
add comment

Your Answer

 
discard

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.