Skip to content

Incorrect Latex parsing when subscript is on LHS #239

Open
@repalash

Description

@repalash

Description

If the subscript is on the left hand side of assignment, the output is incorrect

Steps to Reproduce

console.info(ce.parse("x_{y}\\coloneq z").json);
console.info(ce.parse("x\\coloneq z_{y}").json);

Actual Result

[
  "Assign", 
  "Subscript", 
  ["Function", "z", "x", "y"]
]
["Assign", "x", "z_y"]

Expected Result

["Assign", ["Subscript", "x", "y"], "z"]
["Assign", "x", ["Subscript", "z", "y"]]

Environment

Is this a regression: did it use to work in a previous version?

Tested on the website at https://cortexjs.io/compute-engine/demo/

When testing locally, I think that i got the result for 2nd correctly, but I am not sure which version that was as it was installed as a dependency of mathlive.

Compute Engine version If using the cortexjs.io site, the version is displayed
at the bottom of the page. If using the library, the version is available as
window[Symbol.for('io.cortexjs.compute-engine')].version in the browser or by importing
version from the library.

The website just shows {{SDK_VERSION}}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions