首页 > 解决方案 > Lilypond 到 LaTeX

问题描述

有人可以ELI5这个过程吗?我试过阅读指南

http://lilypond.org/doc/v2.18/Documentation/usage/an-example-of-a-musicological-document

但它似乎不起作用。我在 Windows 10 上,并且安装了 Lilypond 2.18.2。这就是我到目前为止所做的一切。

这是我尝试过的。

在文本编辑器中,我复制并粘贴了代码

\documentclass[a4paper]{article}

\begin{document}

Documents for \verb+lilypond-book+ may freely mix music and text.
For example,

\begin{lilypond}
\relative c' {
  c2 e2 \tuplet 3/2 { f8 a b } a2 e4
}
\end{lilypond}

Options are put in brackets.

\begin{lilypond}[fragment,quote,staffsize=26,verbatim]
  c'4 f16
\end{lilypond}

Larger examples can be put into a separate file, and introduced with
\verb+\lilypondfile+.

\end{document}

然后我将文件保存为 lilybook.lytex

然后我按下开始,然后输入 DOS。出现一个叫做命令提示符的东西,我点击它。然后我输入 after C:\Users\[name]>,以空格开头,

lilypond-book --output=out --pdf lilybook.lytex

然后,它显示

'lilypond-book' is not recognized as an internal or external command, operable program or batch file.

乐理堆栈交换的人说它不适用于 Windows 计算机。那么如何在 Windows 上做到这一点呢?请帮忙,我很困惑。谢谢你。

标签: latexpdflatexlilypond

解决方案


我相信您需要将 lilypond-book 添加到 PATH 变量中,就像您对 lilypond 可执行文件所做的那样。这些是来自 LilyPond 自己网站的说明集:

命令行上的 Windows

运行 LilyPond 最方便的方法是将包含 LilyPond 可执行文件的文件夹添加到环境变量“Path”中。

  1. 打开控制面板上的“系统”,选择高级选项卡,然后单击环境变量按钮。
  2. 从环境变量列表中选择变量“路径”,然后单击编辑按钮。您将看到一个标题为“编辑系统变量”的窗口;将包含 LilyPond 可执行文件的文件夹的名称附加到“变量值”,如下所示:

    [预设路径];DIR\LilyPond\usr\bin

注意:DIR 通常是 64 位系统的 C:\Program Files (x86) 或 32 位系统的 C:\Program Files。

并单击“确定”按钮关闭窗口。

调用单个可执行文件

LilyPond 可执行文件——例如 lilypond、lilypond-book、convert-ly 等——可以通过调用它们从命令行运行:

lilypond test.ly

来自: http: //lilypond.org/windows.html


推荐阅读