[NTG-context] Dump table of contents

Aditya Mahajan adityam at umich.edu
Mon Apr 9 06:08:23 CEST 2012


On Sun, 8 Apr 2012, Kip Warner wrote:

> Hey list,
>
> Is it possible to instruct ConTeXt to generate just the table of
> contents, skipping all other front matter, back matter, appendices, body
> matter, etc.? For example, only the following I'd like to see in the
> outputted PDF:
>
>    % Contents at a glance...
>    \title{Contents at a Glance}
>    \placelist[chapter]
>
>    % Complete table of contents...
>    \title{Table of Contents}
>    \placecontent
>
> Right now I am generating the full book, but then passing through pdftk
> manually to extract just the pages that fall within the aforementioned.
>
> I tried putting the aforementioned code in its own product file and then
> passing that through ConTeXt with the book's environment, but the
> problem is that the TOC now has nothing in it, of course.

I don't know if there is proper interface to this, but you can just load 
the tuc file and reuse the labels.

\def\loaddatafile#1%
     {\ctxlua {
         job.initialize("#1.tuc","#1.tua")
     }}%

\loaddatafile{full-book} %with the .tex extension

\starttext
\placelist[chapter]
\stoptext


Aditya


More information about the ntg-context mailing list