【问题标题】:"simple math syntax" to MathML converter“简单数学语法”到 MathML 转换器
【发布时间】:2009-10-06 19:59:22
【问题描述】:

我想要将 ascii 数学语法等简单计算器转换为 mathML 的东西。

我发现了这个:http://www1.chapman.edu/~jipsen/mathml/asciimath.html

但我不明白如何使用它。例如,我想让它从命令行运行,以便我输入一些数学公式并取回 mathMl 版本。 我怎么能做到?有没有其他类似的程序,可能是比 javascript 更少面向浏览器的语言?

【问题讨论】:

    标签: 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>&#x222B;</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>
    

    【讨论】:

      猜你喜欢
      • 2011-11-10
      • 1970-01-01
      • 1970-01-01
      • 2011-09-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-01-06
      相关资源
      最近更新 更多