Am endeavouring to explore Wolfgang's very 'elegant' solution to this facing page challenge. The exploration has included a look at base/mkxl/page-inj.mklx (thanks Sreeram for reminding me of this) where I see immediately that the approach is experimental and where it says also that 'probably more alternatives will be added'. I wonder if that last phrase also includes the ability to manipulate the image(s) either generally or in individual cases? So, for example., say I need (and in fact I do!) to change some aspect of individual images, e.g. I might want to scale=500, or fiddle with width/height of a particular image. At the moment I cannot see a way of doing this for each image. I wondered if the commented out setups in the response to this question might be a clue, but so far haven't been able to get that to have any effect. Julian On 8/3/22 05:35, Wolfgang Schuster wrote:
jbf via ntg-context schrieb am 07.03.2022 um 09:27:
Appreciate your assistance. I'll do my best with what you offer here. Of course, I've always said these images are at the beginning, not "the end of their respective chapters" and I've already indicated how the images are named, simply as Chapter1.jpg and so on, so I'll need to work around these differences in your example. But with trial and error, let's hope I get there!
The example below uses a different mechanism to add images at the start of a chapter. In the example you have to pass the name of image as userdata argument of \startchapter but in the commented \setuphead setting you can see how this can be automated.
%%%% begin example % \definepageinjectionalternative % [chapter:image] % [renderingsetup=pageinjection:chapter:image] % % \startsetups [pageinjection:chapter:image] % \clip % [width=\framedwidth,height=\framedheight] % {\centerbox{\externalfigure[\dummyparameter{name}][factor=min]}} % \stopsetups
\definepageinjection [chapter:start] [empty] [page=left]
\definepageinjection [chapter:insert] [previouspage] [%alternative=chapter:image, pagestate=stop]
\setuphead [chapter] [beforesection={\pageinjection[chapter:start]}, insidesection={\pageinjection[chapter:insert][name=\structureuservariable{image}]}]
% \setuphead % [chapter] % [beforesection={\pageinjection[chapter:start]}, % insidesection={\pageinjection[chapter:insert][name={chapter\namedheadnumber{chapter}}]}]
\setuppagenumbering [alternative=doublesided]
\setupexternalfigures [location=default]
\starttext
\startchapter [title={Mill}] [image=mill] \dorecurse{7}{\samplefile{lorem}} \stopchapter
\startchapter [title={Mill}] [image=mill] \dorecurse{11}{\samplefile{lorem}} \stopchapter
\startchapter [title={Mill}] [image=mill] \dorecurse{7}{\samplefile{lorem}} \stopchapter
\stoptext %%%% end example
Wolfgang