ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* placing (on) layers
@ 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:19 ` Pablo Rodriguez via ntg-context
  0 siblings, 2 replies; 4+ messages in thread
From: Henning Hraban Ramm via ntg-context @ 2022-04-15 19:51 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Henning Hraban Ramm

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):


\useMPlibrary[dum]

\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[paper][background=cover,state=start]


\starttext
\showframe
TEST

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

\flushlayer[papier]

\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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: placing (on) layers
  2022-04-15 19:51 placing (on) layers 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
  1 sibling, 1 reply; 4+ messages in thread
From: Willi Egger via ntg-context @ 2022-04-16 20:27 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Willi Egger

Hi Hraban,

if you flush a layer like in your example, then the layer is attached to the left top of the text area. If you want to place it in another place, you will have to move it by x and y dimensions to the right place in the first brackets of the \setlayerframed command . — What would be possible is to attach the layer as a background to one of the different areas of the  paper.

I hope this gives you a hint how to proceed..

Willi

> On 15 Apr 2022, at 21:51, Henning Hraban Ramm via ntg-context <ntg-context@ntg.nl> 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):
> 
> 
> \useMPlibrary[dum]
> 
> \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[paper][background=cover,state=start]
> 
> 
> \starttext
> \showframe
> TEST
> 
> \setlayerframed[papier][
>  preset=lefttop,
>  %x=-\measure{Bleed},
>  %y=-\measure{Bleed},
>  offset=overlay,
>  %frame=off,
>  width=\measure{MaxWidth},
>  height=\measure{MaxHeight},
> ]{\externalfigure[dummy][
>  width=\measure{MaxWidth},height=\measure{MaxHeight}
> ]}
> 
> \flushlayer[papier]
> 
> \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
> ___________________________________________________________________________________

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: placing (on) layers
  2022-04-16 20:27 ` Willi Egger via ntg-context
@ 2022-04-16 21:07   ` Henning Hraban Ramm via ntg-context
  0 siblings, 0 replies; 4+ messages in thread
From: Henning Hraban Ramm via ntg-context @ 2022-04-16 21:07 UTC (permalink / raw)
  To: Willi Egger via ntg-context; +Cc: Henning Hraban Ramm

Hi Willi,

thank you, I wasn’t aware that \flushlayer works this way. This was also 
the problem in my real project.

And I had the wrong layer mentioned in \setupbackgrounds from another test.
Also, cropoffset was interfering in the real project, see my other mail.

Hraban

Am 16.04.22 um 22:27 schrieb Willi Egger via ntg-context:
> Hi Hraban,
> 
> if you flush a layer like in your example, then the layer is attached to the left top of the text area. If you want to place it in another place, you will have to move it by x and y dimensions to the right place in the first brackets of the \setlayerframed command . — What would be possible is to attach the layer as a background to one of the different areas of the  paper.
> 
> I hope this gives you a hint how to proceed..
> 
> Willi
> 
>> On 15 Apr 2022, at 21:51, Henning Hraban Ramm via ntg-context <ntg-context@ntg.nl> 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):
>>
>>
>> \useMPlibrary[dum]
>>
>> \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[paper][background=cover,state=start]
>>
>>
>> \starttext
>> \showframe
>> TEST
>>
>> \setlayerframed[papier][
>>   preset=lefttop,
>>   %x=-\measure{Bleed},
>>   %y=-\measure{Bleed},
>>   offset=overlay,
>>   %frame=off,
>>   width=\measure{MaxWidth},
>>   height=\measure{MaxHeight},
>> ]{\externalfigure[dummy][
>>   width=\measure{MaxWidth},height=\measure{MaxHeight}
>> ]}
>>
>> \flushlayer[papier]
>>
>> \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
>> ___________________________________________________________________________________
> 
> ___________________________________________________________________________________
> 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
> ___________________________________________________________________________________

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: placing (on) layers
  2022-04-15 19:51 placing (on) layers Henning Hraban Ramm via ntg-context
  2022-04-16 20:27 ` Willi Egger via ntg-context
@ 2022-04-16 21:19 ` Pablo Rodriguez via ntg-context
  1 sibling, 0 replies; 4+ messages in thread
From: Pablo Rodriguez via ntg-context @ 2022-04-16 21:19 UTC (permalink / raw)
  To: Henning Hraban Ramm via ntg-context; +Cc: Pablo Rodriguez

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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-04-16 21:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-15 19:51 placing (on) layers 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 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).