On Tue, 2015-11-24 at 14:47 +0100, David Kastrup wrote: > David Sumbler <da...@aeolia.co.uk> writes: > > > I have experimented with elements from the all the suggestions made - > > thanks to all. One thing that has been confirmed is that my > > understanding of how to use markup commands is pretty poor. > > > > I still have not managed to solve all of the problems. I tried to test > > Graham's suggestion of a modification of part of Nicolas Sceaux's > > book-titling snippet. But when I try to compile the whole snippet > > (which has a demo at the end of it) I get an error. > > > > I am using Lilypond 2.19.30; the snippet does not have a "version" > > statement. The error I am getting stems from the fact that in the > > snippet the procedure 'collect-music-for-book' is always called with 2 > > arguments: (collect-music-for-book parser (make-music # # ...)). When I > > look in the lily-library.scm in my current Lilypond installation, I see > > that it should only have 1 argument, e.g. > > (collect-music-for-book (make-music # # ...)). > > > > I have tried putting an old version number at the top of the snippet > > (e.g. "version" 2.16.1) and running convert.ly, but no significant > > changes are made to the file. > > > > How can I get this snippet to work? > > I presume you are talking about snippet 368? > > Putting on old version number at the top of the snippet and running > convert-ly works here. Do you have the wrong convert-ly perhaps? > > I get as diff (from 2.18.0) > > differences between files attachment (lsr368.diff) > --- /tmp/Snippet 2015-11-24 14:39:21.482732193 +0100 > +++ - 2015-11-24 14:44:36.648156076 +0100 > @@ -1,3 +1,4 @@ > +\version "2.19.32" > %% http://lsr.di.unimi.it/LSR/Item?id=368 > %% see also > http://www.lilypond.org/doc/v2.18/Documentation/snippets/paper-and-layout > %% see also http://nicolas.sceaux.free.fr/ > @@ -236,7 +237,7 @@ > (set! odd-label-header-table > (cons (list label text display-1st) > odd-label-header-table)) > - (collect-music-for-book parser > + (collect-music-for-book > (make-music 'Music > 'page-marker #t > 'page-label label))))) > @@ -246,7 +247,7 @@ > (set! even-label-header-table > (cons (list label text display-1st) > even-label-header-table)) > - (collect-music-for-book parser > + (collect-music-for-book > (make-music 'Music > 'page-marker #t > 'page-label label)))))) > @@ -266,23 +267,23 @@ > %%% Utilities for adding (no-)page breaks, toplevel markups > %%% > #(define (add-page-break parser) > - (collect-music-for-book parser > + (collect-music-for-book > (make-music 'Music > 'page-marker #t > 'line-break-permission 'force > 'page-break-permission 'force))) > > #(define (add-no-page-break parser) > - (collect-music-for-book parser > + (collect-music-for-book > (make-music 'Music > 'page-marker #t > 'page-break-permission 'forbid))) > > #(define (add-toplevel-markup parser text) > - (collect-scores-for-book parser (list text))) > + (collect-scores-for-book (list text))) > > #(define (add-toc-item parser markup-symbol text) > - (collect-music-for-book parser > + (collect-music-for-book > (add-toc-item! markup-symbol text))) > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > @@ -302,7 +303,7 @@ > (format #f "~a-~a" major-number minor-number)))) > > #(define-public (add-rehearsal-number parser) > - (collect-scores-for-book parser > + (collect-scores-for-book > (list (markup #:huge #:bold (rehearsal-number))))) > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > @@ -314,50 +315,50 @@ > #(define *use-rehearsal-numbers* (make-parameter #f)) > > useRehearsalNumbers = > -#(define-music-function (parser location use-numbers) (boolean?) > +#(define-music-function (use-numbers) (boolean?) > (*use-rehearsal-numbers* use-numbers) > (make-music 'Music 'void #t)) > > bookTitle = > -#(define-music-function (parser location title) (string?) > +#(define-music-function (title) (string?) > (*book-title* title) > (make-music 'Music 'void #t)) > > chapter = > -#(define-music-function (parser location title) (string?) > +#(define-music-function (title) (string?) > (increase-rehearsal-major-number) > - (add-page-break parser) > - (add-toc-item parser 'tocChapterMarkup title) > - (add-even-page-header-text parser (string-upper-case (*book-title*)) #f) > - (add-odd-page-header-text parser (string-upper-case title) #f) > - (add-toplevel-markup parser (markup #:chapter-title (string-upper-case > title))) > - (add-no-page-break parser) > + (add-page-break (*parser*)) > + (add-toc-item (*parser*) 'tocChapterMarkup title) > + (add-even-page-header-text (*parser*) (string-upper-case (*book-title*)) > #f) > + (add-odd-page-header-text (*parser*) (string-upper-case title) #f) > + (add-toplevel-markup (*parser*) (markup #:chapter-title (string-upper-case > title))) > + (add-no-page-break (*parser*)) > (make-music 'Music 'void #t)) > > section = > -#(define-music-function (parser location title) (string?) > - (add-toc-item parser 'tocSectionMarkup title) > - (add-toplevel-markup parser (markup #:section-title (string-upper-case > title))) > - (add-no-page-break parser) > +#(define-music-function (title) (string?) > + (add-toc-item (*parser*) 'tocSectionMarkup title) > + (add-toplevel-markup (*parser*) (markup #:section-title (string-upper-case > title))) > + (add-no-page-break (*parser*)) > (make-music 'Music 'void #t)) > > piece = > -#(define-music-function (parser location title) (markup?) > - (add-toc-item parser 'tocPieceMarkup title) > - (add-no-page-break parser) > +#(define-music-function (title) (markup?) > + (add-toc-item (*parser*) 'tocPieceMarkup title) > + (add-no-page-break (*parser*)) > (if (*use-rehearsal-numbers*) > - (add-toplevel-markup parser (markup #:rehearsal-number > (rehearsal-number)))) > - (add-no-page-break parser) > + (add-toplevel-markup (*parser*) (markup #:rehearsal-number > (rehearsal-number)))) > + (add-no-page-break (*parser*)) > (make-music 'Music 'void #t)) > > titledPiece = > -#(define-music-function (parser location title) (markup?) > - (add-toc-item parser 'tocPieceMarkup title) > +#(define-music-function (title) (markup?) > + (add-toc-item (*parser*) 'tocPieceMarkup title) > (if (*use-rehearsal-numbers*) > - (add-toplevel-markup parser > + (add-toplevel-markup (*parser*) > (markup #:piece-title-with-number (rehearsal-number) > (string-upper-case title))) > - (add-toplevel-markup parser (markup #:piece-title (string-upper-case > title)))) > - (add-no-page-break parser) > + (add-toplevel-markup (*parser*) (markup #:piece-title > (string-upper-case title)))) > + (add-no-page-break (*parser*)) > (make-music 'Music 'void #t)) > > #(define-markup-command (chapter-title layout props title) (markup?) > which seems reasonably nice for an automatic conversion. I haven't > actually tested it. >
Sorry - my stupidity. I forgot the -e flag when I ran convert-ly. David _______________________________________________ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user