I was attempting to place arrows to parts of an equation, however my output is very untidy...the equation is offset and the arrows do not go into the tcolorbox:
Can you help me get the arrows go inside the tcolorbox and have the equation not offset like that shown in the image above?
Here is my code:
\documentclass{article}
\usepackage{xcolor}
\usepackage{tikz}
\usetikzlibrary{tikzmark,calc,,arrows,shapes,decorations.pathreplacing}
\tikzset{every picture/.style={remember picture}}
\usepackage{amsmath}
\usepackage[framemethod=default]{mdframed}
\usepackage{mathtools}
\usepackage[most]{tcolorbox}
\tcbset{myformula/.style={
arc=0pt,
outer arc=0pt,
colback=gray!30,
colframe=black,
boxrule=0.8pt,
left=2pt,
right=2pt,
highlight math style={
arc=0pt,
outer arc=0pt,
colback=gray,
colframe=blue.
}
}
}
\begin{document}
\begin{enumerate}
\item The minimum settling time is given as
\begin{tcolorbox}[ams equation, myformula]
\text{Minimum Settling Time } = (%
\tikz[baseline]{\node(d1) {$q$}} +%
\tikz[baseline]{\node(d2) {$\text{max}\{\ell -1, 0 \}$}} + 1)T
\end{tcolorbox}
\begin{tikzpicture}[remember picture,overlay]{
\draw[blue,thick,latex-,rounded corners] (d1) |- ++ (0.6cm,-1.5cm) node[anchor=west,text = black,] (label1) {input\\order};
\draw[blue,thick,latex-,rounded corners] (d2) |- ($(label1.west)-(-0.8cm,-0.6cm)$) node[anchor=west,text = black] {G(z)};}
\end{tikzpicture}
\vspace{1cm}
\item This is another item
\end{enumerate}
\end{document}


