Giter Club home page Giter Club logo

Comments (4)

jperon avatar jperon commented on June 16, 2024

I don't know why this error occurs. As a workaround for now, putting \def\repeat{} before the ly environment makes it work. I guess this has something to do with robust and fragile LaTeX commands, but this is a pure guess…
@rpspringuel, would you have an idea about that, please ?

from lyluatex.

rpspringuel avatar rpspringuel commented on June 16, 2024

The error is a LaTeX one, which implies that LaTeX is attempting to parse the contents of the environment, which is decidedly not what it should be doing. It should grab the environment contents as they are and pass them on to LilyPond. It's doing it at least partially, since \relative and \repeat are coming back as undefined commands. My best guess is that there's something in how \NewEnviron sets things up so that the body of the environment gets stored in \BODY (before handing it off to lua).

from lyluatex.

uliska avatar uliska commented on June 16, 2024

Yes, I also think that LaTeX somehow tries to process the content, which it shouldn't do.
Some more experiments with different contents of the ly environment:

{ \set Staff.instrumentName = "Hallo" c' }

correctly works

{ \sffamily Staff.instrumentName = "Hallo" c' }

works for LaTeX but gives the expected LilyPond failure

\relative { \set Staff.instrumentName = "Hallo" c' }

compiles correctly

{ \repeat Staff.instrumentName = "Hallo" c' }

does not produce a LilyPond failure but the LaTeX error.

{ \r Staff.instrumentName = "Hallo" c' }

does produce the expected LilyPond failure but not a LaTeX error as does

{ \repea Staff.instrumentName = "Hallo" c' }

Interestingly

```lilypond
{ \\repeat Staff.instrumentName = "Hallo" c' }

does produce the LilyPond error and no LaTeX one.

{ 
  \set Staff.instrumentName = "Hallo"
  \repeat unfold 4  c'
}

also lets LaTeX fail with the usual error

So it seems specifically related to the \repeat and neither to the fact there is a backslash command at the beginning nor to the combination \r. Of course there may be other triggers for this error, and maybe looking into the sourece code of environ may give some insight. Could it be that \repeat is some kind of magic keyword in that package?

from lyluatex.

jperon avatar jperon commented on June 16, 2024

Yes, \repeat seems very special ; I didn't see anything about it in the source of environ, but it seems to be a plain TeX command to do a loop. LaTeX says it is undefined, but a \providecommand in the sty doesn't solve the problem…
As it seems (for now) that it is the only one to raise such a problem, I suggest merging #53 (after #52, on which it is based), that solves it. If we encounter other such problems, it will be time to open a specific issue.

from lyluatex.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.