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.

Is there a way to emulate beamer blocks, e.g., alert/example, in ordinary pdflatex in article documents? Is there a pure tikz way of doing this?

share|improve this question
1  
What exactly do you want to achieve? Colored text? The box around theorem environments? –  Caramdir Aug 29 '10 at 19:23
    
Rounded corners, shadows, two colors (title/body). I have seen some tikz examples, but they are not 100% satisfactory. –  E.Verbitskiy Aug 29 '10 at 19:36

2 Answers 2

It is relatively easy to reproduce similar boxes using TikZ in a non-beamer document. For example, see here. Do you really need it to look exactly the same as in beamer? If so, you can just look at how it is implemented within beamer; I think it is defined either in beamerbaselocalstructure.sty or beamerinnerthemeinmargin.sty.

share|improve this answer

With version 2.00 of tcolorbox and its skin library it's possible to include beamer blocks in non-beamer documents. And now this blocks can break between columns and pages.

Here you have an example:

\PassOptionsToPackage{svgnames}{xcolor}
\documentclass[twocolumn,a4paper]{article}
\usepackage{tcolorbox}
\usepackage{lipsum}
\tcbuselibrary{skins,breakable}
\usetikzlibrary{shadings,shadows}

\title{Beamer blocks in \texttt{article.cls} with \texttt{tcolorbox (v 2.00)}}
\author{xxxxxx}

\newenvironment{myexampleblock}[1]{%
    \tcolorbox[beamer,%
    noparskip,breakable,
    colback=LightGreen,colframe=DarkGreen,%
    colbacklower=LimeGreen!75!LightGreen,%
    title=#1]}%
    {\endtcolorbox}

\newenvironment{myalertblock}[1]{%
    \tcolorbox[beamer,%
    noparskip,breakable,
    colback=LightCoral,colframe=DarkRed,%
    colbacklower=Tomato!75!LightCoral,%
    title=#1]}%
    {\endtcolorbox}

\newenvironment{myblock}[1]{%
    \tcolorbox[beamer,%
    noparskip,breakable,
    colback=LightBlue,colframe=DarkBlue,%
    colbacklower=DarkBlue!75!LightBlue,%
    title=#1]}%
    {\endtcolorbox}

\begin{document}
\maketitle

\section{Section}

\lipsum[2]

\begin{myblock}{Example of \texttt{myblock}}
\lipsum[2-3]
\end{myblock}

\begin{myexampleblock}{Example of \texttt{myexampleblock}}
\lipsum[2]
\end{myexampleblock}

\begin{myalertblock}{Example of \texttt{myalertblock}}
\lipsum[1]
\end{myalertblock}

\end{document}

with its result

enter image description here

share|improve this answer

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.