[NTG-context] How can I get a section title to change depending on the section content?

Joel uaru99 at yahoo.com
Sat Jan 29 15:46:50 CET 2022

I have a section somewhat like this...I'm replacing the code with something much simpler, but its basically doing a similar thing, running conditionals to check which content to place: 
\section{Brave Rabbits}
     \ifnum\somenumber>3         Print this content about rabbits.     \else         Print this stuff about pigeons instead.     \fi
Basically the content inside that section can change, either being about rabbits or about pigeons. I need the section title to follow that change, the problem is the section title appears before this code, so defining some variable in the later code won't affect the rendeiring of the section title.
Is there a way I can tell the section title to change as well to match what content is inside that section?
     \ifnum\somenumber>3         Print this content about rabbits.         \define\thissectiontitle{Brave Rabbits}     \else         Print this stuff about pigeons instead.         \define\thissectiontitle{Hungry Pigeons}     \fi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ntg.nl/pipermail/ntg-context/attachments/20220129/2ef019a2/attachment.htm>

More information about the ntg-context mailing list