enter image description here

I have a big question that I cannot solve by myself.

I would like to add text on my equations, but I like to have some graphics on those. For instance, I would like to explain why I am doing something, e.g. by saying which theorem/result i am using to get to a precise point on my equation. However, I don't want to use only text, but emphasizing with graphics and text box linked with some arrows is preferred.

The image you find is similar to what I am thinking.

I thank you for the help



4 Answers 4


Here, I do it as a compound stacking operation. The macro \calloutsym is the red circle and underarrow; \callouttext{} places \scriptsize text under \calloutsym, where the text can be multi-line with the use of \\ in the argument; and \callout{}{} places the \callouttext of the second argument under the first argument. EDITED so that \callout can take an optional argument denoting a different vertical shift than the default 1.5pt on the red circle (if your circled text is, for example, taller).

\[ K \callout{\subseteq}{by compactness} \bigcup_{J=1}^{n} V_{nJ} \]
\[ \lim_{n\rightarrow \infty} \int\limits_{x} f_{n} \mathrm{d}\mu 
\callout[1.8pt]{=}{By Monotone\\Convergence Theorem} \int\limits_{x} f \mathrm{d}\mu

enter image description here

I should point out that, by default, the red circle will not be overlapped by surrounding math text. However, if the circled item is within text that should not be cleaved apart, the use of \renewcommand\useanchorwidth{T} will present the original math without making allowances for the red circle.

 \callout[.5pt]{D}{Total\\Derivative}\vec{V}/Dt =  \ldots\quad
 \callout[.5pt]{D}{Total\\Derivative}\vec{V}/Dt =  \ldots

enter image description here

  • Nice! This is rather useful with writing lecture notes. (Btw. shouldn't the ring be pushed down a tiny bit?) Oct 25, 2013 at 7:13
  • Also, I think the proper way of typesetting the differential operator is \newcommand*\dif{\mathop{}\!\mathrm{d}} and the using \dif. (Originally, not my idea.) Oct 25, 2013 at 8:30
  • 1
    @SvendTveskæg I updated the result to make the default shift a little larger, and make the shift available as an optional argument to \callout Oct 25, 2013 at 10:53
  • @SvendTveskæg Thanks for the tip on the \dif. I'll leave it out of this solution not to distract things, but I'll add it to my "in-house" style. Oct 25, 2013 at 10:56

With tikz:


\tikzset{every picture/.style={remember picture}}


K \tikz[baseline]{ \node[draw=red,fill=red!20,anchor=base,circle,inner sep = 0pt]
  (d1) {$\subseteq$}; } \bigcup_{J=1}^{n} V_{nJ}
\qquad \qquad
\lim_{n\rightarrow \infty} \int\limits_{x} f_{n} \mathrm{d}\mu \tikz[baseline]{ 
    \node[draw=blue,fill=blue!20,anchor=base,circle,inner sep = 0pt] (d2) {$=$}; } \int\limits_{x} f \mathrm{d}\mu
\begin{tikzpicture}[overlay,remember picture]
\draw[red,->] (d1) -- +(270:1cm) node[anchor=north,text = black,] {by compactness};
\draw[blue,->] (d2) -- +(270:1cm) node[anchor=north,text = black, align = left] {by monotone \\ convergence theorem};

enter image description here

You can bend arrows by to [in=145,out=235] instead of -- in

\draw[red,->] (d1) to [in=90,out=235] +(270:1cm) node[anchor=north,text = black,] {by compactness};

enter image description here


With hf-tikz:


\tikzset{offset def/.style={
    above left offset={0.015,0.3},
    below right offset={-0.015,-0.12},
  use color/.style={
    offset def,
    set fill color=white,
    set border color=#1,

\tikz[remember picture,overlay]\draw[#1,use marker id] (0,0) -- +(270:1cm)
 node[anchor=north,text=black,align=center] {#2};


\tikzmarkin[use color=red,mark at =0.785]{a}\subseteq\tikzmarkend{a}
\annotate[red,-stealth,font=\footnotesize]{by compactness}
\bigcup_{J=1}^{n} V_{nJ}
\qquad \qquad
\lim_{n\rightarrow \infty} \int\limits_{x} f_{n} \mathrm{d}\mu 
\tikzmarkin[use color=blue,mark at =0.785]{b}=\tikzmarkend{b}ù
\annotate[blue,-stealth,font=\footnotesize]{by monotone \\ convergence theorem}
\int\limits_{x} f \mathrm{d}\mu

The result:

enter image description here


You could start looking at pstricks solutions. Here is an example of equation and a graph together: (Note: I had to switch my compiler to XeLaTeX to get this to work)

\usepackage[top=.5in, bottom=.5in,left=0.5in,right=0.5in]{geometry}
The region is rotated around the x-axis, find the volume bounded by: $\displaystyle \quad y=(\,x+1\,)^{2}, \quad y{\,=\,}0, \quad x=1, \quad x=2 $\\\\\\    
\newrgbcolor{zzttqq}{0.6 0.2 0}
\psset{xunit=1.0cm,yunit=1.0cm,algebraic=true,dotstyle=o,dotsize=3pt 0,linewidth=0.8pt,arrowsize=3pt 2,arrowinset=0.25}
\psaxes[labelFontSize=\scriptstyle,xAxis=true,yAxis=true,Dx=1,Dy=1,ticksize=-2pt 0,subticks=2]{->}(0,0)(-0.5,-0.5)(2.5,9.3)[x,140] [y,-40]

\text{Area} &= \int_a^{b} \Bigg[\, \pi\,(\text{\,radius\,})^{2}\; \Bigg] \,dx \\\\
~ &= \int_0^{1} \Bigg[\, \pi\,(\,x^{2}\,)^{2}\; \Bigg] \,dx \\\\
~ &= \int_0^{1} \Bigg[\, \pi\,x^{4}\; \Bigg] \,dx \\\\
~ &= \Bigg[\, \pi\,\frac{\,x^{5}}{5} \;  \Bigg]_0^{1} \\\\
~ &= \Bigg[\, \pi\,\frac{\,1^{5}}{5} \; - \pi\,\frac{0^{5}}{4} \,  \Bigg] \\\\
~ &= \,\frac{\pi}{5} \, - \, 0 \\\\
~ &= \frac{\pi}{5}

Code is from here http://www.latex-community.org/forum/viewtopic.php?f=46&t=10757

You must log in to answer this question.

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