Henning Hraban Ramm schrieb am 13.01.2020 um 19:21:
Am 2020-01-12 um 16:07 schrieb Henning Hraban Ramm <te...@fiee.net>:
Since the structureuservariables of a section aren’t defined in that section’s
"before", I would need a macro or buffer to define the contents of that
epigraph page, like this:
That’s possible, but ugly. I would really like to set those quotes and image
names in the chapter command.
Finally I used the after parameter and needed to define different section
commands for chapters with and without epigraph (i.e. starting on a left or
right page). When I had that distinction and the \page command in my setup, the
header text changed too early.
\definedataset[chapter]
\startsetups[chapter:leftpage]
\page[left]
\doglobal\increment\ChapterData
\doifsomething{\datasetvariable{chapter}{\ChapterData}{subtitle}}
{
\starttabulate
\NC Title \EQ
\datasetvariable{chapter}{\ChapterData}{title} \NC\NR
\NC Subtitle \EQ
\datasetvariable{chapter}{\ChapterData}{subtitle} \NC\NR
\stoptabulate
}
\page[right]
\stopsetups
\startsetups[chapter:savedata]
\setdataset
[chapter]
[\ChapterData]
[ title=\structurevariable{title},
subtitle=\structureuservariable{subtitle}]
\stopsetups
\setuphead
[chapter]
[page=,
beforesection=\directsetup{chapter:leftpage},
insidesection=\directsetup{chapter:savedata}]
\setuppagenumbering[alternative=doublesided]
\starttext
\startchapter[title={My Normal Text}]
\input knuth
\stopchapter
\startchapter[title={My Fancy Story}][subtitle={I thought that was real.}]
\input tufte
\stopchapter
\startchapter[title={Another Fancy Story}][subtitle={Never mind the
bollocks.}]
\input zapf
\stopchapter
\startchapter[title={Another Normal Text}]
\input knuth
\stopchapter
\stoptext
Wolfgang
___________________________________________________________________________________
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
___________________________________________________________________________________