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: Tables in headers
Date: Mon, 28 Apr 2008 14:14:44 +0200	[thread overview]
Message-ID: <115224fb0804280514s7be9bd94le1de2c3cef1a03d@mail.gmail.com> (raw)
In-Reply-To: <99c4e1a80804280329p43f34396jaaf8355ae66a56bf@mail.gmail.com>

Hi Stefan,

> I'll try to illustrate using a monospaced font:
>
> +------+                                         Company Name
> |      |
> | Logo |
> |      |
> +------+
>
> ------------------------------------------------+------------
> Type of document                                | Page
> Report of something                             | 2 (10)
> -----------------------------------+------------+------------
> Name of document                   | Issue      | Date
> My document name                   | 1          | 2008-04-22
> -----------------------------------+------------+------------
> Issuer (dept, name, email)                      | Appendix
> dept, name, email                               | Appendix
> ------------------------------------------------+------------
>
> This is the full header. A reduced header is used on the rest of the pages
> where the last row is excluded.
>
> (I am trying to convert a MS-Word template...)

\setvariables
  [document]
  [type={Report of something},
   name={My document name},
   issue={1},
   date=\currentdate,
   issue={dept, name, email},
   appendices={Appendix}]

\definelayer
  [head:table]
  [width=\paperwidth,
   height=\paperheight,
   state=start]

\definelayer
  [head:picture]
  [width=\paperwidth,
   height=\paperheight,
   state=repeat]

\startsetups head:table

\setlayer
  [head:table]
  [hoffset=\backspace,
   voffset=5cm]
  {\ifnum\pagenumber=\plusone
     \setups{head:table:first}%
   \else
     \setups{head:table:next}%
   \fi}

\stopsetups

\startsetups head:table:first

\bTABLE[textwidth=\textwidth,option=stretch,align=right]
  \bTR
    \bTD[nx=2] Type of document\\\getvariable{document}{type} \eTD
    \bTD Page\\\pagenumber\space(\lastpagenumber) \eTD
  \eTR
  \bTR
    \bTD Name of document\\\getvariable{document}{name} \eTD
    \bTD Issue\\\getvariable{document}{issue} \eTD
    \bTD Date\\\getvariable{document}{date} \eTD
  \eTR
  \bTR
    \bTD[nx=2] Issuer (dept, name, email)\\\getvariable{document}{issue} \eTD
    \bTD Appendix\\\getvariable{document}{appendices} \eTD
  \eTR
\eTABLE

\stopsetups

\startsetups head:table:next

\bTABLE[textwidth=\textwidth,option=stretch,align=right]
  \bTR
    \bTD[nx=2] Type of document\\\getvariable{document}{type} \eTD
    \bTD Page\\\pagenumber\space(\lastpagenumber) \eTD
  \eTR
  \bTR
    \bTD Name of document\\\getvariable{document}{name} \eTD
    \bTD Issue\\\getvariable{document}{issue} \eTD
    \bTD Date\\\getvariable{document}{date} \eTD
  \eTR
\eTABLE

\stopsetups

\setlayer
  [head:picture]
  [hoffset=\backspace,
   voffset=\topspace]
  {\externalfigure[Logo][width=3cm]}

\setlayer
  [head:picture]
  [preset=righttop,
   hoffset=\cutspace,
   voffset=\topspace]
  {Company Name}

\setupbackgrounds[page][setups={head:table},background={head:table,head:picture}]

\starttext
\dorecurse{3}{\page[empty]}
\stoptext

Greetings,
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


  reply	other threads:[~2008-04-28 12:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-28 10:29 Stefan Larsson
2008-04-28 12:14 ` Wolfgang Schuster [this message]
  -- strict thread matches above, loose matches on Subject: below --
2008-04-29  4:53 Stefan Larsson
2008-04-28  6:06 Stefan Larsson
2008-04-28  6:16 ` Wolfgang Schuster

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=115224fb0804280514s7be9bd94le1de2c3cef1a03d@mail.gmail.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).