将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无法使用JAXB配置Moxy   java如何让我的简单Swing telnet客户端正确显示字符?   java中从可运行线程调用主线程的多线程处理   java数据源。EBJ3会话bean中的getConnection()   使用java和正则表达式从xml文件提取值时出现问题   java定制Jersy胡须Mvc   在Java中,“限制并发”是什么意思?   java有没有更干净的方法可以在这里使用Optional,而不在三个地方返回“NA”?   java Tomcat启动,然后崩溃,除非我打电话   java理解客户机和服务器   java时间戳将在视图对象>实体转换期间丢失   如何在java中返回布尔值(基元)?   java使用spring mvc设置日志记录,希望仅对我的代码进行跟踪/调试   用Jackson解析嵌套对象