[NTG-context] \stretched in chapter titles in MKII

Wolfgang Schuster schuster.wolfgang at googlemail.com
Tue Feb 22 09:39:42 CET 2011


Am 22.02.2011 um 01:18 schrieb Tom:

> The code that follows works fine in MKII but doesn't stretch the chapter
> title in MKIV. What must I change? Also, I want to convert the chapter
> number to text before stretching it. Has anything been done to the routines
> that convert numerals to alpha characters since last summer?

Use \structuretitle and \structurenumber to access the values.

\defineconversion [tom] [One,Two,Three,Four,Five,…]

\define[1]\ChapterTextCommand
  {\line{\expanded{\stretched{\structuretitle}}}}

\define[1]\ChapterNumberCommand
  {\line{\expanded{\stretched{Chapter \convertnumber{tom}{\structurenumber}}}}}

\setuphead
  [chapter]
  [  alternative=middle,
           style=\ssc,
       textstyle=\bf,
     numberstyle=\tf,
     textcommand=\ChapterTextCommand,
   numbercommand=\ChapterNumberCommand]

\starttext
\chapter{Test Chapter Title}
\input knuth
\stoptext

Wolfgang



More information about the ntg-context mailing list