jperon / lyluatex

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

\lily not working with real simple snippets #15

Closed rpspringuel closed 6 years ago

rpspringuel commented 6 years ago
\documentclass{article}

\usepackage{lyluatex}

\begin{document}
\lily{c' e' g'}

\end{document}

This document doesn't compile because lilypond runs into an error which indicates that it's running into the notes before it's ready to process music. To get the file to compile one must wrap the notes in a Staff or Voice block (e.g. \new Staff {c' e' g'}).

jperon commented 6 years ago

This should work with double braces : \lily{{c' e' g'}}

rpspringuel commented 6 years ago

That does work too. I thought I'd tried that one, but that must have been before I corrected the smart quotes that my editor was auto-inserting.

Still, the extra set of braces seems like it should be unnecessary (especially for a user transferring from lilypond-book where braces are not supported inside the equivalent \lilypond pseudo-command). Could lyluatex insert them automatically?

jperon commented 6 years ago

Perhaps… I'd have to investigate how to do that ; if you have an idea, I'd be really glad to implement it !

jperon commented 6 years ago

Seems it was easier than I feared (LilyPond apparently doesn't care about braces around whole a document). Should be corrected now ; please test and tell me wether something goes wrong with last commit.

rpspringuel commented 6 years ago

Looks like you found the same fix I did.

LilyPond apparently doesn't care about braces around whole a document

It does and it doesn't. Based on my testing, LilyPond doesn't care until you try to wrap an explicit \score block in an extra set of braces. However, at the point where you have an explicit \score bloc you should be using the environment or a separate file and thus don't have to worry about the automatically added braces.

You should look at https://github.com/rpspringuel/lyluatex/commit/38aacbcc1d3b6cb3ef58d7f2c103fcabc1a59b53 for some possible changes to the documentation that I prepared to document the fix and to fix some other issues. Cherry pick in those changes that you want.

jperon commented 6 years ago

Thank you very much for your testing, help and suggestions !