On Sat, 6 Dec 2008, Sanjoy Mahajan wrote:
Thanks, that's a nice approach. It doesn't fully pass the duck test: The page headlines come from the chapter titles, even in the interludes.
Then beat the hell out of it, until it starts behaving like a duck. The main trouble is that descriptions do not set any marking, and there are not enough hooks to set a mark. But we can still use poor man's marks: macros! % First we need two types of headings: for chapters and for interludes startsetups[headline:chapter] {\ss\it Chapter \getmarking[chapternumber].\quad\getmarking[chapter]} \stopsetups % Marking version does not work ... see comment below % \definemarking[interlude] % \definemarking[interludenumber][expansion=yes] % % \startsetups[headline:interlude] % {\ss\it Interlude \getmarking[interludenumber].\quad\getmarking[interlude]} % \stopsetups % So we define our own marks \def\interludeMARK{empty} \def\interludenumberMARK{empty} % And a second version of heading \startsetups[headline:interlude] {\ss\it Interlude \interludenumberMARK.\quad\interludeMARK} \stopsetups % The header texts need to switch between the two \setupheadertexts[\setups{headline:\CURRENTDIVISION}][pagenumber] \setuppagenumbering[location=] % We start with current division as chapter \def\CURRENTDIVISION{chapter} % Provide an option of switching on interlude pages \couplepage[interlude][before={\gdef\CURRENTDIVISION{interlude}}] \startsetups interlude \page \pagetype[interlude] \stopsetups % And switch back on chapter pages \setuphead[chapter][before={\page[right]\def\CURRENTDIVISION{chapter}}] % Now define the enumeration \defineenumeration[interlude] [before=\setups{interlude}, conversion=Characters,way=bytext,list=interludeA, text=, listtext=, title=yes, titleleft=, titleright=, titlecommand=\interludemarking] \def\interludemarking#1% {\gdef\interludeMARK{#1}% \global \edef\interludenumberMARK{\getnumber[\currentdescriptionnumber]}% #1} % Ideally, I would have liked to use marks, but this does not work % Probably because we are inside a box % \def\interludemarking#1% % {\marking[interlude]{#1}% % \marking[interludenumber]{\getnumber[\currentdescriptionnumber]}% % #1} \starttext \title{Contents} \placelist[chapter,enumeration:interlude,enumeration:interludeA] \chapter{Chap 1} \dorecurse{5}{\input knuth \endgraf} \startinterlude {Interlude 1} \dorecurse{5}{\input knuth \endgraf} \stopinterlude \chapter{Chap 2} \dorecurse{5}{\input knuth \endgraf} \startinterlude {Interlude 2} \dorecurse{5}{\input knuth \endgraf} \stopinterlude \stoptext At this stage I am not sure whether you gain anything by using enumerations. You get predefined support for numbering and lists, but that is not too hard to write on your own. Aditya