Improved version:
\documentclass{article}
\usepackage[many]{tcolorbox}
\usetikzlibrary{calc}
\definecolor{myblue}{RGB}{0,163,243}
\tcbset{mystyle/.style={
breakable,
enhanced,
outer arc=0pt,
arc=0pt,
colframe=myblue,
colback=myblue!20,
attach boxed title to top left,
boxed title style={
colback=myblue,
outer arc=0pt,
arc=0pt,
top=3pt,
bottom=3pt,
},
fonttitle=\sffamily
}
}
\newtcolorbox[auto counter,number within=section]{example}[1][]{
mystyle,
title=Example~\thetcbcounter,
overlay unbroken and first={
\path
let
\p1=(title.north east),
\p2=(frame.north east)
in
node[anchor=west,font=\sffamily,color=myblue,text width=\x2-\x1]
at (title.east) {#1};
}
}
\newtcolorbox[auto counter]{assumption}[1][]{
mystyle,
colback=white,
rightrule=0pt,
toprule=0pt,
title=Assumption SLR.\thetcbcounter,
overlay unbroken and first={
\path
let
\p1=(title.north east),
\p2=(frame.north east)
in
node[anchor=west,font=\sffamily,color=myblue,text width=\x2-\x1]
at (title.east) {#1};
}
}
\begin{document}
\section{Test section}
\begin{example}
test
\end{example}
\begin{assumption}
test
\end{assumption}
\begin{example}[Optional title]
test
\end{example}
\begin{assumption}[Optional title with some more words for the example so it spans two lines]
test
\end{assumption}
\end{document}
The result:
First version:
One possibility:
\documentclass{article}
\usepackage[many]{tcolorbox}
\definecolor{myblue}{RGB}{0,163,243}
\tcbset{mystyle/.style={
breakable,
enhanced,
outer arc=0pt,
arc=0pt,
colframe=myblue,
colback=myblue!20,
attach boxed title to top left,
boxed title style={
colback=myblue,
outer arc=0pt,
arc=0pt,
},
title=Example~\thetcbcounter,
fonttitle=\sffamily
}
}
\newtcolorbox[auto counter,number within=section]{example}[1][]{
mystyle,
title=Example~\thetcbcounter,
}
\newtcolorbox[auto counter]{assumption}[1][]{
mystyle,
title=Assumption SLR.\thetcbcounter,
}
\begin{document}
\section{Test section}
\begin{example}
test
\end{example}
\begin{assumption}
test
\end{assumption}
\end{document}
The output:
I used the same style for both examples and assumptions, but if you also want to reproduce the other style, a simple modification will do:
\documentclass{article}
\usepackage[many]{tcolorbox}
\definecolor{myblue}{RGB}{0,163,243}
\tcbset{mystyle/.style={
breakable,
enhanced,
outer arc=0pt,
arc=0pt,
colframe=myblue,
colback=myblue!20,
attach boxed title to top left,
boxed title style={
colback=myblue,
outer arc=0pt,
arc=0pt,
},
title=Example~\thetcbcounter,
fonttitle=\sffamily
}
}
\newtcolorbox[auto counter,number within=section]{example}[1][]{
mystyle,
title=Example~\thetcbcounter,
}
\newtcolorbox[auto counter]{assumption}[1][]{
mystyle,
colback=white,
rightrule=0pt,
toprule=0pt,
title=Assumption SLR.\thetcbcounter,
}
\begin{document}
\section{Test section}
\begin{example}
test
\end{example}
\begin{assumption}
test
\end{assumption}
\end{document}
The output:
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}
Best Answer
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 anytcolorbox
and implements the design you want.Use
\newtcolorbox
to define an environment calledmybox
that uses themy box
style.Of course, you can apply the
my box
style to othertcolorbox
es if you want—that is the whole point of separating the two operations.Note: the
bc-dodecaedre
graphics comes from thebclogo
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 oftcolorbox
(see thetheorem
environment defined in the example).Page 1:
Top of page 2: