I want to add additional annotations to parts of equations using tikz. Using some examples I found, I came up with the following approach. Where a tikzmkark is placed inside of the equation and used later to draw an arrow to a text description:
\usepackage{tikz}
\usetikzlibrary{calc,fit,positioning}
\newcommand{\tikzmark}[3][]{\tikz[overlay,remember picture,baseline] \node [anchor=base,#1](#2) {#3};}
\begin{document}
\begin{equation*}
a = \tikzmark{log}{$\log(b)$} + 3
\end{equation*}
\begin{tikzpicture}[overlay, remember picture,node distance =.5cm]
\node (logdescr) [below=of log]{Description};
\draw[,->,thick] (log) to [in=90,out=-90] (logdescr);
\end{tikzpicture}
\end{document}
Unfortunately, somehow the spacing of the equation gets broken when I use $$ inside of the tikzmark command. As shown as below:


\tikzmarkcommand of thetikzmarklibrary. That is, addtikzmarkto the loaded libraries,\usetikzlibrary{calc,fit,positioning,tikzmark}, and remove\newcommand{\tikzmark}[3][]{\tikz[overlay,remember picture,baseline] \node [anchor=base,#1](#2) {#3};}. The reason why it fails is that the latter has anoverlayin. Also, usea = \tikzmark{log}{\log(b)} + 3then. – Mar 16 '20 at 18:58