用 jlatexmath 解析乳胶

Parsing latex with jlatexmath

我正在使用 https://github.com/opencollab/jlatexmath 解析 java 中的乳胶数学公式。尝试解析一个简单的复数时:

TeXFormula tex = new TeXFormula("32 + 45~i");

我得到以下异常:

org.scilab.forge.jlatexmath.ParseException: Unknown character : '~' (or 126)

如本文档中所述,字符“~”应该是牢不可破的 space。 https://en.wikibooks.org/wiki/LaTeX/FAQ#Non-breaking_spaces

使用'~'的原因是因为我想渲染由不同库返回的乳胶公式:mathjs.org并且它在某些公式中包含'~'字符。

jlatexmath 支持 '~' 还是我必须使用不同的间距命令?

JLaTeXMath 现在允许使用 ~: https://github.com/opencollab/jlatexmath/commit/27ffa7082efa75e6f86e8788f5cbe2156aa15f5c

欢迎随时报告错误。