Closed bengolds closed 2 years ago
Good find.
The problem occurred when requiring LaTeX metadata in a MathJSON output for a number, i.e. in the example above, it's actually "1" that causes an error to be thrown...
Fixed in 64e15037ddff7a3dbf2e0854729882aaa10bcb2e
Ahhh, that's a funny one! Fantastic, thanks.
Relatedly, we did run into a situation where we wanted the latex
to be preserved for numbers -- if the user types in 1e3
, we'd like to know both that they typed 1e3
AND that it's equal to 1000
. Similarly for 000.113
!
Yeah, that makes sense.
Right now, I think the latex output is omitted only if the serialization of the numeric value is identical to the generated (or input) LaTeX, but perhaps it would be simpler to just always include the LaTeX when it is requested (i.e. via the metadata
prop), even if it was redundant with the numeric serialization...
The consistency seems totally fine to me.
When you get a chance, can you cut a release with 64e1503
? We'd love to install directly to that hash, but our version of node
is too low to do the rebuilding required :(
I've published compute-engine@0.5.0
that incorporate these changes and a corresponding mathlive@0.5.0
.
Thanks a million, Arno! Super excited to get these fixes (and some of the new features in compute engine) integrated :D
Version: 0.4.4
Steps:
jsonSerializationOptions.metadata = ['latex']
1/x
BoxedExpression
.Here's a quick
node
session replicating the problem: