I have no idea how to build the following tcolorbox. Any suggestion will be very helpfull.
-
2It can be done with a small variation of an answer to one of your earlier questions, which you never bothered to accept. – user194703 Mar 16 '20 at 22:36
-
Yes, I tried to modify that very useful suggestion for that tcolorbox, but I don't know how to include top and bottom line as in this new one. – nbach Mar 17 '20 at 1:39
Conceptually this is the same as an earlier answer by Ignasi, but of course a few keys different and also using \newtcolorbox
. It also uses a trick from here to get a nice dotted line. EDIT: Added the changes suggested by Ignasi.
\documentclass{article}
\usepackage[most]{tcolorbox}
\newtcolorbox{mybox}[2][]{enhanced,title=#2,
fonttitle=\sffamily\bfseries,top=2pt,bottom=2pt,boxrule=0pt,arc=0pt,colframe=white,
coltitle=white,colback=white,
attach boxed title to top left={yshift=-1pt,xshift=-1pt},
borderline north={0.5mm}{0mm}{orange,dash pattern=on 0.1pt off 4pt,line
width=2pt,line cap=round},
borderline south={0.5mm}{0mm}{orange,dash pattern=on 0.1pt off 4pt,line
width=2pt,line cap=round},
boxed title style = {colback=orange, colframe=red, sharp corners, rounded
corners=northeast, arc=3mm, boxrule=0pt},
#1}
\begin{document}
\begin{mybox}{EXAMPLE 1}
\vspace{10em}
\end{mybox}
\end{document}
-
1Thank you for pointing to my answer! After re-reading it, I propose an alternative solution without
underlay boxed title
and using just aboxed title style
:attach boxed title to top left={yshift=-2pt, xshift=-1pt},boxed title style = {colback=orange, colframe=red, sharp corners, rounded corners=northeast, arc=3mm, boxrule=0pt}
. – Ignasi Mar 17 '20 at 8:12