• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

oerpub/mathconverter: Converts from AsciiMath, LaTeX, MathML to LaTeX, MathML

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

oerpub/mathconverter

开源软件地址(OpenSource Url):

https://github.com/oerpub/mathconverter

开源编程语言(OpenSource Language):

XSLT 98.6%

开源软件介绍(OpenSource Introduction):

Converter for AsciiMath, LaTeX & MathML equations

Converts from AsciiMath, LaTeX, MathML to LaTeX, MathML

utilizes MathMLCloud (for MathML output) and XSL transforms (for LaTeX output).

(Optional):

virtualenv env
. env/bin/activate

Install:

pip install -r requirements.txt

Usage:

./converter.py --help

Example

$ ./converter.py --equation "x^2" --iformat asciimath --oformat mathml

<math xmlns="http://www.w3.org/1998/Math/MathML" alttext="x squared">
  <mstyle displaystyle="true">
    <msup>
      <mi>x</mi>
      <mn>2</mn>
    </msup>
  </mstyle>
</math>

Known issues

Don't use bash shell confusing/specific signs like e.g. $$ or " in the commandline or escape them properly. If you're unsure how to do that, run the command without --equation like this:

$ ./converter.py --iformat asciimath --oformat mathml

it will prompt you for the equation that way.

Background information

For generating MathML it is using the public reachable MathMLCloud on https://api.mathmlcloud.org/equation which is utilizing a Node.js server version of Mathjax for generating output.

LaTeX is generated by XSLTs from MathML input.

A special case is the AsciiMath to LaTeX conversion. On the first step it generates MathML from MathMLCloud and then uses the XSLTs to generate LaTeX out of it.

MathML to LaTeX XSLTs available in this repo:

  • xsl_yarosh by Vasil Yaroshevich. Contains XSLT 1 transformation from MathML to LaTeX
  • xsl_transpect by transpect.io. Contains XSLT 2 transformations from MathML to LaTeX (not used currently)



鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap