Present a mathematical equation

Hey,
I understood From ami that there is some library that can be used to present a mathematical equation.
Corresponding to the use of math-field in HTML.
I can't find it in Slack, can you send me?

It is called CanvasLatex. You need to import the canvas-latex library which we have just added to the CDN. Then you can code to show equations. Here is an example: ZIM Math

var options = {
	displayMode: true,
	debugBounds: false,
	strict: false
};

var equation = new CanvasLatex.default(`
	ax^2+bx+c+a^{(a^{3a}+3\\times4)}a^{a^a_a}_{a^a_a}\\\\
	1+\\sqrt[3]{2}+\\sqrt[1923^234]{2^{2}}
`, options);
zimify(equation);

equation.sca(1.5).center().expand(0).drag({all:true});

Currently, I am getting an error when we load the script then use the import for zim like shown in the code below. So seeing if we can fix that. Until then, it works if you load createjs and zim in the script tags (the commented out part below).

image

[EDIT] Okay - just tried to fix it and can't figure it out. Adding it to bugs and asking for some help.

2 Likes

And welcome, @racheli - when you get a chance, please introduce yourself at https://forum.zimjs.com/t/introductions-please-tell-us-something-about-you

1 Like