I can see how that works, Sreeram, especially the chapter:after to cope with the chapters ending on an even page. Though I will have to try it now on a copy of the real document to test it there.

All ten images are different, though, in my case (Chapter1.jpg, Chapter2.jpg... Chapter10.jpg all in a pics directory, so I'd point \setupexternalfigures to that). I wonder if there is a way to list them so that they get called in order as chapters proceed. A kind of "if such and such then \setlayer 1,2,3...."

Julian

On 7/3/22 16:38, śrīrāma wrote:
On Monday, March 7, 2022 9:19 AM jbf via ntg-context wrote:
Author wants an image on facing page to each of 10 chapters in the
bodypart of the document. Assume that everything else is working
properly for this document (double-sided etc.), but other than before
chapter 1, I can't seem to get my facing page image to appear where it
should!
 From what I understood from your explanation, I have this:

%%% SOF
   % for 'mill'
   \setupexternalfigures[location={default}]

   \setuppagenumbering[alternative=doublesided]

   
\definelayer[mill][x=0mm,y=0mm,width=\paperwidth,height=\paperheight,repeat=yes]
   \setlayer[mill]{\externalfigure[mill][width=\paperwidth]}

   \startsetups chapter:before
   \doifoddpageelse{}
     {\pushbackground[page]
     \setupbackgrounds[page][background=mill]
     \page[empty]
     \popbackground}
   \stopsetups

   \startsetups chapter:after
   \doifoddpageelse{}
     {\page[empty]}
   \stopsetups

   \setuphead
     [chapter]
     [page=yes,
     before=\directsetup{chapter:before},
     aftersection=\directsetup{chapter:after}]

   \starttext
   \dorecurse{10}{
     \startchapter[title={Chapter \convertnumber{word}{\recurselevel}}]
       \input knuth
       \blank
       \input tufte
       \blank
       \input ward
       \blank
       \ifnum\recurselevel=5
         \page
         \input zapf
         \input zapf
       \fi
     \stopchapter
   }
   \stoptext
%%% EOF

[I am just using the mill picture on every facing page of chapter]
If the chapter ends on an even page then we can insert an empty page with 
\page[empty] with [aftersection=...] in \setuphead. The [before=...] is push, 
set background to mill on a new (empty) left page and then pop back (much like 
the example from wiki).

Sreeram


___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : [email protected] / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to