I'm creating exams, so I need to produce (almost) identical versions of the exam, that would differ in a few characters. For instance
\documentclass{article}
\begin{document}
Here I use the variable $x$
\newpage
Here I use the variable $y$
\end{document}
To avoid mistakes when trying to replicate edits along different pages, what I would like to do would be something like
\documentclass{article}
\begin{document}
\page{Here I use the variable #1}
\pages{$x$,$y$}
\end{document}
Any suggestions on how to do this efficiently? I know how to create a macro and then I could repeat that macro on every page. The concrete question is how to do a command with variable arguments that iterates over the arguments and applies the macro \page to each of them.
