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've using the examdesign class to create exams and it can do almost everything I want. But I find that I've been repeating myself as I reuse old exams as practice exams and quiz problems. I'd like to create a bank of test problems and it seems that this can almost be accomplished using the \InsertChunk function provided by the examdesign class, but there seems to be a small bug.

I can almost accomplish my goal if I put the following in the main LaTeX file:



    Exam Instructions



    Question text goes here.

  \InsertChunk{chunk name}



And the following in a file named foo.tex:

\begin{chunk}{chunk name}
    Question 2 text goes here.

However, this setup breaks if I remove the first question.

I was wondering if anybody knew enough about the examdesign class to propose a modification or a workaround so that I could keep all my questions in foo.tex.

share|improve this question
Your code will produce errors as it is now (apparently you need to provide some value for \class in the preamble). – Gonzalo Medina Apr 19 '12 at 4:00
I am getting ! LaTeX Error: There's no line here to end. as of now. – Harish Kumar Apr 19 '12 at 4:06
I've edited the code to define the examtop environment which I believe fixes the compilation errors. – Guillermo Garza Apr 19 '12 at 4:21

examdesign uses an odd (to me) method of finding the "stuff before the questions". It literally gathers up everything before the first \begin and marks that as the instructions.

% \begin{macro}{\get@instructions}
% This macro collects everything between it and the next |\begin| token.  It then
% calls the |\find@instructions@end| macro to check whether the |\begin| token
% belongs to the \textsf{question} environment or some other environment.
%    \begin{macrocode}
%    \end{macrocode}
% \end{macro}

I think one could rewrite this to define an instructions environment, but maybe that makes the questions unnecessarily wordy.

The \find@instructions@end is pretty particular, and will only stop gobbling when it finds \begin{question} or \begin{block}. The \begin{block} just delays the problem, as it uses a similar method to find the instructions for the block.

In other words, I don't see a simple way to do this without changing the syntax expected by the package. Certainly, to me this looks like a question for the package author.

share|improve this answer

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.