[NTG-context] conditional evaluation and section names

Wolfgang Schuster schuster.wolfgang at googlemail.com
Tue Feb 15 20:05:40 CET 2011


Am 15.02.2011 um 19:53 schrieb Daniel Lyons:

> On Tue, Feb 15, 2011 at 07:12:51PM +0100, Wolfgang Schuster wrote:
>>> 2. If I'm in a chapter that doesn't have sections, I'd like the chapter name to show up instead (without the §).
>>> 
>>> I'm not sure at all how to go about doing this. I suspect the answer is to use plain TeX but I don't understand TeX's conditional system well enough to figure out how to make it work (nor ConTeXt's marking system). If anyone can help, I'd greatly appreciate it!
>> 
>> Make a *complete* minimal example!
> 
> OK, for #2:
> 
> 
> \startsetups[sectioninfo]
> § \getmarking[sectionnumber]
> \stopsetups

\startsetups[sectioninfo]
\doiftextelse{\getmarking[sectionnumber]}
  {§ \getmarking[sectionnumber]}
  {\unknown}
\stopsetups

Wolfgang



More information about the ntg-context mailing list