-
Notifications
You must be signed in to change notification settings - Fork 52
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
The preserveLaTeX option works most of the time, but it misses preserving the LaTeX at a level sometimes. For example, in the expression 3x+y, you get:
{
latex: '3x+y',
fn: [
'Add',
[ 'Multiply', { num: '3', latex: '3' }, { latex: 'x', sym: 'x' } ], // This is short form! We'd expect long form with latex.
{ latex: 'y', sym: 'y' }
]
}
// instead of
{
latex: '3x+y',
fn: [
'Add',
{
latex: '3x'
fn: [ 'Multiply', { num: '3', latex: '3' }, { latex: 'x', sym: 'x' } ]},
}
{ latex: 'y', sym: 'y' }
]
}Quick Repro:
node - << 'EOF'
const util = require('util')
const CE = require("@cortex-js/compute-engine")
const myParse = new CE.LatexSyntax({preserveLatex: true})
console.log(util.inspect(myParse.parse('3x+y'), {depth: null}))
EOFThis prints out:
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working