I am trying to use logical functions in pgfmath and getting unexpected errors. It seems to be related to the use of \pgfmathsetmacro, which according to my understanding should be equivalent to \pgfmathparse{whatever}\let\macro=\pgfmathresult. However, the following example from the manual works with \pgfmathparse and gives the error
! Missing number, treated as zero.
<to be read again>
n
l.52 ...etmacro\macro{ifthenelse(5==4,"yes","no")}
\macro
when used with \pgfmathsetmacro:
\pgfmathparse {ifthenelse(5==4,"yes","no")}% Works
\pgfmathsetmacro\macro{ifthenelse(5==4,"yes","no")}% Fails
Shouldn't I be able to do this?
\tracingalloutput for not very long, I think it might be a bug: pgf is trying to set a\dimenregister to "no", which is not going to work. – Bruno Le Floch Feb 02 '12 at 19:44\pgfmathsetmacro\macro{"no"}won't work either. – cjorssen Feb 02 '12 at 21:07