Forum How do I...?

Formatting Footnotes with the Same Content on the Same Page Versus Multiple Pages

chazelwood
We are attempting to develop a way to format footnotes so that if a footnote with the same content is repeated, then the footnote is not duplicated in the footnote section at the bottom of the page. If an additional footnote reference appears on an additional page, then the footnote needs to be duplicated in that page's footnote section.

Is there an existing method or way to program this approach into Prince? I had considered manipulating the DOM beforehand, then I realized I could not determine what page a footnote was on. Any help or link to others who have solved this is appreciated!

Edited by chazelwood

mikeday
Unfortunately this will not be simple, the only way to do such a thing at present would require a considerable amount of JavaScript work to detect the repeated footnotes and re-run Prince with adjusted styling until they are all gone.
chazelwood
Thanks, Mike. From a high level, how do I go about checking Prince's first output to determine how to format them before going back in the ring for a second round?
mikeday
This would require setting an oncomplete event handler and inspecting the box tree for the footnote elements to see which page they ended up on, there are some examples here:

https://www.princexml.com/doc-prince/#two-pass
https://www.princexml.com/forum/topic/3516/changebars