I am using tikz-qtree to draw a binary tree. As I need to have them labeled I wanted to ues the following macro which work in ordinary tikz:
\newcommand{\A}[1]{\node(a#1){Activity #1};}
However, this does not work; the error is that node is an undefined control sequence.
Of course this macro is used inside a tikzpicture
, so basically I just want to dump \node(a1){Activity 1};
if \A{1}
is called. I am pretty sure it has to do with my TeXnic. . . Maybe expansion?
Note, the tikz-qtree manual states that
\Tree
specifically watches out for the token\node
; do not use\path node
or other equivalents.
Here is a minimal example:
\documentclass{minimal}
\usepackage{tikz,tikz-qtree}
\newcommand{\A}[1]{\node(a#1){Activity #1};}
\begin{document}
Works:\
\tikz\A{1};
\hfill
Works:
\Tree [.\node(a1){A1}; 1 2 ]
\hfill
Doesn't Work:
% \begin{tikzpicture}
% \Tree [.\A{1} b c ]
% \end{tikzpicture}
\end{document}
Thanks,