lyluatex icon indicating copy to clipboard operation
lyluatex copied to clipboard

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

Open thelaumix opened this issue 2 years ago • 3 comments

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

thelaumix avatar Sep 05 '23 10:09 thelaumix

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.

profejuanca avatar Jul 13 '24 03:07 profejuanca

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 avatar Aug 23 '24 18:08 MacLotsen

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.

MacLotsen avatar Aug 28 '24 13:08 MacLotsen