On 13/08/2011 11:01 AM, Uwe Stöhr wrote:
Am 12.08.2011 19:05, schrieb Julien Rioux:

I solved this now. The problem is that one cannot simply call
"lilypond-book". This is a python script and no executable, therefore
one needs to start it with python. Furthermore only executables are
automatically found if they are in LyX's PATH variable, therefore one
has to give the full path to lilypond-book.py.

Right, this is what I said in the part of the email which you elided.

What did I elide?

While I wrote the previous email, it occurred to me that a valid hypothesis why LyX fails to launch lilypond-book on windows is that on this platform very few scripts are interpreted correctly (possibly only .bat is) but instead require the interpreter to be called directly. I wrote:

Am 09.08.2011 17:12, schrieb Julien Rioux:
Oh wait, lilypond-book is a python script. For windows we probably need to 
spawn the python interpreter explicitly.

You replied to this email without quoting this part. Anyway, as you now confirm my hypothesis, it's all good, we can now attack this problem.

If you already knew this, why do we then not call the script via python
in configure.py? I think this should be corrected.

To answer your question, two things: First, on unix-based system, you can call the script directly and not the interpreter. The first line of the script is used by the shell to call the correct interpreter. Second, doing it this way the shell searches for the script in the PATH.

Does it work for you,
if you replace in configure.py this line?:

\converter lilypond-book pdflatex "lilypond-book --safe --pdf
--latex-program=pdflatex --lily-output-dir=ly-pdf $$i" ""

by this one:

\converter lilypond-book pdflatex "python lilypond-book.py --safe --pdf
--latex-program=pdflatex --lily-output-dir=ly-pdf $$i" ""


No, it does not work. You would need the full path to lilypond-book, or use an utility like "which" to find it out: \converter lilypond-book pdflatex "python `which lilypond-book` --safe --pdf --latex-program=pdflatex --lily-output-dir=ly-pdf $$i" ""

But most likely this, too, will not work on Windows OS. So it's not taking us any further.

I implemented this now:
http://www.lyx.org/trac/changeset/39479

This might work for your installation but we should think of a better
fix. Strings like
\"C:\\Program Files (x86)\\LilyPond\\usr\\bin\\lilypond-book.py\" are
not portable.

You mean the fixed path? - that was a commit mistake I already
corrected. The path is stored in a variable that is determined at
installation time.


Good. It's probably best that windows OS is handled specially in the installer for that platform, while other platforms call the script directly as in the status quo. I cannot test your fix, but it looks right.

So now lilypond-book is correctly executed when viewing the lilypond.lyx
example file as PDF (pdflatex). But there are is bug in LilyPond: I get
during the compilation:

Missing set(['ec/lily-5e700a3e.txt', 'ec/lily-5e700a3e.ly',
'ec/lily-5e700a3e-sy stems.count'])
Removing `D:\LyXSVN\LyX2.0.x\lib\examples\lilypond.tex'

And indeed, there are folders "ec1" to "ec5" but no folder named "ec".
I also get this when using lilypond-book with the command line, so
definitively no LyX problem. Can you please take over and report it to
the LilyPond people or can't you reproduce this with Lilypond 2.14.2?

Sorry, I cannot reproduce. The example file compiles perfectly to both
dvi and pdf.

OK, then I will report this bug to Lilypond.

regards Uwe

Thanks,
Regards,
Julien

Reply via email to