You could use something like this:
\documentclass{beamer}
\newlength\bodywd
\setlength\bodywd{.95\linewidth}
\setbeamercolor{block title}{fg=olive,bg=olive!20}
\setbeamercolor{block body}{fg=blue,bg=blue!20}
\setbeamertemplate{block begin}{%
\vskip.75ex%
\begin{beamercolorbox}[rounded=true,leftskip=1cm,colsep*=.75ex]{block title}%
\usebeamerfont*{block title}\insertblocktitle%
\end{beamercolorbox}%
\vskip.5ex %
\usebeamerfont{block body}%
\hspace*{.5\dimexpr\linewidth-\bodywd\relax}%
\begin{beamercolorbox}[wd=\bodywd,colsep*=.75ex,sep=.75ex,vmode]{block body}%
}
\setbeamertemplate{block end}{%
\end{beamercolorbox}%
\hfill\null%
}
\begin{document}
\begin{frame}
\begin{block}{The Title}
text
\end{block}
\end{frame}
\end{document}
The idea is to keep the width of body block in an auxiliar length \bodywd
and to add, before the block, a horizontal space given by 0.5(\linewidth-\bodywd)
.
I stumbled in a similar problem and solved it with the tcolorbox
package.
Here is the code:
\documentclass[final]{beamer}
\usepackage[orientation=portrait,size=a0,scale=1.4,debug]{beamerposter}
\usepackage{tcolorbox} %
\tcbuselibrary{skins} % preamble
\usepackage{tikz} %
\usetikzlibrary{shadows,shadings} %
\tikzset{myshadow/.style={ % custom shadow with tikz
opacity=.85,
shadow xshift=0.15,
shadow yshift=-0.15,
shade,
shading=axis,
shading angle=230}
}
\tcbset{ % set a custom tcolorbox
skin=enhanced, % enables use of shadows
frame style={fill=gray,drop shadow={myshadow}}, % sets the frame color and the shadow properties
bottom=7mm, % distance between the body text and the bottom frame
top=14mm, % distance between the body text and the top frame
boxrule=0mm, % frame width
bottomtitle=5mm, % distance between the title text and the bottom title frame
toptitle=5mm, % distance between the title text and the top title frame
lefttitle=1cm % title text left margin
}
\begin{document}
\begin{frame}
\begin{columns}
\begin{column}{.3\textwidth}
\begin{tcolorbox}[title=\large Fontsizes]
\centering
{\tiny tiny}\par
{\scriptsize scriptsize}\par
{\footnotesize footnotesize}\par
{\normalsize normalsize}\par
\end{tcolorbox}
\end{column}
\end{columns}
\end{frame}
\end{document}
the result is this:
for comparison:
I tried to explain everything in the code. If you want all the tcolorboxes to be like this, just put the \tcbset
code in the preamble, otherwise start a group just before the tcolorboxes you want to customize in that way.
The only thing that doesn't really look the same is the shadow (my shadow isn't blurred), but with some tweaks and the shadows.blur
tikzlibrary it should be possible to obtain the exact same result.
Best Answer
\beamerboxesrounded
uses thebmb@transition
shading to add color between the title and the body parts of blocks. Here's the original definition (found in the filebeamerbaseboxes.sty
):To have a solid color, instead of a shading, you can use the same color for all three components of the shading; something along these lines:
Of course, use the color that best suits your needs.