【发布时间】:2012-06-23 23:15:41
【问题描述】:
我正在尝试将包含方程式的 docx 转换为 Android。我遇到了很棒的 docx4j 并测试了以下示例(HtmlExporterNonXSTL): https://github.com/plutext/docx4j/blob/android/src/main/java/org/docx4j/convert/out/html/HtmlExporterNonXSLT.java
但是我注意到它不能很好地处理方程式 - 如果某些符号或数字具有某些幂和/或索引,它们的位置总是在中间,例如
k_{n+1}^2 (latex format)
显示为:
kn+12 (with 'n+12' having correct smaller font but they are both vertically aligned)
有没有办法调整 CSS 来处理幂和索引? (完整的公式转换会更好,但我想这并不容易)。我是 docx4j 的新手,但看起来有点像
handlePPr()
方法将需要在HtmlExporterNonXSLT 示例中进行修改。在我深入研究之前,我想问是否有可能完成它(任何方式来获得运行的偏移属性?
【问题讨论】: