Document Classesbeamer environments in non beamer documents

Information and discussion about specific document classes and how to create your own document classes.
Post Reply
polla
Posts: 14
Joined: Thu Feb 12, 2009 3:23 pm

beamer environments in non beamer documents

Post by polla »

Hi all,
is there a way to use the \beamerboxesrounded command in a non beamer document? I am writing in a book style.
Thanks!

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
Stefan Kottwitz
Site Admin
Posts: 10324
Joined: Mon Mar 10, 2008 9:44 pm

beamer environments in non beamer documents

Post by Stefan Kottwitz »

Hi polla,

\beamerboxesrounded is defined in beamerbaseboxes.sty, reading that file could give you an impression. Perhaps the fancybox package could be an alternative way.

Stefan
LaTeX.org admin
polla
Posts: 14
Joined: Thu Feb 12, 2009 3:23 pm

Re: beamer environments in non beamer documents

Post by polla »

Hi Stefan, thanks, but the fancybox package does not do all I'd like it to do (though I guess it is better than nothing). I tried loading beamerbaseboxes, but I get error messages on the xcolor package, no matter what I do (i get something along the lines that bg is not defined).
I also tried the article mode in beamer, but with that mode all the typesetting of the boxes is lost. Should I jsut give up?
User avatar
Stefan Kottwitz
Site Admin
Posts: 10324
Joined: Mon Mar 10, 2008 9:44 pm

beamer environments in non beamer documents

Post by Stefan Kottwitz »

You could also use pgf/TikZ, have a look at this example: Boxes with text and math.

If you cannot use beamer boxes directly, a hard workaround would be to create a beamer class document pdf with just those boxes and include parts of the pdf by \includegraphics (cropped) into the book document.

Stefan
LaTeX.org admin
polla
Posts: 14
Joined: Thu Feb 12, 2009 3:23 pm

Re: beamer environments in non beamer documents

Post by polla »

Many thansk, Stefan, I have just tried it and indeed it works like a charm. My problem, though, is that I was looking for something easy to use that would work like:
\begin{mybeautifulbox}[options on colours, lines, etc]
my text here
\end{mybautifulbox}
The reason is, I am working with a coauthor that does not use latex, so we converge on scientific workplace. The beautiful fancybox you suggested have the problem that, because of the "node" environment, would show like a grey square in scientific workplace.... any idea to put something before the \begin{document} command that might do the trick, such as a new environment? I should add that after years of scientific word use I am pretty latex illiterate...
polla
Posts: 14
Joined: Thu Feb 12, 2009 3:23 pm

beamer environments in non beamer documents

Post by polla »

ok, I have been playing around with this, and finally managed to obtain the following (shamelessly plagiarising from http://syracuse-dev.org/mpst-globe/brow ... mp-geo.tex)

Code: Select all

\newsavebox{\dangerbox}
%\newsavebox{\titolo}
\newenvironment{Danger}{  \begin{lrbox}{\dangerbox}
    \begin{minipage}{\linewidth}
}
{\end{minipage}   \end{lrbox}
\tikzstyle{unabox} = [draw=blue!20, fill=red!20, very thick,
    rectangle, rounded corners, inner sep=10pt]
\par
\begin{tikzpicture}
\node [unabox] (box) {    \begin{minipage}[t!]{\linewidth}
        \usebox{\dangerbox}
    \end{minipage}
    };
\node[titolobox, right=10pt] at (box.north west) {#1};
\end{tikzpicture}
\par
}

\begin{document}


\begin{Danger}
BLA BLA BLA
\end{Danger}
This works. However, I cannot put a title in. I tried with

Code: Select all

\newenvironment{Danger}[1]{ etc etc}
but then it does not matter where I call for the argument, the most I manage to do is produce a box with a title consisting of the number 1. Any ideas on how I could solve this?
Many thanks
Post Reply