![如何在“在开始节点处执行”中引用当前节点名称](https://linux22.com/image/260491/%E5%A6%82%E4%BD%95%E5%9C%A8%E2%80%9C%E5%9C%A8%E5%BC%80%E5%A7%8B%E8%8A%82%E7%82%B9%E5%A4%84%E6%89%A7%E8%A1%8C%E2%80%9D%E4%B8%AD%E5%BC%95%E7%94%A8%E5%BD%93%E5%89%8D%E8%8A%82%E7%82%B9%E5%90%8D%E7%A7%B0.png)
你好,我想知道如何在execute at begin node
属性中引用当前节点名称。
\node[execute at begin node = \command_which_uses_node_name_to_to_do_soething_draw_uml_component_symbol] (){Node-name};
答案1
节点名称在执行\tikz@fig@name
代码时存储在。execute at begin node
这是一个 MWE,它打印> \tikz@fig@name=macro: ->myname.
到文件中.log
:
\documentclass{article}
\usepackage{tikz}
\begin{document}
\makeatletter
\tikzset{
teststyle/.style={
execute at begin node=\show\tikz@fig@name
}
}
\makeatother
\begin{tikzpicture}
\node (myname) [teststyle] {Text};
\end{tikzpicture}
\end{document}