8

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

5

2 Answers 2

18

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}
6
  • I was wondering if this could be an evironment or a newcommand to do it multiple times Jan 3 at 8:32
  • 1
    @alvaritomendez Surely you can make a \newcommand as the usual syntax of TeX/LaTeX. However, I think that is not so convenient as you expect (try and see!) I like the hand-made, manual controls such as \vspace*{8mm}, etc
    – Black Mild
    Jan 3 at 10:31
  • Thank you a lot, I will try to make a new command because I have to make this notes everal times (more than 100) so I think it will help me. Jan 3 at 11:14
  • (The narrative really caught me off guard! Hilarious! Thank you! :) Jan 3 at 21:03
  • 1
    If i not upvoted you i am not Happy🤗🤗🤗🤗🤗
    – Sebastiano
    Jan 9 at 8:26
13

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}
3
  • 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 Jan 3 at 8: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 3 at 8: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 Jan 3 at 10:15

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.