[NTG-context] placing (on) layers

Pablo Rodriguez oinos at gmx.es
Sat Apr 16 23:19:44 CEST 2022


On 4/15/22 21:51, Henning Hraban Ramm via ntg-context wrote:
> Hi again,
>
> I’m always struggling with putting stuff on layers, since these just
> never start where I’d expect them to, and the offsets changed a few
> times within the last years.
>
> Please explain how I should define a layer that covers the whole page,
> since the following MWE is wrong (the layer always starts below the
> first line):

Hi Hraban,

slightly modifying your MWE, I think I get what might fit your needs
(see below).

I never used \flushlayer and your sample shows that it doesn’t fit here.

The layer is relative to the page, not to the paper in this case.

And the state is an option for the layer (in \definelayer), not for the
background, being "start" its default value.

Just in case it might help,

Pablo

  \setupexternalfigures
     [location={default,global}]

  \setuppapersize[A5][A4]
  \setuplayout[
     marking=on,
     location=middle,
  ]
  \definemeasure[Bleed][3mm]
  \definemeasure[MaxHeight]
      [{\dimexpr\paperheight + 2\measure{Bleed}\relax}]
  \definemeasure[MaxWidth]
      [{\dimexpr\paperwidth + 2\measure{Bleed}\relax}]

  \definelayer[papier][
     preset=lefttop,
     %x=0mm,y=0mm,
     width=\paperwidth,
     height=\paperheight,
  ]
  \setupbackgrounds[page][background=papier]

  \starttext
  \showframe
  TEST

  \setlayerframed[papier][
     preset=lefttop,
     %x=-\measure{Bleed},
     %y=-\measure{Bleed},
     offset=overlay,
     %frame=off,
     width=\measure{MaxWidth},
     height=\measure{MaxHeight},
  ]{\externalfigure[cow][
     width=\measure{MaxWidth},height=\measure{MaxHeight}
  ]}

  \stoptext


More information about the ntg-context mailing list