On 2024-03-19 9:35 am, Johannes Roeßler wrote:
Hi,

I'd like to make an automatic footer, using infos from the header block.

What do I have to change, to get rid of (or override) the format from the title?

-----8<------------------

\version "2.24.0"

{a4}

\header {

  title =
  \markup
  \fill-line {
    \override #'(font-name . "Calluna")
    \abs-fontsize #22 "Title"
    \null
  }

  composer = "Composer"

}

\paper {

  oddFooterMarkup = \markup {
    \fill-line {
      \tiny {
        {"Edited by Joei"}
        \line  {\fromproperty #'header:composer " - " \fromproperty #'header:title }
       "Copyright 2024"
      }
    }
  }
}

------>8-------

It should be possible to strip markup down to a simple string with the Scheme function markup->string.

%%%%
\version "2.22.0"

foo = \markup \huge \bold "Hello"

#(define-markup-command
  (as-string layout props arg) (markup?)
  (interpret-markup layout props (markup->string arg)))

\markup \foo

\markup \as-string \foo
%%%%

However, the best approach would be to separate content from styling. When you define things like title, specify only the simple string value. Place all formatting/styling commands instead within the paper variables like bookTitleMarkup, scoreTitleMarkup, oddHeaderMarkup, etc.

Reference the file titling-init.ly within your LilyPond installation to see what the default values are for these markup paper variables. Copy-and-paste the default definitions and adjust to your needs. NOTE: These are the sort of things that are best put into include files, so you can reuse them and easily standardize your formatting across many scores.


-- Aaron Hill

Reply via email to