On Thu, Nov 13, 2008 at 7:18 AM, Bart C. Wise
<[EMAIL PROTECTED]> wrote:
> Wolfgang,  thanks so much for your help so far.
>
> I was able to take the code and make it work correctly to stretch the chapter
> title.  What I want is two lines for a chapter head.  For example,
> Line 1: "Chapter One"
> Line 2: "Title for Chap 1"
>
> I want line 1 to be stretched.  Everything I have tried does not work.  I can
> get the "Chapter" word to stretch, but not the whole line (and it should
> probably be treated as a whole line when stretching).  I was never able to get
> the chapter number (now a word) to stretch.
>
> So how do I grab the output for line 1 and then stretch it?
>
> Here's a sample of what I have without any stretching:
>
> \def\Myheader#1#2{%
>    \framedtext[width=0.60\textwidth, frame=off, align=middle]{%
>        \vbox{\headtext{chapter}~#1 \blank #2}}}
>
> \def\englishnumbers#1{
>    \ifcase#1 \or ONE\or TWO\or THREE\or FOUR\or FIVE\fi}
> \defineconversion[englishnumbers][\englishnumbers]
>
> \setupsection[chapter][conversion=englishnumbers]
> \setuphead [chapter][
>    command=\Myheader,
>    textcommand=\bfd,
> ]
> \setupheadtext[chapter=CHAPTER] % used by \headtext
> \starttext
> \chapter{Title for Chap 1}
> \processfile{tufte}
> \stoptext

\def\Myheader#1#2%
 {\framed
    [width=0.60\textwidth,
    frame=off,
    align=middle]
    {\determineheadnumber[chapter]
     
\expanded{\stretchednormalcase{CHAPTER~\convertnumber{englishnumbers}{\currentheadnumber}}}
     \blank#2}}

\def\englishnumbers#1{
  \ifcase#1 \or ONE\or TWO\or THREE\or FOUR\or FIVE\fi}

\defineconversion[englishnumbers][\englishnumbers]

\setuphead
 [chapter]
 [command=\Myheader,
  deeptextcommand=\stretchednormalcase,
  textstyle=\bfd]

> P.S. If there's a better way to do the number->word conversion, let me know.

Search for \numprint in the list archive.

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 via email to