[NTG-context] Tables in headers

2008-04-27 Thread Stefan Larsson
First post on this list...

I have been using LaTeX for several large projects during the last 10 years
and just recently tried to switch to ConTeXt due to the claim of easier
handling of custom page layout. So far it is an enjoyable experience...

I would need to customize my page headers with a custom table (like
LaTeX's tabular environment) instead of just changing the text in the left
and right corners. From the quick browsing I have been doing of
documentation and articles at contextgarden this feature called "layers"
might be what I am looking for. But before trying to grasp this feature I
would like to ask any experienced ConTeXt user for the recommended approach
to achieve what I am trying to do...

So, to conclude: "How do I customize my page header to contain a table
instead of the predefined style?"

Thanks,
Stefan Larsson
___
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
___


Re: [NTG-context] Tables in headers

2008-04-27 Thread Wolfgang Schuster
Hi Stefan,

On Mon, Apr 28, 2008 at 8:06 AM, Stefan Larsson <[EMAIL PROTECTED]> wrote:
> First post on this list...
>
> I have been using LaTeX for several large projects during the last 10 years
> and just recently tried to switch to ConTeXt due to the claim of easier
> handling of custom page layout. So far it is an enjoyable experience...
>
> I would need to customize my page headers with a custom table (like LaTeX's
> tabular environment) instead of just changing the text in the left and right
> corners. From the quick browsing I have been doing of documentation and
> articles at contextgarden this feature called "layers" might be what I am
> looking for. But before trying to grasp this feature I would like to ask any
> experienced ConTeXt user for the recommended approach to achieve what I am
> trying to do...
>
> So, to conclude: "How do I customize my page header to contain a table
> instead of the predefined style?"

can you give us a example of the header do you want to get, tables are not
best solution and they will couse troubles in a few cases. We could try to
find a better solution if possible.

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
___


Re: [NTG-context] Tables in headers

2008-04-28 Thread Stefan Larsson
Hi Stefan,

On Mon, Apr 28, 2008 at 8:06 AM, Stefan Larsson <[EMAIL PROTECTED]> wrote:
>> First post on this list...
>>
>> I have been using LaTeX for several large projects during the last 10
years
>> and just recently tried to switch to ConTeXt due to the claim of easier
>> handling of custom page layout. So far it is an enjoyable experience...
>>
>> I would need to customize my page headers with a custom table (like
LaTeX's
>> tabular environment) instead of just changing the text in the left and
right
>> corners. From the quick browsing I have been doing of documentation and
>> articles at contextgarden this feature called "layers" might be what I am
>> looking for. But before trying to grasp this feature I would like to ask
any
>> experienced ConTeXt user for the recommended approach to achieve what I
am
>> trying to do...
>>
>> So, to conclude: "How do I customize my page header to contain a table
>> instead of the predefined style?"

> can you give us a example of the header do you want to get, tables are not
> best solution and they will couse troubles in a few cases. We could try to
> find a better solution if possible.

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...)

Thanks,
/Stefan
___
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
___


Re: [NTG-context] Tables in headers

2008-04-28 Thread Wolfgang Schuster
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
___


Re: [NTG-context] Tables in headers

2008-04-28 Thread Stefan Larsson
Thank you very much for your explicit hints Wolfgang. I've learnt a lot from
these few lines of code.

/Stefan
___
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
___