Is it possible to have write equations accompanied with explanatory bubbles and comments? I am familiar with underbracket, overbracket, underbrace and overbrace but I have terms close together and I can't squeeze the explanations in. In the main body of the paper, people can scroll and read what a particular symbol means but in a powerpoint/beamer I would rather that people can see the relevant information and the meanings of the variables in the same slide.

Maybe it is better to have a legend accompanying the equation. I'd really appreciate alternative suggestions for getting information across in slides.

enter image description here


1 Answer 1


One possibility using TikZ:


  \tikz[remember picture,overlay] \node[inner xsep=0pt] (#1) {};
\node[draw=red!70!black,fill=red!20,align=left,#1] (box\themybox) {#2};


a(b + c) \tikzmark{a}\onslide<2->{{}&= ab+ac} \\
\tikzmark{b}\onslide<3->{{}&= ba+ca}\\
\tikzmark{c}\onslide<4>{{}&= (b+c)a.}
\begin{tikzpicture}[remember picture,overlay]
\ColorBox[xshift=3cm,yshift=3cm]{by distributivity}
  (box1) -| ([xshift=7.5pt,yshift=4pt]a.north west);
\ColorBox[xshift=1.5cm,yshift=1cm,fill=blue!30,draw=blue]{by commutativity}
  (box2.north) |- ([xshift=1.5pt,yshift=3pt]b.west);
\ColorBox[xshift=1.5cm,fill=orange!30,draw=orange]{by distributivity}
  (box3.east) -| ([xshift=7.5pt,]c.west);


enter image description here

\ColorBox has one optional argument to control options for the \node used to draw the box, and a mandatory argument for the explanatory text. The associated node is automatically named box<number>. Using \tikzmark you mark any element that will be the end of the arrow and then you can draw the arrow with a standard \draw command.

  • If there is text after and/or before the equation, boxes cover it. Is there a way to get the correct spacing between paragraphs and equation, apart from manually changing it?
    – giordano
    Commented Jun 8, 2013 at 8:50
  • @giordano Off the top of my head I think one could write the whole thing (equation and boxes) in one single tikzpicture environment, using a \node to place the equation; this, however, might cause problems with alignment. I guess the simplest thing to do is to manually add some spacing before and/or after the equation if required. Commented Jun 8, 2013 at 14:34
  • moreover, one can't use equation environment inside a node, to number the formula. I'll keep adjusting spacing. Thanks
    – giordano
    Commented Jun 8, 2013 at 14:44

You must log in to answer this question.

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