0

I am writing a document that will involve dozens of snippets of LilyPond. Seeking the simplest way of doing this, I have hit upon lilypond-Book and lyLuaTeX. Not knowing which is ultimately simpler, I have arbitrarily chosen lyLuaTeX, but I am not yet committed to this choice. I have three closely related questions about the use of lyLuaTeX. My questions are boldface.

Is lilypond-book simpler to use than lyLuaTeX?

Page 5 of the lyLuaTeX documentation (https://ctan.math.illinois.edu/support/lyluatex/lyluatex.pdf#page=5) says that lyLuaTeX requires that LuaLaTeX be

started with the --shell-escape command line option to enable the execution of arbitrary shell commands, which is necessary to let LilyPond compile the inserted scores on-the-fly and to perform some auxiliary shell operations. However, this opens a significant security hole, and only fully trusted input files should be compiled. You may mitigate (but not totally remove) this security hole by adding lilypond and gs to shell_escape_commands, and using --shell-restricted instead of --shell-escape: look at the documentation of your TEX distribution.

Are Overleaf and lyLuaTeX compatible?

How do I use the --shell-escape command line option? For example, must I go to a particular place in the Command Prompt (I'm using Windows) before using this option? If so, how do I go there? Once there, what do I do? (As must be obvious by now, I know little about the command line.)

I also considered asking: What are arbitrary shell commands? What risks are associated with enabling such arbitrary shell commands? How do I "[add] lilypond and gs to shell_escape_commands and [use] --shell-restricted instead of --shell-escape"? but I don't want to overload potential answerers with questions.

The author of the question How to use lyLuaTeX? seems to have successfully proceeded beyond the point of needing help with what I am asking about. Therefore, I don't think that my question is a duplicate.

Noah J
  • 515
  • 1
    I think lyluatex is easier and gives better results than lilypond-book, partly because it doesn't create a pile of temporary files. Shell escape means that you authorize the LuaLaTeX program to call other programs on its own. Technically that could be dangerous, so people are warning you out of an abundance of caution. But normally this just means that LuaLaTeX will call Lilypond in the background. – musarithmia Jul 06 '23 at 14:32
  • 1
    It may be possible to configure this in a GUI editor, but the simplest way (IMHO) is to open a terminal, go to the directory with your TeX file, and call the program yourself, lualatex --shell-escape myfile. – musarithmia Jul 06 '23 at 14:34
  • @musarithmia Is that to say that lyLuaTeX and Overleaf are incompatible? I've never had a TeX file saved to my computer, at least to my knowledge. (Still new to using computers beyond email and Google.) – Noah J Jul 06 '23 at 16:50
  • 1
    I don't know. They would have to have Lilypond installed on their server, which seems unlikely to me. See also https://tex.stackexchange.com/questions/481749/generate-a-musical-note-on-overleaf – musarithmia Jul 06 '23 at 16:52

0 Answers0