ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Re: Tables in headers
@ 2008-04-28 10:29 Stefan Larsson
  2008-04-28 12:14 ` Wolfgang Schuster
  0 siblings, 1 reply; 5+ messages in thread
From: Stefan Larsson @ 2008-04-28 10:29 UTC (permalink / raw)
  To: ntg-context


[-- Attachment #1.1: Type: text/plain, Size: 2063 bytes --]

Hi Stefan,

On Mon, Apr 28, 2008 at 8:06 AM, Stefan Larsson <lastsys@gmail.com> 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

[-- Attachment #1.2: Type: text/html, Size: 4361 bytes --]

[-- Attachment #2: Type: text/plain, Size: 487 bytes --]

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Tables in headers
  2008-04-28 10:29 Tables in headers Stefan Larsson
@ 2008-04-28 12:14 ` Wolfgang Schuster
  0 siblings, 0 replies; 5+ messages in thread
From: Wolfgang Schuster @ 2008-04-28 12:14 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Tables in headers
@ 2008-04-29  4:53 Stefan Larsson
  0 siblings, 0 replies; 5+ messages in thread
From: Stefan Larsson @ 2008-04-29  4:53 UTC (permalink / raw)
  To: ntg-context


[-- Attachment #1.1: Type: text/plain, Size: 111 bytes --]

Thank you very much for your explicit hints Wolfgang. I've learnt a lot from
these few lines of code.

/Stefan

[-- Attachment #1.2: Type: text/html, Size: 172 bytes --]

[-- Attachment #2: Type: text/plain, Size: 487 bytes --]

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Tables in headers
  2008-04-28  6:06 Stefan Larsson
@ 2008-04-28  6:16 ` Wolfgang Schuster
  0 siblings, 0 replies; 5+ messages in thread
From: Wolfgang Schuster @ 2008-04-28  6:16 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi Stefan,

On Mon, Apr 28, 2008 at 8:06 AM, Stefan Larsson <lastsys@gmail.com> 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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Tables in headers
@ 2008-04-28  6:06 Stefan Larsson
  2008-04-28  6:16 ` Wolfgang Schuster
  0 siblings, 1 reply; 5+ messages in thread
From: Stefan Larsson @ 2008-04-28  6:06 UTC (permalink / raw)
  To: ntg-context


[-- Attachment #1.1: Type: text/plain, Size: 846 bytes --]

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

[-- Attachment #1.2: Type: text/html, Size: 1049 bytes --]

[-- Attachment #2: Type: text/plain, Size: 487 bytes --]

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-04-29  4:53 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-04-28 10:29 Tables in headers Stefan Larsson
2008-04-28 12:14 ` Wolfgang Schuster
  -- 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

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