[NTG-context] Placing a section ending depending on odd/even sectionnumber

Wolfgang Schuster wolfgang.schuster.lists at gmail.com
Tue Aug 4 19:46:36 CEST 2020

Willi Egger schrieb am 04.08.2020 um 18:56:
> Hi,
> now I have another hurdle to be taken :-) — Depending on the odd or even number of the section I have to place an ornament at the end of the section.
> I have sofar the following setup:
> [...]
> However the the evaluation of the sectionnumber results always in “false”, having therefore always odd as a sectionending.

You have two problem:

1. To get the current value for \currentheadnumber you have use 
\determineheadnumber[section] before you use it but the example below 
shows a better method.

2. What you do with \doifelse{...}{even} is to compare the numeric value 
of the section with the string "even" which is always false. To check 
whether the value is odd or even you have to use the \ifodd command.

> What to change in order to get the desired result?

%%%% begin example
\startsetups [section:odd]
   \bold {End of odd numbered section}

\startsetups [section:even]
   \bold {End of even numbered section}

\startsetups [section:end]



\input ward


\input knuth

%%%% end example


More information about the ntg-context mailing list