[prev in list] [next in list] [prev in thread] [next in thread] 

List:       lilypond-user
Subject:    Re: Converting \page-ref value to number type
From:       "Benjamin Bruce" <benjamin () koine ! gr>
Date:       2024-04-24 18:23:19
Message-ID: f8811418-8889-4c98-8812-d8637a1c388c () app ! fastmail ! com
[Download RAW message or body]

Here is an updated (tinier) example:

\version "2.24"

{ 
  \label #'myLabel
  c4 c c
}

\markup #(markup #:page-ref 'myLabel "0" "?")

This displays the label's page number, but I still can't figure out how to extract \
that value so I can do things with it. Looking forward to your ideas. 


𐑪𐑯 2024-04-24 𐑨𐑑 08:47, Benjamin Bruce <benjamin@koine.gr> 𐑮𐑴𐑑:
> Hello all,
> I am just now learning how to use labels and \page-ref to retrieve the 
> page number where a label is located.
> I would like to use the value returned by \page-ref to do simple math 
> in Scheme. I am able to pass the label to a markup command, but I can't 
> figure out how to get it into a number format so I can manipulate it. 
> Any tips? Here is my tiny example:
> 
> \version "2.24"
> 
> { 
> \label #'myLabel
> c4 c c
> }
> 
> #(define-markup-command 
> (page-number-calculations layout props label) (markup?)
> ; Throws error "Wrong type argument in position 1"
> (interpret-markup layout props (+ label 1))
> )
> 
> myLabel = \markup { \page-ref #'myLabel "0" "?" }
> \markup \page-number-calculations \myLabel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic