I want to generate SVG from Lilypond. I have used the following command:

lilypond -fsvg music.ly

It works correctly. Trouble is for big input files multiple svg files are generated. I would really prefer to have a single file. How to do this?


2 Answers 2


I suppose you are talking about multiple svgs being generated from multiple pages? In this case you can go this route:

Make Lilypond output a single page instead:

\paper {
  page-breaking = #ly:one-page-breaking

  \repeat unfold 400 c1
  • Does SVG support multiple pages? I can't tell from a quick Google and I don't think I've ever encountered a multiple-page SVG file. (Doesn't mean they don't exist, though!) Jun 1, 2023 at 14:30
  • @MichaelSeifert w3.org/TR/2004/WD-SVG12-20041027/multipage.html
    – Lazy
    Jun 1, 2023 at 14:59
  • Are pageset and page supported in epub?
    – kargirwar
    Jun 1, 2023 at 15:05
  • @Lazy: I found that, but my understanding from skimming the Wikipedia article on SVG was that the SVG 1.2 Full specification was never implemented, and SVG 2 doesn't support multiple pages. See this link. Jun 1, 2023 at 15:14
  • @MichaelSeifert Ah, good to know. I suppose there was not enough usecase to demand all renderers to handle multiple pages well.
    – Lazy
    Jun 1, 2023 at 15:28

There are several possible meaning for this question.

One is "how to generate one single SVG file with multiple pages in it". This is a rarely used feature of the SVG format; LilyPond does not support it.

Another is "how to simulate one single long, continuous page with all the systems on it, instead of breaking into several pages". As demonstrated in @Lazy's answer, you need to use \paper { page-breaking = #ly:one-page-breaking }. Documentation

Yet a third option is to generate normal pages (with page numbers, and everything), and then just squash them together vertically into one single "page". While this is not useful very often, it's used, for example, in the LilyPond documentation, to show how the multi-page output of certain examples looks like. If that is what you want, you should use the -dtall-page-formats=svg option. Documentation

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.