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.
Am 25.01.2009 um 00:49 schrieb Alfredo Catalina:
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]
\definebodyfont[10pt,11pt,12pt][ss][tfe=Sans 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}
{\tfc \sc {C~h~a~p~t~e~r}} ~~ {#1}\\ \hairline {#2}
} } \egroup }
\starttext \setuphead[chapter] [command=\HeadTitle]
\setuphead[chapter] [command=\HeadTitle,numberstyle=\tff,textstyle=\ss \tfe]
\chapter{An Insight\\Into Fred's Design} \stoptext
Wolfgang
participants (2)
-
Alfredo Catalina
-
Wolfgang Schuster