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

Reply via email to