4

The following displays only the book title. I want a separate title for each score. It shows the opus and piece, but not the title for that score. What am I doing wrong? I'm basing this on Creating titles headers and footers.

\version "2.18.2"
\book {
    \header {
        title = "book title"
    }
    \score {
        \header {
            title = "song title is missing"
            subtitle = "subtitle is missing"
            opus = "opus"
            piece = "yo"
        }
        \new Staff {
            \key f \major
            \time 6/4
            \clef treble
        } % Staff
    } % score
} % book
2

You could force LilyPond to display all titles like with this \paper block:

\version "2.18.2"
\book {
\paper {print-all-headers = ##t}
    \header {
        title = "book title"
    }
    \score {
        \header {
            title = "song title is missing"
            subtitle = "subtitle is missing"
            opus = "opus"
            piece = "yo"
        }
        \new Staff {
            \key f \major
            \time 6/4
            \clef treble
        } % Staff
    } % score
} % book

You can see it here on lilybin.com.

I have no idea why the default behavior is not to display the title, but fortunately you can always change the setting to what you like most.

2

From Lilypond's manual:

4.1.6 Miscellaneous \paper variables

  • print-all-headers

...this will print all headers for each \score in the output. Normally only the piece and opus header variables are printed. Default: #f.

3.2.1 Titles explained:

...only piece and opus fields are printed by default in Score Titles unless the \paper variable, print-all-headers, is set to #t.

So, for an example that includes a book header and multiple score headers, that would look like this:

\book {

 \paper {
  print-all-headers = ##t
 }

 \header {
  title = "Title for book"
 }

 \score {
  %...music here...
  \header {
   title = "Title for first score"
  }
 }

 \score {
  %...music here...
  \header {
   title = "Title for second score"
  }
 }

}

That should do the trick.

1

bookpart is another way, though if you want a one-off title and the part title to be in the title field then a leading title page and to use title for what I've placed in subtitle for each bookpart may be necessary:

\version "2.18.2"
\header {
    title = "book title"
}
\book {
    \bookpart {
        \header {
            subtitle = "part1"
            opus = "opus"
            piece = "yo"
        }
        \score {
            \new Staff {
                \key f \major
                \time 6/4
                \clef treble
            }
        }
    }
    \bookpart {
        \header {
            subtitle = "part2"
            opus = "opus"
            piece = "yo"
        }
        \score {
            \new Staff {
                \key f \major
                \time 6/4
                \clef treble
            }
        }
    }
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.