I'm currently working on a textbook. It contains numerous exercises and I'd like it to contain an answer key at the end of the book. The answer key should have the same structure as the book, that is all the chapter/section titles and correct exercise numbers. I can't figure out how to deal with a few issues in ConTeXt.

Here is my minimal example using \definelist:


        \writetolist[Answers]{}{\getnumber[Exercise] #1}


\chapter{First chapter}

Some text
\Task[Answer 1]{Content here}
\Task[Answer 2]{Text goes here}

\chapter{Second chapter}

\Task{Question three without answer}
\Task[Answer 4]{Number four}




  1. Why does \getnumber[Exercise] not work? (Answers without question numbers make no sense.)
  2. How to include chapter and section titles/numbers where appropriate in the answer key? (To make the structure and navigation clear and to prevent ambiguity.)
  3. How to deal with questions that don't have an answer in the key?
  4. [optional] How to include page numbers of the actual content that the answers are referring to in the header/footer of the answer key (e.g. Answers pp. 76-100)?

Edit: scanned answer key illustration to point 2

  • Can you explain what you mean by point 2. Perhaps, it will be easiest if you can post an image that shows the desired output. – Aditya Dec 17 '13 at 18:30
  • @Aditya, I have updated the question with a scanned page, see edit. (By the way, that image is almost identical to what my concept looks like - including the itemize in answers) – user19041 Dec 17 '13 at 19:10

I'll write in more detail in later, but this may help you get started:



\chapter{First chapter}

Some text
\startTask{Answer 1}
  Content here
\startTask{Answer 2}
  Content here

\chapter{Second chapter}
  Content here
\startTask{Answer 4}
  Content here

\completelist[Task][criterium=all, pagenumber=no]


Another option is to use the annotation module by Wolfgang Schuster which provides a key-value driven interface, so you'll be able to write:

\startTask[list={....}] .... \stopTask
  • Thanks a lot! However, I tried to experiment with this solution incorporating \definecombinedlist to get the chapters and sections but without success (newest ConTeXt generates empty list). The second important issue is dealing with the "Tasks" that don't have answers in the list so that they don't appear there at all. Also, if point 4 of my actual question requires too much coding, please don't waste your time. – user19041 Dec 17 '13 at 17:14

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.