Peter Schaffter <pe...@schaffter.ca> wrote: [ about heirloom troff paragraph at once adjustment ]
> > 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. :) Do you mean that you've worked on mom so that it can be used with heirloom troff and its paragraph at once adjustment activated ? If that's not what you wanted to say, you, did not understood me. Usual troff line by line formating make (almost) sure that the note diversion occurs on the page where the note has to be printed. But with the heirloom paragraph at once adjustment, the diversion occurs at the time the whole paragraph is formated, then, the paragraph is printed, and might be split on two pages. The result is that the note which should appear on the second page are part of the diversion of the first page... That's why we must divert the note to the new linetrap, and wait that the linetrap is executed to divert the note to the diversion containing the note of the page. Here is a short (not working) example: .de NOTESTART .nr I +1 .\" Put the line trap \&\\P[LINETRAP-\\nI]\c . .\" Define the macro of the line trap . de LINETRAP-\\nI . \" add the note to the other notes of the page . da PRINTNOTES . NOTETRAP-\\nI . di \\.. . . \" divert the note to the line trap . di NOTETRAP-\\nI .. .de NOTESTOP . di .. .de FOOTER . PRINTNOTES .. If there are three notes on a single paragraph split on two pages, and that only the first two notes are on the first page, heirloom troff will execute the macros in that order if paragraph at once adjustment is set: .NOTESTART .NOTESTOP .NOTESTART .NOTESTOP .NOTESTART .NOTESTOP .LINETRAP-1 .NOTETRAP-1 .LINETRAP-2 .NOTETRAP-2 .FOOTER .PRINTNOTES .LINETRAP-3 .NOTETRAP-3 .FOOTER .PRINTNOTES Funny isn't it ? Cheers, Pierre-Jean.