Math

Answered

MyScript web api input SVG returns LaTeX

The MyScript canvas is only capable of handling one equation at a time. I have built my own canvas and it uses an intelligent bounding box algorithm to group SVG paths into separate equations.


What I would like from MyScript is to be able to send a series of SVG paths, with temporal data, to a web API and get back a LaTeX string.


Example, on my canvas I draw “y=mx+c” this is sent to MyScript’s web API and the response I get back is the equation string. This will work by actively listening to the users gestures and sending them directly to MyScript’s web API. Hence the temporal data is included as the request is sent “live”. Once the user has finished the final computed result will be returned.


I will handle the logic of figuring out if an equation is being written into a new bounded region, or if the user is editing an existing equation. In order to achieve this, I need to be able to send “recorded” SVG instructions with recorded temporal information.


Example, a user live writes another equation “2+5=7” somewhere else. This is treated as a separate new request and gets the response in LaTeX.


The user then comes back to the first equation “y=mx+c” and deletes “c” and puts “b” or adds “+ 2a” on the end. This triggers the resending of the initial SVG paths “y=mx+c” along with the new changes. All of these should trigger a LaTeX response with the newly updated equation.


I hope this is clear, in essence I would like a web API that I can send SVG paths with temporal data and get a LaTeX response.


Does anyone know if this is possible. I have looked through this forum and the documentation and cannot see how to do this.


Best Answer

Dear Stephen,


thank you for contacting us, and describing so clearly your use-case.


Currently, the only limitation is that our system is not able to deal with images, you then understand SVG images cannot be provided as an input to our web-based interactive ink.


How do you build your SVG files? Indeed, if you happen to have the x and y coordinates, you should then be able to send these to the editor, then have the latex result from our server: https://developer.myscript.com/docs/interactive-ink/1.3/web/myscriptjs/editing/


You should also be able to use the interactivity to update your equation.


Best regards,


Olivier

1 Comment

Answer

Dear Stephen,


thank you for contacting us, and describing so clearly your use-case.


Currently, the only limitation is that our system is not able to deal with images, you then understand SVG images cannot be provided as an input to our web-based interactive ink.


How do you build your SVG files? Indeed, if you happen to have the x and y coordinates, you should then be able to send these to the editor, then have the latex result from our server: https://developer.myscript.com/docs/interactive-ink/1.3/web/myscriptjs/editing/


You should also be able to use the interactivity to update your equation.


Best regards,


Olivier

Login or Signup to post a comment