3.6 lilypond-book テンプレート

以下に示すテンプレートは lilypond-book で使います。lilypond-book に馴染みが無いのであれば、lilypond-book を実行する を読んで下さい。

LaTeX

LilyPond 断片を LaTeX ドキュメントに組み込むことができます。

\documentclass[]{article}

\begin{document}

通常の LaTeX テキスト。

\begin{lilypond}
\relative {
  a'4 b c d
}
\end{lilypond}

次の LaTeX テキスト。オプションは角括弧の中に入れます。

\begin{lilypond}[fragment,relative=2,quote,staffsize=26,verbatim]
d4 c b a
\end{lilypond}
\end{document}

Texinfo

LilyPond 断片を Texinfo に組み込むことができます。実際、このマニュアル全体が Texinfo で記述されています。

\input texinfo @node Top
@top

Texinfo テキスト

@lilypond
\relative {
  a4 b c d
}
@end lilypond

次の Texinfo テキスト。オプションは角括弧の中に入れます。

@lilypond[verbatim,fragment,ragged-right]
d4 c b a
@end lilypond

@bye

html

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

<p>

以下のように、lilypond-book 用のドキュメントには自由に楽譜と
テキストを組み合わせることができます。
<lilypond>
\relative {
  a'4 b c d
}
</lilypond>
</p>

<p>
次の lilypond コードにはオプションをつけます

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

</body>
</html>


xelatex

\documentclass{article}
\usepackage{ifxetex}
\ifxetex
%xetex specific stuff
\usepackage{xunicode,fontspec,xltxtra}
\setmainfont[Numbers=OldStyle]{Times New Roman}
\setsansfont{Arial}
\else
%This can be empty if you are not going to use pdftex
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{mathptmx}%Times
\usepackage{helvet}%Helvetica
\fi
%Here you can insert all packages that pdftex also understands
\usepackage[ngerman,finnish,english]{babel}
\usepackage{graphicx}

\begin{document}
\title{A short document with LilyPond and xelatex}
\maketitle

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:

\begin{lilypond}
{a2 b c'8 c' c' c'}
\end{lilypond}

\noindent
and so on.

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

\selectlanguage{ngerman}
Auch Umlaute funktionieren ohne die \LaTeX -Befehle, wie auch alle
anderen
seltsamen Zeichen: __ ______, wenn sie von der Schriftart
unterst__tzt werden.
\end{document}

GNU LilyPond – アプリケーション使用方法 v2.25.14 (開発版).