Unfortunately I found only a French version of the package documentation, but if I understood it correctly, one could modify the margins to fit the text. Of course this is a non-automatic solutions which would have to be adapted depending on the content of the box.
\documentclass{beamer}
\usepackage[tikz]{bclogo}
\begin{document}
\begin{frame}
\begin{bclogo}[epBord=0.1, arrondi=0.4,
couleur=white, logo=\bcplume,
ombre=true, couleurOmbre=gray!50, epOmbre=0.1, blur,
barre=none, margeG=4, margeD=4
]{the title}
\end{bclogo}
\end{frame}
\end{document}
Automatic Solution (but not using bclogo
)
\documentclass{beamer}
\usepackage{tcolorbox}
\tcbuselibrary{skins}
\usepackage[tikz]{bclogo}
\begin{document}
\begin{frame}
\tcbset{enhanced,colframe=black,colback=white,colupper=black, fonttitle=\bfseries,center title,size=title,arc=4mm,frame style={drop shadow},boxrule=0.1mm}
\centering
\tcbox{\raisebox{-.25\height}{\bcplume}Title}
\end{frame}
\end{document}
Welcome to TeX.SE!
Implementing a style giving the desired layout
As said in the comments, this box style can be obtained with the powerful tcolorbox
. I do this in two steps:
Define a my box
style that can be applied to any tcolorbox
and implements the design you want.
Use \newtcolorbox
to define an environment called mybox
that uses the my box
style.
Of course, you can apply the my box
style to other tcolorbox
es if you want—that is the whole point of separating the two operations.
\documentclass{article}
\usepackage{xcolor}
\usepackage{graphicx}
\usepackage{tcolorbox}
\tcbuselibrary{skins}
\usepackage{lipsum}
\definecolor{boxTitle}{HTML}{fff79a}
\definecolor{boxBackground}{HTML}{fffce0}
\definecolor{boxFrame}{HTML}{f1e2b8}
\tcbset{my box/.style={
enhanced, fonttitle=\bfseries,
colback=boxBackground, colframe=boxFrame,
coltitle=black, colbacktitle=boxTitle,
attach boxed title to top left={xshift=0.3cm,
yshift*=-\tcboxedtitleheight/2},
boxed title style={
before upper=\hspace*{0.5cm}, % reserve space for the image
overlay={
\node at ([xshift=0.5cm]frame.west)
{\includegraphics[scale=0.65]{bc-dodecaedre}};
}
}
}
}
\newtcolorbox{mybox}[1][]{my box, #1}
\begin{document}
\begin{mybox}[title={This is a great title, with a comma}]
\lipsum[1]
\end{mybox}
\end{document}
Note: the bc-dodecaedre
graphics comes from the bclogo
package, so you must have it installed in order to have the graphics (.mps
file, obtained with MetaPost).
Automatically numbered boxes
Following your request in a comment, here are several ways of creating independently-numbered series of boxes using the layout we developed in the previous section (reusing it is particularly easy thanks to the my box
style). There are basically two ways:
using auto counter
in the first optional argument of \newtcolorbox
(see the two box series defined in the example below: boxes of type A and boxes of type B);
using the theorems
library of tcolorbox
(see the theorem
environment defined in the example).
\documentclass{article}
\usepackage{xcolor}
\usepackage{graphicx}
\usepackage{tcolorbox}
\tcbuselibrary{skins, theorems}
\usepackage{nameref} % only needed if you use \nameref
\definecolor{boxTitle}{HTML}{fff79a}
\definecolor{boxBackground}{HTML}{fffce0}
\definecolor{boxFrame}{HTML}{f1e2b8}
\tcbset{my box/.style={
enhanced, fonttitle=\bfseries,
colback=boxBackground, colframe=boxFrame,
coltitle=black, colbacktitle=boxTitle,
attach boxed title to top left={xshift=0.3cm,
yshift*=-\tcboxedtitleheight/2},
boxed title style={
before upper=\hspace*{0.5cm}, % reserve space for the image
overlay={
\node at ([xshift=0.5cm]frame.west)
{\includegraphics[scale=0.65]{bc-dodecaedre}};
}
}
}
}
\newtcolorbox[auto counter]{countedboxa}[2][]{%
my box, title={Counted box of type A~(\thetcbcounter): #2}, #1}
\newtcolorbox[auto counter, number within=section]{countedboxb}[2][]{%
my box, title={Counted box of type B.~(\thetcbcounter): #2}, #1}
\newtcbtheorem[number within=section]{theorem}{Theorem}{my box}{th}
\begin{document}
\section{First section}
\label{sec:first}
\begin{countedboxa}[label={first box of type A}]{Some title}
My number is~\thetcbcounter.
\end{countedboxa}
\begin{countedboxb}[label={first box of type B}]{Other title}
Note the different numbering style due to our use of
\verb|number within=section| for boxes of type~B. My number is~\thetcbcounter.
\end{countedboxb}
\begin{countedboxa}[label={second box of type A}]{Another title}
My number is~\thetcbcounter. The third box of type A is number~\ref{third
box of type A} on page~\pageref{third box of type A}.
\end{countedboxa}
\begin{countedboxb}[label={second box of type B}]{The title}
My number is~\thetcbcounter. The third box of type B is number~\ref{third
box of type B} on page~\pageref{third box of type B}.
\end{countedboxb}
\begin{theorem}{Compacity of Foo spaces}{foo}
% Text (mostly) from the tcolorbox manual
This is the text of the theorem. The counter is automatically assigned and,
in this example, prefixed with the section number due to our use of
\verb|number within=section|. This theorem is numbered \ref{th:foo}, found
on page~\pageref{th:foo} and titled ``\nameref{th:foo}.''
\end{theorem}
An immediate but very convenient consequence of this result is
theorem~\ref{th:bar}.
\begin{theorem}{Bar}{bar}
Trivial consequence of theorem~\ref{th:foo}.
\end{theorem}
\section{Second section}
\begin{countedboxa}[label={third box of type A}]{Some title}
See boxes~\ref{first box of type A} and \ref{second box of type A} in
section~\ref{sec:first}.
\end{countedboxa}
\begin{countedboxb}[label={third box of type B}]{Title of the box}
See boxes~\ref{first box of type B} and \ref{second box of type B} in
section~\ref{sec:first}.
\end{countedboxb}
\begin{theorem}{Quux}{quux}
This is a very important result.
\end{theorem}
\end{document}
Page 1:
Top of page 2:
Best Answer
Assuming that you compile with pdflatex it works if you remove the
\DeclareGraphicsRule{.mps}{eps}{*}{}
: