I am currently trying to add some nice textboxes to my current paper. Therefore, I found the tcolorbox
package and consulted corresponding manual.
Once I browsed through some of the examples and became familiar with the basic usage of the package, I found the example in the manual on page 154 which has an enhanced title box.
The basic code concerning this example would be about (basically copied from the manual):
\documentclass[pdftex]{report}
\usepackage{lipsum}
\usepackage[many]{tcolorbox} % Paket für textboxen
\usepackage{varwidth} % Paket zur anpassung der titelbreite von textboxen
\begin{document}
\newtcolorbox{mybox}{
enhanced,
before skip=2mm,after skip=2mm,
colback=black!5,colframe=black!50,boxrule=0.2mm,
attach boxed title to top left={xshift=1cm,yshift*=1mm-\tcboxedtitleheight},
varwidth boxed title*=-3cm,
boxed title style={
frame code={
\path[fill=tcbcol@back!30!black]
([yshift=-1mm,xshift=-1mm]frame.north west)
arc[start angle=0,end angle=180,radius=1mm]
([yshift=-1mm,xshift=1mm]frame.north east)
arc[start angle=180,end angle=0,radius=1mm];
\path[left color=tcbcol@back!60!black,right color=tcbcol@back!60!black,
middle color=tcbcol@back!80!black]
([xshift=-2mm]frame.north west) -- ([xshift=2mm]frame.north east)
[rounded corners=1mm]-- ([xshift=1mm,yshift=-1mm]frame.north east)
-- (frame.south east) -- (frame.south west)
-- ([xshift=-1mm,yshift=-1mm]frame.north west)
[sharp corners]-- cycle;
},
interior engine=empty,
},
fonttitle=\bfseries,
title={My title},
colbacktitle=green
}
\begin{mybox}
\lipsum[1]
\end{mybox}
\end{document}
Sadly, this does not seem to work.
I have narrowed down the problem to the block:
boxed title style={
frame code={
\path[fill=tcbcol@back!30!black]
([yshift=-1mm,xshift=-1mm]frame.north west)
arc[start angle=0,end angle=180,radius=1mm]
([yshift=-1mm,xshift=1mm]frame.north east)
arc[start angle=180,end angle=0,radius=1mm];
\path[left color=tcbcol@back!60!black,right color=tcbcol@back!60!black,
middle color=tcbcol@back!80!black]
([xshift=-2mm]frame.north west) -- ([xshift=2mm]frame.north east)
[rounded corners=1mm]-- ([xshift=1mm,yshift=-1mm]frame.north east)
-- (frame.south east) -- (frame.south west)
-- ([xshift=-1mm,yshift=-1mm]frame.north west)
[sharp corners]-- cycle;
},
interior engine=empty,
},
If one removes the both \path branches out of the frame code, it seems to work, but the title box also not coded!
Since I did not change anything important from the example code, I do not understand the error message I am getting:
Undefined control sequence. [ \begin{mybox}]
Undefined control sequence. [ \begin{mybox}]
tcolorbox
. Current version is 3.94, the feature you're using has beenupdated
on 2016-02-26. – user31729 Aug 24 '16 at 16:10