LILYPOND_LOGLEVEL=BASIC lilypond -drelative-includes -dbackend=eps \
-dpreview -dno-aux-files --pdf --png -dpixmap-format=pngalpha -o
out/ \
FILENAME.ly
This creates FILENAME.{pdf,eps} and FILENAME.preview.{eps,pdf,png}
in the out/
directory. -dpreview ensures that the *.preview.* images are
cropped, and -
dpixmap-format=pngalpha makes the background of the png images
transparent.
There's no need to specify a line width (i.e. paper size) for single-
line
snippets, because one-line snippets are layed out with ragged-right.