I put some files in GitHub to show the problem. In this folder: https://github.com/neonscribe/lilypond-lead-sheets/tree/main/TeX
there are four files, AV.ly, AV.pdf, AVX.ly and AVX.pdf. The AV files show the layout spilling past the edges, while the AVX files show the layout shrinking. On Mon, Jun 29, 2026 at 11:51 AM Eric Benson <[email protected]> wrote: > I'm not getting any errors or warnings when compiling. When I compile this > single song by itself, the margins stay where they belong. It's only in the > context of a book with more songs that the margins go haywire, and they > stay that way until another specific song is compiled. > > Here is the "wrong size" file: > > > https://github.com/neonscribe/lilypond-lead-sheets/blob/main/Core/Chega%20de%20Saudade%20-%20Ly%20Core%20-%20D.ly > > and here is the "right size" file: > > > https://github.com/neonscribe/lilypond-lead-sheets/blob/main/Core/Destination%20Moon%20-%20Ly%20Core%20-%20Bb.ly > > On Mon, Jun 29, 2026 at 11:35 AM Xavier Scheuer <[email protected]> > wrote: > >> On Mon, 29 Jun 2026 at 20:17, Eric Benson <[email protected]> wrote: >> > >> > I have a large collection of lead sheets in LilyPond I've been working >> on >> > for several years. I believe I may have stumbled upon a strange bug. I >> had >> > been engraving these individually and assembling PDFs using LaTeX, but >> the >> > resulting files were huge because each separate PDF has its own separate >> > copy of its fonts. Combining PDFs this way doesn't offer any way to >> combine >> > fonts. I finally broke down and figured out how to compile these books >> > entirely within LilyPond, so the largest native-buit PDF is now about >> 10% >> > of the size of the assembled PDF. >> > >> > Anyway, in the process of building these books I encountered a strange >> > problem. There is a particular song that causes the engraving to either >> go >> > past the right edge and bottom edge of the page, or shrink both margins >> so >> > that it uses a smaller part of the page. This condition persists in the >> > book until it engraves a different particular song that sets it back to >> the >> > correct size. I use a somewhat complicated system of include files to >> > enable these songs to be typeset in different keys. There is one key for >> > the "wrong size" song that makes it get too large. All the other keys >> that >> > I've tried make it get too small. The song is written in D, but if I >> > transpose it to C it spills over the limits of the page. If I keep it >> in D >> > or transpose to some other key it shrinks to a smaller portion of the >> page. >> > This new page size stays until the "right size" song gets engraved, then >> > the rest of the book uses the correct size. >> >> Hello, >> >> Do you have any errors or warnings when compiling the scores? >> Music running off the page is almost always due to an error of duration >> in a measure. >> Check again the score (song) producing the error (and/or tell us which >> one it is in your repository, it may help).. >> https://lilypond.org/doc/v2.27/Documentation/usage/music-runs-off-the-page >> >> Kind regards, >> Xavier >> >>
