Closed PunctatorFortunatus closed 9 years ago
You might try adding #(ly:set-option 'relative-includes #t)
to the head of your Lilypond files. This option will make it so that any include statements in the file are taken to be relative to the file's location, rather than the working directory from which lilypond was invoked.
No, I'm trying this right now and the path is always relative to the .tex file. The file structure I'm working with is as follows:
project/main.tex project/main.sty project/lilypond/music.ly project/style/style.ly project/tex/music.tex
So in project/main.tex, there is a \input{tex/music.tex}
and the \includely{lilypond/music.ly}
command is in project/tex/music.tex file. In music.ly is a \include "../style/style.ly"
wich works when processing the file solely with lilypond, but when I compile main.tex, the file stile.ly is not found. However, if I change the line to \include "style/style.ly"
in music.ly, then I can compile main.tex without problem.
In the process, I stumbled across the bug in the other thread, I'll explain it there.
Could you please send me an archive with an elementary project like this ? I'll have a look at this problem tomorrow.
Here you can see an example. In master.pdf you can see the incorrect output, and in music/music_example.pdf the expected output. If you add #(ly:set-option 'relative-includes #t)
to music_example.ly the output remains the same.
I think I've seen the problem : as lyluatex outputs temporary results to tmp_ly/TREE
, this adds one level to the hierarchy of folders. As a result, ../style/style.ly
is equivalent to project/tmp_ly/style/style.ly
.
I've corrected that in last commit, may you try it please ?
It seems to work correctly now, thank you very much. I've only tried in the example, I'll test in my project by sunday.
I'll leave this open for now, as I think the fix is really a workaround, that doesn't cover all possible cases.
The last commit should really solve the problem : the folder of the lilypond score is now included in search path at compile time. Let me know wether you encounter bugs ; if not, I'll close this issue.
I've tested it on my project today without any problem. Thank you so much for this. Regards.
Is there a way to set a working directory for lilypond? I'm using a complex structure for my project, and when I compile my files only with lilypond, all
\include
d files are found correctly; but when compiling with LuaLaTeX they are no longer found. This is because the relative path changes from one file to the other, so it would be nice to add some working directory parameter to lyluatex, so lilypond can find her files without having to symlink them.