ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Pablo Rodriguez via ntg-context <ntg-context@ntg.nl>
To: Henning Hraban Ramm via ntg-context <ntg-context@ntg.nl>
Cc: Pablo Rodriguez <oinos@gmx.es>
Subject: Re: placing (on) layers
Date: Sat, 16 Apr 2022 23:19:44 +0200	[thread overview]
Message-ID: <b40e5b77-7eec-546e-c4b7-44dda3114370@gmx.es> (raw)
In-Reply-To: <0d30ca92-fc91-0155-953d-4ddbac396200@fiee.net>

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
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

      parent reply	other threads:[~2022-04-16 21:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-15 19:51 Henning Hraban Ramm via ntg-context
2022-04-16 20:27 ` Willi Egger via ntg-context
2022-04-16 21:07   ` Henning Hraban Ramm via ntg-context
2022-04-16 21:19 ` Pablo Rodriguez via ntg-context [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b40e5b77-7eec-546e-c4b7-44dda3114370@gmx.es \
    --to=ntg-context@ntg.nl \
    --cc=oinos@gmx.es \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).