To run grtex you need the input files, which we will call exam1.tex, the source of the exam, and exam1.w, the want file. Execute
grtex
This will start the program, which will give some outdated message and then ask
FileName OF FILE FOR Questions : (or EXIT)*
You give the name of the source file, exam1.tex
Here is the rest of the start of the conversation, with your responses in italics:
FileName OF FILE FOR Questions : (or EXIT)*  exam1.tex
FileName OF FILE FOR Want & Par: (or EXIT)*  exam1.w
FileName OF FILE FOR KEY out: (or EXIT)*  exam1.k
FileName OF FILE FOR EXAM out: (or EXIT)*  exam1.e

Note if you try to overwrite an existing file it will ask if that is okay.

Grtex will then output a list of questions you requested and it found, some information about the versions and answers, and then asks
Are you happy with the distribution? (Y=CR)*
You probably want to say y, or just enter. If you are not happy, grtex will generate a new randomly permuted exam, but it may become hard to reproduce this if you don't keep careful track.

If things have gone well, the file exam1.e is the file which you need to latex, which will produce all versions of the exam.

Things do go wrong, and the diagnostics are not very good. Several things to check are

  • You must have a line that says exactly
    %%End of header
    after the latex header and before any cover page material or any text to be printed.
  • You must have a line that says exactly
    enter your header page material      or
    enter your cover page material
    after the ifpagesnumbered command.
  • You must have a line that says exactly
    % end of exam questions.
  • You must have no nonascii characters (32-126) except tab, newline, and carriage return in the file
  • You must not have any line which is too long, probably 99 characters is the limit, but 80 is safer

The last two problems often occur if someone prepares the source in Word (shame on them!).


Criticisms or additions to this page should be sent to

Joel Shapiro

(shapiroatpixphysics)