# [NTG-context] How to define a section title, after the section title appears?

Joel uaru99 at yahoo.com
Sun Jun 12 19:10:11 CEST 2022

```I have a document with conditionally-generated content.

There are some situations when I need the section title to change according to the content displayed within that section.

For instance, the 14th section that appears in *every* chapter is either called "Cause and Effect" if the conditions decide to place macros \altMa, \altMb, or \altMc inside, but becomes called "Compare and Contrast" if one of a dozen other macros are pladed there.

- The macros are defined in an entirely different macros.tex file.
- The whole document is in a recurse loop, so \recurselevel or \chaptertitleis can give the current chapter number.

I tried defining chapter titles inside the macros, `\setvalue{title\recurselevel}{Cause and Effect}`, but \getvalue{title\recurselevel}` couldn't find the defined value.
I tried just defining in each macro \define\thesectiontitleis{Compare and Contrast}, but that only affects things AFTER the macro is called, so the wrong titles appear.

How do I very simply make a section title change according to what content is inside it?
--Joel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ntg.nl/pipermail/ntg-context/attachments/20220612/dc171cd5/attachment.htm>
```