lilypond-user
[Top][All Lists]
Advanced

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

Re: Get the margin values


From: Pierre Perol-Schneider
Subject: Re: Get the margin values
Date: Mon, 5 Jun 2023 15:07:17 +0200

So far:

\version "2.24.1"

\paper {
  top-margin = 30
  left-margin = 30
}

#(define-markup-command
  (margin layout props)()
  (let* ((top-margin   (ly:output-def-lookup $defaultpaper 'top-margin))
         (bottom-margin  (ly:output-def-lookup $defaultpaper 'bottom-margin))
         (left-margin  (ly:output-def-lookup $defaultpaper 'left-margin))
         (right-margin   (ly:output-def-lookup $defaultpaper 'right-margin)))
    (interpret-markup layout props
      #{
        \markup\column {
          \line { top-margin = #top-margin }
          \line { bottom-margin = #bottom-margin }
          \line { left-margin = #left-margin }
          \line { right-margin = #right-margin }
        }
      #})))

% Test:
\markup\margin

Error: not a markup
So how can I get the paper values as a markp?
Tia, cheers,
Pierre

Le lun. 5 juin 2023 à 09:54, Pierre Perol-Schneider <pierre.schneider.paris@gmail.com> a écrit :
Dear List,
How could I automagically get the margin values, including the default values ?

Ex.

\version "2.24.1"

\paper {
  top-margin = 30
  left-margin = 30
}

\markuplist {
  "top-margin = ?"
  "bottom-margin = ?"
  "left-margin = ?"
  "right-margin = ?"
}

TIA, cheers,
Pierre

reply via email to

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