Problem with empheq, xcolor[x11names] and tcolorbox – packages

colortcolorbox

FIRST EDIT:
N.B.: I just ansewered to this question
(you can find it in the bottom) Please, DO NOT CANCEL this question, Thank you so much!.

I have a trouble with my code:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[x11names]{xcolor}
\usepackage{amsmath}
\usepackage{mathtools}
\usepackage{amsthm}
\usepackage{stix}
\usepackage[listings]{tcolorbox}
\usepackage{empheq}
\tcbuselibrary{theorems}

\newtcbox{\Goldonebox}[1][]{nobeforeafter,math upper,tcbox raise base, enhanced,frame hidden,boxrule=0pt,interior style={top color=Gold1!10!white,
bottom color=Gold1!10!white,middle color=Gold1!50!yellow},
fuzzy halo=1pt with Gold1,#1}

\newtcbox{\greenbox}[1][]{nobeforeafter,math upper,tcbox raise base,
enhanced,frame hidden,boxrule=0pt,interior style={top color=green!10!white,
bottom color=green!10!white,middle color=green!50!yellow},
fuzzy halo=1pt with green,#1}

\title{XCOLOR}
\author{MATTIA ONOFRI}
\date{August 2021}

\begin{document}

\maketitle
\Huge
\section{Introduction}

\begin{empheq}[box=\Goldonebox]{align}
a&=b+c\\
E&=mc^2
\end{empheq}

\begin{empheq}[box=\greenbox]{align}
a&=b+c\\
E&=mc^2
\end{empheq}

\textcolor{Gold1}{GOLDEN}.

\end{document}

Overleaf tells me there are 8 errors (4 for first begin{empheq}…\end{empheq} and 4 for the second one):

  1. Package pgfkeys Error: I do not know the key '/tcb/enhanced' and I am going to ignore it. Perhaps you misspelled it.

  2. Package pgfkeys Error: I do not know the key '/tcb/frame hidden' and I am going to ignore it. Perhaps you misspelled it.

  3. Package pgfkeys Error: I do not know the key '/tcb/interior style', to which you passed 'top color=Gold1!10!white, bottom color=Gold1!10!white,middle color=Gold1!50!yellow', and I am going to ignore it. Perhaps you misspelled it.

  4. Package pgfkeys Error: I do not know the key '/tcb/fuzzy halo', to which you passed '1pt with Gold1', and I am going to ignore it. Perhaps you misspelled it.

Why in this case all functions well?

Empheq

Where I have wronged?

Thank you for help.

Best Answer

Instead of \usepackage[listings]{tcolorbox}, you'd better \usepackage[most]{tcolorbox} to avoid all errors.

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[x11names]{xcolor}
\usepackage{amsmath}
\usepackage{mathtools}
\usepackage{amsthm}
\usepackage{stix}
\usepackage[most]{tcolorbox}
\usepackage{empheq}
\tcbuselibrary{theorems}

\newtcbox{\Goldonebox}[1][]{nobeforeafter,math upper,tcbox raise base, enhanced,frame hidden,boxrule=0pt,interior style={top color=Gold1!10!white,
bottom color=Gold1!10!white,middle color=Gold1!50!yellow},
fuzzy halo=1pt with Gold1,#1}

\newtcbox{\greenbox}[1][]{nobeforeafter,math upper,tcbox raise base,
enhanced,frame hidden,boxrule=0pt,interior style={top color=green!10!white,
bottom color=green!10!white,middle color=green!50!yellow},
fuzzy halo=1pt with green,#1}

\title{XCOLOR}
\author{MATTIA ONOFRI}
\date{August 2021}

\begin{document}

\maketitle
\Huge
\section{Introduction}

\begin{empheq}[box=\Goldonebox]{align}
a&=b+c\\
E&=mc^2
\end{empheq}

\begin{empheq}[box=\greenbox]{align}
a&=b+c\\
E&=mc^2
\end{empheq}

\textcolor{Gold1}{GOLDEN}.

\end{document}