Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

How can I attach an arrow with text to some part of an equation?

share|improve this question
add comment

2 Answers 2

up vote 10 down vote accepted

Here's something to get you started using Andrew Stacey's \tikzmark idea, first posted here

Adding a large brace next to a body of text

screenshot

MWE

\documentclass{article}
\usepackage{amsmath}
\usepackage{tikz}
\usetikzlibrary{positioning}
\usetikzlibrary{calc}

\newcommand{\tikzmark}[1]{\tikz[overlay,remember picture] \node (#1){};}

\begin{document}

\[
    \int\limits_{\tikzmark{Vi}V_i}f(r)\mathrm{d}r
    \tikz[overlay, remember picture] \node[below right=1cm of Vi](annotate){Your text here};
    \tikz[overlay,remember picture]\path[red,->] ($(Vi.south)+(.2em,0em)$) edge[bend right=45](annotate.west);
\]
\end{document}

The idea is to add nodes to your expression, and then connect them as you see fit. The main tool is overlay, remember picture from tikz.

And if you want the right angled line

screenshot

then you can use something like

\tikz[overlay,remember picture]\draw[red,->] ($(Vi.south)+(.2em,0em)$) -- ++(0,-.95cm)--(annotate.west);
share|improve this answer
    
You may have to add extra vspace after the diagram as this does not create extra space to allocate the labelling. It runs on top of the text that follows. –  azetina Nov 12 '12 at 20:02
    
That looks interesting, thank you! –  queueoverflow Nov 12 '12 at 20:36
add comment

This had to be fine tuned but it is completely general and requires no tikz. It's in plain TeX, but it should work with LaTeX after minor edits.

The idea is to manually position boxes to form an arrow with the specified shape (\cornerarr). Then one uses the equation alignment environment to place this arrow below the desired point.

The MWE:

\def\cornerarr{\hbox to 1.7cm{$\uparrow$\hskip-2.5pt\hbox{\lower2pt\vbox{\hbox to 1.5cm{\hrulefill}}}}}

$$\eqalignno{
= {1\over v(r)} \sum_{i}^{N(v(r))} m_i &\int_{v_i} d^3r f_i(r)\cr
&\hskip3pt\cornerarr\hbox{\lower2pt\vbox{\hbox{Volumen des i-ten Teilchens}}}
}$$

\bye

enter image description here

Update: MWE in LaTeX:

\documentclass{article}
\usepackage{amsmath}

\def\cornerarr{\hbox to 1.7cm{$\uparrow$\hskip-2.5pt\hbox{\lower2pt\vbox{\hbox to 1.5cm{\hrulefill}}}}}

\begin{document}

\begin{align*}
= {1\over v(r)} \sum_{i}^{N(v(r))} m_i &\int_{v_i} d^3r f_i(r) \\
&\hskip3pt\cornerarr\hbox{\lower2pt\vbox{\hbox{Volumen des i-ten Teilchens}}} \\
\end{align*}

\end{document}
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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