ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Wolfgang Schuster <schuster.wolfgang@googlemail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: Help wanted for layers and pagebackgrounds
Date: Thu, 20 May 2010 10:14:34 +0200	[thread overview]
Message-ID: <4BF4EF6A.9020607@googlemail.com> (raw)
In-Reply-To: <41EE1BC8-D5A3-4F7A-AE79-674B8E454CE1@gmail.com>

Am 19.05.10 18:21, schrieb Otared Kavian:
> Dear all,
>
> I need to have a special layout, in which a number (which is not a page number nor a section number or such) is printed in big size on the right when the pagenumber is even (that is on a leftpage) and printed on the left when the pagenumber is odd (that is a rightpage). With the help of examples gleaned here and there in the manuals, I came up with the following minimal example:
>
> [...]


Good example!


\setupcolors[state=start]

\setuppagenumbering[location=footer,alternative=doublesided]

\definelayer[Number][width=\paperwidth,height=\paperheight,doublesided=yes]

\define[1]\myNumber
   {\setlayer[Number][odd]
      [preset=righttop,voffset=45mm,hoffset=3mm]
      {\offset[location=rt,rightoffset=-3mm]
         {\tlap{\color[darkgreen]{\scale[height=30mm,width=22mm]{\ss#1}}}}}%
    \setlayer[Number][even]
      [preset=lefttop,voffset=45mm,hoffset=25mm]
      {\offset[location=tl,leftoffset=-3mm]
         {\tlap{\color[darkgreen]{\scale[height=30mm,width=22mm]{\ss#1}}}}}}

\setupbackgrounds[page][background=Number]

\starttext
\dorecurse{4}{\myNumber{#1}\input knuth \page}
\dorecurse{4}{\myNumber{#1}\dorecurse{6}{\input knuth }\page}
\dorecurse{4}{\myNumber{#1}\dorecurse{3}{\input knuth }\page}
\stoptext

Wolfgang

___________________________________________________________________________________
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:[~2010-05-20  8:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-19 16:21 Otared Kavian
2010-05-20  8:14 ` Wolfgang Schuster [this message]
2010-05-20 11:17   ` Otared Kavian

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=4BF4EF6A.9020607@googlemail.com \
    --to=schuster.wolfgang@googlemail.com \
    --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).