I am trying to write a code to repeat a command until the end of page. But it seems below code over does it 2 more times into the next page. (I have written below code that just prints the page number instead, to see what is wrong with it.)
Did I write something wrong in my code, or how should I adjust my code to accommodate for the bug?
Thanks in advance.
Regards,
Jie
Code: Select all
\documentclass{article}
\newcounter{mypageno}
\newcounter{mypageno2}
\begin{document}
asdfasf
\setcounter{mypageno}{\thepage}
\loop
\setcounter{mypageno2}{\thepage}
\ifnum \value{mypageno} = \value{mypageno2}
This is the pagenumber \arabic{mypageno2}
\repeat
\end{document}