答案1
\subnode
来自的命令tikzmark
是为这种情况而设计的。它伪造了 内的文本周围的节点\node
。它确实需要几次编译运行才能解决(对我来说,这段代码花了 3 次),并且您必须记住remember picture
tikzpicture 上的密钥。
\documentclass{article}
%\url{https://tex.stackexchange.com/q/582127/86}
\usepackage{tikz}
\usetikzlibrary{tikzmark, arrows.meta}
\begin{document}
\begin{tikzpicture}[>=Latex,remember picture]
\node (eipi) at (0,0) {\(e^{i\pi}+1=0\)};
\node at (0,-1) {\(\subnode{e}{e}^{\subnode{i}{i}\subnode{pi}{\pi}}+\subnode{one}{1}=\subnode{zero}{0}\)};
\draw[<-] (e) to[out=-90, in=90] ++(-2,-1) node[below] {Base of natural logarithm};
\draw[<-] (i) to[out=135, in=0] ++(-2,1) node[left] {A square root of \(-1\)};
\draw[<-] (pi) -- ++(0,-2) node[below] {Area of a unit circle};
\draw[<-] (one) to[out=-45, in=180] ++(2,-1) node[right] {Unity};
\draw[<-] (zero) -- ++(2,0) node[right] {Zilch};
\draw[<-] (eipi) -- ++(0,1) node[above] {An ugly equation};
\end{tikzpicture}
\end{document}