On 11/3/23 12:42 AM, Jean Abou Samra wrote:
Le 3 nov. 2023 à 07:56, Paul Scott <waterhorsemu...@aol.com> a écrit :
I know how to use fromproperty to put the page number in a header or
footer. Can I get the page number in a variable so I can use it in
another text string?
It depends on what kind of variable you are talking about and what you
want to use it for. There is no way to do "num = \currentPage" in the
middle of the music, simply because the music cannot be defined in
terms of its own page numbers. However, if you write a custom markup
command, then you can read the 'page:page-number property, and this
will work in paper or header markups (but elsewhere, it gets more subtle).
So, this is a little complicated in general. But if you're just trying
to print a reference like "go to page x", see \label and \markup
\page-ref (
https://lilypond.org/doc/v2.25/Documentation/notation/other-markup-commands ).
I did find the reference above from the index.
Your answer made me realize that I can use a normal header for all the
page numbers except the first one which I want to embed in the title to
duplicate the music that I am modifying.
Now if I define firstPage = #59, I can do:
first-page-number = \firstPage
in the \paper block but when I try
\markup\fill-line{ \firstPage } :
I get:
error: syntax error, unexpected NUMBER_IDENTIFIER
I can provide a MWE if necessary.
Thank you,
Paul