Re: [NTG-context] fancyhdr equivalent

2007-07-02 Thread Peter I. Hansen

On 7/2/07, Aditya Mahajan [EMAIL PROTECTED] wrote:


On Mon, 2 Jul 2007, Peter I. Hansen wrote:

 On 7/1/07, Aditya Mahajan [EMAIL PROTECTED] wrote:

 On Sun, 1 Jul 2007, Peter I. Hansen wrote:

  Hello
 
  Just getting started with ConTeXt, and liking it so far :)
 
  However, I would like to use something similar to the LaTeX
'fancyhdr'
  package. I've been poking around trying to find such a thing and the
 closest
  I could get is:
 
  http://osdir.com/ml/tex.context/2001-10/msg00094.html
 
  I can't find it in the manual, so if it is built in maybe one of you
 guys
  can tell how to use it?

 Look at Section 4.17 of ConTeXt manual
 http://www.pragma-ade.com/general/manuals/cont-enp.pdf


 What I would like to do is for example to frame the headertext, and I
tried
 with eg.

 \setupheadertexts  [chapter][pagenumber]
 \setupheader [style=\inframed]

 But this creates a framed chapter text and a framed pagenumber. How do I
put
 both in one frame?


\setupbackgrounds  [header][text][frame=on]

To get a decent visual effect, you need to set the header height to be
something reasonable, for example

\setuplayout[header=2\lineheight]



Thanks, this works for me. One thing though, I would like to turn the
framing off on pages where a chapter begins. I tried
\setuphead[chapter][header=empty], but this just gives me an empty frame.
Is there a way to selectively turn of backgounds on for example chapter
pages?
___
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] fancyhdr equivalent

2007-07-02 Thread Wolfgang Schuster
2007/7/2, Peter I. Hansen [EMAIL PROTECTED]:
 Thanks, this works for me. One thing though, I would like to turn the
 framing off on pages where a chapter begins. I tried
 \setuphead[chapter][header=empty], but this just gives me
 an empty frame.
  Is there a way to selectively turn of backgounds on for example chapter
 pages?

\setuphead
  [chapter]
  [%before={\blank[force,\dimexpr\headerheight+\headerdistance\relax]},
   header=high]

\setupbackgrounds[header][text][frame=on]

\starttext

\dorecurse{4}
  {\chapter{Knuth}
   \dorecurse{12}
 {\input knuth\par}}

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


Re: [NTG-context] fancyhdr equivalent

2007-07-02 Thread Wolfgang Schuster

2007/7/1, Peter I. Hansen [EMAIL PROTECTED]:

Hello

Just getting started with ConTeXt, and liking it so far :)

However, I would like to use something similar to the LaTeX 'fancyhdr'
package. I've been poking around trying to find such a thing and the closest
I could get is:

http://osdir.com/ml/tex.context/2001-10/msg00094.html

I can't find it in the manual, so if it is built in maybe one of you guys
can tell how to use it?

Thanks, Peter


Hi Peter,

you can use my module wolf-txt to come closer to the LaTeX.

It provides left, middle and right keys for the headertexts.

Wolfgang


wolf-txt.tex
Description: TeX document
___
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] fancyhdr equivalent

2007-07-02 Thread Aditya Mahajan
On Mon, 2 Jul 2007, Wolfgang Schuster wrote:

 2007/7/2, Peter I. Hansen [EMAIL PROTECTED]:
 Thanks, this works for me. One thing though, I would like to turn the
 framing off on pages where a chapter begins. I tried
 \setuphead[chapter][header=empty], but this just gives me
 an empty frame.
  Is there a way to selectively turn of backgounds on for example chapter
 pages?

 \setuphead
  [chapter]
  [%before={\blank[force,\dimexpr\headerheight+\headerdistance\relax]},
   header=high]

And incase you only want to get rid of the frame:

\setupbackgrounds[state=repeat]
\setupbackgrounds[header][text][background=whatever]
\defineoverlay[whatever][{\framed[width=\overlaywidth,height=\overlayheight]{}}]
\couplepage[chapter][before={\defineoverlay[whatever][]}]
\setuphead[chapter][before={\pagetype[chapter]}]
\starttext
  \chapter{First} \page test \chapter{second} \page test

Aditya
___
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] fancyhdr equivalent

2007-07-02 Thread Peter I. Hansen

On 7/2/07, Wolfgang Schuster [EMAIL PROTECTED] wrote:


2007/7/2, Peter I. Hansen [EMAIL PROTECTED]:
 Thanks, this works for me. One thing though, I would like to turn the
 framing off on pages where a chapter begins. I tried
 \setuphead[chapter][header=empty], but this just gives me
 an empty frame.
  Is there a way to selectively turn of backgounds on for example chapter
 pages?

\setuphead
  [chapter]
  [%before={\blank[force,\dimexpr\headerheight+\headerdistance\relax]},
   header=high]

\setupbackgrounds[header][text][frame=on]

\starttext

\dorecurse{4}
  {\chapter{Knuth}
   \dorecurse{12}
 {\input knuth\par}}

\stoptext



Beautifull. One problem arise, if you put a \placecontent after \starttext
the first chapter will stil have the frame on.
___
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] fancyhdr equivalent

2007-07-02 Thread Wolfgang Schuster
2007/7/2, Peter I. Hansen [EMAIL PROTECTED]:
 On 7/2/07, Wolfgang Schuster
 [EMAIL PROTECTED] wrote:

  2007/7/2, Peter I. Hansen [EMAIL PROTECTED]:
   Thanks, this works for me. One thing though, I would like to turn the
   framing off on pages where a chapter begins. I tried
   \setuphead[chapter][header=empty], but this just gives
 me
   an empty frame.
Is there a way to selectively turn of backgounds on for example chapter
   pages?
 
  \setuphead
[chapter]
 
 [%before={\blank[force,\dimexpr\headerheight+\headerdistance\relax]},
 header=high]
 
  \setupbackgrounds[header][text][frame=on]
 
  \starttext
 
  \dorecurse{4}
{\chapter{Knuth}
 \dorecurse{12}
   {\input knuth\par}}
 
  \stoptext

 Beautifull. One problem arise, if you put a \placecontent after \starttext
 the first chapter will stil have the frame on.

do you mean

\starttext
\placecontent
\chapter{Knuth}
\stoptext

I see only a frame on the first page with the table of contents and
this normal because there is no chapter on this page.

use \completecontent and not \placecontent

if this is not what you mean send a example

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] fancyhdr equivalent

2007-07-02 Thread Peter I. Hansen
On 7/2/07, Wolfgang Schuster [EMAIL PROTECTED] wrote:
 2007/7/2, Peter I. Hansen [EMAIL PROTECTED]:
  On 7/2/07, Wolfgang Schuster
  [EMAIL PROTECTED] wrote:
 
   2007/7/2, Peter I. Hansen [EMAIL PROTECTED]:
Thanks, this works for me. One thing though, I would like to turn the
framing off on pages where a chapter begins. I tried
\setuphead[chapter][header=empty], but this just gives
  me
an empty frame.
 Is there a way to selectively turn of backgounds on for example chapter
pages?
  
   \setuphead
 [chapter]
  
  [%before={\blank[force,\dimexpr\headerheight+\headerdistance\relax]},
  header=high]
  
   \setupbackgrounds[header][text][frame=on]
  
   \starttext
  
   \dorecurse{4}
 {\chapter{Knuth}
  \dorecurse{12}
{\input knuth\par}}
  
   \stoptext
 
  Beautifull. One problem arise, if you put a \placecontent after \starttext
  the first chapter will stil have the frame on.

 do you mean

 \starttext
 \placecontent
 \chapter{Knuth}
 \stoptext

 I see only a frame on the first page with the table of contents and
 this normal because there is no chapter on this page.

 use \completecontent and not \placecontent

 if this is not what you mean send a example

\completecontent seems to solve my problem so far... To see  what my
problem was  try out the following example:

\setuplayout[location=middle,
 header=\lineheight,
 headerdistance=\lineheight]

\setuppagenumbering [alternative=doublesided,location=]

\setupheadertexts   [section][pagenumber]
[pagenumber][chapter]

\setuphead
 [chapter]
 [%before={\talkingk[force,\dimexpr\headerheight+\headerdistance\relax]},
  header=high]

\setupbackgrounds   [header][text][frame=off,bottomframe=on]

\starttext

\placecontent
%\completecontent

\dorecurse{3}
{\chapter{Test}
\dorecurse{250}{talking talking talking }
}

\stoptext
___
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] fancyhdr equivalent

2007-07-02 Thread Wolfgang Schuster
2007/7/2, Peter I. Hansen [EMAIL PROTECTED]:

 \completecontent seems to solve my problem so far... To see  what my
 problem was  try out the following example:

 \setuplayout[location=middle,
  header=\lineheight,
  headerdistance=\lineheight]

 \setuppagenumbering [alternative=doublesided,location=]

 \setupheadertexts   [section][pagenumber]
 [pagenumber][chapter]

 \setuphead
  [chapter]
  [%before={\talkingk[force,\dimexpr\headerheight+\headerdistance\relax]},
   header=high]

 \setupbackgrounds   [header][text][frame=off,bottomframe=on]

 \starttext

 \placecontent
 %\completecontent

 \dorecurse{3}
 {\chapter{Test}
 \dorecurse{250}{talking talking talking }
 }

 \stoptext


I see a rule on page 1, 2, 4, 6 and 8, no rules are on page 3, 5 and 7.

All of them are correct and what I expect from your setups.
I am correct you don't want the rule on the first page.

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] fancyhdr equivalent

2007-07-02 Thread Peter I. Hansen

On 7/2/07, Peter I. Hansen [EMAIL PROTECTED] wrote:


On 7/2/07, Wolfgang Schuster [EMAIL PROTECTED] wrote:
 2007/7/2, Peter I. Hansen [EMAIL PROTECTED]:
  On 7/2/07, Wolfgang Schuster
  [EMAIL PROTECTED] wrote:
 
   2007/7/2, Peter I. Hansen [EMAIL PROTECTED]:
Thanks, this works for me. One thing though, I would like to turn
the
framing off on pages where a chapter begins. I tried
\setuphead[chapter][header=empty], but this just gives
  me
an empty frame.
 Is there a way to selectively turn of backgounds on for example
chapter
pages?
  
   \setuphead
 [chapter]
  
  [%before={\blank[force,\dimexpr\headerheight+\headerdistance\relax]},
  header=high]
  
   \setupbackgrounds[header][text][frame=on]
  
   \starttext
  
   \dorecurse{4}
 {\chapter{Knuth}
  \dorecurse{12}
{\input knuth\par}}
  
   \stoptext
 
  Beautifull. One problem arise, if you put a \placecontent after
\starttext
  the first chapter will stil have the frame on.

 do you mean

 \starttext
 \placecontent
 \chapter{Knuth}
 \stoptext

 I see only a frame on the first page with the table of contents and
 this normal because there is no chapter on this page.

 use \completecontent and not \placecontent

 if this is not what you mean send a example

\completecontent seems to solve my problem so far... To see  what my
problem was  try out the following example:

\setuplayout[location=middle,
 header=\lineheight,
 headerdistance=\lineheight]

\setuppagenumbering [alternative=doublesided,location=]

\setupheadertexts   [section][pagenumber]
[pagenumber][chapter]

\setuphead
[chapter]
[%before={\talkingk[force,\dimexpr\headerheight+\headerdistance\relax]},
  header=high]

\setupbackgrounds   [header][text][frame=off,bottomframe=on]

\starttext

\placecontent
%\completecontent

\dorecurse{3}
{\chapter{Test}
\dorecurse{250}{talking talking talking }
}

\stoptext



Actually, if I add something before the content, eg.
\subject{Preface}\page[yes] then things go bad again... There is something
about this I can't grasp.
___
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] fancyhdr equivalent

2007-07-02 Thread Wolfgang Schuster
2007/7/2, Peter I. Hansen [EMAIL PROTECTED]:
 On 7/2/07, Peter I. Hansen [EMAIL PROTECTED] wrote:
  On 7/2/07, Wolfgang Schuster
 [EMAIL PROTECTED] wrote:
   2007/7/2, Peter I. Hansen [EMAIL PROTECTED] :
On 7/2/07, Wolfgang Schuster
[EMAIL PROTECTED] wrote:
   
 2007/7/2, Peter I. Hansen  [EMAIL PROTECTED]:
  Thanks, this works for me. One thing though, I would like to turn
 the
  framing off on pages where a chapter begins. I tried
  \setuphead[chapter][header=empty], but this just
 gives
me
  an empty frame.
   Is there a way to selectively turn of backgounds on for example
 chapter
  pages?

 \setuphead
   [chapter]

   
 [%before={\blank[force,\dimexpr\headerheight+\headerdistance\relax]},
header=high]

 \setupbackgrounds[header][text][frame=on]

 \starttext

 \dorecurse{4}
   {\chapter{Knuth}
\dorecurse{12}
  {\input knuth\par}}

 \stoptext
   
Beautifull. One problem arise, if you put a \placecontent after
 \starttext
the first chapter will stil have the frame on.
  
   do you mean
  
   \starttext
   \placecontent
   \chapter{Knuth}
   \stoptext
  
   I see only a frame on the first page with the table of contents and
   this normal because there is no chapter on this page.
  
   use \completecontent and not \placecontent
  
   if this is not what you mean send a example
 
  \completecontent seems to solve my problem so far... To see  what my
  problem was  try out the following example:
 
  \setuplayout[location=middle,
   header=\lineheight,
 
 headerdistance=\lineheight]
 
  \setuppagenumbering [alternative=doublesided,location=]
 
  \setupheadertexts   [section][pagenumber]
  [pagenumber][chapter]
 
  \setuphead
  [chapter]
 
 [%before={\talkingk[force,\dimexpr\headerheight+\headerdistance\relax]},
header=high]
 
  \setupbackgrounds
 [header][text][frame=off,bottomframe=on]
 
  \starttext
 
  \placecontent
  %\completecontent
 
  \dorecurse{3}
  {\chapter{Test}
  \dorecurse{250}{talking talking talking }
  }
 
  \stoptext
 

 Actually, if I add something before the content, eg.
 \subject{Preface}\page[yes] then things go bad again... There is something
 about this I can't grasp.

Can you send the pdf file and explain what is wrong in the output

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] fancyhdr equivalent

2007-07-01 Thread Aditya Mahajan
On Sun, 1 Jul 2007, Peter I. Hansen wrote:

 Hello

 Just getting started with ConTeXt, and liking it so far :)

 However, I would like to use something similar to the LaTeX 'fancyhdr'
 package. I've been poking around trying to find such a thing and the closest
 I could get is:

 http://osdir.com/ml/tex.context/2001-10/msg00094.html

 I can't find it in the manual, so if it is built in maybe one of you guys
 can tell how to use it?

Look at Section 4.17 of ConTeXt manual 
http://www.pragma-ade.com/general/manuals/cont-enp.pdf

Aditya
___
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] fancyhdr equivalent

2007-07-01 Thread Peter I. Hansen

On 7/1/07, Aditya Mahajan [EMAIL PROTECTED] wrote:


On Sun, 1 Jul 2007, Peter I. Hansen wrote:

 Hello

 Just getting started with ConTeXt, and liking it so far :)

 However, I would like to use something similar to the LaTeX 'fancyhdr'
 package. I've been poking around trying to find such a thing and the
closest
 I could get is:

 http://osdir.com/ml/tex.context/2001-10/msg00094.html

 I can't find it in the manual, so if it is built in maybe one of you
guys
 can tell how to use it?

Look at Section 4.17 of ConTeXt manual
http://www.pragma-ade.com/general/manuals/cont-enp.pdf



What I would like to do is for example to frame the headertext, and I tried
with eg.

\setupheadertexts  [chapter][pagenumber]
\setupheader [style=\inframed]

But this creates a framed chapter text and a framed pagenumber. How do I put
both in one frame?
___
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] fancyhdr equivalent

2007-07-01 Thread Aditya Mahajan
On Mon, 2 Jul 2007, Peter I. Hansen wrote:

 On 7/1/07, Aditya Mahajan [EMAIL PROTECTED] wrote:
 
 On Sun, 1 Jul 2007, Peter I. Hansen wrote:
 
  Hello
 
  Just getting started with ConTeXt, and liking it so far :)
 
  However, I would like to use something similar to the LaTeX 'fancyhdr'
  package. I've been poking around trying to find such a thing and the
 closest
  I could get is:
 
  http://osdir.com/ml/tex.context/2001-10/msg00094.html
 
  I can't find it in the manual, so if it is built in maybe one of you
 guys
  can tell how to use it?
 
 Look at Section 4.17 of ConTeXt manual
 http://www.pragma-ade.com/general/manuals/cont-enp.pdf


 What I would like to do is for example to frame the headertext, and I tried
 with eg.

 \setupheadertexts  [chapter][pagenumber]
 \setupheader [style=\inframed]

 But this creates a framed chapter text and a framed pagenumber. How do I put
 both in one frame?


\setupbackgrounds  [header][text][frame=on]

To get a decent visual effect, you need to set the header height to be 
something reasonable, for example

\setuplayout[header=2\lineheight]

Aditya
___
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
___