Quantcast
Channel: Use a variable in foreach - TeX - LaTeX Stack Exchange
Viewing all articles
Browse latest Browse all 2

Use a variable in foreach

$
0
0

I am trying to use a variable in my foreach loop. It would make things a lot easier, because i only need to change one value and multiple loops are affected.

Something like this:

\begin{tikzpicture}[y=-1cm]    \pgfmathsetmacro\end{2}    \foreach \x in {0,...,\end}{        %do something    }    \foreach \x in {1,...,\end}{        %do something    }\end{tikzpicture}

The problem is that when using this im getting lots of errors that aren't related to this tikZ image. There mostly Something's wrong--perhaps a missing \item. Like something broke.

Thanks a lot in advantage


Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images