1

Can someone ELI5 the process? I've tried reading the guide from

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

but it doesn't seem to work. I am on Windows 10, and I have Lilypond 2.18.2 installed. That's everything I've done so far.

Here's what I've tried.

In a text editor, I copy and pasted the code

\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}

Then I saved the file as lilybook.lytex

Then I pressed Start, and type in DOS. Something called a command prompt shows up, and I click it. Then I type in after C:\Users\[name]>, starting with a space,

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

Then, it shows

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

People at music theory stack exchange have said that it is not for a Windows computer. So how to do this on Windows? Please help, I am very confused. Thank you.

Ilyankor
  • 171
  • 3
  • 8

1 Answers1

0

I believe you need to add lilypond-book to your PATH variable just like you possibly did with the lilypond executable. These are the set of instructions from LilyPond's own website:

Windows on the command line

The most convenient way to run LilyPond is by adding the folder which contains LilyPond executable files to the environmental variable “Path”.

  1. Open your “System” on the Control Panel, select Advanced tab and click Environmental Variables button.
  2. Select the Variable “Path” from Environmental variables list and click the Edit button. You will be presented a window titled “Edit System Variable”; append to “Variable value” the name of the folder which contains LilyPond executable files like this:

    [pre-set paths];DIR\LilyPond\usr\bin

Note: DIR will generally be C:\Program Files (x86) for 64 bit or C:\Program Files for 32 bit systems.

and click “OK” button to close the window.

Invoking individual executable files

LilyPond executable files – such as lilypond, lilypond-book, convert-ly, and so on – can be run from the command-line by invoking them:

lilypond test.ly

From: http://lilypond.org/windows.html

gilbertohasnofb
  • 1,984
  • 16
  • 28
  • 1
    Thank you. However, after following those directions, and running `lilypond-book --pdf [name].lytex`, I now get an error. It says that [name].lytex couldn't be found. Do I need to put it in a certain place? – Ilyankor Nov 28 '18 at 05:58
  • You need to make sure that your Command Prompt is in the correct directory where your .lytex file is. I am not on Windows but, according to one of the answers of [this question](https://stackoverflow.com/questions/60904/how-can-i-open-a-cmd-window-in-a-specific-location), you can apparently Shift + Right Click on the background of the Explorer window in the directory you want to open, then click on "Open command window here". Else I would recommend you to take a look at these [basic navigation commands](https://www.digitalcitizen.life/command-prompt-how-use-basic-commands). – gilbertohasnofb Nov 28 '18 at 12:41
  • Ok I figured it out. Thank you. – Ilyankor Nov 28 '18 at 13:17
  • 1
    Let me add that nowadays the best tool is [LyLuaTex](https://github.com/jperon/lyluatex/blob/master/README.en.md). One of the advantages is that you can run LaTeX directly and lilypond snippets will be compiled at the same time. – fedelibre Dec 08 '18 at 08:43