cortex-js / compute-engine

An engine for symbolic manipulation and numeric evaluation of math formulas expressed with MathJSON
https://cortexjs.io
MIT License
357 stars 42 forks source link

Parsing expressions with Abs expression gives different latex emitted from mathlive input #136

Closed OnlyBjarne closed 9 months ago

OnlyBjarne commented 9 months ago

Description

When parsing expressions containing "Abs" the returned latex string is not working in mathlive. mathlive returns latex \left|a\right| when writing manually

Steps to Reproduce

  1. Paste ["Abs", "x"] into MathJSON-field in compute-engine demo
  2. Add any input to the field

Actual Behavior

Following the steps above gives the following error ["Error", "'unexpected-delimiter'", ["LatexString", "'\\vert'"]] when giving the latex string to mathlive field

Expected Behavior

Expected behaviour is no latex errors and having possibillity to edit field further

Environment

MathLive version 0.98.4 ComputeEngine version 0.22.0

arnog commented 9 months ago

Fixed.