I have this error: Dimension to large. } the code is:
\documentclass{report}
\usepackage{pgffor}
\parindent=0cm
\begin{document}
\foreach \n in {1,...,20000}{
Hola a todos. el numero es \n \\
}
\end{document}
I have this error: Dimension to large. } the code is:
\documentclass{report}
\usepackage{pgffor}
\parindent=0cm
\begin{document}
\foreach \n in {1,...,20000}{
Hola a todos. el numero es \n \\
}
\end{document}
I don't know if this qualifies for an answer. There are two facts that come into play:
pgffor works with dimensions, see e.g. this nice answer. This has several advantages, among them the fact that you can loop over non-integers. Drawbacks include the above observation and some inaccuracies reported e.g. here.16383.99999pt, see e.g. here. The loop will stop when the number exceeds 16383-1. A precise explanation of the -1 would require to look up the internals of pgffor, but I do not see a motivation for this.So the bottom-line is that you cannot go above 16382 in the above loop.
16383. If you loop until16382, it's fine. Don't ask me why, but for historical reasons TeX has that limitation. But frankly, even after a few lines the content of that document is no longer exciting. ;-) – Nov 07 '18 at 00:49\loop \repeatconstruction, you can well go beyond the 20,000 lines limit. – siracusa Nov 07 '18 at 01:56