0

i'm having a issue with tcolorbox involving tcbset, newtcbtheorem, optional color arguments and attach boxed title to .... The error is the following :

Package xcolor Error: Undefined color `visible'.

Here's a sample code :

\documentclass[a4paper, 11pt]{report}
\usepackage[many]{tcolorbox}

\tcbset{
    titlebox/.style={
        colframe=#1!50!white,
        attach boxed title to top left,
    }
}

\newtcbtheorem[number within=section]%
{theo}
{Théorème}
{titlebox=red}
{theo}

\begin{document}

\begin{theo}{Test}{}
Test.
\end{theo}

\end{document}

I have no clue why this occurs. If anyone happens to have an idea, please let me know. Thanks in advance :)

1 Answer 1

3

titlebox is a known key of tcolorbox. By overwriting it you are confusing the code. You are also missing the enhanced key.

\documentclass[a4paper, 11pt]{report}
\usepackage[many]{tcolorbox}

\tcbset{
    mytitlebox/.style={
        enhanced,
        colframe=#1!50!white,
        attach boxed title to top left,
    }
}

\newtcbtheorem[number within=section]%
{theo}
{Théorème}
{mytitlebox=red}
{theo}

\begin{document}

\begin{theo}[title=Title]{Test}{xxx}
Test.
\end{theo}

\end{document}
1
  • Straight to the point and very clear. Thans a lot ! Jun 19, 2022 at 21:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .