The question is, how to horizontally center a beamercolorbox
on the page?
I put it in the center
environment, but that doesn't work.
\setbeamercolor{bgcolor}{fg=black,bg=blue} \begin{center} \begin{beamercolorbox}[rounded=true, center=true, shadow=true, wd=6cm]{bgcolor} Some text goes here... \end{beamercolorbox} \end{center}
Best Answer
wd=<dimen>
not only sets the width of thebeamercolorbox
to<dimen>
, it sets the\hsize
to<dimen>
. So you're centering a box in a line which has the same width as the box, resulting in nothing.So to force centering, use some
\hfill
s:I'm not sure why you need two at the end—it seems like one at the front and back would do the centering. But instead you just get a box flush right. So an extra one does the trick.