TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

If so, how? Do I need any additional software?

share|improve this question
In case the answer is no, this may be useful: vexflow.com – nedned Aug 3 '10 at 2:37
I have created some examples you might be interested in: martin-thoma.com/how-to-write-music-with-latex - if somebody knows some more complex ones or a page like TeXample, please let me know! – Martin Thoma Aug 1 '12 at 8:47
up vote 34 down vote accepted

I'd instead use LilyPond, which, though not based on TeX at all, has similar goals of human-readable plain-text source files and beautiful, customizable output.

share|improve this answer
Actually, Lilypond was originally based on TeX, at least partly, but now it's not the case any more. – Arthur Reutenauer Aug 3 '10 at 7:32
@Arthur: that's news to me. (Seriously. The last time I used Lilypond was close to 6 years ago, and back then it was based on TeX. I wonder what made them switch.) – Willie Wong Aug 3 '10 at 10:07
Now it's mostly written in C++ with a Scheme interface to control many aspects of the typesetting process. There also are bits and pieces in Python. – Arthur Reutenauer Aug 3 '10 at 16:11

There's also MusiXTeX for the actual typesetting (CTAN). A bit of searching turned up this page about exporting from LilyPond to MusiXTeX.

share|improve this answer
Hi! The link to "this page" looks obsolete. – MattAllegro Dec 8 '15 at 16:25

In addition to MusiXTeX, there's also GregorioTeX for gregorian chant. It's apparently very well suited to typesetting this particular type of scores, and is actively maintained.

share|improve this answer

Lilypond provides a tool called lilypond-book for creating LaTeX documents with embedded music pieces inside. The embedding works via images, and baselines are not considered. So if you want to display a clef in the middle of a line, it will only be nicely aligned vertically with the rest of the line after you have tweaked its vertical position using additional LaTeX code.

If you don't want to create a document, but rather music sheets on their own, Lilypond wins hands down in user friendliness. I am considered quite unanimously as a TeX wizard and would no longer think of using the TeX-based approaches for typesetting music.

With regard to its implementation: I think Lilypond has always been C++, has gained some Scheme innards rather early, but used TeX as its typesetting backend internally for quite a long time. However, its current mode of operation is to write PostScript files directly as main output (PDF generation works internally by using Ghostscript on those). As a result, utf-8 characters work rather transparently if the font has them. TeX's track record in that area, in comparison, is less than fabulous although in the last years, a few TeX engines (XeTeX, LuaTeX) that can work with larger character sets than 8bit have been developed.

share|improve this answer

I'd go for Lilypond, myself (see Ben Alpert's answer), but note that there's a TeX FAQ page of discussion about the alternatives

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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