On my computer, Mac OSX 10.8.5, with texshop, the following code produces only a line between (0,0) and (1,2), like if the loop was ignored. Why?
\documentclass[reqno]{amsart}
\usepackage{amsmath}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\draw (0,0)
\foreach \x in {1,...,5}
{ --++ (1,2) }
;
\end{tikzpicture}
\end{document}
Thanks for the quick reply!
I did what you said and the version is 2.00
With the command \fill (5,10) circle (2pt); I get the circle at the correct position (5,10).
The code should produce a straight line. Now with the replacement by --++ (\x,2) I get a line from (0,0) to (1,2) and an horizontal line from (1,2) to (5,2).
In fact I downloaded the pgf version 3.00 but it seems that Tex does not see it since \pgfversion gives always 2.00
I put the downloaded pgf folder (the name was pgf3) in texmf/tex/generic/
\pgfversionin your document, that prints the version number. (By the way OS and editor shouldn't matter for the output, but the version of MacTeX/TeX Live you're running, and package versions, might.) – Torbjørn T. Aug 19 '16 at 08:17\fill (5,10) circle (2pt);to your code and you will see that the line ends exactly there, right? – Stefan Pinnow Aug 19 '16 at 08:22(0,0)to(5,10)as it is now. To test if the loop is used change to{ --++ (\x,2) }which does not give a straight line. – StefanH Aug 19 '16 at 08:45/etc/environmentand several other commands will fail for similar reasons. – cfr Aug 19 '16 at 22:48PATHshould be set differently on OS X, for example. (And, of course, the OP will not get any of the GUI conveniences and goodies likeconvertif they forswear MacTeX.) – cfr Aug 20 '16 at 12:56