Exams/problem sets with individual student names in LaTeX

Usually my exams have a large blank space for students to write their names in.

If, instead, I wanted to generate individualised exams with their names printed in that space, this code will do that for you. It uses the pgffor package to loop over the list of names you provide.

\documentclass{article}
\usepackage{pgffor}
\def\classlist{Enda Hargaden,
George Akerlof,
Joe Stiglitz,
Don Bruce}
\pagenumbering{gobble}
\begin{document}
\foreach \studentname in \classlist{

Econ 381 Problem Set: \studentname's Copy

\begin{enumerate}
\item What is OLS?
\item What's the square root of 25?
\item More questions yadda yadda
\end{enumerate}

\newpage}

\end{document}

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top