jperon / lyluatex

Alternative à lilypond-book pour lualatex
MIT License
58 stars 12 forks source link

Reuse precompiled files in different document #306

Open rpspringuel opened 1 year ago

rpspringuel commented 1 year ago

I have a project where a particular piece of music (contained in an external ly file) is used in several different documents. Is there a way to setup lyluatex so that all the documents share a common compilation of the music? I.e. If after putting together document_A.tex which uses sample.ly, I create document_B.tex, which also uses sample.ly (exactly as it was in document_A.tex), document_B.tex will use the precompiled version of the music from document_A.tex rather than compiling it for itself.

This would be a significant timesaver in compilations times.

jperon commented 1 year ago

If document_A.tex and document_B.tex are in the same folder, I think it should already be the case: the hash of cached files doesn’t depend on the document’s name. If a recompilation is triggered, please send me a (double) mwe, so that I can test and debug it.

If they are in two different folders, I’d suggest symlinking tmp-ly from document_A’s folder into document_B’s.

rpspringuel commented 1 year ago

The files are decidedly in different folders.

Is there a way to set the location of tmp-ly as an option? These documents are stored in a git repository to which I don't normally commit the intermediate files (including the contents of the tmp-ly directory). To get a symlink based system working on another computer that checks out the repository, I'd either have to commit all the symlinks or set them up independently on each computer.

jperon commented 1 year ago

There is a tmpdir option that should fit your need. That said, with separate folders, I fear you’ll encounter issues with openout security.