Is this the sort of thing you're looking for?

```
#(define (dump-system-info sys)
   (let* ((right (ly:spanner-bound sys RIGHT))
          (time (ly:grob-property right 'when 0)))
     (format #t "\nline break at ~f" (ly:moment-main time))))

\layout {
  \context {
    \Score
    \override System.after-line-breaking = #dump-system-info
  }
}
```

It should work on LilyPond 2.23.7 or later (current stable is 2.24). This:

> ```
> \layout {
>   \context {
>     \Staff
>     \override System.after-line-breaking = #printPage
>   }
> }
> ```
>
> should work.  And it doesn't.  I tried \Score context,

probably means you're running an older version.

Listening to page-break-event in an engraver is not what you're looking for — 
these are only emitted for explicit `\break` commands.

Another way would be

```
#(define (dump-col-info col)
   (when (eqv? LEFT (ly:item-break-dir col))
     (let ((time (ly:grob-property col 'when 0)))
       (format #t "\nline break at ~f" (ly:moment-main time)))))

\layout {
  \context {
    \Score
    \override NonMusicalPaperColumn.after-line-breaking = #dump-col-info
  }
}
```

which prints the time of all NonMusicalPaperColumn grobs that are just before a 
line break. Note the difference between a PaperColumn, which is on a vertical 
alignment of notes, and a NonMusicalPaperColumn, which is between two 
PaperColumns (or at one extreme end of the system). There is a diagram 
[here](https://extending-lilypond.gitlab.io/en/extending/backend.html#how-line-breaking-clones-grobs)
 about `ly:item-break-dir`.

Both of these methods will print at each line break, but since you have just 
one system per page, that's equivalent to printing page breaks in your case.

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to