On Mon, 2005-07-11 at 17:12 +0000, John R. Culleton wrote:
I am trying to set up chapter heads a certain way and my code keeps getting uglier. Here are the specs:
1. Chapter number centered, with decorations on either side. 2. Chapter title centered below chapter number. 3. Additional decoration centered below chapter title. 4. Both number and text show up in TOC in normal Context manner.
Can this be done easily using the normal chapter macro or should I do it all from scratch? (If I roll my own I worry about getting info to the TOC.)
I am doing something like that now. Sorry the example isn't very pretty,
had to rip out parts that were specific to the font I'm using, but
should give you an idea of what you need to do.
=====
\unexpanded\def\chaptercase{\uppercase}
\def\mychapter#1#2%
{\setupframed[width=1.75in,align={right,broad},frame=off]\vbox{%
\framed{\setupbodyfont[18pt]\setupinterlinespace[height=0,depth=0]Chapter}%
\framed{\setupbodyfont[36pt]\setupinterlinespace[height=.1,depth=0]#1}%
\godown[-1ex]\framed{\setupbodyfont[24pt]\setupinterlinespace[line=2ex]#2\par}%
}}
\setuphead
[chapter]
[command=\mychapter,textcommand=\chaptercase,
textstyle=\sl,numberstyle=\bf]
\starttext
\placelist[chapter,section][criterium=all,alternative=b]
\chapter{foo}
\chapter{bar}
\stoptext
=====
--
Stuart Jansen