Re: footnote example

2010-11-06 Thread Jan-Peter Voigt

Hi Eluze,

wouldn't it anyway be nicer to have each item on an own line, as  
well as the

composer and title?

you can achieve this with

 \column {
   {note1}
   {note2}
   {note3}
   …
 }
and - if necessary - add a \wordwrap for each item.



the problem is the fixed spacing. Lily can't change the space for the  
footer line from page to page but only from bookpart to bookpart. So  
if there is one page with a lot of foot-notes, all pages have to  
reserve the space, or they will float into the music. The footer  
should only contain one, maybe two, line(s).


Jan-Peter


___
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user


Re: footnote example

2010-11-05 Thread -Eluze


Jan-Peter Voigt wrote:
> 
> Hello Eluze, hello list,
> 
> thanks for the test! I will install a dev-version and test - right now I 
> am only using the stable version for my projects. It seems, the 
> fill-line spacing has changed - if you change the footerMarkup to 
> contain only the footer-items and the page-number, it should run fine?
> But it points to an inherent problem. The markup-stencil is of a fixed 
> size. If it is filled with too many notes on one page, the markup might 
> cross stencil/page borders.
> 

indeed - if i remove items it works better.

wouldn't it anyway be nicer to have each item on an own line, as well as the
composer and title?

you can achieve this with 

  \column {
{note1}
{note2}
{note3}
…
  }
and - if necessary - add a \wordwrap for each item.

hope this can help a little!

-- 
View this message in context: 
http://old.nabble.com/footnote-example-tp30141914p30145463.html
Sent from the Gnu - Lilypond - User mailing list archive at Nabble.com.


___
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user


Re: footnote example

2010-11-05 Thread Jan-Peter Voigt

Hello Eluze, hello list,

thanks for the test! I will install a dev-version and test - right now I 
am only using the stable version for my projects. It seems, the 
fill-line spacing has changed - if you change the footerMarkup to 
contain only the footer-items and the page-number, it should run fine?
But it points to an inherent problem. The markup-stencil is of a fixed 
size. If it is filled with too many notes on one page, the markup might 
cross stencil/page borders.


Regards,
Jan-Peter

On 05.11.2010 16:30, -Eluze wrote:


Jan-Peter Voigt wrote:
   

Hello list,

here is a snippet, wich creates footnotes. It is not tested very much!!!
If you like, try it and tell me how it works! If you have improvements,
tell the list :-)

 

sounds interesting!

however - using your example with version 2.13.38 - the last footer gets
scrambled! http://old.nabble.com/file/p30142289/footer.pdf footer.pdf
   



___
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user


Re: footnote example

2010-11-05 Thread -Eluze


Jan-Peter Voigt wrote:
> 
> Hello list,
> 
> here is a snippet, wich creates footnotes. It is not tested very much!!! 
> If you like, try it and tell me how it works! If you have improvements, 
> tell the list :-)
> 

sounds interesting!

however - using your example with version 2.13.38 - the last footer gets
scrambled! http://old.nabble.com/file/p30142289/footer.pdf footer.pdf 
-- 
View this message in context: 
http://old.nabble.com/footnote-example-tp30141914p30142289.html
Sent from the Gnu - Lilypond - User mailing list archive at Nabble.com.


___
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user


Re: footnote example

2010-11-05 Thread Bernardo Barros
Very useful, I will test it.

If this is a good implementation, maybe consider it for the next release?

2010/11/5 Jan-Peter Voigt :
> Hello list,
>
> here is a snippet, wich creates footnotes. It is not tested very much!!! If
> you like, try it and tell me how it works! If you have improvements, tell
> the list :-)
> I don't know what happens, when you use it extensibly in a large book with
> several pages - if there are X pages and Y footnotes, the footer-items
> markup has to loop X*Y through the list of notes!
> I will try later ...
>
> First I was trying to get the piece field in the footer with several scores
> in one bookpart. I looked through the lily-files in /usr/share and used some
> code of toc-init.ly (\label) define-markup-commands.scm (\page-ref) and
> thought of using a global running variable to keep this info available for
> the footer ...
> Then I received my first printed book of lily-scores I typesetted ( I am
> 10cm larger now ;-) ) and I see, the piece info in the footer is not that
> important.
> But my tries made me think of footnotes. So I made this little script.
>
> Regards,
> Jan-Peter
>
> --snip--
> \version "2.12.3"
>
> % Trying to get small(!) footnotes with excerpts from
> define-markup-commands.scm and toc-init.ly
> % This is a first try!
> % TODO take gauge-stencil from page-width?
> % TODO parameter for markup styles in paper{} (like 'tocItemMarkup)
> % PROBLEM if there are X pages and Y footnotes, the footer-items markup has
> to loop X*Y through the list of notes!
> % PROBLEM the gauge-stencil always uses the same space! Also if there are no
> notes on the page!
>
> % define the footnote counter
> #(define footnr 0)
> % to be defined in a closure later (see toc-init.ly)
> #(define-public (add-foot-item! dir text) #f)
> #(define-public (foot-items) #f)
>
> % define add item and get list functions
> #(let ((foot-item-list (list)))
>     (set! add-foot-item!
>       (lambda (dir text)
>               (let ((label (gensym "foot")))
>                    (set! footnr (+ footnr 1))
>                    (set! foot-item-list
>                      (cons (list label text footnr)
>                            foot-item-list))
>                    (make-music 'EventChord
>                      'page-marker #t
>                      'page-label label
>                      'elements (list
>                        (make-music 'LabelEvent 'page-label label)
>                        (make-music 'TextScriptEvent 'direction dir 'text
> (markup #:super #:circle (number->string footnr)))
>     )
>     (set! foot-items (lambda ()
>               (reverse foot-item-list
>
> % conditionally add text markup, if we are on the right page
> #(define (runfi pagelist cur-page table label text fnnr)
>        (let ((label-page (and (list? table) (assoc label table
>             (if (and label-page (= cur-page (cdr label-page)))
>                 (markup pagelist #:super (number->string fnnr) text)
>                 pagelist
>             )
>        )
> )
>
> % define markup command to be used in footerMarkup
> % delayed stencil-evaluation like in page-ref - so we know the pagenumber of
> the label and the current page
> % needs 'gauge'-stencil --- is hardcoded right now
> #(define-markup-command (footer-items layout props)()
>  "markup footer items"
>  (let* ((gauge-stencil (interpret-markup layout props (markup #:super "1"
> "XXX")))
>         (x-ext (ly:stencil-extent gauge-stencil X))
>         (y-ext (ly:stencil-extent gauge-stencil Y)))
>        (ly:make-stencil
>          `(delay-stencil-evaluation
>            ,(delay (ly:stencil-expr
>
>                     (let* ((table (ly:output-def-lookup layout
> 'label-page-table))
>                            (cur-page (inexact->exact (string->number
> (chain-assoc-get 'page:page-number-string props
>                            (pagelist (markup))
>                            (page-number -1))
>                           (map (lambda (fn)
>                                        (let ((label (car fn))
>                                              (text (cadr fn))
>                                              (fnnr (caddr fn)))
>                                             (set! pagelist (runfi pagelist
> cur-page table label text fnnr))
>                                        )
>                                ) (foot-items))
>                           (interpret-markup layout props (markup pagelist))
>                     )
>
>                   )
>          )) x-ext y-ext)))
> % the footnote function
> % takes direction (UP/DOWN) and markup
> % other layout properties can be set via [\once] \override TextScript #'...
> = ...
> addfoot = #(define-music-function (parser location dir text)(integer?
> markup?)
>  (begin (add-foot-item! dir text)
> ))
>
>
> \paper {
>  #(set-paper-size "a5" 'landscape)
>  oddHeaderMarkup = ""
>  evenHeaderMarkup = ""
>  oddFooterMarkup = \markup { \fill-line {
>      \co

footnote example

2010-11-05 Thread Jan-Peter Voigt

Hello list,

here is a snippet, wich creates footnotes. It is not tested very much!!! 
If you like, try it and tell me how it works! If you have improvements, 
tell the list :-)
I don't know what happens, when you use it extensibly in a large book 
with several pages - if there are X pages and Y footnotes, the 
footer-items markup has to loop X*Y through the list of notes!

I will try later ...

First I was trying to get the piece field in the footer with several 
scores in one bookpart. I looked through the lily-files in /usr/share 
and used some code of toc-init.ly (\label) define-markup-commands.scm 
(\page-ref) and thought of using a global running variable to keep this 
info available for the footer ...
Then I received my first printed book of lily-scores I typesetted ( I am 
10cm larger now ;-) ) and I see, the piece info in the footer is not 
that important.

But my tries made me think of footnotes. So I made this little script.

Regards,
Jan-Peter

--snip--
\version "2.12.3"

% Trying to get small(!) footnotes with excerpts from 
define-markup-commands.scm and toc-init.ly

% This is a first try!
% TODO take gauge-stencil from page-width?
% TODO parameter for markup styles in paper{} (like 'tocItemMarkup)
% PROBLEM if there are X pages and Y footnotes, the footer-items markup 
has to loop X*Y through the list of notes!
% PROBLEM the gauge-stencil always uses the same space! Also if there 
are no notes on the page!


% define the footnote counter
#(define footnr 0)
% to be defined in a closure later (see toc-init.ly)
#(define-public (add-foot-item! dir text) #f)
#(define-public (foot-items) #f)

% define add item and get list functions
#(let ((foot-item-list (list)))
 (set! add-foot-item!
   (lambda (dir text)
   (let ((label (gensym "foot")))
(set! footnr (+ footnr 1))
(set! foot-item-list
  (cons (list label text footnr)
foot-item-list))
(make-music 'EventChord
  'page-marker #t
  'page-label label
  'elements (list
(make-music 'LabelEvent 'page-label label)
(make-music 'TextScriptEvent 'direction dir 
'text (markup #:super #:circle (number->string footnr)))

 )
 (set! foot-items (lambda ()
   (reverse foot-item-list

% conditionally add text markup, if we are on the right page
#(define (runfi pagelist cur-page table label text fnnr)
(let ((label-page (and (list? table) (assoc label table
 (if (and label-page (= cur-page (cdr label-page)))
 (markup pagelist #:super (number->string fnnr) text)
 pagelist
 )
)
)

% define markup command to be used in footerMarkup
% delayed stencil-evaluation like in page-ref - so we know the 
pagenumber of the label and the current page

% needs 'gauge'-stencil --- is hardcoded right now
#(define-markup-command (footer-items layout props)()
  "markup footer items"
  (let* ((gauge-stencil (interpret-markup layout props (markup #:super 
"1" "XXX")))

 (x-ext (ly:stencil-extent gauge-stencil X))
 (y-ext (ly:stencil-extent gauge-stencil Y)))
(ly:make-stencil
  `(delay-stencil-evaluation
,(delay (ly:stencil-expr

 (let* ((table (ly:output-def-lookup layout 
'label-page-table))
(cur-page (inexact->exact (string->number 
(chain-assoc-get 'page:page-number-string props

(pagelist (markup))
(page-number -1))
   (map (lambda (fn)
(let ((label (car fn))
  (text (cadr fn))
  (fnnr (caddr fn)))
 (set! pagelist (runfi 
pagelist cur-page table label text fnnr))

)
) (foot-items))
   (interpret-markup layout props (markup 
pagelist))

 )

   )
  )) x-ext y-ext)))
% the footnote function
% takes direction (UP/DOWN) and markup
% other layout properties can be set via [\once] \override TextScript 
#'... = ...
addfoot = #(define-music-function (parser location dir text)(integer? 
markup?)

  (begin (add-foot-item! dir text)
))


\paper {
  #(set-paper-size "a5" 'landscape)
  oddHeaderMarkup = ""
  evenHeaderMarkup = ""
  oddFooterMarkup = \markup { \fill-line {
  \concat { \fromproperty #'header:composer ", " \bold 
\fromproperty #'header:title }

  % fill in footer-items
  \footer-items
  \fromproperty #'page:page-number-string
}
  }
  evenFooterMarkup = \markup { \fill-line {
  \fromproperty #'page:page-number-string