Big Boxed equation with title using tcolorbox

boxesequationshorizontal alignmenttcolorboxvertical alignment

I currently have this command:

\NewDocumentCommand{\deq}{omo}{%
  \begin{tcolorbox}[
    colback = blizzardblue!30!white,
    colframe = white,
  ]
  \setlength{\abovedisplayskip}{0pt}
  \begin{flalign}
    \IfValueT{#1}{\text{\Emph{#1}}} && #2 &&
  \end{flalign}
  \IfValueT{#3}{\emph{#3}}
  \end{tcolorbox}\noindent
}

and this code:

\deq[Equation's title]{pV = nRT}

that produces

enter image description here

I'm looking for a way to improve that command to be able to write more than 1 equation. For example, with this code:

\documentclass{book}
\usepackage[italicdiff]{physics}
\usepackage[scr = rsfso]{mathalfa}
\usepackage{mathtools}
\usepackage{amssymb}
\usepackage{tcolorbox}
\tcbuselibrary{skins, breakable, hooks, theorems}
\usepackage{xcolor}
\definecolor{blizzardblue}{rgb}{0.4, 0.6, 0.8}

\begin{document}
\begin{tcolorbox}[
    colback = blizzardblue!30!white,
    colframe = white]
    \begin{gather}
        \begin{align}
            \qty(\pdv{T}{V})_S &= -\qty(\pdv{p}{S})_V \\
            \qty(\pdv{T}{p})_S &= +\qty(\pdv{V}{S})_p \\
            \qty(\pdv{S}{V})_T &= +\qty(\pdv{p}{T})_V \\
            \qty(\pdv{S}{p})_T &= -\qty(\pdv{V}{T})_p
    \end{align}
    \end{gather}
\end{tcolorbox}
\end{document}

I'd like to be able to produce this (edited figure):

enter image description here

for any number of equations. Of course, I'm able to use tcolorbox environment and gather / equation environment to write something like that but I can't place — in the right place — the equation title. The "right place" is maximally separated (and automatically) from the equations but also centered vertically to all the equations (and of the tcolorbox environment).

The ideal answer to this question would be a new command for N equations with an optional title (which must be centered vertically and maximally separated from the equations). Thanks for reading and helping!

Best Answer

Here is a solution. I have replaced the call to the package physics to the call to the package derivative because physics is not recommanded (see Alternatives to the physics package by the way, there is a new package called physics2 which replace some functionalitys of physics package, see https://www.ctan.org/pkg/physics2 and the document http://mirrors.ctan.org/macros/latex/contrib/physics2/doc/physics2-legacy.pdf for switching from physics to physics2). It isn't need to load xcolor because tcolorbox load it.

\documentclass{article}

\usepackage{derivative}

\usepackage{mathtools}
\usepackage{amssymb}

\usepackage{tcolorbox}

\definecolor{blizzardblue}{rgb}{0.4, 0.6, 0.8}

\newcommand{\mybox}[2][]{%
\tcbsidebyside[sidebyside adapt=left, sidebyside gap=5mm,colback = blizzardblue!30!white,colframe = blizzardblue!30!white
]{%
 #1
}{%
\begin{gather}
    \begin{align}
        #2      
    \end{align}
\end{gather}
}
}

\begin{document}

\mybox[Equation title]{%
\pdv{T}{V}_S &= -\pdv{p}{S}_V \\
\pdv{T}{p}_S &= +\pdv{V}{S}_p \\
\pdv{S}{V}_T &= +\pdv{p}{T}_V \\
\pdv{S}{p}_T &= -\pdv{V}{T}_p
}
    
\end{document}

Result:

enter image description here