I've created a couple LilyPond .ly files, with some music I want to insert into a Latex document I have on ShareLatex, but I don't know which packages to use etc.

Does anyone know how I can get this done?

  • Welcome to TeX.SX! Have you read Lilypond's documentation? If yes, could you please add a minimal working example (MWE) that illustrates where exactly is your problem? You can also browse lilypond related questions to help you.
    – ebosi
    Commented May 19, 2017 at 20:21
  • IN general, to insert lilypond music into LaTeX, you can either create images (e.g. in .png format) from Lilypond and \includegraphics in LaTeX, or use Lilypond-book. The "best" choice depends what you want to do - for example, if the music needs two systems, do you want one at the bottom of a page and the second at the top of the next page, or both on the same page? I don't know anything about ShareLatex, so this is a comment not an answer.
    – alephzero
    Commented May 19, 2017 at 20:30
  • If you're restricted to working with ShareLatex, I recommend creating the individual LilyPond images (I recommend .pdf because they're smaller and higher quality) and using \includegraphics. Going the lilypond-book route requires some command-line work that, if it's even possible on ShareLatex, seems needlessly complex.
    – Richard
    Commented May 19, 2017 at 20:56

1 Answer 1


I ended up going with just creating individual images (.pdf, with the highest quality option, as @Richard suggested) and inserting them into the .tex with \includegraphics. It's not a perfect solution, but it was definitely good enough for my purposes.

As an aside, using ShareLaTeX (now Overleaf) is a good solution when you're relatively new to LaTeX, but situations like this where it forces you to use suboptimal workarounds do arise quite often. I now use TeXStudio and don't think I'll ever need another LaTeX editor again.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .