When I use TeXworks to create the .lytex file, I don’t know what typesetting tool to use (pdfLaTeX?)
You use the lilypond-book typesetting tool. Since this tool doesn't come setup in TeXworks by default, you have to add it. Given your reference to terminal I assume that you're using Mac OSX. In that case the easiest way to set things up is grab the TeXShop engines from https://sole.dimi.uniud.it/~nicola.vitacolonna/software/lilypond-texshop/ They work in TeXworks just as well as in TeXShop. Place these in ~/Library/TeXworks/engines (you may have to create this folder). Then in TeXworks open the preferences and go to the typesetting tab. Click on the "+" in the lower pane to add a new engine. Call the processing tool LilyPond-Book and browse to the LilyPond-Book.engine file that you just got. Add $fullname as the argument and click OK until you're back at the main program. Now you should be able to select LilyPond-Book from the drop down menu of TeX processors and compile your file.
when I try to typeset it, it says: ! LaTeX Error: Environment lilypond undefined.
This error results from not running the lilypond-book processor. The lilypond environment isn't defined by any class or style file so pdflatex (or any other latex processor) doesn't know what to do with it. lilypond-book actually removes these environments, runs their contents through lilypond, and replaces them by the resulting graphic in the background.
or ! LaTeX Error: \begin{[} on input line 5 ended by \end{lilypond}.
This error is because you changed your \begin{lilypond} to \begin{[}. Even though the lilypond environment isn't a real latex environment, you still need to treat it as such. Then, when I just save the file as .lytex and run lilypond-book in the Terminal, I get: -bash: lilypond-book: command not found This means the location of lilypond-book isn't in path and you're not in the folder where it's located. This isn't an unusual situation as lilypond-book is inside the LilyPond.app that you should have placed in your Applications folder. If you want to run any of the lilypond scripts from the command line then you need to follow the instructions in the right hand column here: http://www.lilypond.org/macos-x.html Note that if you want to stick with the GUI interfaces (either LilyPond's own or TeXworks) then you don't need to follow these instructions. ✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝ Br. Samuel (R. Padraic Springuel) PAX ☧ ΧΡΙΣΤΟΣ _______________________________________________ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user