I have a macro that draw some objects, which takes as argument an optional parameter (left
or right
). To avoid repetitive code, I check for the input argument and condition TikZ parameter on that (left=of
or right=of
):
\newcommand{\mycommand}[1]{
\ifthenelse{\equal{#1}{left}}{
\def\side left
}{
\def\side right
}
\node (A) {$A$}
\node (B) [\side=of A] {$B$};
I obtained the following error:
Use of \side doesn't match its definition.
Could you please help me to resolve this issue? Thank you very much in advance!
\def\side{left}
?