包括Lilypond在LaTeX

71G*_*1GA 4 lilypond

在这里指出,我必须将Lilypond包含在LaTeX中,如下所示:

\documentclass[a4paper,10pt]{report}
\usepackage[utf8x]{inputenc}

\begin{document}
\begin{lilypond}
\relative c'' {
\time 4/4

< a e' a >2 
< a e' a >4
< a e' a >8
< a e' a >8 

} 
\end{lilypond}
\end{document}
Run Code Online (Sandbox Code Playgroud)

但这不起作用,因为命令\begin{lilypond}没有被重新认识,所以我什么都没有.我必须包括任何包裹或什么?那个教程太草率了......

thu*_*ele 9

必须lilipond-book使用命令 编译具有lilipond环境的.tex文件lilypond-book -f latex --psfonts --output OUTPUT TEX_FILE.tex

这在lilipond文档的不同部分进行了解释:http://lilypond.org/doc/v2.12/Documentation/user/lilypond-program/Invoking-lilypond_002dbook#Invoking-lilypond_002dbook