I was looking for a way to use a conditional expression to define the node type in TikZ. Specifically, I wanted to do something based on the section number.
\def\checksectionshape#1{\ifthenelse{\value{section}=#1}{typea}{typeb}}
...
\begin{tikzpicture}
\node[\checksectionshape{1}] at (0,0) {Test};
\end{tikzpicture}
From some of the similar questions and their, I guess this is because the \ifthenelse
part is probably not expanded when the macro is called. But I couldn't manage to get one of those answers to work for my case.
Is there a workaround?
\xdef\tmp{\checksectionshape{1}} \node[\tmp] ...
or the same with\expandafter\node\expandafter[\tmp] ...
.