# Is this the expected behavior or am I missing something? [duplicate]

This question already has an answer here:

Consider the following simple MWE:

\documentclass[tikz]{standalone}
\begin{document}
\begin{tikzpicture}
\draw(0,0) -- (3,3);
\pgfmathparse{2+1}
\draw[red] (0,0) -- (3,\pgfmathresult);
\end{tikzpicture}
\end{document}


I expect to have, as an output, one red line, however this is the result that I get:

So, is it a bug, feature, or simply me doing something wrong?

## marked as duplicate by jub0bs, Peter Jansson, Adam Liter, barbara beeton, Svend TveskægMar 25 '14 at 16:22

• I don't know the details, but the value of \pgfmathresult changes at \draw[red]. Try \pgfmathsetmacro\temp{2+1}\draw[red] (0,0) -- (3,\temp); instead. – jub0bs Mar 25 '14 at 15:34