Skip to content

\mathrm and a variable with sub-script causes error in evaluation #60

@aniketkotal

Description

@aniketkotal

@cortex-js/compute-engine: v0.8.0 from npm
vue: v3.2.40
Minimal Stackblitz demo: https://stackblitz.com/edit/vue-agjdaa?file=src/App.vue

What's happening

Substituting any variable with 0 returns an evaluated equation with the variable substituted with 0 untouched.

What should happen

The variable should be treated as 0 and the equation should evaluate as normal

Steps to Reproduce

  1. Create a new ComputeEngine
  2. Parse a latex equation which has both a \mathrm and variable with subscript(ex: F_i) with the created CE. (take \pi-a-\mathrm{AD}-F_o as example)
  3. Substitute the variables with any values.
  4. Evaluate and check the output

Quick Demonstration

Equation: \pi-a-\mathrm{AD}-F_o
Variables: AD: 1, F_o: 2, Pi: 3.14, a: 1
Expected Output: Evaluated output
Actual Output: 1.14-\mathrm{F_{o}}

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions