GeneralGenerating data similar to \toc or \lof

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
angelixd
Posts: 15
Joined: Thu Jul 26, 2007 4:53 pm

Generating data similar to \toc or \lof

Post by angelixd »

Hello everyone,

I am typesetting a class for generating tests, and I would like to auto-generate an answer key at the end. I find that the syntax for \addcontentsline{}{}{} would work perfect for me, as I can just embed it directly into my question macro without any serious finagling and I have a counter for it set up already.

My question is, how do I go about defining a \answerkey macro, and a correct list so that I can just type something like \addcontentsline{ans}{\arabic{Qcount}}{#3} ? I assume that I would have to deal with some file I/O in latex, but it would be helpful if this stuff has already been defined; in particular, things like \@starttoc{}. Any sort of direction would be appreciated. Thanks!

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Post Reply