From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/114308 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Joel via ntg-context Newsgroups: gmane.comp.tex.context 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) Message-ID: <1577230768.1649216.1643467610308@mail.yahoo.com> References: <1577230768.1649216.1643467610308.ref@mail.yahoo.com> Reply-To: mailing list for ConTeXt users Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============4665300317286222484==" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35721"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Joel To: "ntg-context@ntg.nl" Original-X-From: ntg-context-bounces@ntg.nl Sat Jan 29 15:54:21 2022 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane-mx.org Original-Received: from zapf.boekplan.nl ([5.39.185.232] helo=zapf.ntg.nl) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nDp7N-00093I-7F for gctc-ntg-context-518@m.gmane-mx.org; Sat, 29 Jan 2022 15:54:21 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id D674F28978D; Sat, 29 Jan 2022 15:47:00 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id c37j3k8IJ6p0; Sat, 29 Jan 2022 15:46:58 +0100 (CET) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id CFE5228978F; Sat, 29 Jan 2022 15:46:58 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 4D09328978F for ; Sat, 29 Jan 2022 15:46:57 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id obwrXnL_7iqV for ; Sat, 29 Jan 2022 15:46:56 +0100 (CET) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=74.6.132.41; helo=sonic306-2.consmr.mail.bf2.yahoo.com; envelope-from=uaru99@yahoo.com; receiver= Original-Received: from sonic306-2.consmr.mail.bf2.yahoo.com (sonic306-2.consmr.mail.bf2.yahoo.com [74.6.132.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id 3E24E28978D for ; Sat, 29 Jan 2022 15:46:56 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1643467613; bh=N8WhSqR6MNoGyh4c1ceykevYmde5SBhtq+Ugsn9SVis=; h=Date:From:To:Subject:References:From:Subject:Reply-To; b=on4CnAZ5zjIag+nomaV01osT47qN8HIJ5+K7UcT3pyS/u9SkeQn8h8vr5lLm6+zQ8dOgur33XraBFMhu6LfZheSCHx64FTMwshLyE2EYIiLDg1QglbGr7l4uSWRaZ/4jy2DCYc2BQKlrBqCQ2fbzyJidyCo8FcTIHjdci1+5GTU/ZMPtb/vkjTxmeaYisTN4mH8VUGrwLY6dPD1ubAdAnc6sQpRYo7ld8I1itQZELZ/dOoWMp/KzcC7ZNsKKSiKC9cOX+k9KF6iJgtMtKsjLAv0ww/a4N+QX9L0Y0b7QB/38A6oXP6EUkdSmc3IMkV2Hrya2lhNR7wNsHb+Wi3UbGQ== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1643467613; bh=sLlQbSnC7Tp8mCIJh5lybeGvL+fN9Kz2EXMVnVt14KN=; h=X-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_uFwCXZWJ9zlcrXVMkQUrk95piN2GxmtSzGsYPNB0WxnGcI75CW z4YCrJSqXWmD1c3XKz2lV5tgWCzzHgy8.kBicYuKwRi3vKh1u89wjyV2Gtws__r0Ij0Q_Lu2_zhN qtf_eWAsdlMipUZAwelXVGfN40sDtIGP7bJPZJ9ZBL X-Sonic-MF: Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic306.consmr.mail.bf2.yahoo.com with HTTP; Sat, 29 Jan 2022 14:46:53 +0000 X-Mailer: WebService/1.1.19615 YMailNorrin X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.26 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: "ntg-context" Xref: news.gmane.io gmane.comp.tex.context:114308 Archived-At: --===============4665300317286222484== Content-Type: multipart/alternative; boundary="----=_Part_1649215_2031979621.1643467610307" ------=_Part_1649215_2031979621.1643467610307 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable I have a section somewhat like this...I'm replacing the code with something= much simpler, but its basically doing a similar thing, running conditional= s to check which content to place:=20 \section{Brave Rabbits} =C2=A0=C2=A0=C2=A0=C2=A0 \ifnum\somenumber>3=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 Print this content about rabbits.=C2=A0=C2=A0=C2=A0=C2= =A0 \else=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Print this stuff = about pigeons instead.=C2=A0=C2=A0=C2=A0=C2=A0 \fi Basically the content inside that section can change, either being about ra= bbits 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 va= riable 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} =C2=A0=C2=A0=C2=A0=C2=A0 \ifnum\somenumber>3=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 Print this content about rabbits.=C2=A0=C2=A0 =C2=A0 =C2= =A0 =C2=A0 \define\thissectiontitle{Brave Rabbits}=C2=A0=C2=A0=C2=A0=C2=A0 = \else=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Print this stuff abou= t pigeons instead.=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 \define\= thissectiontitle{Hungry Pigeons}=C2=A0=C2=A0=C2=A0=C2=A0 \fi --Joel ------=_Part_1649215_2031979621.1643467610307 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit
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

------=_Part_1649215_2031979621.1643467610307-- --===============4665300317286222484== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly9jb250ZXh0LmFhbmhldC5uZXQKYXJjaGl2ZSAgOiBodHRwczovL2JpdGJ1Y2tldC5v cmcvcGhnL2NvbnRleHQtbWlycm9yL2NvbW1pdHMvCndpa2kgICAgIDogaHR0cDovL2NvbnRleHRn YXJkZW4ubmV0Cl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCg== --===============4665300317286222484==--