ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* wrong positioning of MP graphic in layer
@ 2013-10-07 15:56 Pablo Rodríguez
  2013-10-07 17:16 ` luigi scarso
  0 siblings, 1 reply; 7+ messages in thread
From: Pablo Rodríguez @ 2013-10-07 15:56 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Dear list,

I have the following sample:

    \definelayer[wrongpositioned][x=0mm, y=0mm, hoffset=0mm,
     voffset=48mm, state=start]
    \setuplayer[wrongpositioned]{\startMPcode draw
     (0mm,0mm)--(8mm,0mm)--(8mm,38mm)--(14mm,38mm) ; \stopMPcode}
    \setupbackgrounds[page][background={wrongpositioned}]
    \starttext
    \input knuth
    \stoptext

No matter what x, y, hoffset, voffset, location or corner, the MP
graphic is located where the page margins start.

Sorry for the so basic question, but what is wrong there?

Besides that, I don’t understand how positioning in layers work. I have
read the wiki, but I don’t get it (geometry isn’t my strength).

x, y, hoffset and voffset are fine. But location and corner are
mysterious to me. Changing them gave me no clue of what they are.

The four mentioned options set a point in the paper. The corner could be
the point of the graphic or text that would be set in the previously
defined point in the paper.

Well, if this isn’t wrong, what can location be?

Sorry, I know it‘s my lack of geometrical knowledge.

Could anyone be so kind to explain me what location and corner mean in
layers?

Many thanks for your help,


Pablo
-- 
http://www.ousia.tk
___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: wrong positioning of MP graphic in layer
  2013-10-07 15:56 wrong positioning of MP graphic in layer Pablo Rodríguez
@ 2013-10-07 17:16 ` luigi scarso
  2013-10-07 20:04   ` Pablo Rodríguez
  0 siblings, 1 reply; 7+ messages in thread
From: luigi scarso @ 2013-10-07 17:16 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1932 bytes --]

On Mon, Oct 7, 2013 at 5:56 PM, Pablo Rodríguez <oinos@gmx.es> wrote:

> Dear list,
>
> I have the following sample:
>
>     \definelayer[wrongpositioned][x=0mm, y=0mm, hoffset=0mm,
>      voffset=48mm, state=start]
>     \setuplayer[wrongpositioned]{\startMPcode draw
>      (0mm,0mm)--(8mm,0mm)--(8mm,38mm)--(14mm,38mm) ; \stopMPcode}
>     \setupbackgrounds[page][background={wrongpositioned}]
>     \starttext
>     \input knuth
>     \stoptext
>
> No matter what x, y, hoffset, voffset, location or corner, the MP
> graphic is located where the page margins start.
>
> Sorry for the so basic question, but what is wrong there?
>
> Besides that, I don’t understand how positioning in layers work. I have
> read the wiki, but I don’t get it (geometry isn’t my strength).
>
> x, y, hoffset and voffset are fine. But location and corner are
> mysterious to me. Changing them gave me no clue of what they are.
>
> The four mentioned options set a point in the paper. The corner could be
> the point of the graphic or text that would be set in the previously
> defined point in the paper.
>
> Well, if this isn’t wrong, what can location be?
>
> Sorry, I know it‘s my lack of geometrical knowledge.
>
> Could anyone be so kind to explain me what location and corner mean in
> layers?
>
> Many thanks for your help,
>
>
You can start from here

\setuppapersize[A4][A3]
\setuplayout[location=middle]
\showframe %showlayout
\definelayer[Page]
\setuplayer[Page][width=\paperwidth,height=\paperheight]
\setlayer[Page]{\startMPcode
draw    (0mm,0mm)--(PaperWidth,PaperHeight) withpen pencircle scaled 2pt
withcolor red;
draw    (0mm,PaperHeight)--(PaperWidth,0mm) withpen pencircle scaled 2pt
withcolor blue;
\stopMPcode}
\setupbackgrounds[page][background={Page}]


\starttext
    \input knuth
\stoptext


See also
http://wiki.contextgarden.net/Layers
-- 
luigi

[-- Attachment #1.2: Type: text/html, Size: 2571 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: wrong positioning of MP graphic in layer
  2013-10-07 17:16 ` luigi scarso
@ 2013-10-07 20:04   ` Pablo Rodríguez
  2013-10-07 20:48     ` Hans Hagen
  2013-10-07 21:01     ` luigi scarso
  0 siblings, 2 replies; 7+ messages in thread
From: Pablo Rodríguez @ 2013-10-07 20:04 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 10/07/2013 07:16 PM, luigi scarso wrote:
> On Mon, Oct 7, 2013 at 5:56 PM, Pablo Rodríguez wrote:
>  Dear list,
> 
>  I have the following sample:
>  [...]

Many thanks for your reply, Luigi.

I need to insist on this sample, because the layer doesn’t behave as such:

\definelayer[wrongpositioned][x=5000cm, y=5000cm, state=start]
\setuplayer[wrongpositioned]{\startMPcode draw
(0mm,0mm)--(8mm,0mm)--(8mm,38mm)--(14mm,38mm) ; \stopMPcode}
\setupbackgrounds[page][background={wrongpositioned}]
\starttext
\input knuth
\stoptext

x and y are outside the page in the layer definition (50 meters).

It should be a stupid error, but I cannot say which one.

It is a line that I need for my work.

>  Could anyone be so kind to explain me what location and corner mean in
>  layers?
>  
> You can start from here
> [...]

Many thanks for this excellent example. Playing with it is the best way
to learn.

Thanks again for your help,


Pablo
-- 
http://www.ousia.tk
___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: wrong positioning of MP graphic in layer
  2013-10-07 20:04   ` Pablo Rodríguez
@ 2013-10-07 20:48     ` Hans Hagen
  2013-10-08 15:21       ` Pablo Rodríguez
  2013-10-07 21:01     ` luigi scarso
  1 sibling, 1 reply; 7+ messages in thread
From: Hans Hagen @ 2013-10-07 20:48 UTC (permalink / raw)
  To: ntg-context

On 10/7/2013 10:04 PM, Pablo Rodríguez wrote:
> On 10/07/2013 07:16 PM, luigi scarso wrote:
>> On Mon, Oct 7, 2013 at 5:56 PM, Pablo Rodríguez wrote:
>>   Dear list,
>>
>>   I have the following sample:
>>   [...]
>
> Many thanks for your reply, Luigi.
>
> I need to insist on this sample, because the layer doesn’t behave as such:
>
> \definelayer[wrongpositioned][x=5000cm, y=5000cm, state=start]
> \setuplayer[wrongpositioned]{\startMPcode draw
> (0mm,0mm)--(8mm,0mm)--(8mm,38mm)--(14mm,38mm) ; \stopMPcode}
> \setupbackgrounds[page][background={wrongpositioned}]
> \starttext
> \input knuth
> \stoptext
>
> x and y are outside the page in the layer definition (50 meters).
>
> It should be a stupid error, but I cannot say which one.
>
> It is a line that I need for my work.
>
>>   Could anyone be so kind to explain me what location and corner mean in
>>   layers?
>>
>> You can start from here
>> [...]
>
> Many thanks for this excellent example. Playing with it is the best way
> to learn.

you confuse \setuplayer with setlayer

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: wrong positioning of MP graphic in layer
  2013-10-07 20:04   ` Pablo Rodríguez
  2013-10-07 20:48     ` Hans Hagen
@ 2013-10-07 21:01     ` luigi scarso
  2013-10-08 15:29       ` Pablo Rodríguez
  1 sibling, 1 reply; 7+ messages in thread
From: luigi scarso @ 2013-10-07 21:01 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1673 bytes --]

On Mon, Oct 7, 2013 at 10:04 PM, Pablo Rodríguez <oinos@gmx.es> wrote:

> On 10/07/2013 07:16 PM, luigi scarso wrote:
> > On Mon, Oct 7, 2013 at 5:56 PM, Pablo Rodríguez wrote:
> >  Dear list,
> >
> >  I have the following sample:
> >  [...]
>
> Many thanks for your reply, Luigi.
>
> I need to insist on this sample, because the layer doesn’t behave as such:
>
> \definelayer[wrongpositioned][x=5000cm, y=5000cm, state=start]
> \setuplayer[wrongpositioned]{\startMPcode draw
> (0mm,0mm)--(8mm,0mm)--(8mm,38mm)--(14mm,38mm) ; \stopMPcode}
> \setupbackgrounds[page][background={wrongpositioned}]
> \starttext
> \input knuth
> \stoptext
>
> x and y are outside the page in the layer definition (50 meters).
>
> It should be a stupid error, but I cannot say which one.
>
> It is a line that I need for my work.
>


I don't understand  what exactly you need, but I hope this can help you.

\showlayout
\showframe

\definelayer[wrongpositioned]

\setuplayer[wrongpositioned][x=\backspace, y=\dimexpr
\topspace+\headerheight\relax, state=start]

\setlayer[wrongpositioned]{\startMPcode
draw (0mm,0mm)--(TextWidth,0mm)--(TextWidth,TextHeight)--(0mm,TextHeight)
-- cycle withpen pencircle scaled 2 withcolor red;
drawarrow (0mm,0mm) -- (TextWidth,TextHeight) withpen pencircle scaled 2
withcolor blue;
drawarrow (0mm,TextHeight) -- (TextWidth,0mm) withpen pencircle scaled 2
withcolor black;
fill (0mm,0mm) -- (0mm,-FooterHeight) -- (TextWidth,-FooterHeight) --
(TextWidth,0mm) -- cycle withcolor blue;
\stopMPcode}

\setupbackgrounds[page][background={wrongpositioned}]

\starttext
\input knuth
\stoptext


-- 
luigi

[-- Attachment #1.2: Type: text/html, Size: 2234 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: wrong positioning of MP graphic in layer
  2013-10-07 20:48     ` Hans Hagen
@ 2013-10-08 15:21       ` Pablo Rodríguez
  0 siblings, 0 replies; 7+ messages in thread
From: Pablo Rodríguez @ 2013-10-08 15:21 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 10/07/2013 10:48 PM, Hans Hagen wrote:
> On 10/7/2013 10:04 PM, Pablo Rodríguez wrote:
>> [...]
>>
>> I need to insist on this sample, because the layer doesn’t behave as such:
>>
>> \definelayer[wrongpositioned][x=5000cm, y=5000cm, state=start]
>> \setuplayer[wrongpositioned]{\startMPcode draw
>> (0mm,0mm)--(8mm,0mm)--(8mm,38mm)--(14mm,38mm) ; \stopMPcode}
>> [...]
> 
> you confuse \setuplayer with setlayer

Exactly my fault, Hans, Totally overseen.

Many thanks for your help,


Pablo
-- 
http://www.ousia.tk
___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: wrong positioning of MP graphic in layer
  2013-10-07 21:01     ` luigi scarso
@ 2013-10-08 15:29       ` Pablo Rodríguez
  0 siblings, 0 replies; 7+ messages in thread
From: Pablo Rodríguez @ 2013-10-08 15:29 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 10/07/2013 11:01 PM, luigi scarso wrote:
> On Mon, Oct 7, 2013 at 10:04 PM, Pablo Rodríguez wrote:
> 
>     I need to insist on this sample, because the layer doesn’t behave as
>     such:
> 
>     \definelayer[wrongpositioned][x=5000cm, y=5000cm, state=start]
>     \setuplayer[wrongpositioned]{\startMPcode draw
>     (0mm,0mm)--(8mm,0mm)--(8mm,38mm)--(14mm,38mm) ; \stopMPcode}
>     \setupbackgrounds[page][background={wrongpositioned}]
>     \starttext
>     \input knuth
>     \stoptext
> 
>     x and y are outside the page in the layer definition (50 meters).
> 
>     It should be a stupid error, but I cannot say which one.
>  
> I don't understand  what exactly you need, but I hope this can help you.

Many thanks for your reply, Luigi.

As Hans pointed out, I wrote \setuplayer instead of \setuplayer.

As weird as it sounds, yesterday I used my first layers ever (copied
from the wiki) and only in this one I typed \setuplayer instead of
\setlayer.

Well, it seems that I shouldn’t be sleepy when writing layers ;-).

Many thanks for your help again,


Pablo
-- 
http://www.ousia.tk
___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

end of thread, other threads:[~2013-10-08 15:29 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-07 15:56 wrong positioning of MP graphic in layer Pablo Rodríguez
2013-10-07 17:16 ` luigi scarso
2013-10-07 20:04   ` Pablo Rodríguez
2013-10-07 20:48     ` Hans Hagen
2013-10-08 15:21       ` Pablo Rodríguez
2013-10-07 21:01     ` luigi scarso
2013-10-08 15:29       ` Pablo Rodríguez

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