Is there a simple way to have the body of a block
environment in beamer to have a frame around it, rather than having a background colour? I tried putting a \fbox
inside the block, but it just wrote off the side of the slide… I tried putting the fbox outside the block environment, but that looks mega ugly.
Ideally, I'd like to do this through defining a beamer template with \setbeamertemplate{blocks}{framed}
or something like this. So that colour themes and blocks inside columns work nicely.
I looked up the definition of beamercolorbox
and it's not pretty…
Best Answer
With some serious butchering of
beamerbaseboxes.aux
I managed to get the following[framed]
template for beamer boxes. For easier digestibility, I'll split the code into several chunks and add some comments inbetween. You'll probably want to move some parts to a .sty file.It all starts, innocently, with
Next, I took the code from
\beamerboxesrounded
, removed the shadow part, changed the drawinging commands a bit and changed some\vskip
s. First this sets up some colors. Then it sets the title in a minipage (that is saved to a box). Then it draws around the title. Finally it starts a minipage for the main content. The rest of the code glues things together.The end command ends the
\minipage
of the content and draws a line around it (not drawing on the top). Again I removed all the code for the shadow and changed the drawing code slightly.Having defined the commands that do the actual drawing work, we need to set up the template. The following code is almost verbatim from
beamerbaseauxtemplates.sty
, only changingrounded
toframed
and removingshadow=false
. If you want to, you can also remove the\vskip\smallskipamount
(as the boxes are lighter, they can probably be placed closer together)Now we only have to select the template
You might want to change some styling (depending on your theme, the defaults might look fine). Here is what I used for the example image.
An example: