--- /dev/null
+\version "2.15.41"
+
+\header {
+
+ texidoc = "Page-headers and -footers. All headers and footers
+ should be printed on their specified page. "
+
+}
+
+\paper {
+ ragged-last-bottom = ##f
+
+ oddHeaderMarkup = \markup {
+ \override #'(baseline-skip . 1)
+ \center-column {
+ \box \fill-line { \teeny " " " " }
+ \on-the-fly #first-page "first-page-header-text"
+ \on-the-fly #not-first-page \fromproperty #'page:page-number-string
+ \on-the-fly #(on-page 2) "page-2-header-text"
+ \on-the-fly #last-page "last-page-header-text"
+ }
+ }
+
+ evenHeaderMarkup = \oddHeaderMarkup
+
+ oddFooterMarkup = \markup \fill-line {
+ \override #'(baseline-skip . 0.5)
+ \center-column {
+ \on-the-fly #first-page "first-page-footer-text"
+ \on-the-fly #last-page "last-page-footer-text"
+ \on-the-fly #(on-page 2) "page-2-footer-text"
+ \box \fill-line { \teeny " " " " }
+ }
+ }
+}
+
+#(set-default-paper-size "a6" 'portrait)
+
+\book {
+ \score {
+ \new Staff \relative c' {
+ \repeat unfold 18 { a b c d \break }
+ }
+ }
+}
SCM ly_hash_table_keys (SCM tab);
SCM ly_assoc_prepend_x (SCM alist, SCM key, SCM val);
-inline bool ly_is_fraction (SCM x) { return SCM_FRACTIONP (x) || scm_is_integer (x); }
inline bool ly_is_list (SCM x) { return scm_is_true (scm_list_p (x)); }
inline bool ly_cheap_is_list (SCM x) { return scm_is_pair (x) || x == SCM_EOL; }
SCM
ly_rational2scm (Rational r)
{
+ if (r.is_infinity ())
+ if (r > Rational(0))
+ return scm_inf ();
+ else
+ return scm_difference (scm_inf (), SCM_UNDEFINED);
+
return scm_divide (scm_from_int64 (r.numerator ()),
scm_from_int64 (r.denominator ()));
}
Rational
ly_scm2rational (SCM r)
{
+ if (scm_is_true (scm_inf_p (r)))
+ {
+ if (scm_is_true (scm_positive_p (r)))
+ {
+ Rational r;
+ r.set_infinite (1);
+ return r;
+ }
+ else
+ {
+ Rational r;
+ r.set_infinite (-1);
+ return r;
+ }
+ }
+
return Rational (scm_to_int64 (scm_numerator (r)),
scm_to_int64 (scm_denominator (r)));
}
Rational
robust_scm2rational (SCM n, Rational rat)
{
- if (ly_is_fraction (n))
+ if (scm_is_real (n)
+ && (scm_is_true (scm_exact_p (n))
+ || scm_is_true (scm_inf_p (n))))
return ly_scm2rational (n);
else
return rat;
(interpret-markup layout props arg)
empty-stencil))
+#(define ((on-page 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 arg)
(if (= (chain-assoc-get 'page:page-number props -1)