lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Macro for NR appendix


From: Jean Abou Samra
Subject: Re: Macro for NR appendix
Date: Thu, 25 Aug 2022 01:00:36 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.12.0

Le 25/08/2022 à 00:32, Dan Eble a écrit :
I tried this:

     @macro appendixBarLineDemo{BARTYPE}
     @code{"\BARTYPE\"}
     @lilypond[notime,relative=2]
     \bar "\BARTYPE\" b4 \bar "\BARTYPE\" b4 \bar "\BARTYPE\"
     @end lilypond
     @end macro

but with \BARTYPE\ in the lilypond section, no staff appears in the PDF.  I 
guess I need some additional quoting — or unquoting.  Is there a way to make 
this work or am I stuck writing out the bar type 4 times per type?



There is no way this can work. The LilyPond output is produced by
lilypond-book, which just scans the .texi file for @lilypond sections
and replaces them with an @image of the output. It doesn't know
about macros (and teaching it about them is probably tricky).

Instead, try autogenerating the appendix without Texinfo macros. You coul
add infrastructure generating the Texinfo code (see
scm/document-outside-staff-priorities.scm for a simple example), but the
most straightforward solution is probably putting everything in the LilyPond
output image, like the list of special characters for example. Probably
along the lines of

\version "2.23.13"

\layout {
  \context {
    \Score
    \remove Bar_number_engraver
  }
  \context {
    \Staff
    \remove Time_signature_engraver
    \remove Clef_engraver
  }
}

\markuplist \override #'(baseline-skip . 15) \table #(make-list 4 CENTER)
#(map
  (lambda (entry)
    (let ((glyph (car entry)))
       #{
         \markup \score {
           {
             % Change to \textMark when it's available
             \tweak self-alignment-X #LEFT \mark \markup \typewriter \concat { "\\bar \"" #glyph "\"" }
             \bar #glyph
             s1
             \bar #glyph
             s1
             \bar #glyph
           }
         }
       #}))
  ;; probably make bar-glyph-alist public if you do this
  (reverse (@@ (lily) bar-glyph-alist)))






reply via email to

[Prev in Thread] Current Thread [Next in Thread]