lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Header fields in custom footer


From: Noeck
Subject: Re: Header fields in custom footer
Date: Sat, 26 Nov 2016 22:27:26 +0100
User-agent: Mozilla/5.0 (X11; Linux i686; rv:45.0) Gecko/20100101 Thunderbird/45.4.0

Hi Andrew, Harm, all,

thanks for your help. I tried to post a minimal example, but it looks
like it was too minimal to show my intent. And of course, the LSR
snippet works and does what says. I just could solve my issue with it -
just passing my expression to the function did not solve it.

So here is the full thing I want to achieve:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\version "2.19.50"

\header {
  composer = "Mozart"
  maintainer = "Name"
  maintainerWeb = "http://example.com";
  license = "cc-by-sa"
}

\paper {
  oddFooterMarkup = \markup \line{
    \with-url
      #"http://example.com";
      #(format "By ~a - ~a"
        "Name"
        (substring "http://example.com"; 7))
    "-"
    \with-url
      #(format "https://creativecommons.org/licenses/~a/4.0/";
        (substring "cc-by-sa" 3))
      % putting the \markupWithHeader function here does not work
      #(format "License: CC ~a"
        (string-upcase (substring "cc-by-sa" 3)))
  }
}

{ a }
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
This code shows the footer I want to have, but whenever I wrote "Name",
"http://example.com"; or "cc-by-sa", I would like the corresponding
header fields to be used.

In the end, I would improve it (check whether the license starts with
'cc-', replace substrings rather than cutting out part of them, etc.).
But that would all be possible once I understood how to combine
\fromproperty, \with-url and scheme functions for this purpose.


Your code, Harm, looks promising. I tried to adapt it and put several
return values of \test into a modified test-proc function. But
apparently the lambda function does not accept more than one argument:
Wrong number of arguments to #<procedure #f (strg strh)>

Now I try to write several test-proc like functions, one for each call
of a header, and combine them with lilypond later as you did. Might be a
way. I am not sure yet, whether that amount of code is resonable in
contrast to the fact that I saved typing the url etc. twice.

The problem how to put the maintainerWeb field in the first argument of
\with-url remains.

Thanks,
Joram



reply via email to

[Prev in Thread] Current Thread [Next in Thread]