Is it possible to create exams with student names automatically printed on them?

I was in the middle of a final exam and a thought occured to me. If I am able to provide a list of student names and IDs, can I have typst generate n PDFs such that each exam PDF has the student name and ID printed on it?

This is just a question out of curiosity.

Typst generates only one PDF file per typst compile. Use external scripts to split and rename pages.

If the exams are meant to be printed, I would say that you don’t even have to generate distinct PDFs; you can put all the exams for every student in one big PDF and print it.

2 Likes

Questions on data-loading and Can I configure my document (e.g. draft/release version, color theme) when creating a PDF without modifying the Typst file directly? - #3 by SillyFreak in particular are definitely relevant here.

  • for separate PDFs, you can use a script to call the Typst compiler with different --inputs and so customize each PDF
  • for one joined PDF, you can provide your Typst document with e.g. a CSV file and then make a loop that produces the pages for each student
2 Likes