I have been trying to use a tcolorbox within a titleformat call to use part of an image in each section title. Unfortunately, it seems as though it gets stuck with passing the section title through to the tcolornox, such that calling {#1} within the tcolorbox throws up an error
\titleformat{\section} [block] {\center\normalfont\bfseries\color{Red}} {} {0pt} { \begin{tcolorbox}[enhanced, width=\textwidth, watermark graphics=graphic.jpg, watermark opacity=0.2, watermark overzoom=1.0, colback=Red!10, colframe=Red!80, sharp corners, valign=center, height=1.5cm] \begin{center} \textbf{#1} \end{center} \end{tcolorbox} } The error message that comes up at each section call:
Illegal parameter number in definition of \ttlf@section
Any help would be greatly appreciated
EDIT: To note, the code works when #1 is replaced with 'test', however the section title is printed underneath the tcolorbox rather than within it.
