I am wishing for writing $\n$
as node text, where \n
has the node's name.
Working example:
\documentclass{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
[node distance=2em]
\node (0) {0};
\node (h) [above of=0] {};
\node (a) [left of=h] {$a$};
\node (b) [right of=h] {$b$};
\draw (0) -- (a);
\draw (0) -- (b);
\end{tikzpicture}
\end{document}
Ideally, I hope to write the description of node a
as
\node (a) [left of=h] {$\n$};
so that I can forget about the text (but still have them in math mode).