I need to produce dozens of same pages, except for the part that each page has to have a different person's name on it. Imagine it as an exam, where the content is equal for every page, except that I want to print the student's name in the header of somewhere else on the page.
From my programming perspective, one clue would be to make a list/series (or array in programming terms) of names in the beginning of a document, and invoke it further in the text as, say, \student[i], where i is an integer (i.e. number of current page). But I have no idea how to implement it as this is my first touch of this topic.
My current document looks like this:
\begin{document}
\newcounter{i}
\setcounter{i}{1}
\whiledo{\value{i} < 50}{
Lorem ipsum ...
% The place where I need to put a variable string
Lorem ipsum ...
\newpage
\addtocounter{i}{1}
}
\end{document}
This produces 49 equal pages, however, I don't know how to create a series of names in a variable, and then print on every page a different name following the series.