Re: [NTG-context] \setuphead and horizontal rules

2008-10-22 Thread Andrew Ho
>> |--- 1.1 Some chapter --|
>
>\define[2]\ChapterCommand
>[...]

Thank you, this is exactly what I was looking for.

Regards,
Andrew
___
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] \setuphead and horizontal rules

2008-10-22 Thread Wolfgang Schuster
On Tue, Oct 21, 2008 at 7:00 PM, Andrew Ho <[EMAIL PROTECTED]> wrote:
> Hi,
>
> Let me prefix this first my saying that I'm new to ConTeXT, so
> apologies if there is an obvious solution to what I'm trying to do or
> I'm approaching it in the wrong way.  I'm trying to style chapter
> headings so that they are right justified, with a line before them *on
> the same line*.  In other words, the page should look like this, where
> vertical bars represent the edges of the text width:
>
> |--- 1.1 Some chapter --|
>
> Can anyone give me pointers on how to do this?  I've trawled the wiki
> and the internet at large, but an inability to precisely word this
> leaves it difficult to find any previous example of this.
>
> Many thanks,
> Andrew

\define[2]\ChapterCommand
  {\line
 {\leaders\hbox
{\vrule width 1pt height .5\strutht depth
-\dimexpr.5\strutht-\linewidth\relax}\hfill
  #1\space#2}}

\setuphead[chapter][command=\ChapterCommand]

\starttext

\chapter{Some chapter}

\stoptext


Works only for headers shorter than one line.


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
___


[NTG-context] \setuphead and horizontal rules

2008-10-21 Thread Andrew Ho
Hi,

Let me prefix this first my saying that I'm new to ConTeXT, so 
apologies if there is an obvious solution to what I'm trying to do or 
I'm approaching it in the wrong way.  I'm trying to style chapter 
headings so that they are right justified, with a line before them *on 
the same line*.  In other words, the page should look like this, where 
vertical bars represent the edges of the text width:

|--- 1.1 Some chapter --|

Can anyone give me pointers on how to do this?  I've trawled the wiki 
and the internet at large, but an inability to precisely word this 
leaves it difficult to find any previous example of this.

Many thanks,
Andrew
___
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
___