jperon / lyluatex

Alternative à lilypond-book pour lualatex
MIT License
56 stars 11 forks source link

Error in lilypond-Log: "/bin/sh: 1: Syntax error: Unterminated quoted string" #312

Open Luensche opened 1 year ago

Luensche commented 1 year ago

Hello,

I am trying to use lyluatex but already fail in the beginnings.

This is my MWE:

% !TeX program = lualatex
\documentclass[
ngerman
]{scrartcl}
\RequirePackage{luatex85}
\usepackage{babel}
\usepackage{graphicx}
\usepackage{emerald}
\usepackage{geometry}
\usepackage{luacode}
\usepackage{luaotfload}
\usepackage{fontspec}
\setmainfont{Noto Sans}
\geometry{a4paper,left=20mm,right=20mm,top=20mm,bottom=20mm}
\usepackage[pass-fonts]{lyluatex}

\begin{document}
\lilypond{ c' d' e' }
\end{document}

When I execute lualatex -synctex=1 -interaction=nonstopmode -shell-escape "mwe".tex I will find the following passage in my log file:

Module lyluatex Info: Compiling score tmp-ly/fc20691fa92c1ef1cd34040369dc610f wi
th LilyPond executable 'lilypond'. on input line 18

Module lyluatex Warning: The score doesn't contain any music:
(lyluatex)               this will probably cause bad output. on input line 18
/usr/local/share/miktex-texmf/tex/latex/base/ltluatex.lua:110: 
Module lyluatex Error: 
(lyluatex)             LilyPond failed to compile the score.
(lyluatex)             Please check the log file
(lyluatex)             and the generated LilyPond code in
(lyluatex)             tmp-ly/fc20691fa92c1ef1cd34040369dc610f.log
(lyluatex)             tmp-ly/fc20691fa92c1ef1cd34040369dc610f.ly
(lyluatex)             
(lyluatex)             As the input code has been automatically wrapped
(lyluatex)             with a music expression, you may try repeating
(lyluatex)             with the `nofragment` option.
(lyluatex)             on input line 18

stack traceback:
    [C]: in function 'error'
    /usr/local/share/miktex-texmf/tex/latex/base/ltluatex.lua:110: in function </us
r/local/share/miktex-texmf/tex/latex/base/ltluatex.lua:109>
    (...tail calls...)
    /usr/local/share/miktex-texmf/scripts/lyluatex/lyluatex.lua:561: in method 'che
ck_compilation'
    /usr/local/share/miktex-texmf/scripts/lyluatex/lyluatex.lua:1209: in method 'wr
ite_latex'
    /usr/local/share/miktex-texmf/scripts/lyluatex/lyluatex.lua:1133: in method 'pr
ocess'
    [\directlua]:1: in main chunk.
\ly@compilescore ...directlua {ly.score:process()}

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

The lua interpreter ran into a problem, so the
remainder of this lua chunk will be ignored.

So I had first a look into tmp-ly/fc20691fa92c1ef1cd34040369dc610f.log. It shows only one line: /bin/sh: 1: Syntax error: Unterminated quoted string Up next, I looked into the generated LilyPond file which looks fine:

%%File header
\version "2.18.2"

#(define inside-lyluatex #t)
#(set-global-staff-size 12.166663275825)
#(set! paper-alist (cons '("lyluatexfmt" . (cons (* 597.507874 pt) (* 845.046844 pt))) paper-alist))

\include "lilypond-book-preamble.ly"

\header {
    copyright = ""
    tagline = ##f
}
\paper{
    #(set-paper-size "lyluatexfmt")
    two-sided = ##f
    line-width = 483.69686889648\pt
    indent = 0\pt
    % no alignment set
    #(define fonts
    (make-pango-font-tree "Noto Sans"
                          "Latin Modern Sans"
                          "Latin Modern Mono"
                          (/ staff-height pt 20)))

}
\layout{
    % no clef set
    % timing not suppressed
    % no time signature set
    % staff symbol not suppressed
    % no fix for badly cropped StaffGroup brackets
}

%%Follows original score
{c' d' e' }

So I executed lilypond fc20691fa92c1ef1cd34040369dc610f.ly. This produces the normal files. For me, it seems that there is an error in lyluatex. But I couldn't find it on a first look at the source.

OS: Ubuntu 22.04 TeX: MikTeX 23.5 LilyPond: 2.22.1

jperon commented 1 year ago

May you please try with debug option ?

\usepackage[debug,pass-fonts]{lyluatex}
Luensche commented 1 year ago

Now the log contains the following:

Module lyluatex Info: Compiling score tmp-ly/624d513bb9296e3eafb63884d8ab98be wi
th LilyPond executable 'lilypond'. on input line 18
Module lyluatex Info: VERSION 2.22.1 on input line 18
Module lyluatex Info: Command:
(lyluatex)            "lilypond" -E -dno-point-and-click -djob-count=2 -dno-dele
te-intermediate-files -I ".\" -I "/home/bjoern/Downloads/tmp/Lua/" -o "tmp-ly/62
4d513bb9296e3eafb63884d8ab98be" tmp-ly/624d513bb9296e3eafb63884d8ab98be.ly 2>&1 
on input line 18
Module lyluatex Info: Command:
(lyluatex)            "lilypond" -E -dno-point-and-click -djob-count=2 -dno-dele
te-intermediate-files -I ".\" -I "/home/bjoern/Downloads/tmp/Lua/" -o "tmp-ly/62
4d513bb9296e3eafb63884d8ab98be" tmp-ly/624d513bb9296e3eafb63884d8ab98be.ly 2>&1 
on input line 18

Module lyluatex Warning: The score doesn't contain any music:
(lyluatex)               this will probably cause bad output. on input line 18
/usr/local/share/miktex-texmf/tex/latex/base/ltluatex.lua:110: 
Module lyluatex Error: 
(lyluatex)             LilyPond failed to compile the score.
(lyluatex)             Please check the log file
(lyluatex)             and the generated LilyPond code in
(lyluatex)             tmp-ly/624d513bb9296e3eafb63884d8ab98be.log
(lyluatex)             tmp-ly/624d513bb9296e3eafb63884d8ab98be.ly
(lyluatex)             
(lyluatex)             As the input code has been automatically wrapped
(lyluatex)             with a music expression, you may try repeating
(lyluatex)             with the `nofragment` option.
(lyluatex)             on input line 18

stack traceback:
    [C]: in function 'error'
    /usr/local/share/miktex-texmf/tex/latex/base/ltluatex.lua:110: in function </us
r/local/share/miktex-texmf/tex/latex/base/ltluatex.lua:109>
    (...tail calls...)
    /usr/local/share/miktex-texmf/scripts/lyluatex/lyluatex.lua:561: in method 'che
ck_compilation'
    /usr/local/share/miktex-texmf/scripts/lyluatex/lyluatex.lua:1209: in method 'wr
ite_latex'
    /usr/local/share/miktex-texmf/scripts/lyluatex/lyluatex.lua:1133: in method 'pr
ocess'
    [\directlua]:1: in main chunk.
\ly@compilescore ...directlua {ly.score:process()}

l.18 \lilypond{ c' d' e' }
Luensche commented 1 year ago

Shouldn't be the command the following?

"lilypond" -E -dno-point-and-click -djob-count=2 -dno-dele te-intermediate-files -I ".\" -I "/home/bjoern/Downloads/tmp/Lua/" -o "tmp-ly/62 4d513bb9296e3eafb63884d8ab98be" tmp-ly/624d513bb9296e3eafb63884d8ab98be.ly 2>&1

If I run "lilypond" -E -dno-point-and-click -djob-count=2 -dno-delete-intermediate-files -I .\ -o "tmp-ly/624d513bb9296e3eafb63884d8ab98be" tmp-ly/624d513bb9296e3eafb63884d8ab98be.ly 2>&1 directly in the shell, it produces an eps-file as output.

Luensche commented 1 year ago

I changed a few lines in lyluatex.lua and not it works for me. The changes can be found here.