1

I have a long equation and I want to write this equation in the following shape: enter image description here

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}}{%
\def\radius{#1}%
\begin{tikzpicture}[line cap=rect,line width=0.055*\radius]
\filldraw [fill=#3] (0,0) circle [radius=\radius];
\foreach \angle [count=\xi] in {60,30,...,-270}
{
  \draw[line width=1pt] (\angle:0.9*\radius) -- (\angle:\radius);
  \node[font=#2] at (\angle:0.68*\radius) {\textsf{\xi}};
}
\foreach \angle in {0,90,180,270}
  \draw[line width=0.04*\radius] (\angle:0.82*\radius) -- (\angle:\radius);
\draw (0,0) -- (120:0.4*\radius);
\draw (0,0) -- (90:0.5*\radius);
\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
\begin{equation}
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]
            };
        }
\end{equation}

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

And this is the result enter image description here

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

1 Answer 1

2

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

\begin{equation}
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}
            };
        }
\end{equation}

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

enter image description here

Edit: you need at least this in the preamble:

\usepackage{tikz}
\usetikzlibrary{calc}
8
  • I would like to draw the clock with tikz too
    – j.doe
    Jan 4, 2023 at 0:46
  • Does \tikz[baseline]{ } require calc library?
    – youthdoo
    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?
    – youthdoo
    Jan 4, 2023 at 4:33
  • @youthdoo ok, I edited the answer.
    – xpt
    Jan 4, 2023 at 4:43

You must log in to answer this question.

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