loop latex code example

Example 1: loop latex

\foreach \n in {apples,burgers,cake}{Let's eat \n.\par}

Example 2: loop latex

\foreach \n in {0,...,22}{do something}

Example 3: loop latex

\newcounter{themenumber}
\newcounter{classnumber}
\newcounter{imagenumber}
\forloop{themenumber}{1}{\value{themenumber} < 24}{
    % \hline <-- Error here
    \arabic{themenumber}
    \forloop{classnumber}{0}{\value{classnumber} < 2}{
        \forloop{imagenumber}{1}{\value{imagenumber} < 6}{
            & \includegraphics[scale=2]{
                ../../results/\arabic{themenumber}/\arabic{classnumber}_\arabic{imagenumber}.eps
            }
        }
    }
    \\
    \hline
}

Tags:

Misc Example