I'm having trouble passing an argument to \pgfmathparse inside a macro I defined. Here is the code:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{calc}
\newcommand{\drawmestg}[2]{
\def\endpt{\pgfmathparse{#1+#2}\pgfmathresult}
\draw (0,0) -- (\endpt,0);
}
\begin{document}
\begin{tikzpicture}
\drawmestg{1}{1}
\end{tikzpicture}
\end{document}
I must confess, I'm quite clueless why I get the error:
Incomplete \iffalse; all text was ignored after line 14