lyluatex icon indicating copy to clipboard operation
lyluatex copied to clipboard

lilypond 2.23.x and lyluatex (fragments not inserted)

Open notacontranota opened this issue 3 years ago • 10 comments
trafficstars

With lilypond 2.23.5 & 2.23.6 lyluatex doesn't insert the music fragment. With lilypond 2.22, all Ok.

GNU/Linux Kubuntu 21.10 Texlive 2021 (20220214, not kubuntu repositories)

notacontranota avatar Feb 15 '22 14:02 notacontranota

It seems to come from the fact lilypond 2.23 doesn't generate both pdf and eps in one compilation (for multi-system output). So it'll be necessary to convert intermediate eps to pdf. I'm going to do that ASAP.

jperon avatar Feb 16 '22 18:02 jperon

@notacontranota May you please test with latest commit on master ? I think it fixed this issue.

jperon avatar Feb 16 '22 23:02 jperon

I'm trying to build a document with LilyPond 2.23.80 and the latest lyluatex release and I get this error:

(/tmp/tex2pdf.-e25a259986005e58/input.toc) [3] [4] [1] [2]
(lyluatex)	Compiling score tmp-ly/841dc758b474d99c78eb9e55320c1db9 with LilyPond executable 'lilypond'.
...are/texlive/texmf-
dist/scripts/lyluatex/lyluatex-lib.lua:159: bad argument #1 to 'rawget' (table 
expected, got nil).
\ly@compilescore ...directlua {ly.score:process()}
                                                  
l.168 \end{lilypond}
                  
 4646 words of node memory still in use:
   18 hlist, 2 vlist, 5 rule, 1 mark, 48 disc, 3 local_par, 4 dir, 77 glue, 22 
kern, 14 penalty, 365 glyph, 48 attribute, 70 glue_spec, 26 attribute_list, 2 t
emp, 2 write, 1 user_defined, 3 pdf_dest, 1 pdf_colorstack nodes
   avail lists: 2:84,3:42,4:13,5:299,6:10,7:6004,8:3,9:117,10:10,11:651
!  ==> Fatal error occurred, no output PDF file produced!
Transcript written on input.log.

Error producing PDF.
!  ==> Fatal error occurred, no output PDF file produced!

I'll try to remember how to use the git master version...

fedelibre avatar Oct 28 '22 21:10 fedelibre

Ok, quick and dirty:

$ sudo cp /usr/share/texlive/texmf-dist/scripts/lyluatex/lyluatex.lua /usr/share/texlive/texmf-dist/scripts/lyluatex/lyluatex.lua.backup
$ sudo cp ~/src/lyluatex/lyluatex.lua /usr/share/texlive/texmf-dist/scripts/lyluatex/lyluatex.lua

but it complains:

(/usr/share/texlive/texmf-dist/tex/generic/iftex/ifxetex.sty))/usr/share/texliv
e/texmf-dist/scripts/lyluatex/lyluatex.lua:12: module 'luaoptions-lib.lua' not 
found:
	no field package.preload['luaoptions-lib.lua']
	[kpse lua searcher] file not found: 'luaoptions-lib.lua'
	[kpse C searcher] file not found: 'luaoptions-lib.lua'
	no file '/usr/local/lib/lua/5.3/luaoptions-lib.so'
	no file '/usr/local/lib/lua/5.3/loadall.so'
	no file './luaoptions-lib.so'
stack traceback:
	[C]: in function 'require'
	/usr/share/texlive/texmf-dist/scripts/lyluatex/lyluatex.lua:12: in main chunk
	[C]: in function 'require'
	[\directlua]:1: in main chunk.
l.140 }

@jperon Please remind us how to use the git master version of lyluatex.

fedelibre avatar Oct 28 '22 21:10 fedelibre

I've now found this issue.

The next LilyPond stable (2.24) will be released within the end of the year, so it's important to release luaoptions asap.

fedelibre avatar Oct 29 '22 20:10 fedelibre

Here's what I did to install luaoptions manually:

$ git clone [email protected]:lualatex-tools/luaoptions.git ~/src/luaoptions
$ mkdir -p ~/texmf/scripts/luaoptions
$ mkdir -p ~/texmf/tex/luatex/luaoptions
$ cp src/luaoptions/luaoptions*.lua ~/texmf/scripts/luaoptions/
$ cp src/luaoptions/luaoptions.sty ~/texmf/tex/luatex/luaoptions/
$ tree ~/texmf
/var/home/fede/texmf
├── scripts
│   └── luaoptions
│       ├── luaoptions-lib.lua
│       └── luaoptions.lua
└── tex
    └── luatex
        └── luaoptions
            └── luaoptions.sty

Now I get a different error when I build my book:

(/usr/share/texlive/texmf-dist/tex/generic/iftex/ifxetex.sty))/usr/share/texliv
e/texmf-dist/scripts/lyluatex/lyluatex.lua:13: attempt to index a nil value (gl
obal 'lua_options')
stack traceback:
	/usr/share/texlive/texmf-dist/scripts/lyluatex/lyluatex.lua:13: in main chunk
	[C]: in function 'require'
	[\directlua]:1: in main chunk.
l.140 }
     
 423 words of node memory still in use:
   3 hlist, 1 rule, 1 dir, 3 kern, 1 glyph, 5 attribute, 53 glue_spec, 5 attrib
ute_list, 1 if_stack, 1 write, 1 pdf_colorstack nodes
   avail lists: 2:15,3:2,7:2,9:2
!  ==> Fatal error occurred, no output PDF file produced!
Transcript written on input.log.

Error producing PDF.
!  ==> Fatal error occurred, no output PDF file produced!

fedelibre avatar Oct 29 '22 20:10 fedelibre

/usr/share/texliv e/texmf-dist/scripts/lyluatex/lyluatex.lua:13: attempt to index a nil value (gl obal 'lua_options') indicates that lualatex doesn’t find lyluatex.lua in its TEXINPUTS path.

When I use last lyluatex version, I generally put the whole luaoptions subfolder in the project directory, and add it to TEXINPUTS environment variable:

TEXINPUTS="lib:" lualatex --shell-escape DOCUMENT

jperon avatar Oct 30 '22 15:10 jperon

I'm using a pandoc command (I'm writing the document in Markdown). I tried your suggestion, but it didn't work. Maybe it doesn't work with pandoc?

I may consider switching the text input from Markdown to LaTeX if it helps with debugging. I'll have to find some spare time and think about it.

fedelibre avatar Oct 30 '22 20:10 fedelibre

After a quick test, it effectively doesn’t seem working with pandoc. I could suggest the following workaround (that works for me):

export TEXINPUTS="luaoptions:"
pandoc --standalone -i DOC.md -o DOC.tex
lualatex --shell-escape DOC

jperon avatar Oct 30 '22 21:10 jperon

I did a quick test and didn't work. I must find some spare time at day time to do a proper testing. It might take a lot...

fedelibre avatar Nov 01 '22 22:11 fedelibre

I tried a minimal example:

\documentclass{article}

\usepackage[]{lyluatex}

\begin{document}

\lily{
\fixed c'{c d e f}
\addlyrics{c d e f}
}

\end{document}

and it doesn't work:

$ echo $TEXINPUTS
luaoptions:
$ ls luaoptions/
LICENSE   README.md  luaoptions-lib.lua  luaoptions.md
Makefile  latexmkrc  luaoptions.lua      luaoptions.sty
$ lualatex --shell-escape test.tex
[...]
[\directlua]:1: attempt to index a nil value (global 'ly')
stack traceback:
	[\directlua]:1: in main chunk.
\ly@currentfonts ..., \sffamilyid , \ttfamilyid )}
                                                  \endgroup 
l.10 }
    
? 
[\directlua]:1: attempt to index a nil value (global 'ly')
stack traceback:
	[\directlua]:1: in main chunk.
\ly@compilescore ...directlua {ly.score:process()}
                                                  
l.10 }
    
? 
(./test.aux))
 426 words of node memory still in use:
   3 hlist, 1 vlist, 1 rule, 2 glue, 3 kern, 1 glyph, 6 attribute, 49 glue_spec
, 6 attribute_list, 2 write, 1 pdf_colorstack nodes
   avail lists: 2:10,3:1,4:1,5:4,7:1,9:1

warning  (pdf backend): no pages of output.
Transcript written on test.log.

fedelibre avatar Nov 05 '22 06:11 fedelibre

That’s weird, that time it seems it doesn’t find lyluatex.lua… May you try that way, please:

export TEXINPUTS="PATH/TO/LYLUATEX/FOLDER//:"
lualatex -shell-escape DOCUMENT_NAME

Please note the double slash at the end of lyluatex folder.

jperon avatar Nov 05 '22 07:11 jperon

I tried but didn't help. Why should I need TEXINPUTS if kpsewhich can find lyluatex and luaoptions files without any problem?

I think I'd better install the native TexLive 2022 in my home so I can use the latest updates without having to do any tweak in ~/texmf.

fedelibre avatar Nov 05 '22 20:11 fedelibre

I think I'd better install the native TexLive 2022 in my home so I can use the latest updates without having to do any tweak in ~/texmf.

Without any doubt !

jperon avatar Nov 05 '22 21:11 jperon

It works perfect with TeXlive 2022!

BTW, I installed texlive-medium and checked-also the music packages and graphic packages collections. I think lyluatex was already installed, while I had to install luaoptions. Then in order to compile my book I had to also install:

tlmgr install minibox currfile catchfile

I wonder if this is Ok or lyluatex is missing these three dependencies (I know nothing about Latex packaging).

fedelibre avatar Nov 06 '22 20:11 fedelibre

@notacontranota May you please test with latest commit on master ? I think it fixed this issue.

I think commit 06a7c270ec2251d4ad6bcda016879689dd4e6484 fixed this issue.

fedelibre avatar Nov 06 '22 20:11 fedelibre

@notacontranota May you please test with latest commit on master ? I think it fixed this issue.

I think commit 06a7c270ec2251d4ad6bcda016879689dd4e6484 fixed this issue.

@jperon thanks!

notacontranota avatar Nov 06 '22 20:11 notacontranota

You’re welcome !

jperon avatar Nov 06 '22 21:11 jperon

@fedelibre I keep note about missing dependencies; I’ll ask for a modification in next upload to CTAN, after merging #298.

jperon avatar Nov 06 '22 22:11 jperon