I'm using datatool to load a csv table. Students names are in that table (first column first name, second column last name) and I like to print them on the exam. In a related question, I asked how to print a student id number on each exam. In a similar way I like to print the names taken from the table on each exam. My first approach (I just like to print an arbitrary value) looks like this and unfortunately doesn't work:






\newcommand{\studentname}[2]{#1 #2}



\multido{\nx = 1+1}{3}{  
  % Uncomment next lines if exam has an odd number of pages.
%   \newpage
%   \mbox{}
%   \newpage


So how can I achieve that the table is iterated within multido? And I need some kind of macro that I can use in examMain.tex to access the students full name?

A possible example of members.cvs could look like this

Name1, FirstName1
Name2, FirstName2
Name3, FirstName3
  • 1
    Could you please add a small example of how the members.csv file is organized?
    – egreg
    Feb 12 '13 at 11:57
  • I added an example. But I think that doesn't really matter. I suggest a situation where I already had been able to seperate my file with the help of datatool into 2 columns, one for the family name and one for the first name.
    – DaPhil
    Feb 13 '13 at 11:32

Use \DTLforeach:


\noindent Student ID = \fbox{\studentid}\quad
\studentfirstname\ \studentlastname


Solve the equation $x-1=0$.



  \ifnum\thestudentidcounter<10 0\fi



   \par\bigskip\hrule\bigskip % just not to produce many pages


enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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