1

My book has:

  • full-page images and captions on some pages
  • and body text flowing through the other pages. My document is divided into sections, each starting on a new page.

I'm trying to place the full-page images and captions on layers by postponing them just before the section breaks. A typical section has 2 pages of body text and 3 full-page images. I tried using floats, but it was too difficult to find where in the body text to place the floats.

It mostly works well, except that the full-page images sometimes get postponed onto the wrong page. I suspect that the \page in the postponed commands gets it confused. Here's a MWE that shows the problem.

In my MWE, the \startpostponing[+2] should place the words POSTPONED CONTENT on page 3, instead the words are on page 4. When I change the postponing +2 to +1 or +3 it works fine.

Can someone please check if it's like this on their computer?

postponing

\setuppapersize[A6, portrait][A3, landscape]
\setuppaper[nx=3,ny=2]
\setuparranging[XY]

\starttext

\startpostponing[+2] 
POSTPONED CONTENT
\page
\stoppostponing

ON PAGE 1
\page
\dorecurse{3}{\input tufte}
\stoptext
2
  • I've tried to use \startpostponing to solve a bunch of different problems, but I've unfortunately never gotten it to work very well since as soon as I solve one problem, another one pops up. Less abstractly, what are you trying to do here? There is likely a better way than using \startpostponing. Feb 4 at 22:05
  • Thanks. I edited the post to say what I'm eventually trying to achieve. I'll try setting ` \c_page_postponed_mode` to 0.
    – Stanley
    Feb 5 at 0:17

2 Answers 2

2

A different solution that uses floats instead of \startpostponing to achieve the goals described in the edit:

\setuppapersize[A6, portrait][A3, landscape]
\setuppaper[nx=4,ny=2]
\setuparranging[XY]

\definefloat[endofsection][figure][
    default={somewhere:endofsection},
    minheight=\dimexpr\textheight-2\baselineskip,
    frame=on,
]

\setupfloat[ntop=100]

\setuphead[section][
    before={\page\placenamedfloat[endofsection][endofsection]\page}
]

\starttext

\section{Section One}

\dorecurse{2}{\samplefile{knuth}\par}

\placeendofsection{Caption One}{Content One}

\placeendofsection{Caption Two}{Content Two}

\section{Section Two}

\dorecurse{3}{\samplefile{bryson}\par}

\placeendofsection{Caption Three}{Content Three}

\placeendofsection{Caption Four}{Content Four}

\placeendofsection{Caption Five}{Content Five}

\section{Section Three}

\dorecurse{6}{\samplefile{zapf}\par}

\stoptext

enter image description here enter image description here

It's a little hacky, so take it as a starting point rather than a finished solution :)

(If using layers is a hard requirement, then you could probably do something with Lua + buffers, but that would be best for another question)

1
  • 1
    Yes, I think I need to embrace floats instead of all that postponing. I seem to seek distraction from actually writing my book.
    – Stanley
    Feb 5 at 20:37
2

This looks like a bug to me. Setting \c_page_postponed_mode to 0 seems to fix the problem, although this may have other unintended consequences:

\unprotect
\c_page_postponed_mode=0
\protect

\setuppapersize[A6, portrait][A3, landscape]
\setuppaper[nx=3,ny=2]
\setuparranging[XY]

\starttext

\startpostponing[+2]
POSTPONED CONTENT
\page
\stoppostponing

ON PAGE 1
\page
\dorecurse{3}{\input tufte}
\stoptext

enter image description here

I suspect that the issue has something to do with \aftergroup in the definition of \page_otr_construct_and_shipout (page-ini.mkxl:170-175):

     % this is tricky! we need to make sure we are in the output group
     \ifnum\c_page_postponed_mode=\plusone
       \aftergroup\page_postponed_blocks_flush
     \else
       \page_postponed_blocks_flush
     \fi
2
  • Thanys. In my book, setting that to 0 fixed some problems, but changed other problems and didn't fix them.
    – Stanley
    Feb 5 at 0:48
  • 1
    Not terribly surprising that setting that to zero broke stuff since I'm honestly not too sure what that parameter does. Regardless, the fact that the postponed stuff is showing up on the wrong page seems to be a bug, so you'll probably have better luck submitting it to the list so that the developers can see it. Feb 5 at 8:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .