On Tue, Feb 25, 2014, Pierre-Jean wrote: > But, to effectively use the paragraph at once adjustment, one > need to patch the macro sets (or create some new ones). > Because of the architecture of troff, things are done this > way: > - when troff format the paragraph at once, it also > deal with diversion (and footnotes) inside it. > - then it output the formated paragraph, and deal with > break page and traps. > - The problem is that the diversion containing all the > footnotes of the paragraph has been populated when troff > encounters the traps and break page. So, footnotes might > not be on the correct page. > > To handle these kind of situation, Heirloom Troff provide > the \P[macro] escape sequence, which will execute 'macro' > when the line is printed. So, to deal correctly with > footnotes, the note macro *must* divert the content of each > note inside a macro 'noteX', add the \P[noteX] to the > content of the paragraph, and let the noteX macro do the > usual job of a note macro. > > I believe that Groff will face this kind of problems.
FWIW, the mom macros solved this thorny some time ago. I won't say it was easy--I still recall the hair-pulling six weeks I spent getting it right. And, to be honest, I'm not sure the mom solution is 100% robust, though no one has ever reported a problem. And, again being honest, when I look at the macros these days, I'm not certain even I can untangle all the hoops I had to jump through. :) -- Peter Schaffter http://www.schaffter.ca