Enrico Forestieri <for...@lyx.org> writes:
> The real problem is not \ce or any other supported macro, but the way
> LyX parses a math formula. When loading in LyX the attached document,
> you will see a greek beta on screen, but a greek alpha on output.
> Do you now see where the real problem is? LyX first tries all internal
> macros and then the user defined ones. Instead, it should be the
> contrary.

Excellent analysis. Fixing this would make things much better.

> This is difficult to achieve, though, as the user defined macros are
> bound to buffers and the createInsetMath() function has no way to
> know for what buffer it is creating a math inset. Solving this problem
> entails a whole overhaul of mathed, most probably.

I would be curious to see how big the overhaul would be. Having the
current user-defined macros not be part of the parser state is a very
big mistake IMO. We could add a macrotable object (does this exist?) to
the parser state and define a Parser::createInsetMath.

I am surprised that this bug has not been identified earlier.

JMarc

Reply via email to