3.7 lilypond-book templates

These templates are for use with lilypond-book. If you’re not familiar with this program, please refer to Running lilypond-book.


You can include LilyPond fragments in a LaTeX document.


% here you can insert packages all LaTeX flavours understand

  % stuff specific to XeTeX
  % this can be empty if you are not going to use pdfTeX


\title{A short document with LilyPond and \LaTeX}

Normal \textbf{font} commands inside the \emph{text} work,
because they are \textsf{supported by all \LaTeX{} flavours}.
If you want to use specific commands like \verb+\XeTeX+, you
should include them again in a \verb+\ifxetex+ block.
You can use this to print the \ifxetex \XeTeX{} \else XeTeX \fi
command, which is not known to pdfTeX by default.

In normal text you can easily use LilyPond commands, like this:

{ a2^"foo" b_"bar" c'8 c' c' c' }

\paper {
  property-defaults.fonts.serif = "Libertinus Serif"

Note that the fonts used in snippets have to be set from inside
the snippets, as demonstrated.

Da die Standard-Eingabekodierung von \LaTeX{} UTF-8 ist,
funktionieren Umlaute u.\,ä. ohne \LaTeX-Akzentbefehle (ßäöü),
wenn sie von der Schriftart unterstützt werden.



You can include LilyPond fragments in Texinfo; in fact, this entire manual is written in Texinfo.

\input texinfo 
@node Top
@end ifnottex

Texinfo text

\relative {
  a4 b c d
@end lilypond

More Texinfo text, and options in brackets.

d4 c b a
@end lilypond



<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

Documents for lilypond-book may freely mix music and text.  For
\relative {
  a'4 b c d

Another bit of lilypond, this time with options:

<lilypond fragment quote staffsize=26 verbatim>
a4 b c d


LilyPond Application Usage v2.25.13 (development-branch).