I want to set up a customised tcolorbox
where the title of the box is automatically formatted as a section heading. Here's a MWE with my current set up:
\documentclass[a0]{a0poster}
\usepackage{lipsum}
\usepackage[margin=4cm]{geometry}
\usepackage{multicol}
\columnsep=3cm
\columnseprule=0pt
\usepackage{xcolor}
\definecolor{grey}{RGB}{240,240,240}
\usepackage{tcolorbox}
\newtcolorbox{info}[1]{boxrule=1.5mm,sharp corners,colback=grey,colframe=black,title=#1,fontupper=\color{black},fonttitle={\color{white}\bf\section{#1}}}
\begin{document}
\begin{multicols}{3}
\begin{info}{Introduction}
\lipsum[1]
\end{info}
\lipsum[2-30]
\end{multicols}
\end{document}
The problem is that this creates this:
Rather than, as desired, this:
A solution would be welcome.
Best Answer
The
\section
should go intotitle=...
, not again infonttitle=
, which is meant for font settings, not for structure levels.(Well, 'again' is the wrong term:
fonttitle
settings are done first, so\section
will come first then as well, which is clearly visible in the O.P.'s screenshot)