so I have this:
\newcommand{\boxx}[2]{
\colorbox{white}{\begin{varwidth}{\textwidth}
% Heading
\colorbox{green!30}{#1}\\
% Content
\fcolorbox{green}{yellow}{\begin{varwidth}{\textwidth}
#2
\end{varwidth}}
\end{varwidth}}
}
Using it looks like this:
\boxx{Heading}{Some \\ fancy \\ content}
I'd like to create a 3th and 4th argument for the border color of my fcolorboy and the backgroundcolor.
So that I can do e.g.:
\boxx{Heading}{Some \\ fancy \\ content}{green}
\boxx{Heading}{Some \\ fancy \\ content}{}{yellow}
\boxx{Heading}{Some \\ fancy \\ content}{blue}{red}
so basically:
\newcommand{\boxx}[4]{
% Do something to set #3, #4 a default value
\colorbox{white}{\begin{varwidth}{\textwidth}
% Heading
\colorbox{green!30}{#1}\\
% Content
\fcolorbox{#3}{#4}{\begin{varwidth}{\textwidth}
#2
\end{varwidth}}
\end{varwidth}}
}



\newcommand-- to set up a 4-argument macro, of which 2 are optional. – Mico Mar 08 '18 at 11:57xparse, e.g. https://tex.stackexchange.com/a/29975/ – Torbjørn T. Mar 08 '18 at 12:09