0

I want to iterate the variable i between [1,9], with the iterations with the variable j between [3,11]

\foreach \i/\j in {1/3,...,9/11}{}

So I wrote the above code, however as I run this , the error messages with

! Illegal unit of measure (pt inserted).
<to be read again> 
                   /

appears .

What can I do next?

\documentclass[border=0.1cm]{standalone}
\usepackage{tikz}
\usepackage{mathtools}

\begin{document}

\begin{tikzpicture}[]

    \foreach \i/\j in {1/3,...,9/11}{
    \draw[-&gt;](\i,\i,0)--(\i,\j,0);
    }

\end{tikzpicture}

\end{document}

1 Answers1

2

Your code can reduce to

\documentclass[border=0.1cm]{standalone}
\usepackage{tikz}
\usepackage{mathtools}

\begin{document}

\begin{tikzpicture}[]

    \foreach \i/\j in {1,2,...,9}{
        \draw[-&gt;](\i,\i,0)--(\i,\i+2,0);
    }

\end{tikzpicture}

\end{document}

enter image description here

js bibra
  • 21,280