Hi Thomas,

You know more about XML processing than I do, but how does your project
setup look like?

I imagine you should be able to keep track of the footnotes in a lua table
(just like shown in the xml-mkiv manual) and place them manually with
\placefootnotes where you want.

Something like this:

\setupfootnotes[location=text]
\starttext

\xmlprocessfile{whatever}{chapter1.xml}
\xmlprocessfile{whatever}{chapter2.xml}
\placefootnotes

\stoptext

But, this won't help you with the backreferences... But maybe with a custom
command you could place the pagereference in the margin (given you have also
saved it to the lua table for the footnote definitions). Could that work?

Best,
Denis


> -----Ursprüngliche Nachricht-----
> Von: Thomas A. Schmitz <thomas.schm...@uni-bonn.de>
> Gesendet: Mittwoch, 13. August 2025 14:42
> An: ntg-context@ntg.nl
> Betreff: [NTG-context] Notes at end of book
> 
> Hi all,
> 
> I'd like some advise on the best way to approach the result I want. I'm
typesetting a
> book; the source is in xml, every chapter in its own file.
> I want my notes to appear in their own chapter at the end of the book; the
reference
> (in the margin) should be to the page number where the paragraph with the
note
> reference is found. For my work with the source files, I would prefer the
notes be
> included within the respective xml files.
> 
> The solution I have been thinking about: every note has a unique xml:id
attribute,
> ConTeXt sets a \pagereference with the value of this attribute and writes
the content
> of all notes to an external file. Then, I can retrieve the notes from this
file and include
> the page number from the \pagereference. I'm making some progress here,
but am
> not quite sure how to use \xmltofile or \xmlsave (or their Lua
counterparts lxml.tofile
> or xml.save).
> 
> I'm also wondering if I'm reinventing the wheel here. Maybe there is an
easier
> solution because notes can be postponed? I'll be grateful for any ideas!
> 
> All best
> 
> Thomas
> ___________________________________________________________________
> ________________
> If your question is of interest to others as well, please add an entry to
the Wiki!
> 
> maillist : ntg-context@ntg.nl /
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
> webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  :
> https://github.com/contextgarden/context
> wiki     : https://wiki.contextgarden.net
> ___________________________________________________________________
> ________________

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

Reply via email to