lilypond-devel
[Top][All Lists]
Advanced

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

Add on-page-greater-than, -less-than (on-the-fly) (issue 74540044)


From: paulwmorris
Subject: Add on-page-greater-than, -less-than (on-the-fly) (issue 74540044)
Date: Tue, 18 Mar 2014 03:07:23 +0000

Reviewers: ,

Message:
Using a different local branch did the trick.  -Paul

Description:
Add on-page-greater-than, -less-than (on-the-fly)

Adds two new ready-made procedures for use with the
\on-the-fly conditional markup command.  They test whether a
page is greater than or less than a user-specified number.
Documentation for both of them is also part of this commit.

Please review this at https://codereview.appspot.com/74540044/

Affected files (+12, -0 lines):
  M Documentation/notation/input.itely
  M ly/titling-init.ly


Index: Documentation/notation/input.itely
diff --git a/Documentation/notation/input.itely b/Documentation/notation/input.itely index fc2ead626d388a27ad52491105450a6ac0c5dfd9..21d43f1f090d91ced92b08e94179a0ba3fa3fbb7 100644
--- a/Documentation/notation/input.itely
+++ b/Documentation/notation/input.itely
@@ -1138,6 +1138,8 @@ provided:
 @item print-all-headers             @tab  print-all-headers true?
 @item first-page                    @tab  first page in the book?
 @item (on-page nmbr)                @tab  page number = nmbr?
address@hidden (on-page-greater-than nmbr)   @tab  page number > nmbr?
address@hidden (on-page-less-than nmbr)      @tab  page number < nmbr?
 @item last-page                     @tab  last page in the book?
 @item not-first-page                @tab  not first page in the book?
 @item part-first-page               @tab  first page in the book part?
Index: ly/titling-init.ly
diff --git a/ly/titling-init.ly b/ly/titling-init.ly
index da2bf166c94e063ec5b419b2bf38cc5325ce7603..a15298a33ce91dd2e405ac4cab709ef8dd657e52 100644
--- a/ly/titling-init.ly
+++ b/ly/titling-init.ly
@@ -108,6 +108,16 @@ book last one."
    (interpret-markup layout props arg)
    empty-stencil))

+#(define ((on-page-greater-than nmbr) layout props arg)
+   (if (> (chain-assoc-get 'page:page-number props -1) nmbr)
+       (interpret-markup layout props arg)
+       empty-stencil))
+
+#(define ((on-page-less-than nmbr) layout props arg)
+   (if (< (chain-assoc-get 'page:page-number props -1) nmbr)
+       (interpret-markup layout props arg)
+       empty-stencil))
+
 %% Bookpart first page and last page predicates
 #(define (part-first-page? layout props)
   (= (chain-assoc-get 'page:page-number props -1)





reply via email to

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