9

Hi I was searching for a function that allows me to do what the picture shows, if someone could make a function like \underset{}_{}, where you put what you want to appear below the text, to make a function that allows me to put information pointing with an arrow to a place in the equation. Thank you for your help. Also, sorry for not having any code.

enter image description here

Mico
  • 506,678
alvarito mendez
  • 329
  • 1
  • 9

2 Answers2

20

I would use tikzmark.

enter image description here

\documentclass{article}
\usepackage{tikz,amsmath}
\usetikzlibrary{tikzmark}
\usepackage{lipsum} %>>> for dummy text only
\begin{document}
\lipsum[1]
\vspace*{8mm}  % a gap for tikzmark later. Change as you wish

[A(r)=\int_{V'}\dfrac{\mu_0}{4\pi}\dfrac{M(r')\times \hat{R} d\tau'}{R^2}; \tikzmarknode{e1}{=} ;\dfrac{\mu_0}{4\pi}\int_{V'}M(r')\times\nabla'\left(\dfrac{1}{R}\right)d\tau' ] \begin{tikzpicture}[overlay,remember picture] \draw[stealth-,cyan,thick] (e1)+(90:.2)--+(90:.7) node[above=-2mm]{$\dfrac{\hat R}{R^2}=\nabla'\left(\dfrac{1}{R}\right)$}; \end{tikzpicture}
\lipsum[2] \end{document}

Black Mild
  • 17,569
15

Rather than cram too much visual information into what is already a lengthy derivation, I'd employ \shortintertext{...} and \intertext{...} directives to intersperse the explations with the actual steps of the derivation. That way, you're giving your readers some visual "breathers" between the steps. If you feel it's necessary or beneficial, you can still use colors (say, blue) to differentiate the explanations visually from the actual formulas.

enter image description here

\documentclass{article}
\usepackage{mathtools,bm,xcolor}
\begin{document}

\begin{align} \bm{A}(\bm{r}) &= \int\limits_{V'} \frac{\mu_0}{4\pi} \frac{\bm{M}(\bm{r}') \times \widehat{\bm{R}}, d\tau'}{R^2}\ \shortintertext{Employ \textcolor{blue}{$\displaystyle\frac{\widehat{\bm{R}}}{R^2}=\bm{\nabla}'\biggl(\frac{1}{R}\biggr)$}:} &= \frac{\mu_0}{4\pi} \int\limits_{V'} \bm{M}(\bm{r}')\times \bm{\nabla}'\biggl(\frac{1}{R}\biggr) , d\tau'\ \intertext{Employ \textcolor{blue}{$\displaystyle \bm{M}(\bm{r}')\times \bm{\nabla}'\biggl(\frac{1}{R}\biggr) = \frac{\bm{\nabla}'\times \bm{M}}{R}-\bm{\nabla}'\times\biggl(\frac{\bm{M}}{R}\biggr)$}:} &= \frac{\mu_0}{4\pi}\int\limits_{V'} \frac{\bm{\nabla}'\times \bm{M}}{R} ,d\tau' + \frac{\mu_0}{4\pi}\int\limits_{V'}\biggl[-\bm{\nabla}'\times\biggl(\frac{\bm{R}}{R} \biggr) \biggr],d\tau'\ \intertext{Employ \dots} \end{align}

\end{document}

Mico
  • 506,678
  • 1
    It's a good option but not what I'm searching for, becaus it makes the equations to long and I need a short way to explain some changes from one side to the other, but thanks – alvarito mendez Jan 03 '22 at 08:34
  • 4
    @alvaritomendez - I would like beg to differ with the view that my solution suggesion "makes the equations too long". Why? The screenshot you posted which contains a single, very long line, which cannot be replicated realistically in TeX/LaTeX unless one chooses a rather diminutive font size and an even smaller for the colored material. The only realistic option, in my opinion, is to split the equation across several lines -- at which point the colored explanatory material hardly takes up any extral space. – Mico Jan 03 '22 at 08:43
  • It's just my opinion and as in the previous awnser I got the exact awnser for what I asked for, and I'm asking if there is a way to do it more easy for doing it several times – alvarito mendez Jan 03 '22 at 10:15