可以通过lilypond-book命令将LilyPond注释雕刻机与LaTeX一起使用。首先,我们创建一个LaTeX文档(文件扩展名为.lytex),将我们的音乐嵌入到:
\documentclass[letterpaper,12pt]{article} \begin{document} \begin{center} {\fontsize{24pt}{24pt}\textbf{Twa Corbies}}\\ \end{center} \begin{flushright} \textsc{Your Name} \end{flushright} % We don't need to require anything for this because lilypond-book will process it. \lilypondfile{TwaCorbies.ly} \end{document}
然后,我们创建我们的LilyPond文件(.ly),包括lilypond-book-preamble.ly文件(LilyPond将知道如何查找):
\version "2.16.2" \include "lilypond-book-preamble.ly" voice = << \relative c' { \tempo "con affetto" \clef bass \key e \minor \time 3/4 a a b | c a a | g a2 | a4 a b | c2 ~ c8 a8 | a8 g a2 | \bar "|." } \addlyrics{ As I was wal -- king all a -- lane I heard twa cor -- bies make a mane. } >> \score { << \new Staff = "voice" { \voice } >> \layout { } \midi { \context { \Score tempoWholesPerMinute = #(ly:make-moment 90 4) } } }
要构建,我们然后运行lilypond-book命令:
lilypond-book --include=mymusicsourcedirectory/ --pdf TwaCorbies.lytex
它将输出包含您的LilyPond雕刻音乐的PDF: