I want to improve the clarity of my Latex articles for readers by adding hyper clear annotations on my equations, like in the two images shown below.
I can imagine a possible solution using Tikz using \draw for lines and \node for text, and this question using tikzmarks has been pointed by @Schrödinger's cat.
Helping the writer's process is the important objective of this question, rather than perfect recreation. For example, using a command like \mathannotation{e=mc^2}{annotation to explain} (fuller example below) within a \begin{equation}{\label{xyz}... block, would be a simple mental transition, and less distracting than thinking about lines and boxes.
Such a solution would encourage ease of use/reuse and improves the writer's process. This could possibly become a future CTAN package for future communicators of science and mathematics.
\documentclass{article}
\begin{document}
\begin{equation}
\label{xyz}
\mathannotation{e=mc^2}{some insightful explanation, e is energy, m is mass or matter and c is the speed of light}
\end{equation}
At a basic level equation \ref{xyz} shows us that under the right conditions, energy can become mass, and vice versa.
\end{document}
Similar questions, that do not address this:
- add remarks to the right,
- text in parentheses below equation,
- text under aligned components, using
\underbraceandarray- although this is clearest so far. - custom underlines under text components - could avoid absolute position used by Tikz


tikzmarklibrary, and has been treated in several posts. See e.g. here for one example which looks remotely similar to your screen shots. – Apr 18 '20 at 07:35tikzmarklooks valuable. I will edit the question to be more specific. The focus for my thinking is when a writer is preparing the equation (\begin{equation}\label{xyz}..), and referencing it within the text (\ref{xyz}), working out graphic line positions (i.e. intikz/tikzmark) is distracting from the writing process. Where as an abstraction of\mathannotation{e=mc^2}{this explains a lot}to annotate part of the equation is a smooth integration into the writing process. I think you can see what I mean.. – pds Apr 18 '20 at 07:50\mathannotation[length of connection=2em,text width=5em]{e=mc^2}{this explains a lot}and so on and so forth, Unless you expect LaTeX to figure out all the dimension on its own, you will probably get used to the idea that more is needed than a two-parameter macro, especially since there are many things in the appearance that users may want to vary. pgf keys are ideal for that... – Apr 18 '20 at 07:55