ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Joel via ntg-context <ntg-context@ntg.nl>
To: "ntg-context@ntg.nl" <ntg-context@ntg.nl>
Cc: Joel <uaru99@yahoo.com>
Subject: How can I get a section title to change depending on the section content?
Date: Sat, 29 Jan 2022 14:46:50 +0000 (UTC)	[thread overview]
Message-ID: <1577230768.1649216.1643467610308@mail.yahoo.com> (raw)
In-Reply-To: <1577230768.1649216.1643467610308.ref@mail.yahoo.com>


[-- 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
___________________________________________________________________________________

           reply	other threads:[~2022-01-29 14:46 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <1577230768.1649216.1643467610308.ref@mail.yahoo.com>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1577230768.1649216.1643467610308@mail.yahoo.com \
    --to=ntg-context@ntg.nl \
    --cc=uaru99@yahoo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).