On 6/27/2026 6:12 AM, Jeroen wrote:
\setupinteractionscreen[width=max,height=max]
\definepapersize[cover][width=330mm,height=240mm]
\definepapersize[book][width=160mm,height=240mm]
\setuppapersize[distance=38mm]
\setuplayout[backspace=18mm, width=129mm, height=223mm, marking=color]
\setuplayout[
    marking=color,
    location=middle,
    cropoffset=0mm,
    trimoffset=-7.5mm,
    bleedoffset=3mm]
\definelayer
   [foo]
   [width=\paperwidth,
   height=\paperheight]

\starttext
\pagebreak
\setuppapersize[cover][oversized]
\setlayer[foo][x=-19.5mm,y=-40.5mm]{
\startMPpage
StartPage;
numeric w, h, m;
w := bbwidth(Page);
h := bbheight(Page);
m := 19mm;
path p;
p := unitsquare xyscaled (w-2m,h-2m) shifted (m,m);
fill Page withcolor \MPcolor{yellow};
draw (.4889w,0) -- (.4889w,1h) withpen pensquare scaled 1pt withcolor \MPcolor{black}; %testline draw (.5111w,0) -- (.5111w,1h) withpen pensquare scaled 1pt withcolor \MPcolor{black}; %testline
\stopMPpage}
\flushlayer[foo]
\pagebreak
\setuppapersize[book][oversized]
\dorecurse{5}{\samplefile{tufte}}
\stoptext

You're missing a StopPage but anyway, this is not really a use case for startMPpage, you can do this:

\definepapersize
  [cover]
  [width=330mm,
   height=240mm]

\setuppapersize
  [distance=38mm]

\setuplayout
  [backspace=18mm,
   width=129mm,
   height=223mm]

\setuplayout
  [marking=color,
   location=middle,
   cropoffset=0mm,
   trimoffset=-7.5mm,
   bleedoffset=3mm]

\starttext

\setuppapersize[cover][oversized]

\startpagemakeup

\paperbleed  1mm
\spinewidth 15mm

\startMPcode
    StartPage;
        fill Page enlarged PaperBleed withcolor "yellow" ;
        draw leftboundary  Page shifted ( PaperWidth/2-SpineWidth/2,0) ;
        draw rightboundary Page shifted (-PaperWidth/2+SpineWidth/2,0) ;
    StopPage;
\stopMPcode

\stoppagemakeup

If we can find keys for these two already present variables we can interface them better.

bleed=
spine=

But I want to hear Wolfgang (consistency) and Willi (bookbinding) opinions on this. The two dinwmnsions will stay anyway (have been there for a while).

Hans

-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
       tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : [email protected] / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

Reply via email to