# Write the equation, box it and put clock under it by using tikz

I have a long equation and I want to write this equation in the following shape:

I want to put some text under each big rectangle and draws the clock in tikz too

P.S I have put just the first part of the equation, I have 7 more terms but if I can do the first part, I simply redo the same things with different coordinates...

How can I do that in overleaf in an efficient way?

I could that this:

 \NewDocumentCommand{\Clock}{O{2cm}O{\large}O{cyan}}{%
\foreach \angle [count=\xi] in {60,30,...,-270}
{
}
\foreach \angle in {0,90,180,270}
\end{tikzpicture}%
}
\makeatletter
\newcommand\mathcircled[1]{%
\mathpalette\@mathcircled{#1}%
}
\newcommand\@mathcircled[2]{%
\tikz[baseline=(math.base)] \node[draw=green,circle,inner sep=1pt] (math) {$\m@th#1#2$};%
}
\makeatother
$$U = \tikz[baseline]{ \node[rectangle,draw=red,anchor=base,text width=2cm] (eq1) {e^{-i \mathcircled{\gamma_e B_o} S_z t} \quad\Clock[1cm][\footnotesize][orange] }; }$$

\begin{tikzpicture}[overlay]
\node[below of=eq1] (text1) {some text};
\end{tikzpicture}


And this is the result

but I am not able to write the text just under rectangle and display the equation as image or at least bigger:

You can use something like the presented here https://texample.net/tikz/examples/global-nodes/

$$U = \tikz[baseline]{ \node[rectangle,draw=red,anchor=base,text width=2cm] (eq1) {e^{-i \gamma_e B_o S_z t} \includegraphics[width=1cm]{clock} }; }$$

\begin{tikzpicture}[overlay]
\node[below of=eq1] (text1) {some text};
\end{tikzpicture}


Edit: you need at least this in the preamble:

\usepackage{tikz}
\usetikzlibrary{calc}

• I would like to draw the clock with tikz too Jan 4, 2023 at 0:46
• Does \tikz[baseline]{ } require calc library? Jan 4, 2023 at 4:00
• @youthdoo I'm not sure, I used \usetikzlibrary{shapes,positioning,arrows,calc}
– xpt
Jan 4, 2023 at 4:16
• I've tested it and only calc is necessary. Could you put this into your answer? Jan 4, 2023 at 4:33
• @youthdoo ok, I edited the answer.
– xpt
Jan 4, 2023 at 4:43