[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Hi - Problem with \with-link
From: |
Jean Abou Samra |
Subject: |
Re: Hi - Problem with \with-link |
Date: |
Thu, 17 Nov 2022 20:17:18 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.1 |
Le 17/11/2022 à 12:30, Eulogia a écrit :
Thanks for the answer!
In fact I should have started with that…Now I've found the solution.
I give the code, if it could help someone:
\version "2.20.0"
reference = "1"
labelNr = #(string-append "Ref" reference)
\label \labelNr
\markup { "Page 1" }
\pageBreak
If I guess correctly, your problem is that
\version "2.22.2"
reference = "1"
\label #(string-append "Ref" reference)
does not work? The issue here is that string-append takes
strings and returns a string, while \label takes a Scheme
symbol, which is a different beast (#"abc" vs. #'abc).
The reason why it magically works if the string comes from a
variable is a bit difficult to explain without going into
details, but it's pretty unusual to do it like this. Instead,
just convert the string to a symbol:
\version "2.22.2"
reference = "1"
\label #(string->symbol (string-append "Ref" reference))
Best,
Jean
OpenPGP_signature
Description: OpenPGP digital signature