Thanks for this. I'll look into it.
-----Ursprüngliche Nachricht----- Von: ntg-context
Im Auftrag von Rik Kabel Gesendet: Mittwoch, 30. Juni 2021 21:40 An: ntg-context@ntg.nl Betreff: Re: [NTG-context] Heading for endnotes / grouped by chapter endnotes For what its worth, I offer my endnote apparatus with updates for parts. It uses the standard note/notation mechanism, not a list, for endnotes. Perhaps it can be further adapted to the needs of this thread.
There is at least one small issue with it: I have to use \stopendnote even though I define \startEndnote. This causes issues with the linter (mtxrun --script check <fn>) but seems otherwise harmless.
I am sure that others more versed in ConTeXt can find some ways to fix this and improve the overall approach. I welcome suggestions.
%------------------------------------------------------------------% % Endnote apparatus adapted for parts % \mainlanguage [en] \language [en] \setupinteraction [state=start] \setuppagenumbering[alternative=doublesided]
\setupheadertexts [{\it\getmarking[part]}][{\it\getmarking[section]}] [{\it\getmarking[chapter]}][{\it\getmarking[part]}] \setupheads [number=no] \setuphead [part] [placehead=yes, header=empty]
%------------------------- footnote setup -------------------------% % footnotes uses asterisk, dagger, ddagger... so that endnotes % and pagenotes have separate sequences. Change way= to suit % your footnote frequency
\setupnotation [footnote] [numberconversion=set 2, way=chapter]
%------------------------- endnote setup --------------------------% % endnotes use numeric indices, reset by part
\setupnote [endnote][ textseparator={,}, textstyle=\high{\small\hairspace}, location=none, bodyfont=]
\setupnotation [endnote] [headstyle=\small, way=bypart, numbercommand=, after={\blank[halfline]}]
%--------------------- endnote pages setup ------------------------%
\definemarking [notePage]
\startsetups [noteHeadingsText] {\em Notes for page \doifelse{\fetchmark[notePage][top]}{\fetchmark[notePage][bottom]} { \getmarking[notePage][top]} {s \getmarking[notePage][top]–\getmarking[notePage][bottom]}} \stopsetups
\starttexdefinition unexpanded startEndnote \dosingleempty\doStartEndnote \stoptexdefinition
\starttexdefinition doStartEndnote [#1] \expanded{\dodoStartEndnote[#1][{\rawcountervalue[userpage]}]} \stoptexdefinition
\starttexdefinition dodoStartEndnote [#1][#2] \startendnote[#1] \marking[notePage]{#2}\removeunwantedspaces \stoptexdefinition
\starttexdefinition endnoteChapter \startchapter [title=Notes] \setupheadertexts[{\it\getmarking[part]}][\setups{noteHeadingsText}] [\setups{noteHeadingsText}][{\it\getmarking[part]}] \placenotes [endnote] \page \setupheadertexts[{\it\getmarking[part]}][{\it\getmarking[section]}] [{\it\getmarking[chapter]}][part] \stopchapter \stoptexdefinition
%------------------------------------------------------------------%
\starttext
\completecontent
\startpart[title=Part 1] \dorecurse{3}{ \startchapter[title=Chapter #1] If a man wants to read good books, he must make a point of avoiding bad ones; for life is short, and time and energy limited. \startfootnote T.\,Baily Saunders’ translation, in his 1891 {\em The Art of Literature}, of part of one of Arthur Schopenhauer’s essays. \stopfootnote \startEndnote {\language[deo]% Um das Gute zu lesen, ist eine Bedingung, dass man das Schlechte nicht lese: denn das Leben ist kurz, Zeit und Kräfte beschränkt.} \stopendnote
\dorecurse{6}{ \startsection[title=Section ##1] This followed by:
{\it Repetitio est mater studiorum}. Any book that is at all important ought to be at once read through twice; partly because, on a second reading, the connection of the different portions of the book will be better understood, and the beginning comprehended only when the end is known; and partly because we are not in the same temper and disposition on both readings. On the second perusal we get a new view of every passage and a different impression of the whole book, which then appears in another light. \startEndnote {\language[deo]% Repetitio est mater studiorum. Jedes irgend wichtige Buch soll man sogleich zwei Mal lesen, theils weil man die Sachen das zweite Mal in ihrem Zusammenhange besser begreift und den Anfang erst recht versteht, wenn man das Ende kennt; theils weil man zu jeder Stelle das zweite Mal eine andere Stimmung mit bringt, als beim ersten, wodurch der Eindruct verschieden ausfällt und es ist, wie wenn man einen Gegenstand in anderer Beleuchtung sieht.} \stopendnote \stopsection } \stopchapter } \endnoteChapter \stoppart \startpart[title=Part 2] \dorecurse{3}{ \startchapter[title=Chapter #1] If a man wants to read good books, he must make a point of avoiding bad ones; for life is short, and time and energy limited. \startfootnote T.\,Baily Saunders’ translation, in his 1891 {\em The Art of Literature}, of part of one of Arthur Schopenhauer’s essays. \stopfootnote \startEndnote {\language[deo]% Um das Gute zu lesen, ist eine Bedingung, dass man das Schlechte nicht lese: denn das Leben ist kurz, Zeit und Kräfte beschränkt.} \stopendnote
\dorecurse{6}{ \startsection[title=Section ##1] This followed by:
{\it Repetitio est mater studiorum}. Any book that is at all important ought to be at once read through twice; partly because, on a second reading, the connection of the different portions of the book will be better understood, and the beginning comprehended only when the end is known; and partly because we are not in the same temper and disposition on both readings. On the second perusal we get a new view of every passage and a different impression of the whole book, which then appears in another light. \startEndnote {\language[deo]% Repetitio est mater studiorum. Jedes irgend wichtige Buch soll man sogleich zwei Mal lesen, theils weil man die Sachen das zweite Mal in ihrem Zusammenhange besser begreift und den Anfang erst recht versteht, wenn man das Ende kennt; theils weil man zu jeder Stelle das zweite Mal eine andere Stimmung mit bringt, als beim ersten, wodurch der Eindruct verschieden ausfällt und es ist, wie wenn man einen Gegenstand in anderer Beleuchtung sieht.} \stopendnote \stopsection } \stopchapter } \endnoteChapter \stoppart
\stoptext %------------------------------------------------------------------%
-- Rik
________________________________________________________________ ___________________ 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 ________________________________________________________________ ___________________