On 30 May 2024, at 23:25, Gerion Entrup
wrote: Am Donnerstag, 30. Mai 2024, 18:49:08 MESZ schrieb Bruce Horrocks:
On 30 May 2024, at 15:15, Gerion Entrup
wrote: Let's begin with a minimal example: ``` \define[2]\MyChapter{% #1 #2: \structureuservariable{subtitle} (\structureuservariable{intro}) }
Stop there!
Use \definehead to create your own variation of a heading - much more robust. Something like the following (untested):
\startsetups PlaceSubTitleAndIntro % Set font and and style etc for the subtitle here \structureuservariable(subtitle)
% Set font and style etc for the intro text here \structureuservariable(intro) \stopsetups
\definehead [MyChapter] [chapter] \setuphead [MyChapter] [ style={...}, % heading style after={\setup{PlaceSubTitleAndIntro}}, ]
\starttext \startMyChapter[title={Foo}] [ subtitle={Bar}, intro={Some explanation}, ] The text of the chapter \stopMyChapter \stoptext
Thanks for the input. A comparable example is also listed in the wiki. I like the approach for placing subtitle and intro alone. However, I also want to style chapter number and chapter title separately.
Any setuphead commands that apply to MyChapter also apply to chapter so you should be able to use exactly the same styling commands.
I'm also not sure, if an extra heading (MyChapter) is needed, since all my chapters are styled in this way. Isn't it possible to define "after" of chapter directly?
Yes, I think it is possible to just use \setuphead [chapter] instead of \setuphead [MyChapter] with the rest remaining the same. The only reason I don't do it is that if something goes wrong, I know I have an original version of \chapter readily to hand to compare against for debugging. Regards, — Bruce Horrocks Hampshire, UK