Dear Werner,
Thank you so much for your guidance on reducing the complexity of my LilyPond score step by step to identify the issue. Your suggestion indeed helped me pinpoint the problem. The issue stemmed from my attempt to embed the score as a figure-like object within the LaTeX document. My goal was to number each score and later include these numbers in the table of contents for easy reference.
···latex
\begin{figure}[h]
\lilypondfile[papersize=letter,paper-height=150mm,noragged-right,staffsize=18]{
repeated_notes.ly} % paper-height=150pt,
\caption{Repeated Notes}
\label{sng:repeated_notes}
\end{figure}
···
However, treating the score as a figure resulted in it being rendered as a single, non-breakable image, preventing it from spanning multiple pages. Once I removed this figure-like embedding, the score could successfully break across pages as intended.
Now, my challenge is how to retain the numbering and indexing of these scores in the document without treating them as figures. I want to be able to cross-reference the scores within the text and have them appear in the table of contents under their respective section.
Could you suggest any approaches or workarounds that would allow me to achieve these goals? I am looking for a solution that provides the flexibility of indexing and cross-referencing without compromising the ability to break scores across pages.
Thank you again for your invaluable advice. I look forward to any further suggestions you might have.
Best regards,
Peter