1

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}

enter image description here


enter image description here


Similar questions, that do not address this:

  • 3
    This is very easy to do with TikZ, especially when using the tikzmark library, and has been treated in several posts. See e.g. here for one example which looks remotely similar to your screen shots. – user194703 Apr 18 at 7:35
  • That's a great example and tikzmark looks 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. in tikz/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 at 7:50
  • In your example the connecting lines have different lengths and the texts below different text widths. You will probably need something like \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... – user194703 Apr 18 at 7:55
  • The objective would be to standardise towards a conventional font and formatting appearance to be as widely applicable as possible. Auto-positioning of boxes and lines would be ideal, what Latex facilities are available for this, while also being wrapped within an equation environment? – pds Apr 18 at 8:45
  • 2
    Converting the vage idea of a nice looking distribuation of such annotations into an algorithm is hard work. Look at the forest documentation and code to get an idea. – Ulrike Fischer Apr 18 at 9:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.