1

I'm trying to build this mwe taken from the tcolorbox manual p. 270 (I have simplified it a bit):

\documentclass{article}
\usepackage{tcolorbox}
\tcbuselibrary{skins}

\tcbset{frogbox/.style={enhanced,colback=green!10,colframe=green!65!black,
enlarge top by=5.5mm,overlay={\foreach \x in {2cm,3.5cm} {
\begin{scope}[shift={([xshift=\x]frame.north west)}]
\path[draw=green!65!black,fill=green!10,line width=1mm] (0,0) arc (0:180:5mm);
\path[fill=black] (-0.2,0) arc (0:180:1mm);
\end{scope}}}]}}

\tcbset{app/.style={overlay app={%
\draw(frame.north)--(frame.south)}}}

\begin{document}
\begin{tcolorbox}[frogbox,title=My title]
This is a \textbf{tcolorbox}.
\end{tcolorbox}

\begin{tcolorbox}[frogbox,app,title=My title]
This is a \textbf{tcolorbox}.\par
Here, we apply a second overlay.
\end{tcolorbox}
\end{document}

The build fails with the following error:

! Package pgfkeys Error: I do not know the key '/tcb/overlay app', to which you passed '\draw (frame.north)--(frame.south)', and I am going to ignore it. Perhaps you misspelled it.

I'm using TL14 pretest, everything up-to-date. Is this a bug somewhere?

4

In order to be able to use the ... app or ... pre families of keys, you need to load the hooks library:

\documentclass{article}
\usepackage{tcolorbox}
\tcbuselibrary{skins,hooks}

\tcbset{
  frogbox/.style={
    enhanced,
    colback=green!10,
    colframe=green!65!black,
    enlarge top by=5.5mm,
    overlay={
      \foreach \x in {2cm,3.5cm} {
        \begin{scope}[shift={([xshift=\x]frame.north west)}]
        \path[draw=green!65!black,fill=green!10,line width=1mm] (0,0) arc (0:180:5mm);
        \path[fill=black] (-0.2,0) arc (0:180:1mm);
        \end{scope}
      }
    }
  }
}

\tcbset{
  app/.style={
    overlay app={%
      \draw(frame.north)--(frame.south);
    }
  }
}

\begin{document}
\begin{tcolorbox}[frogbox,title=My title]
This is a \textbf{tcolorbox}.
\end{tcolorbox}

\begin{tcolorbox}[frogbox,app,title=My title]
This is a \textbf{tcolorbox}.\par
Here, we apply a second overlay.
\end{tcolorbox}
\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.