I'm new to the #+INCLUDE command, and am using it to assemble a book of sheet music.

At the top of the file I've placed a #+LaTeX_HEADER to use the \fancyhdr package for footers for all the pages in the book. After a few pages of text introduction, I insert sheet music:

#+INCLUDE: "/home/me/music.ly" src lilypond :file output.eps

This does kind of work, but there are about 4 pages of outputted sheet music, and only the first ends up in the exported PDF. Additionally, there is this collision between the sheet music and the footer:

enter image description here

I wonder, on the one hand, if it's possible to get #+INCLUDE to include all of the pages of sheet music within the bounds of the margins of the page---and on the other hand if doing this with Org might be less sensible than directly using LaTeX or Lilypond-book. I'm struggling to get my head around it all, and would appreciate any voices of experience.

1 Answer 1


It seems that the lilypond file is compiled into a picture that is then included in the latex file by the latex macro \includegraphics which is not supposed to handle multi-page files.

Since you apparently don't want to edit your lilypond files from the org file (you would use src blocks rather than #+INCLUDE:), I would suggest that you:

  • convert them to pdf outside of org (lilypond music.ly in a command line shell should create file music.pdf for example),
  • include them through \includepdf from the pdfpages latex package.

Here's a minimum working example:

#+TITLE: test include lilypond through includepdf
#+LaTeX_HEADER: \usepackage{pdfpages}

* intro

bla bla

now the music !


This turns out to be more of a latex answer than an org one.

  • Yes, this is exactly the solution I've ended up using. I stumbled across a good blogpost on the subject at lilypondblog.org/2013/07/…, which recommended your same solution. The only other thing I had to do was use the \paper environment in Lilypond to get the pdf margins to match the margins I'd set in LaTeX (for header and footer issues). Thank you! Commented Nov 11, 2015 at 19:56

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.