对于以下内容
\node (formula) [] {$2x+3y$};
\draw[-latex,red] ($(formula.north west)$) arc
如何提取 x 坐标。也就是说,我假设 Formula.north west 的形式为 (x,y),如何分别获取 x 和 y 坐标?
我正在使用\tikzmath 并想做类似的事情
\x1 = (公式.西北).x
这有道理吗?
最佳答案
您可以使用let
操作将坐标分配给点寄存器:
\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{calc}
\begin{document}
\begin{tikzpicture}
\node (formula) [] {$2x+3y$};
\draw[red] let \p1 = (formula.north west)
in (\x1,\y1) circle [radius=0.1];
\end{tikzpicture}
\end{document}
关于latex - 从 TikZ 获取 x 和 y 坐标,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67737975/