Wow! Thank you so much for looking at this. I've done a lot of tweaking over the years to make songs fit onto one or two pages, but now I'm doing my best to let LilyPond do its thing and find page breaks automatically. I'm trying to make sure that those page breaks fall between sections and it is working pretty well at this point. Those global staff size settings were done at an earlier point in this project and I'd more or less forgotten about them. Sure enough, taking them out is making these combined books work much better.
I know I have some enormous folders in my repo. It just happened as I added more songs. I could try to split things up, but that's a bit of a challenge. My best advice is to use the git command line and just fetch the whole thing at once. It's a lot of files, but they are all small. You're right though, I could have made a tarball for this example. I should probably try Frescobaldi. I'm an old (school) Lisp hacker, so I pretty much do everything in Emacs. I try pretty hard to keep source files as compact as possible and especially to separate formatting from abstract music data. This latest phase of building books in LilyPond has led me to write a few Python scripts to generate input to LilyPond and TeX. Yes, that helps! I'm extremely grateful. On Wed, Jul 1, 2026 at 10:55 PM Jeff Olson <[email protected]> wrote: > On 6/30/2026 2:24 PM, Eric Benson wrote: > > 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. > > ... > > 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. > > Eric, > > In short, the problem is due to an include file for a different song doing > #(set-global-staff-size 18) when that is not what is appropriate to the > problem song. In your structure, if you need to set-global-staff-size for > one song, maybe you need to do that for every song. > > Here is how I made an MWE for your AV.ly example, where the first song > (Chega de Saudade) gets clipped on the right margin, as you showed. I > reduced AV.ly to the following, *so only the first song was produced but > with the problem still present*: > > \version "2.26.0" > > inBook = ##t > > thisPart = ##f > > \include "../Wrappers/Chega de Saudade - Ly - C Alto Voice.ly" > > songaaaaaa = \bookpart { \thisPart } > > %\include "../Wrappers/Darn That Dream - Ly - C Alto Voice.ly" > > %songaaaaab = \bookpart { \thisPart } > > * \include "../Wrappers/Destination Moon - Ly - Eb Alto Voice.ly"* > > %songaaaaac = \bookpart { \thisPart } > > \book { > \paper { > tocItemMarkup = \tocItemWithDotsMarkup > tocTitleMarkup = \markup \huge \larger \larger \larger \column { > \fill-line { \null "AVB" \null } > \hspace #1 > } > } > > \markuplist \table-of-contents > > \bookpart { \songaaaaaa } > > %\bookpart { \songaaaaab } > > %\include "../Include/blank-staff.ily" > > %\bookpart { \songaaaaac } > > } > > You can see that the other two songs are not being produced in the pdf, > but nevertheless the problem (at this level) is the following include > statement: > > \include "../Wrappers/Destination Moon - Ly - Eb Alto Voice.ly" > > That Wrappers file then does another include of the Core file: > > \include "../Core/Destination Moon - Ly Core - Bb.ly" > > That Core file, where you declare variables defining the particulars of > that song, also begins with the statement (that has global effect) > > #(set-global-staff-size 18) > > *Commenting out that statement restores the first song to its appropriate > margins.* > > That's how you can make an MWE even for your huge project. > > Lessons learned (for me and probably others): > > 1) On huge github repos, where the list of files exceeds what the gui can > handle, the "Go to file" dialogue may hang forever unless you *use a > private browser window* (learned that from AI just now). That finally > allowed me to start downloading files until your AV.ly would compile. > > 2) In all, that required 39 downloads, mostly of short files. It would > have helped in this case if you had made a zip of all those files to > package your MWE. > > 3) Frescobaldi 3.1.1 doesn't seem to have an explicit way to comment out > selected lines of code, but it does have a useful tool that helped me: *Edit > > Cut/Copy (advanced) > Cut and Assign (Ctrl-Shift-X).* This moves the > selected lines into a variable, replacing them by an invocation of that > variable. You can then comment out the single line invocation to disable > all that code, or re-enable it by uncommenting that one line. > > As they say, "Hope that helps!" > > Jeff > >
