# Options in newtcolorbox not working

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]

{
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. Apr 21 '18 at 13:20
• While possible I don't recommend numbers in environment names
– user31729
Apr 21 '18 at 13:47
• tcolorbox has a pretty manual. We call it documentation and not papers, however.
– user31729
Apr 21 '18 at 14:16
• @ChristianHupfer thank you, thats was I was looking for Apr 21 '18 at 16:33

\newtcolorbox{foo}[3][Heading} defines a tcolorbox with one optional argument (the first one!), to be used with [...] and two mandatory arguments with {} pairs.

The usage

\begin{mybox2}{Uberschrift}{red}{Carmin} is wrong then, it must be \begin{mybox2}[Uberschrift]{red}{Carmine}, also correcting the typo for Carmine.

\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]

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}{Carmine}
Zusammensetzung einer \textbf{Indexformel}
\end{mybox2}

\end{document}