This is a follow up question to Problem with pgfmathsetmacro in foreach loop with pgfplots.
In short I also want to use \pgfmathabs to get the absolute value of a number in that example (with \i as input). But I get the following error:
ERROR: Incomplete \iffalse; all text was ignored after line 8.
--- TeX said ---
! Incomplete \iffalse; all text was ignored after line 8.
--- HELP ---
No help available
I tried to compose a MWE to isolate this problem:
\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\edef\test{\noexpand \node at (0,0) {\pgfmathabs{-2}};}
\test
\end{tikzpicture}
\end{document}
Any idea how to fix this?
\noexpandbefore the\pgfmathabssolves the problem. – Sep 25 '12 at 09:11