将hml中的eqaution字符串转换为乳胶字符串。

hml_equation_parser的Python项目详细描述


hml公式分析器

使用量

如果有来自hml文档的equation string,则可以转换 它通过使用eq2latex函数生成乳胶字符串。

>>>importhml_equation_parserashp>>>hp.eq2latex("LEFT ⌊ a+b RIGHT ⌋")'\\left \\lfloor a+b \\right \\rfloor'

示例代码

假设您有test.hml文件用于转换。有 一些示例代码来演示如何解析hml文档。你可以参考 此示例代码位于hmlParser.pyparseHmlSampleconvertEquationSampleextract2HtmlStrSample)。

importhml_equation_parserashpdoc=hp.parseHmlSample("test.hml")# parse hml document and make ElementTreedoc=hp.convertEquationSample(doc)# find equations from ElementTree and convert them to latex stringstring=hp.extract2HtmlStrSample(doc)# convert ElementTree to html document with MathJax.importcodecsf=codecs.open("test.html","w","utf8")f.write(string)f.close()

hml方程分析器

_

hml___ string___ eq2latex__ __ ^{TT12}$______。

>>>importhml_equation_parserashp>>>hp.eq2latex("LEFT ⌊ a+b RIGHT ⌋")'\\left \\lfloor a+b \\right \\rfloor'

__

HML_____________ ____。___ test.hml___html__ __。______库^{TT5}$ ___(parseHmlSampleconvertEquationSampleextract2HtmlStrSample)。

importhml_equation_parserashpdoc=hp.parseHmlSample("test.hml")# parse hml document and make ElementTreedoc=hp.convertEquationSample(doc)# find equations from ElementTree and convert them to latex stringstring=hp.extract2HtmlStrSample(doc)# convert ElementTree to html document with MathJax.importcodecsf=codecs.open("test.html","w","utf8")f.write(string)f.close()

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
在Java中使用BufferedReader类读取文本文件的子字符串   java如何在JSP页面上包含来自另一台服务器的动态JSP   使用单表策略的java持久化Hibernate继承映射   java报告状态失败达600秒。谋杀!报告hadoop的进展   java将字符串解析为形状   使用JTable的java ClassCastException?   java在Spring引导中关闭数据库   java Android Studio调试错误(Ubuntu)   java如何区分apache beam中KV实例中的两个键?   java将RealmObjectChangeListener添加到异步下载的RealmObject   java匹配模式之前的所有内容,包括新行和/或回车   java使用JAXB在XML中动态更改元素序列   java如何在MACOS中找到动态库(.dylib文件)的版本   Android中的java Nanohttpd服务器   java libGDX:3d动画不工作