I am preparing a booklet using lilypond-book
and have some snippets formatted with \begin{lilypond}[fragment]
. These generally do what I want, but I would like to use some custom macros that I defined for chant formatting:
recitingNote = {
\once \override NoteHead #'stencil = #ly:text-interface::print
\once \hide Stem
\once \override NoteHead.text = \markup { \lower #0.5 \filled-box #'(0 . 6) #'(0 . 1) #0 }
\once \override Dots.dot-count = #0
}
recitedText = {
\once \override LyricText.self-alignment-X = #LEFT
}
I have these in a file named chant.lyinc
, and in my usual full Lilypond documents I just \include "chant.lyinc"
and am set. However, when I try it in fragment
mode:
\begin{lilypond}[fragment]
\include "chant.lyinc"
c'2 d'2 e'2 f'2
\end{lilypond}
I get the errors
Parsing...
../chant.lyinc:1:1: error: not a note name: recitingNote
recitingNote = {
../chant.lyinc:1:14: error: syntax error, unexpected '='
recitingNote
= {
../chant.lyinc:8:1: error: not a note name: recitedText
recitedText = {
../chant.lyinc:8:13: error: syntax error, unexpected '='
recitedText
= {
Clearly the fragment
wrapper is preventing the usual definitions from taking place. How can I use my custom includes with fragment
snippets?