質問

I have javascipt string in LaTeX format. For example: \frac{y^2}{2}x-\frac{2}{\sqrt{y}}+2(x-y)^2

I want to be able evaluate it with defined variables. Does anyone know framework or lib for this purpose? I've tried to find it in google and stack but without success.

If you suggest to evaluate it using replace/eval - please answer without evaluating example above. Do not waste your strength =)

Sorry, if I duplicate someone question - I will be grateful for link.

役に立ちましたか?

解決

I think you'd need to get hold of a LaTeX grammar and use a tool like PEGjs or Jison to create a parser/evaluator for the subset you're planning to use.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top