![在 let 命令中访问变量](https://linux22.com/image/471373/%E5%9C%A8%20let%20%E5%91%BD%E4%BB%A4%E4%B8%AD%E8%AE%BF%E9%97%AE%E5%8F%98%E9%87%8F.png)
我想通过 let 命令访问 x1 变量,如下所示:
\documentclass[border=5mm,tikz]{standalone}
\usetikzlibrary{calc}
\begin{document}
\begin{tikzpicture}
\node[draw] (P) at (0,0) {Hello};
\path let \p1=($(P.east)-(P.west)$) in
node[draw=red,anchor=west,text width=\textwidth-\x1] (Q) at (P.east) {World};
\message{node width: \x1};
\end{tikzpicture}
\end{document}
我尝试使用消息命令访问 x1 变量但编译失败:
! Undefined control sequence.
l.8 \message{node width: \x
1};
我可以通过任何方式访问它或者定义另一个全局变量?