I want to have a document, where the exact same page will be printed for a certain number of pages and on every page there should be a unique number.
I know how to do so with a loop, but I don't want the numbers of random order, like 5,2,7,10,1,.... (without any double number and no number out of range).
Is it possible to do this in LaTeX? I would give a number and I get an shuffled array of numbers back which I can use within the loop? (I do not want to create the list by some external script since the number can be different).
Is there a way that LaTeX can do something like this? Thank you very much!
(Background: I want to make exams where the numbers should refer to the students in order to make an anonymous list in the end. When the numbers are in natural order, everyone can see the mark of their neighbors in the exam. At the moment I am shuffeling after printing)
Edit: At the moment, I'm using sort of this code. And I would like to have a solution that something is calculated a new quantity \randno
, which I can used within the loop instead of examno
.
\documentclass{article}
\newcounter{examno} \setcounter{examno}{1}
\newcommand{\numbermax}{7}
\begin{document}
\loop
Test. This is exam no. \arabic{examno} \pagebreak
\ifnum\value{examno}<\numbermax
\stepcounter{examno}
\repeat
\end{document}