[NTG-context] \writetolist in mkiv

Jano Kula jano.kula at gmail.com
Sun Oct 12 20:39:31 CEST 2014


Hello to everybody!

Minimal story
-------------
How to insert local TOC of manually created subsections after the 
section starts?

% start minimal example
\def\ManualSubsection#1{\blank%
{\bf Manual Subsection #1}\par%
\writetolist[subsection]{whatever}{Manual Subsection #1}%
\input tufte\relax}

\starttext
\dorecurse{3}{%
\startchapter[title=Chapter]
\placecontent[chapter,criterium=local] % local TOC OK
\startsection[title=Section]
Here we would like to see the local list of manual subsections
\placecontent[section,criterium=local] % local TOC not OK
\ManualSubsection{\recurselevel-1}
\ManualSubsection{\recurselevel-2}
\stopsection
\stopchapter}
\stoptext
% stop minimal example

Longer Story
------------
Predefined \start<chapter|section> inserts "titledata" in TUC file:
   ["titledata"]={
    ["label"]="chapter",
    ["title"]="Chapter",
   },
   ...
   ["titledata"]={
    ["label"]="section",
    ["title"]="Section",
   },
while \writetolist[subsection]{whatever}{Manual Subsection #1} inserts 
"userdata":
   ["userdata"]={
    ["first"]="whatever",
    ["second"]="Manual Subsection \\recurselevel -1",
   },
Is this the reason and can I force to write "titledata" in the TUC file?

Real case is of course more complicated and also PDF hyperlinks should work.

Thank you in advance,

Jano



More information about the ntg-context mailing list