0

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.

3
  • the first error tells you that your use of enhanced, in the list is wrong and could be deleted. Similarly the other errors. But perhaps instead you should define these options. what do you intend them to do? Commented Aug 10, 2021 at 21:53
  • Thanx for answering. I edited my question.
    – Puck
    Commented Aug 10, 2021 at 22:15
  • I answer my question because I solv my problem. Thank you
    – Puck
    Commented Aug 10, 2021 at 22:34

1 Answer 1

0

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}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .