jperon / lyluatex

Alternative à lilypond-book pour lualatex
MIT License
58 stars 12 forks source link

Can't compile on MacOS - bad argument #1 to 'rawget' #316

Open thelaumix opened 1 year ago

thelaumix commented 1 year ago

Hey,

I'm trying to include lylualatex into Texifier on MacOS (Lilypond v2.24.2 / homebrew), but despite my efforts, any attempt to compile even the most basic scores results in an error being thrown by LuaLaTeX.

(lyluatex)  Compiling score tmp-ly/8de58477103c654174a63450fab5a00f with LilyPond executable '/opt/homebrew/bin/lilypond'.
...23/texmf-dist/tex/lualatex/luaoptions/luaoptions-lib.lua:236: bad argument #1 to 'rawget' (table expected, got nil)
stack traceback:
    [C]: in function 'rawget'
    ...23/texmf-dist/tex/lualatex/luaoptions/luaoptions-lib.lua:236: in metamethod '__index'
    ...al/texlive/2023/texmf-dist/scripts/lyluatex/lyluatex.lua:802: in method 'lilypond_cmd'
    ...al/texlive/2023/texmf-dist/scripts/lyluatex/lyluatex.lua:1146: in method 'run_lilypond'
    ...al/texlive/2023/texmf-dist/scripts/lyluatex/lyluatex.lua:1110: in method 'process'
    [\directlua]:1: in main chunk.
\ly@compilescore ...directlua {ly.score:process()}

l.16 \end{lilypond}

I did already find some issues referring to a similar log output, but so far none of the solutions provided there have been able to resolve the problem. Does anyone know what might be causing this to happen?

Best regards

profejuanca commented 4 months ago

Same error in manjaro (in 3 different computers), using Gummy or another editor, but if I use a document without save them and autocompile option fron ram, this works perfectly, but is useless without saving option.

MacLotsen commented 3 months ago

Same for Ubuntu 22.04 with GNU LilyPond 2.24.3 and TeX Live (latest, not apt). MWE: lualatex lualatex --shell-escape myfile

\documentclass[11pt]{scrbook}
\usepackage{lyluatex}
\begin{document}
    \begin{lilypond}[quote,fragment,staffsize=26]
      c'4 d' e' f' g'2 g'
    \end{lilypond}
\end{document}

However, it does the same for any lilypond macro.

MacLotsen commented 3 months ago

When the first argument is nil, the log file couldn't be found. I think you can work around it if you keep the source and output directory the same. I have opened a PR in luaoptions to solve this matter.