latex_word
主要目的:
创作背景: (纯粹扯淡,可以忽略)
微笑着说‘预估需要两周的时间’)
转换不出来或转换出错,转换出错的再用另一种将latex转换为图片的形式,这样做到一个折中的方案,但在显示效果上图片相
对于word公式还是有很大差距的,另外图片的公式不能编辑,还好惨品宽容大度,容许了这个瑕疵
latex: | mathml: | omml: | |
一般转换步骤: |
\(\sqrt[3]{2+x}\) |
<math xmlns="http://www.w3.org/1998/Math/MathML"><mroot><mrow><mn>2</mn><mo>+</mo><mi>x</mi></mrow><mn>3</mn></mroot></math> | <m:oMath><m:rad><m:deg><m:r><m:t>3</m:t></m:r></m:deg><m:e><m:r><m:t>2+x</m:t></m:r></m:e></m:rad></m:oMath> |
我的工具: |
\(\sqrt[3]{2+x}\) |
不需做中转,直接转omml | <m:oMath><m:rad><m:deg><m:r><m:t>3</m:t></m:r></m:deg><m:e><m:r><m:t>2+x</m:t></m:r></m:e></m:rad></m:oMath> |
作品简介:
\(\sqrt[3]{2+x}\) \[\{\frac{3-a}{2+x}\}\] $3^(x+1)$ $$sum\limits_{i=1}^n$$
\(f(x)= \begin{cases}x,x>0 \\ 0,x=0 \\-x,x<0 \end{cases}\)
\(\left\{ \begin{array}{l}{x+y-1≥0} \\ {x-1≤0} \\ {ax-y+1≥0} \end{array} \right.\)
\(7+97+997+9997+\cdots\underbrace{99\cdots9}_{10个9}7\)
\(37.5^\circ {\rm C}\) \(str\bf{B}C^\circ\)
使用方法:
mvn install:install-file -Dfile=(jar包的位置) -DgroupId=com.latextoword -DartifactId=latex-word -Dversion=1.0.0 -Dpackaging=jar
<dependency> <groupId>com.latextoword</groupId> <artifactId>latex-word</artifactId> <version>1.0.0</version> </dependency>
public static void main(String[] args) { String latexStr="\\(\\sqrt[3]{2+x}\\)"; String omml= Latex_Word.latexToWord(latexStr); System.out.println(omml); }
public static void main(String[] args) { String latexStr="\\sqrt[3]{2+x}"; String omml= Latex_Word.latexToWordAlreadyClean(latexStr); System.out.println(omml); }
<m:oMath><m:rad><m:deg><m:r><m:t>3</m:t></m:r></m:deg><m:e><m:r><m:t>2+x</m:t></m:r></m:e></m:rad></m:oMath>
ERROR
五月 16, 2019 2:39:43 下午 com.latextoword.Latex_Word latexToWordAlreadyClean
信息: [latexToWord:ERROR]:ERROR:解析标记:[\sqqq]没有对应的解析规则
ERROR
小结:
此工具已经过大量公式测试,但应该还有不能转换的公式,如果有遇到敬请告知
公式展示字体相对大小这块没兼顾
在内容完整度上还是可以的
如果你觉滴这个工具对你还有一点用处或将来能用到,请走这里,不要太多意思意思就行了(\手动微笑脸)
没有蓝朋友的妹子,汉子(\手动狗头)或有问题的猿请走这里:mao_yuwei@163.com
latex转word公式(latextoword,latex_word,latex2word,latex_omml)
原文:https://www.cnblogs.com/maoyuwei/p/10874773.html