ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* How can I get a section title to change depending on the section content?
       [not found] <1577230768.1649216.1643467610308.ref@mail.yahoo.com>
@ 2022-01-29 14:46 ` Joel via ntg-context
  0 siblings, 0 replies; only message in thread
From: Joel via ntg-context @ 2022-01-29 14:46 UTC (permalink / raw)
  To: ntg-context; +Cc: Joel


[-- Attachment #1.1: Type: text/plain, Size: 1093 bytes --]

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?
\section{\thissectiontitle}
     \ifnum\somenumber>3         Print this content about rabbits.         \define\thissectiontitle{Brave Rabbits}     \else         Print this stuff about pigeons instead.         \define\thissectiontitle{Hungry Pigeons}     \fi
--Joel

[-- Attachment #1.2: Type: text/html, Size: 1881 bytes --]

[-- Attachment #2: Type: text/plain, Size: 493 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-01-29 14:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1577230768.1649216.1643467610308.ref@mail.yahoo.com>
2022-01-29 14:46 ` How can I get a section title to change depending on the section content? Joel via ntg-context

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).