3

I want to modify the display of my equation little bit. Below is the code which I used to show the ratio of two expressions and use a pointer for the descrption of the items.

I was able to show the expressions but I was wondering if it is possible to use them as a real fraction just like the expression we get while using \frac function.

\tikzstyle{na} = [baseline=-.5ex]


\begin{equation*}
a_i(t,x) =
        \tikz[baseline]{
            \node[fill=blue!20,anchor=base] (t1)
            {$ \tau C_i(t,x,\tau )\partial \tau$};
        } /
        \tikz[baseline]{
            \node[fill=red!20, ellipse,anchor=base] (t2)
            {$C_i(t,x,\tau) \partial \tau$};
        } 
\end{equation*}


\begin{itemize}[<+-| alert@+>]
 \item Coriolis acceleration
        \tikz[na] \node[coordinate] (n1) {};
    \item Transversal acceleration
        \tikz[na]\node [coordinate] (n2) {};
\end{itemize}

% Now it's time to draw some edges between the global nodes. Note that we
% have to apply the 'overlay' style.
\begin{tikzpicture}[overlay]
        \path[->]<1-> (n1) edge [bend right] (t1);
        \path[->]<2-> (n2) edge [bend right] (t2);

\end{tikzpicture}

The output of the above code is as follows:

enter image description here

  • 1
    Please add a minimal working example (MWE), complete with \documentclass{...}, the required \usepackage{...}'s, \begin{document}, \end{document}. The code should be compilable without requiring modification. – jub0bs Mar 20 '13 at 8:19
  • This is possible (I just did it.) but I had to add some TikZ library and a package that wasn't mentioned in your "MWE". The result looked dreadful because the shapes overlapped. I think you should stick to a presentation with a reduced wow-this-is-amazing factor. – user10274 Mar 20 '13 at 8:38
5

Here's a working example:

\documentclass{beamer}
\usepackage{tikz}
\usetikzlibrary{shapes}
\tikzstyle{na} = [baseline=-.5ex]
\tikzstyle{every picture}=[remember picture]

\begin{document}
\begin{frame}
\begin{equation*}
a_i(t,x) =
        \frac{
        \tikz[baseline]{
            \node[fill=blue!20,anchor=base] (t1)
            {$ \tau C_i(t,x,\tau )\partial \tau$};
        }}{
        \tikz[baseline]{
            \node[fill=red!20, ellipse,anchor=base] (t2)
            {$C_i(t,x,\tau) \partial \tau$};
        }} 
\end{equation*}


\begin{itemize}[<+-| alert@+>]
 \item Coriolis acceleration
        \tikz[na] \node[coordinate] (n1) {};
    \item Transversal acceleration
        \tikz[na]\node [coordinate] (n2) {};
\end{itemize}

% Now it's time to draw some edges between the global nodes. Note that we
% have to apply the 'overlay' style.
\begin{tikzpicture}[overlay]
        \path[->]<1-> (n1) edge [bend left] (t1);
        \path[->]<2-> (n2) edge [bend right] (t2);

\end{tikzpicture}
\end{frame}
\end{document}

sample image output

| improve this answer | |
  • @ Matthew: Thank you so much for your answer. Actually I had tried using this way, may be the syntax was wrong. Thanks. – Jdbaba Mar 20 '13 at 17:59
  • Your upvote and check are thanks enough. :-) – Matthew Leingang Mar 20 '13 at 20:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.