【问题标题】:"simple math syntax" to MathML converter“简单数学语法”到 MathML 转换器
【发布时间】:2009-10-06 19:59:22
【问题描述】:
【问题讨论】:
标签:
javascript
math
mathml
mathematical-notation
【解决方案1】:
Perl 有Text::ASCIIMathML,它工作得很好。
改编自 Synopsys 部分:
#!/usr/bin/perl
use strict;
use warning;
use Text::ASCIIMathML;
my $parser = Text::ASCIIMathML->new;
my $ASCIIMathML = "int_0^1 e^x dx";
print $parser->TextToMathML($ASCIIMathML);
给出(为便于阅读而重新格式化):
<math>
<mstyle>
<mrow><msubsup><mo>∫</mo><mn>0</mn><mn>1</mn></msubsup></mrow>
<msup><mi>e</mi><mi>x</mi></msup>
<mrow><mi>d</mi><mi>x</mi></mrow>
</mstyle>
</math>