2

I am trying to use lyLuaTeX but it is not working. I've read the documentation but I don't understand how to get it to work.

I am on Windows 10, using TeX Live (first comment). Here is what I am trying to compile.

\documentclass{article}
\usepackage[program=C:/Program Files (x86)/LilyPond/usr/bin/lilypond.exe]{lyluatex}

\begin{document}

Help.

\lilypond{ c' d' e'}

\end{document}

I've added --shell-escape to the LuaLaTeX preferences on TeXworks above the file name, and then I press compile with LuaLaTeX. However, I receive the following error.

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 8

stack traceback:
    [C]: in function 'error'
    ...iles/texlive/2020/texmf-dist/tex/latex/base/ltluatex.lua:109: in function <
...iles/texlive/2020/texmf-dist/tex/latex/base/ltluatex.lua:108>
    (...tail calls...)
    ...es/texlive/2020/texmf-dist/scripts/lyluatex/lyluatex.lua:1081: in method 'p
rocess'
    [\directlua]:1: in main chunk.
\ly@compilescore ...directlua {ly.score:process()}

l.8 \lilypond{ c' d' e'}

? 

Thank you for your time.

Ilyankor
  • 353

2 Answers2

1

I had the same issue on WIndows 10 and LilyPond 2.22.2. I fixed it by moving LilyPond to a path with no spaces.

This MWE works for me:

\documentclass[a4paper]{article}
\usepackage[program=/bin/lilypond/usr/bin/lilypond.exe]{lyluatex}
\begin{document}

\lilypondfile[staffsize=17]{/score.ly}

\end{document}

gsl
  • 699
0

As this is unanswered and someone might stumble upon this, I answered a very similar question in music.sx. The best strategy to integrate music into LaTeX is by making the music snippets and text document separately, then integrate the snippets as pdfs with graphicx.

MaestroGlanz
  • 2,348