This question follows https://tex.stackexchange.com/a/688116/298558 .
Here, I asked a question about \newtcolorbox taking agruments. On page 15 on the manual there is an example that takes 2 arguments:
\newtcolorbox{mybox}[2][]{colback=red!5!white, colframe=red!75!black,fonttitle=\bfseries,
colbacktitle=red!85!black,enhanced, attach boxed title to top center={yshift=-2mm},
title={#2},#1}
\begin{mybox}[colback=yellow]{Hello there}
This is my own box with a mandatory title
and options.
\end{mybox}
I would like to pass 3 or 4 arguments to \newtcolorbox so that it takes the following form:
\newtcolorbox{mybox}[4][]{colback=red!5!white, colframe=red!75!black,fonttitle=\bfseries,
colbacktitle=red!85!black,enhanced, attach boxed title to top center={yshift=-2mm},
title={#2}, height = #3, halign = #4, #1}
This works:
\begin{mybox}[colback=yellow]{Hello there}{0.3\textheight}{flush center} This is my own box with a mandatory title and options. \end{mybox}
This doesn't work:
\begin{mybox}[colback=yellow, halign = flush left]{Hello there}{0.3\textheight}
I would be pleased, if someone could give me ideas.
[4]
instead of[3]
.\newtcolorbox{mybox}[4][]{colback=red!5!white, colframe=red!75!black,fonttitle=\bfseries, colbacktitle=red!85!black,enhanced, attach boxed title to top center={yshift=-2mm}, title={#2}, height = {#3}, halign = {#4}, #1}
Then, I use\begin{mybox}[colback=yellow]{Hello there}{0.3\textheight} This is my own box with a mandatory title and options. \end{mybox}
I get the error: "Package pgfkeys Error: Choice 'T' unknown in choice key '/tcb/halign'. I am going to ignore this key. T"[4][]{
defines a command with one optional and three mandatory arguments so#4
isT
in your example and the body startshis is my own