In the following example I want to use \ifnum to compare two numbers computed by pgfmath, for simplicity I use simply 1 and 2 in the example below. Compiling this code gives me the error:
ERROR: Missing = inserted for \ifnum.
--- TeX said ---
<to be read again>
.
l.11 \ifnum \one
<\two
--- HELP ---
From the .log file...
I was expecting to see `<', `=', or `>'. Didn't.
The example is:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{calc}
\begin{document}
\begin{tikzpicture}
\pgfmathsetmacro{\one}{1};
\pgfmathsetmacro{\two}{2};
\ifnum \one<\two
\draw (0,0) -- (0,1);
\fi
\end{tikzpicture}
Any idea how to solve this?