lilypond-user
[Top][All Lists]
Advanced

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

Re: Footnotes documentation


From: address@hidden
Subject: Re: Footnotes documentation
Date: Sun, 11 Dec 2011 10:28:49 +0100

Le Dec 11, 2011 à 8:06 AM, David Kastrup a écrit :

> "address@hidden" <address@hidden> writes:
> 
>> Le Dec 10, 2011 à 9:18 PM, David Kastrup a écrit :
>> 
>>>> 
>>> 
>>> Why don't we have \footnote \default for autonumbering (just like with
>>> \mark),
>> 
>> We could...I don't understand how \default works, so I'm not sure how
>> to make it work here, but a tutorial would get me on my way!
> 
> Have you read "Scheme function usage" in EG?
> 

Nope - this certainly helps for \default.

> Anyway, let's take a look at two contenders:
> 
> There is an optional argument before number-pair giving the symbol, and
> an optional markup text before the footnote.  So we do
> 
> footnote =
> #(define-music-function (parser location grob-name offset text footnote)
>  ((symbol? '()) number-pair? (markup?) markup?)
>  (_i "Attach @var{text} at @var{offset} with @var{text} referring
> to @var{footnote} (use like @code{\\tweak})")
>  (make-music 'FootnoteEvent
>              'automatically-numbered (not text)
>              'symbol grob-name
>              'X-offset (car offset)
>              'Y-offset (cdr offset)
>              'text (or text (make-null-markup))
>              'footnote-text footnote))
> 
> And there you are.

I still am having trouble seeing what grob this would footnote?

Here, '() gets set as the grob-name for footnote.  So, if footnote worked like 
parenthesize, it'd presumably have code like:

parenthesize =
#(define-music-function (parser loc arg) (ly:music?)
  (_i "Tag @var{arg} to be parenthesized.")

  (if (memq 'event-chord (ly:music-property arg 'types))
      ;; arg is an EventChord -> set the parenthesize property
      ;; on all child notes and rests
      (for-each
       (lambda (ev)
         (if (or (memq 'note-event (ly:music-property ev 'types))
                 (memq 'rest-event (ly:music-property ev 'types)))
             (set! (ly:music-property ev 'parenthesize) #t)))
       (ly:music-property arg 'elements))
      ;; No chord, simply set property for this expression:
      (set! (ly:music-property arg 'parenthesize) #t))
  arg)

Which would footnote every note and rest in the chord (w/ some extra code to 
make a music-property called footnote, etc.), and even if it just applied to 
one event as in the ";; No chord, simply..." case, this event may result in the 
creation of footnotes on several grobs.  I'm not sure how code could be written 
that would discern one meaningful grob and footnote it.  You could pick one at 
random, but this seems like it wouldn't be a gain compared to specifying the 
grob in the first place.

Cheers,
MS


reply via email to

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