I am new to ConTeXt. I am trying to define a customized head for chapters
but I am finding some problems. The sentences below are based on the chapter
Text Elements which may be found in the ConTeXt manual.

Prior to setting up the title, a new Head command is defined
by \def\HeadTitle#1#2%. It takes two arguments, the chapter number and the
chapter title. The Head so defined will show the word "C h a p t e r" in
capitals, then the chapter number at 80pt, then a horizontal line, and
finally the title.

The definition works quite well except that both, the chapter number and the
chapter title, are not show at the specified font size.

\definebodyfont[10pt,11pt,12pt][rm][tff=Regular at 80pt]
\definebodyfont[10pt,11pt,12pt][rm][tfe=Regular at 42pt]

\def\HeadTitle#1#2%
    {\hbox to \hsize \bgroup
        {\hfill %
        \setupframed[height=7cm,offset=.5em,frame=off]
         \framed[width=9cm,align=left]
            {
                {\tfc \sc {C~h~a~p~t~e~r}} ~~ {\tff #1}\\
                \hairline
                {\ss \tfe #2}
            }
        }
        \egroup
    }
\starttext
\setuphead[chapter] [command=\HeadTitle]
\chapter{An Insight\\Into Fred's Design}
\stoptext

An easy workaround for the chapter number replaces the argument #1 by
\currentheadnumber

\def\HeadTitle#1#2%
    {\hbox to \hsize \bgroup
        {\hfill %
        \setupframed[height=7cm,offset=.5em,frame=off]
         \framed[width=9cm,align=left]
            {
                {\tfc \sc {C~h~a~p~t~e~r}} ~~ {\tff #1}\\
                \hairline
                {\ss \tfe #2}
            }
        }
        \egroup
    }

Now the chapter number is shown at 80pt as defined. But I have not found the
way to solve the problem with the head title, #2. ¿Any ideas?

Thanks in advance.
Alfredo.
___________________________________________________________________________________
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