12

In Lilypond the paper size can be set to A4, A5, Letter and so forth. However I have only a short song, and I want to embed it lateron. Therefore the output from Lilypond must be cropped somehow.

Is there a possibility to let Lilypond itself do this? Some setting to the \paper{} block, perhaps?

Journeyman Geek
  • 133,878
Boldewyn
  • 4,468

4 Answers4

11
  • If you want only the first system, you can use the -dpreview command-line option.
  • If you want multiple systems:

    \include "lilypond-book-preamble.ly"

    \paper { oddFooterMarkup = ##f }

  • Have ImageMagick convert autocrop it with the -trim option, e.g. via a shell script.

thSoft
  • 530
4

I managed this with running:

lilypond -dbackend=eps -dresolution=600 --png FILE.ly

And a paper section within the FILE.ly like this:

\paper {
  indent = 0\mm
  line-width = 110\mm
  oddHeaderMarkup = ""
  evenHeaderMarkup = ""
  oddFooterMarkup = ""
  evenFooterMarkup = ""
}
Flor
  • 41
  • 1
3

I know this is twelve years old now, but it still comes up on google. Add this line to the top of the lilypond file...

#(ly:set-option 'crop #t)

It will produce another file called filename.cropped.pdf, or svg, or png, whatever you have it set to.

Jordan
  • 31
0

From the Lilypond manual:

Extra sizes may be added by editing the definition for paper-alist in the initialization file scm/paper.scm.

You can therefore add your own page sizes to the default ones.

harrymc
  • 498,455