LaTeX and Math Editor Tool


Userlevel 1

Hi Everyone, 

I’ve written a Miro addon that renders LaTeX math expressions to images you can then drag and drop to your boards. It also includes the option to toggle the input mode from plain tex to the excellent MathLive equation editor widget.

I’m looking for a few test users to give some feedback on the UI and iron out any bugs.

I hope people find this useful.

 

 


10 replies

@Grady W Thanks a lot for your work! I was longing for such a feature :)
I just tried it and I could produce nice formulas - just the newline “\\” did not work with LaTeX input.
Do I have to create multiple images or did I miss something about the newline?
Best

Userlevel 1

@lorny This uses MathJax to create the images, so it’s limited to whatever MathJax can do. Here’s a list of commands they implement… https://docs.mathjax.org/en/latest/input/tex/macros/index.html

From how I intended this to be used, I think you need to make multiple images, or try one of the multiline ams environments like gather

\begin{gather}
f(x)=x^2 \\ g(w)=w+\sqrt w - 2
\end{gather}

Userlevel 1

Small update annoucement: There is now a very experimental history/editing feature. If you create a new latex image, the latex string for that image will be stored within the board data. If you later have the MiroTeX window open and then select that image (and only that image), you should get the latex string inserted into the editor box for you to edit. 

You also get a new button “Replace selection” in this situation. If you click that, the currently active latex is converted and uploaded in the same location as the old image, and the old image is deleted. 

Currently very alpha, but the basic feature works for me. However, there are things missing too: If you resized the image, it won’t resize the replacement for you yet.

Experimental History/Edit and Replace feature.

 

Thank you soo much! This is awesome!

Userlevel 7
Badge +5

@Grady W Wow, looks cool – I'll definitely try it out!

Userlevel 1

Known bug: If the drag & drop controls or the place button don’t work, just close and re-open the app panel. This bug is triggered if the board needs to “reconnect” after idling while the app panel is open. 

If anyone knows a way to fix this disconnection issue with the Miro SDK v2, please let me know.

Thank you very much. Is there a way to change the formula once it is created? It looks like the ‘update’ button might do this, I have tried to change the formula using the text field on the left but it doesn’t work (figure 2)

After creating a formula, changed its value in the text field
‘Update’: error message

 

Userlevel 1

@gianluca Sorry, no way to edit images that have been created at the moment. MathJax takes the input and produces a static svg image. The label you’re seeing there in the name field is just the input string, for reference only at the moment. 

I wasn’t aware of the update button in the interface there, but based on how this works, that error message makes sense. What happens briefly is that 

  1. When you type, your tex string is processed by MathJax in your browser and the static SVG in the tool panel is produced.
  2. When you place the image on the board, the svg is compressed and uploaded to the miroTeX server, where it is hosted publicly for about 10 seconds under a random url, which is passed back to the app in your browser.
  3. During that 10 second window, I add the image to your Miro board using the temporary public URL address.
  4. After 10 seconds the cache of your SVG image is purged and the URL goes away.

So, when you hit the refresh image button, Miro will get a 404 error when it tries to re-read the SVG from my server. This displays the error message you see.

Hope that explains somewhat why no editing is currently possible.

This whole convoluted mess could be avoided if Miro adds local image upload to the SDK. If you’re interested, please go upvote the product roadmap item for that:  https://portal.productboard.com/bs3msuyjdbfr8dfxd84wngpn/c/75-local-image-file-uploads

Userlevel 1

@gianluca One of the next things I was thinking of implementing was a history list of the latex strings you’ve placed on the board from your current browser. That way you could recover the strings you used, and modify them for re-inserting an updated version. However, your comment gave me another idea. 

Instead, perhaps you could select an image on the board, and I could add two buttons to the app panel interface that do the actions “Copy tex string from current selection title” and then "replace selected image.” I think that should all be fairly easy to implement with the SDK.

Any potential users please let me know which of these (or both?) seems like a better idea for implementing some sort of ability to go back and change what you’ve made.

@Grady W thank you for your reply! The history list sounds cool (is it going to be related to the entire board history or just to the current session or to the single user?), but maybe your second idea might be even more useful, in my opinion. 

Reply