I'm making an axis environment that recieves 5 arguments (the first is optional and it's 1 by default). To make the x marks on the x axis I use
\foreach \x in {#2,...,#4}
{\ifthenelse{\x = 0}{}{\draw [shift={(\x,0)}] (0,1pt)--(0,-1pt);\draw (\x,0.5mm) node[anchor=north,font=\tiny] {$\x$};}}
and works perfect, but it's not flexible: it labels all integers between #2 and #4; so i write this in an atempt to make it not label all the numbers:
\foreach \x in {#2,#2+#1,...,#4}%#1 is the optional argument and by default is 1.
{\ifthenelse{\x = 0}{}{\draw [shift={(\x,0)}] (0,1pt)--(0,-1pt);\draw (\x,0.5mm) node[anchor=north,font=\tiny] {$\x$};}}
but I get:
Missing = inserted for \ifnum."
I also tryed:
\foreach \x [evaluate=\x as \xeval using \evaluar{\x}] in {#2,#2+#1,...,#4}
{\ifthenelse{\x = 0}{}{\draw [shift={(\x,0)}] (0,1pt)--(0,-1pt);\draw (\x,0.5mm) node[anchor=north,font=\tiny] {$\x$};}}
where
\newcommand{\evaluar}[1]{\pgfmathparse{int(#1)} \pgfmathresult}
and getting:
Incomplete \iffalse; all text was ignored after line 121.
I tryed a lot of combinations but LaTeX always complains about something. Any idea of what can I do?
Thank you.
PD: I'm from Argentina, so sorry about my writing if I have some mistakes.



