I would like to create a template for my tcolorboxes
in my thesis, but I dont seem to get the options to work properly. Here my MWE (the first tcolorbox
is the one not using the \newtcolorbox
command, just showing the result i want to achieve, and the second is using the \newtcolorbox
:
\documentclass[openany,11pt]{book}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{tcolorbox}
\definecolor{Carmine}{HTML}{960018}%define a color for code blocks [background Latex Code]
\newtcolorbox{mybox2}[3][Heading]
{
title= \textbf{#1},
colback=#2!5!white, %background color box
colframe=red!50!black, %framecolor box
colbacktitle=#3!85!white, %backgroundcolor titile box
coltitle=white, %color title
%sharp corners,
arc=.3mm,
fonttitle=\bfseries,
}
\begin{document}
\begin{tcolorbox}[%
colback=red!5!white, %background color box
colframe=red!50!black, %framecolor box
colbacktitle=Carmine!85!white, %backgroundcolor titile box
coltitle=white, %color title
%sharp corners,
arc=.3mm,
fonttitle=\bfseries,
title= \textbf{Gaspreisfunktion},
]
Zusammensetzung einer \textbf{Indexformel}.
\end{tcolorbox}
\vspace{2cm}
\begin{mybox2}{Uberschrift}{red}{Carmin}
Zusammensetzung einer \textbf{Indexformel}
\end{mybox2}
\end{document}
\begin{mybox2}[Uberschrift]{red}{Carmine}
should give you the desired result.tcolorbox
has a pretty manual. We call it documentation and not papers, however.