Am Donnerstag, 6. Juni 2024, 16:34:03 MESZ schrieb Wolfgang Schuster:
\startsetups [userdata:extract] \startnarrower \setupindenting[next] \getuserdata \hairline \dontleavehmode\wordright{\itx\userdataparameter{author}} \stopnarrower \stopsetups
\defineuserdataalternative [extract] [renderingsetup=userdata:extract]
\defineuserdata [extract] [style=italic, alternative=extract]
\starttext
\startextract[author=René Descartes] Cogito ergo sum. \stopextract
\stoptext
Wolfgang
I tried to combine this with the code of the mail thread: "setuphead in connection with the command argument" but had not luck. ConTeXt always stops with: ``` close source > level 1, order 2, name './mwe.tex' tex error > runaway error: end of file encountered mtx-context | fatal error: return code: 1 ``` Here is the MWE: ``` \startsetups [userdata:extract] \getuserdata \hairline \itx\userdataparameter{author} \stopsetups % original definition (also does not work) % \startsetups [userdata:extract] % \startnarrower % \setupindenting[next] % \getuserdata % \hairline % \dontleavehmode\wordright{\itx\userdataparameter{author}} % \stopnarrower % \stopsetups \defineuserdataalternative [extract] [renderingsetup=userdata:extract] \defineuserdata [extract] [style=italic, alternative=extract] \defineframed[chapter_frame][ width=\textwidth, align=flushright, offset=0pt, rulethickness=0pt ] \startsetups[my_chapter] \startlocalheadsetup \startframed[chapter_frame] \blank[2cm] \startfont[Serif sa 8] \color[darkgray]{\headnumbercontent} \stopfont \blank[5mm] \startfont[SerifBold sa 2] \color[m-indigo-800]{\headtextcontent} \stopfont \blank[1cm] \startfont[SerifBold sa 1.5] \color[m-indigo-800]{\structureuservariable{subtitle}} \stopfont \blank[3cm] \startextract[author={\structureuservariable{quoteauthor}}] \structureuservariable{quote} \stopextract \stopframed \stoplocalheadsetup \stopsetups \defineheadalternative[chap][renderingsetup=my_chapter] \setuphead[title, chapter][ alternative=chap, after={\page[yes]}, sectionsegments=2:2, header=high, footer=high, style= ] \starttext % embedded startextract into startchapter does not work \startchapter[title=Foo][subtitle=bla, quoteauthor={René Descartes}, quote={% Cogito ergo sum. }] \stopchapter \startextract[author=René Descartes] Cogito ergo sum. \stopextract \stoptext ``` I also tried to combine it less interleaved, but it fails with the same error: ``` \startsetups [userdata:extract] \getuserdata \hairline \itx\userdataparameter{author} \stopsetups % original definition (also does not work) % \startsetups [userdata:extract] % \startnarrower % \setupindenting[next] % \getuserdata % \hairline % \dontleavehmode\wordright{\itx\userdataparameter{author}} % \stopnarrower % \stopsetups \defineuserdataalternative [extract] [renderingsetup=userdata:extract] \defineuserdata [extract] [style=italic, alternative=extract] \defineframed[chapter_frame][ width=\textwidth, align=flushright, offset=0pt, rulethickness=0pt ] \defineframed[chapter_quote][ width=\textwidth, align=flushright, offset=0pt, rulethickness=0pt ] \startsetups[my_chapter] \startlocalheadsetup \startframed[chapter_frame] \blank[2cm] \startfont[Serif sa 8] \color[darkgray]{\headnumbercontent} \stopfont \blank[5mm] \startfont[SerifBold sa 2] \color[m-indigo-800]{\headtextcontent} \stopfont \blank[1cm] \startfont[SerifBold sa 1.5] \color[m-indigo-800]{\structureuservariable{subtitle}} \stopfont \blank[3cm] \startframed[chapter_quote] \structureuservariable{quote} \stopframed \stopframed \stoplocalheadsetup \stopsetups \defineheadalternative[chap][renderingsetup=my_chapter] \setuphead[title, chapter][ alternative=chap, after={\page[yes]}, sectionsegments=2:2, header=high, footer=high, style= ] \starttext % embedded startextract into startchapter does not work \startchapter[title=Foo][subtitle=bla, quote={% \startextract[author=René Descartes] Cogito ergo sum. \stopextract }] \stopchapter \startchapter[title=Foo][subtitle=bla, quote={bla}] \startextract[author=René Descartes] Cogito ergo sum. \stopextract \stopchapter \stoptext ``` Do you know where the problem is? Gerion