Is there an option key for aligning subtitles in tcolorbox
? I do not see it in the package manual. The best I can do is: \tcbsubtitle{\centering{My centered subtitle}}
. I am looking for a way to define it in \tbcset
options.
1 Answer
Try with subtitle style={halign=center}
.
\documentclass{article}
\usepackage{tcolorbox}
\tcbset{subtitle style={halign=center}}
\begin{document}
\begin{tcolorbox}[title=My title]
\tcbsubtitle{My subtitle}
Further text.
\end{tcolorbox}
\end{document}
Unrelated note: \centering
is not a macro that takes an argument, so it should be used as {\centering ..}
, not \centering{..}
.