Reviewers: ,
Message:
please review
Description:
input/regression/bookparts.ly fails at PDF conversion stage
issue 4554
fixes \with-link
let it look at the first page number of the entire book
Please review this at https://codereview.appspot.com/260790043/
Affected files (+12, -9 lines):
M ly/titling-init.ly
M scm/define-markup-commands.scm
Index: ly/titling-init.ly
diff --git a/ly/titling-init.ly b/ly/titling-init.ly
index
eb9ced5375c577714e31e005877a71caeaad6fe9..f397ad6bd90177b34de35c2f28ba5d96d8ce15f6
100644
--- a/ly/titling-init.ly
+++ b/ly/titling-init.ly
@@ -76,14 +76,8 @@ scoreTitleMarkup = \markup { \column {
#(define (book-first-page? layout props)
"Return #t iff the current page number, got from @code{props}, is the
book first one."
- (define (ancestor layout)
- "Return the topmost layout ancestor"
- (let ((parent (ly:output-def-parent layout)))
- (if (not (ly:output-def? parent))
- layout
- (ancestor parent))))
(= (chain-assoc-get 'page:page-number props -1)
- (ly:output-def-lookup (ancestor layout) 'first-page-number)))
+ (book-first-page layout props)))
#(define (book-last-page? layout props)
"Return #t iff the current page number, got from @code{props}, is the
Index: scm/define-markup-commands.scm
diff --git a/scm/define-markup-commands.scm b/scm/define-markup-commands.scm
index
d7c0f22e469c0a6093288a4eaa8a58395b1eabc6..a390330a2ac7204ecaca695970eacf53a7a32b02
100644
--- a/scm/define-markup-commands.scm
+++ b/scm/define-markup-commands.scm
@@ -509,6 +509,16 @@ in the PDF backend.
(ly:stencil-add (ly:make-stencil link-expr xextent yextent) stil)))
+(define-public (book-first-page layout props)
+ "Return the @code{'first-page-number} of the entire book"
+ (define (ancestor layout)
+ "Return the topmost layout ancestor"
+ (let ((parent (ly:output-def-parent layout)))
+ (if (not (ly:output-def? parent))
+ layout
+ (ancestor parent))))
+ (ly:output-def-lookup (ancestor layout) 'first-page-number))
+
(define-markup-command (with-link layout props label arg)
(symbol? markup?)
#:category other
@@ -536,8 +546,7 @@ only works in the PDF backend.
(if (list? table)
(assoc-get label table)
#f))
- (first-page-number
- (ly:output-def-lookup layout 'first-page-number))
+ (first-page-number (book-first-page layout props))
(current-page-number
(if table-page-number
(1+ (- table-page-number first-page-number))
_______________________________________________
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel