4

I used the following code for page numbering and copyright formatting in lilypond --version 2.20.0:

pagenumcol = \markup {
  \column {
    \vspace #0.5
    \fromproperty #'page:page-number-string
  }
}

copyrightcol = "My Copyright file"

\paper {
  ragged-right = ##f
  page-breaking = #ly:page-turn-breaking

  oddHeaderMarkup = \markup \null
  evenHeaderMarkup = \markup \null

  oddFooterMarkup = \markup {
    \copyrightcol
    \on-the-fly #print-page-number-check-first
    \pagenumcol
  }

  evenFooterMarkup = \markup {
    \on-the-fly #print-page-number-check-first
    \pagenumcol
    \copyrightcol
  }
}

Now with lilypond --version 2.24.1 I get the following error:

GNU LilyPond 2.24.1 (running Guile 2.2)
Processing `First-Piano-two-hand-Exercises.ly'
Parsing...
./global-files/paper.ily:19:18: error: Guile signaled an error for the expression beginning here
    \on-the-fly #
                 print-page-number-check-first
Unbound variable: print-page-number-check-first
./global-files/paper.ily:19:17: error: wrong type for argument 1.  Expecting procedure, found #<unspecified>
    \on-the-fly 
                #print-page-number-check-first
ERROR: In procedure ly:parse-file:
In procedure reverse!: Wrong type argument in position 1: (#<unspecified> . #f)

Does anyone know how to fix this? A simple convert-ly run did not do :-(

5
  • 2
    I don't know to use these commands, but I remember it said something about \on-the-fly being depreciated on the 2.24 Changes page. Commented Jul 9, 2023 at 15:16
  • YEA, THX @ElementsinSpace it claims to use \if or \unless instead of \on-the-fly, both not working with #print-page-number-check-first. Guess the last one has to be replaced too... :-/
    – nath
    Commented Jul 9, 2023 at 15:31
  • 4
    @nath Please check that you ran convert-ly correctly. For me, it converts this code to correct LilyPond 2.24 code. Commented Jul 9, 2023 at 15:42
  • THX @jeanas - yea it does! I forgot adding a \version NUMBER!!! My paper-file is an inlcuded .ily file that does not have a version number by default. Can convert-ly follow files linked with the \include command?
    – nath
    Commented Jul 9, 2023 at 15:56
  • 2
    Currently, it cannot. You should either put \version numbers in all included files (which I would recommend), or run convert-ly with --from 2.20.0 to override the \version detection logic. Commented Jul 9, 2023 at 16:40

1 Answer 1

5

Some further reading in the documentation and I found this:

\paper {
  print-page-number = ##t
  print-first-page-number = ##t
  oddHeaderMarkup = \markup \null
  evenHeaderMarkup = \markup \null
  oddFooterMarkup = \markup {
    \fill-line {
      \if \should-print-page-number
      \fromproperty #'page:page-number-string
    }
  }
  evenFooterMarkup = \oddFooterMarkup
}

I changed my code by replacing \on-the-fly #print-page-number-check-first with \if \should-print-page-number:

pagenumcol = \markup {
  \column {
    \vspace #0.5
    \fromproperty #'page:page-number-string
  }
}

copyrightcol = "My Copyright file"

\paper {
  ragged-right = ##f
  page-breaking = #ly:page-turn-breaking

  oddHeaderMarkup = \markup \null
  evenHeaderMarkup = \markup \null

  oddFooterMarkup = \markup {
    \copyrightcol
    \if \should-print-page-number
    \pagenumcol
  }
  
  evenFooterMarkup = \markup {
    \if \should-print-page-number
    \pagenumcol
    \copyrightcol
  }
}

It compiles without errors :-)

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.