# [NTG-context] conditional evaluation and section names

Tue Feb 15 19:12:51 CET 2011

Am 15.02.2011 um 09:11 schrieb Daniel Lyons:

> Hi again,
>
> I have this in my environment
>
> \startsetups[sectioninfo]
> \ss
>  \rlap{\userpagenumber}
>  \hfill
>  § \getmarking[sectionnumber][current]
>  \emspace
>  \bf \getmarking[section][current]
>  \hfill
>  \llap{}
> \stopsetups
>
>                 []                    [\setups{sectioninfo}]
>
> This seems to be working, but there are a couple improvements I'd like to make and I'm not quite sure where to start:
>
> 1. If I'm in a later chapter than the current section is defined in, it shows up anyway. I'd like to prevent that.
> 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!

Wolfgang