Jump to content

Using ad hoc paper sizes: Difference between revisions

From LilyPond wiki
m Replace version="2.24.0" with version="2.24" now that the LilyWiki extension supports auto-selecting the latest release in a stable series
Tags: Mobile edit Mobile web edit
m New category
 
(One intermediate revision by the same user not shown)
Line 26: Line 26:


[[Category:Paper and layout]]
[[Category:Paper and layout]]
[[Category:Snippet]]

Latest revision as of 23:29, 21 November 2025

This snippet shows how to define custom paper sizes.

\version "2.24"

%% http://lsr.di.unimi.it/LSR/Item?id=762

% define the new format with a unique name and width and height
#(set! paper-alist (cons '("square" . (cons (* 10 cm) (* 10 cm))) paper-alist))

\paper {
% utilize the new format
  #(set-paper-size "square" 'landscape)

  oddHeaderMarkup = \markup {
    \fill-line { "***" "***" }
  }
  oddFooterMarkup = \markup {
    \fill-line { "***" "***" }
  }
}
#(set-global-staff-size 16)

\relative c'' {
  bes a c b
}