The context
I am generating an hymn booklet (containing mostly text), and I want to easily insert snippets of music scores based on .ly files I already have.
I have two kind of files:
- my
.texfiles, that should be compilable without lilypond code in it - my
.lyfiles, that I also use to generate.midifiles and regular music sheets.
(Purpose is to be able to modify them independently - and to tidy up my main.tex.)
My question
I am looking for an easy way to include my already existing .ly files in my .tex document with such kind of pattern:
\documentclass{scrbook}
[...]
\begin{document}
Some regular text
\begin{lilypond}
\input{part/mylyfile.ly}
\end{lilypond}
\end{document}
My trials
I have seen the principle of the two steps compilation with first lilypond-book, then (xe)latex ; an interesting for-newbee lilypond-in-latex-MWE ; and to finish, the automation of the compiling with arara...
I am able to run the MWE and generate related .pdf document.
My issues
However, I'm stuck with following issues:
I have noticed that
\inputdoesn't work with thelilypond-environment. Is there a way to call an external.lyfile?If I plain copy-paste my
ly-file into the environment, I get plenty of errors, such aslivret.lytex:40:44: Erreur : syntax error, unexpected '.', expecting SCM_FUNCTION or SCM_IDENTIFIER or SCM_TOKEN \override Lyrics.LyricText .font-shape = #'italicthat refers to
emph = { \override Lyrics.LyricText.font-shape = #'italic }- I also get errors for my
\tupletthat I have to replace with\times.
- I also get errors for my
Would you have any ideas of which idea I could explore in order not to be forced to re-write all my .ly code ?
\lilypondfile[options]{myFile.ly}seems indeed to be what I'm looking for! (I'm going to test it, thx for the link !) – ebosi Nov 27 '15 at 15:07