org.das2.util.LatexToGranny

Lightweight converter for LaTeX expressions to Granny strings, for the MMS mission. This handles strings like:

The IDL project that minimally specifies is: TeXtoIDL, at http://physics.mnstate.edu/craig/textoidl/


isLatex

isLatex( String s ) → boolean

detect if the string is LaTeX. This currently looks for ^{ or _{, but is expected to be changed in the future.

Parameters

s - the string

Returns:

true if the string appears to be LaTeX.

search for examples view on GitHub view source


latexToGranny

latexToGranny( String latex ) → String

for the latex encoded string, return the granny string that implements.

Parameters

latex - LaTeX encoded string. E.g. \rho^2 + 2\Gamma_{ij}

Returns:

the granny string. E.g. ρ!U2!n + 2Γ!Dij!N

search for examples view on GitHub view source