Re: Trimbox and crop marks on cover page
Jeroen <[email protected]> Sat, 27 Jun 2026 06:12:33 +0200
| Newsgroups | gmane.comp.tex.context |
|---|---|
| Message-ID | <CAPtmdbPotAkJuuW-DeN2z4i1SODvhB8_16E5pMkRYcci_iCyog@mail.gmail.com> |
I managed to get the desired result by placing the \startMPpage inside a
layer and shifting the layer:
\setlayer[foo][x=-19.5mm,y=-40.5mm]{...}
However, these offsets were found by trial and error.
Setting
\definelayer
[foo]
[width=\paperwidth,
height=\paperheight]
or using the layer as a page background makes no difference.
What is the relation between the origin of a layer and the origin of Page
inside \startMPpage? Is there a documented way to compute these offsets
instead of hard-coding them? This is the MWE to reproduce:
\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
Op do 25 jun 2026 om 10:55 schreef Henning Hraban Ramm <[email protected]>:
> Am 25.06.26 um 10:22 schrieb Jeroen:
> > I want to generate a press-ready PDF book with cover with the following
> > but I dont seem to get the cover correct.
> >
> > - Trim size 320 × 240 mm
> > - MediaBox enlarged using \setuppapersize[cover][oversized]
> > - Crop marks (marking=color)
> > - Artwork extending into the bleed outside the TrimBox
> > - I am using LMTX v. 2026.04.27 on windows 11 Pro, 25H2
> >
> > 1. With the minimal example below, \startMPpage is clipped to Page so
> > the bleed area in the enlarged MediaBox remains white
> > 2. Is this the intended behaviour of \startMPpage? If so, what is
> > recommended to create artwork that extends into the bleed while keeping
> > the TrimBox and crop marks?
> >
> > \definepapersize[cover][width=320mm,height=240mm]
> > \definepapersize[book][width=160mm,height=240mm]
> > \setuppapersize[distance=38mm]
> > \setuplayout[backspace=18mm, width=129mm, height=223mm, marking=color]
> > \setuplayout[location=middle]
>
> You must set the PDF boxes like
>
> \setuplayout[
> marking=color,
> location=middle,
> cropoffset=0mm,
> trimoffset=-7.5mm,
> bleedoffset=3mm,
> ]
> \setupinteractionscreen[width=max,height=max] % needed for activation
>
> I didn’t check if \startMPpage then still crops the image, I’d use
> \setlayer for placement.
>
> Hraban
>
> ___________________________________________________________________________________
> 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
>
> ___________________________________________________________________________________
>
___________________________________________________________________________________
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
___________________________________________________________________________________