The following code fails with the error
! LaTeX Error: Command \mybox already defined. Or name \end... illegal, see p.192 of the manual. \usepackage[most]{tcolorbox} \newtcolorbox{mybox}[2][]{% colback=bg, colframe=blue!75!black, fonttitle=\bfseries, coltitle=blue!75!black, colbacktitle=bg, enhanced, attach boxed title to top left={yshift=-1.2mm, xshift=2mm}, title=#2, #1} %-------------------- \usepackage{fancybox} %pour faire l'encadrement \newcommand{\mybox}[1]{ \setlength{\fboxsep}{7pt} \begin{center} \shadowbox{#1} \end{center}} %-------------------- Could you please help me
\newcommand{\mybox}[1]{to\newcommand{\anythingbutnotmybox}[1]{\myboxis already defined: When you write\begin{mybox}LaTeX translates that into\myboxwith some checking around it. Therefore, when you created the environmentmyboxas a new tcolorbox, internally, that defined the command\mybox:)