[NTG-context] simple usage of \hpos

Wolfgang Schuster schuster.wolfgang at googlemail.com
Sun Feb 7 13:46:47 CET 2010


Am 07.02.10 13:22, schrieb Peter Münster:
> The main idea, to position the layer with x=\MPx{} and y=\MPy{} seems to be broken.
>
> Smaller test-file:
>
> \definelayer[graphics][position=yes]
> \setupbackgrounds[page][background=graphics]
> \starttext
> I would like to appear a graphics exactly 2cm left from he\xypos{XXX}re.
>
> \setlayer[graphics][x=\MPx{XXX}, y=\MPy{XXX}, dx=-2cm]{%
>    \externalfigure[hacker.jpg][width=1cm]}
> \stoptext
>
> Any other ideas?

Remove the 'position=yes' setup and correct the coordinates, layers use 
the top left corner as origin but positions are measures from the left 
bottom corner.

\definelayer[graphics]

\setupbackgrounds[page][background=graphics]

\starttext

I would like to appear a graphics exactly 2cm left from he\xypos{XXX}re.

\setlayer
   [graphics]
   [x=\the\dimexpr\MPx{XXX}-2cm\relax,
    y=\the\dimexpr\paperheight-\MPy{XXX}-\strutht\relax]
   {\externalfigure[hacker.jpg][width=1cm]}

\stoptext

Wolfgang


More information about the ntg-context mailing list