TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to make a number of badges using LaTeX for the participants of a summer school. There are 40 or so people, so I don't want to manually change the name and compile and then print. I could think of:

  1. Making a single document with a dropdown box with 40 choices. I don't know if it is possible to automate the choosing and printing in this case.

  2. Using a script language such as python to call latex to do the job. But I have 0 experience with Python, and I didn't find a foolproof tutorial on the web (probably because of wrong search keywords).

So...I'm waiting for you guys to come up with a good solution :-).

share|improve this question
You should search this side for "serial letter". This will give you some examples on how people are getting data from .csv and producing mutliple pdfs from it. – LaRiFaRi Jul 11 '14 at 12:40
Probably datatool package provides some help – Christian Hupfer Jul 11 '14 at 12:49
There's also csvsimple, which would surely be enough for this kind of task. Would take the fun out of the answer below, however.... – jon Jul 11 '14 at 13:43
Related: Template for Cubicle Tags (Desk Tags) in LaTeX. – Mike Renfro Jul 11 '14 at 14:49
up vote 8 down vote accepted



\@for \name:=%
{{Werner}{Not Here}},%
{{Gonzalo}{Not There}}%
\do {
Name: \Name\\
Afilliation: \Affiliation

share|improve this answer
Thank you. It is a good start. Is there an \affiliation too?I tried but failed. – Troy Woo Jul 11 '14 at 13:21
@user74973 updated with two fields per name, more could be added as an exercise:-) – David Carlisle Jul 11 '14 at 13:28
Wow,I really need to learn such techniques...is it something written in the texbook? – Troy Woo Jul 11 '14 at 13:30
@user74973 \@for \@firstoftwo are defined in the latex format (so not in the texbook) The texbook of course describes the primitoves that define those commands. – David Carlisle Jul 11 '14 at 13:32

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.