Converting LaTeX expression to infix expression -
let assume have expression in latex form:
var latex =\frac{x}{\frac{y}{y}}
so output required is:
output= (x)/((y)/(y));
i tried out example stated in link: convert latex dynamic javascript function getting output of above latex as:
(x)/(\frac{y){y}}`
how can expression converted properly? in advance!
var func = '\frac{x}{\frac{y}{y}}'; func = func.replace(/}{/g, ")/(").replace(/\frac{/g, "(").replace(/}/g, ")") console.log(func);
- innput = \frac{x}{\frac{y}{y}}
- output = (x)/((y)/(y))
Comments
Post a Comment