I am trying to incorporate Lilypond files into LaTeX. I use MacOS Sonoma 14.1.1. TexShop (5.2.2) and write my Lilypond files in Frescobaldi 3.3.0, where they compile into pdf files without a problem.
This question has been asked before, I am incorporating the answer of How to run `--shell-escape` for LuaLaTeX in Texshop, in particular the steps:
I just have an Engine file to do this, or use the arara engine. Save the following file as lualatex-shell.engine in ~/Library/TeXShop/Engines.
#!/bin/tcsh
set path= ($path /usr/texbin /usr/local/bin)
lualatex --shell-escape --file-line-error --synctex=1 "$1"
In the Terminal type:
chmod +x ~/Library/TeXShop/Engines/lualatex-shell.engine
Then restart TeXShop and you can invoke it either by choosing it from the Program item in the Macros menu, or by adding a magic comment line:
% !TEX TS-program = lualatex-shell
I follow all these steps diligently and apply this to several lilypond examples, e.g. my file test4.tex
!TEX TS-program = lualatex-shell
\documentclass{article}
\usepackage{lyluatex}
\begin{document}
\begin{lilypond}
\relative{\time 8/4 \key g \major g'4 a b c d e fis g}
\end{lilypond}
\end{document}
But when I Typeset it in TeXshop or use the terminal I get the following error
(lyluatex) Compiling score tmp-ly/e0245313228d92c30cf69cc0a8ddc120 with LilyPond executable 'lilypond'. ...ocal/t exlive/2023/texmf-dist/tex/latex/base/ltluatex.lua:110: Module lyluatex Error: LilyPond could not be started. (lyluatex) Please check that LuaLaTeX is started with the (lyluatex) --shell-escape option, and that 'program' (lyluatex) points to a valid LilyPond executable. (lyluatex) on input line 9
stack traceback: [C]: in function 'error' ...ocal/texlive/2023/texmf-dist/tex/latex/base/ltluatex.lua:110: in function < ...ocal/texlive/2023/texmf-dist/tex/latex/base/ltluatex.lua:109> (...tail calls...) ./lyluatex.lua:1106: in method 'process' [\directlua]:1: in main chunk. \ly@compilescore ...directlua {ly.score:process()}
l.9 \end{lilypond}
I am complete at a loss here as it seems to know the lyluatex package but find an error in a lilypond code.
Can anyone help me resolve this.
Please note that I am not a (La)TeX expert keep it simple if you can !
\begin{lilypond}is missing. It looks like thelyluatexpackage can't find Lilypond. Did you check thelyluatexmanual? – Jasper Habicht Nov 24 '23 at 15:03lilypond." If you type this command in the command line (Terminal on macOS), does Lilypond start up? If not, you might need to telllyluatexwhere it should look for LilyPond using theprogramoption. – Jasper Habicht Nov 24 '23 at 15:06