3.6 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.

3.6.1 LaTeX

You can include LilyPond fragments in a LaTeX document.



Normal LaTeX text.

\relative {
  a'4 b c d

More LaTeX text, and options in square brackets.

d4 c b a

3.6.2 Texinfo

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


3.6.3 html

<!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


3.6.4 xelatex

%xetex specific stuff
\setmainfont[Numbers=OldStyle]{Times New Roman}
%This can be empty if you are not going to use pdftex
%Here you can insert all packages that pdftex also understands

\title{A short document with LilyPond and xelatex}

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

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

{a2 b c'8 c' c' c'}

and so on.

The fonts of snippets set with LilyPond will have to be set from
of the snippet.  For this you should read the AU on how to use

Auch Umlaute funktionieren ohne die \LaTeX -Befehle, wie auch alle
seltsamen Zeichen: __ ______, wenn sie von der Schriftart
unterst__tzt werden.

LilyPond — Usage v2.24.3 (stable-branch).