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:

\definelist[Answers]

\startExercise
#2
\stopExercise
}

\starttext

\chapter{First chapter}

Some text

\chapter{Second chapter}

\stoptext


Issues:

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)?

• 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:

\defineenumeration
[
title=yes,
way=bychapter,
titlecommand=\gobbleoneargument,
]

\starttext

\chapter{First chapter}

Some text
Content here
Content here

\chapter{Second chapter}
Content here
Content here

\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