ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Wolfgang Schuster <schuster.wolfgang@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: Letterhead Usage
Date: Fri, 1 May 2015 11:24:24 +0200	[thread overview]
Message-ID: <B40924ED-9677-4B8E-AC10-012AAC8CEF96@gmail.com> (raw)
In-Reply-To: <554278A3.6010808@gmail.com>


> Am 30.04.2015 um 20:46 schrieb henman <dhenman@gmail.com>:
> 
> 
> I have created a letterhead for correspondence, but it is too unfriendly to have to include it in every time.
> 
> I would like to use it as a package, but don't know if it's possible.
> 
> The problem I see is that the command \setlayer must  be done after the \starttext command.
> If it doesn't then formatting commands such as \sc  will not take affect and I believe a different font is also applied.
> 
> What would  be a user friendly way to implement letterheads (made up using the layers functionality of context?


You can put the layer settings in a setups environment and flush the content when the page backgrounds are applied
with the setups key for \setupbackground.

\definelayer[letterhead][width=\paperwidth,height=\paperheight]

\startsetups[letterhead]

\ifnum\rawcountervalue[userpage]=1

	\setlayerframed[letterhead][x=\backspace,y=1cm][width=\textwidth,height=2cm,align={middle,lohi}]{First page}

\else

	\setlayerframed[letterhead][x=\backspace,y=1cm][width=\textwidth,height=2cm,align={middle,lohi}]{Second page}

\fi

\stopsetups

\setupbackgrounds[page][background=letterhead,setups=letterhead]

\starttext
\dorecurse{3}{\page[empty]}
\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
___________________________________________________________________________________

      parent reply	other threads:[~2015-05-01  9:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-30 18:46 henman
2015-05-01  9:09 ` Pablo Rodriguez
2015-05-01  9:24 ` Wolfgang Schuster [this message]

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=B40924ED-9677-4B8E-AC10-012AAC8CEF96@gmail.com \
    --to=schuster.wolfgang@gmail.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).