Open christianp opened 2 years ago
Another option is to produce both versions and store them in the TString
token. When the string is subbed into LaTeX, the LaTeX version would be used.
This might need all string operations to also operate on the LaTeX version.
While resolving #889, it became apparent that we really need to produce a different string version of a number for LaTeX, rather than assuming the plain-text version will be fine. Commas inside numbers shouldn't be followed by an extra space.
There are several JME functions which format numbers as strings:
formatnumber
,dpformat
,sigformat
, andscientificnumber[latex|html]
. These should produce LaTeX code when called inside a call tolatex()
.The
latex
function should set astringSyntax
attribute on the scope which gets passed through asNumbas.math.niceNumber
'ssyntax
option.