ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: "Procházka Lukáš Ing. - Pontex s. r. o." <LPr@pontex.cz>
To: "mailing list for ConTeXt users" <ntg-context@ntg.nl>
Subject: Re: [***Spam/VIR***] Re:  Layer vs. overlay
Date: Tue, 15 Jan 2013 13:10:48 +0100	[thread overview]
Message-ID: <op.wqyb4av8tpjj8f@lpr> (raw)
In-Reply-To: <10BF7AFF-32C7-4C8C-A1C6-538C9EB591EA@gmail.com>

... Thanks again.

On Tue, 15 Jan 2013 11:09:48 +0100, Wolfgang Schuster <wolfgang.schuster@gmail.com> wrote:

> \setupbodyfont[30pt]
>
> \starttext
>
> A
>
> \definelayer  [beforetext][width=\overlaywidth,height=\overlayheight]
> \defineoverlay[beforetext][{\setups[beforetext]\tightlayer[beforetext]}]
>
> \startsetups[beforetext]
>   \setlayer[beforetext][preset=righttop]{\framed[width=2in]{BEFORE}}
> \stopsetups
>
> \startTEXpage[background={foreground,beforetext}]
>   \externalfigure[cow][width=30cm]
> \stopTEXpage
>
> Z
>
> \stoptext
>
> A similar example is also on the wiki: http://wiki.contextgarden.net/Layers#Place_labels_on_pictures

Yes, I started altering it... But I wans't sure abou relation layers vs. overlays vs. setups.

I'd need also to add some dynamically generated content, something like \pagenumber in the wiki example, but to be generated by Lua.

So I extended your example:

----
\setupbodyfont[30pt]

\starttext
   A

   \definelayer  [beforetext][width=\overlaywidth,height=\overlayheight]
   \defineoverlay[beforetext][{\setups[beforetext]\tightlayer[beforetext]}]

   \startsetups[beforetext]
     \setlayer[beforetext][preset=righttop]{\framed[width=2in]{\directlua{context(userdata.LPr.text)}}}
   \stopsetups

   \startTEXpage[background={foreground,beforetext}]
     \startluacode
       userdata = userdata or {}
       userdata.LPr = userdata.LPr or {}
       userdata.LPr.text = "BEF"

       context.externalfigure({"cow"},{width="30cm"})
     \stopluacode
   \stopTEXpage

   Z
\stoptext
----

I believe I used a proper way; if not so, please correct "bad places".

(Finally: I'd like to achieve a Lua function which will copy all pages of a .pdf file, keeping size of each page, and adding a customizable string with page-in-the-pdf number (with default value "<page-i>/<n-pages>"), being placed to the right top corner of the i-th page. All to be provided by Lua.)

Thanks again.

Best regards,

Lukas

> Wolfgang


-- 
Ing. Lukáš Procházka [mailto:LPr@pontex.cz]
Pontex s. r. o.      [mailto:pontex@pontex.cz] [http://www.pontex.cz]
Bezová 1658
147 14 Praha 4

Tel: +420 244 062 238
Fax: +420 244 461 038

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


  reply	other threads:[~2013-01-15 12:10 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-11 15:32 Procházka Lukáš Ing. - Pontex s. r. o.
2013-01-11 18:06 ` Hans Hagen
2013-01-12  7:44 ` Wolfgang Schuster
2013-01-12 10:36   ` Procházka Lukáš
2013-01-12 13:25   ` Hans Hagen
2013-01-12 17:54   ` [***Spam/VIR***] " Procházka Lukáš
2013-01-12 18:11     ` Wolfgang Schuster
2013-01-15  8:04       ` Procházka Lukáš Ing. - Pontex s. r. o.
2013-01-15 10:09         ` Wolfgang Schuster
2013-01-15 12:10           ` Procházka Lukáš Ing. - Pontex s. r. o. [this message]
2013-01-15 12:25             ` [***Spam/VIR***] " Aditya Mahajan
2013-01-15 16:21               ` Philipp Gesang
2013-01-16  8:41               ` Procházka Lukáš Ing. - Pontex s. r. o.
2013-01-16 11:47                 ` Philipp Gesang
2013-01-16 13:09                   ` Procházka Lukáš Ing. - Pontex s. r. o.
2013-01-16 13:34                     ` Philipp Gesang

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=op.wqyb4av8tpjj8f@lpr \
    --to=lpr@pontex.cz \
    --cc=ntg-context@ntg.nl \
    /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).