Thoughts on WYSIWYG formula editing

Hi all,

While working on the math editor for TyX I came across a library called mathlive which provides a web component with a WYSIWYG editor for math formulas, based on LaTeX.

Of course, I want to tweak mathlive so it supports Typst, and better yet if possible create some fork which is Typst-based!

For now, I created a PR which adds a new getValue(“typst”) option.

However, I would love to hear the thoughts you have about how to go about forking this for Typst - my biggest question would be how to insert commands/symbols? since on the one hand Typst has no “backslash” concept, but on the other - always showing a popup seems like a bad user experience.

1 Like

Hi.

With the keyboard?

I even tried writing alpha and it auto converted it, same with <=. So this is mostly solved.

Oh, so it autocompletes the command in this field and not in the HTML…

You can show popup only with Ctrl+Space.

I’m not a WYSIWYG kinda guy, apart from browser, so I don’t have any thoughts, but autocompletion and conversion is nice. Like any math keyboard, you would have to get used to the layout. I struggled for 5–10 seconds to find fraction button only to find out that it’s hidden under division button, no boxes like on other template buttons.

Thank you!
Here would be my concerns:

  • The virtual keyboard is probably necessary for mobile, if we’re even considering that; On the other hand, it is much slower using the mouse, so I’m looking for a keyboard-based solution.
  • Ctrl+Space seems good, although maybe slow. Perhaps allowing customization helps this out. In any case, it seems better than backslash, thanks!
  • The inline completions are problematic in my opinion since it has prefix collisions. For instance, you have the “in” symbol and also “infinity” and “integral”.

All keyboard-based completions are either implicit with substitutions/snippets, or with a dropdown menu. I imagine that WYSIWYG is always catered towards mouse users (majority of people are like this), since folks like me are zooming in terminal in file manager, IDE/text editor (Neovim, btw), etc. I guess you can make a toggle of what is the preferred input method.

  1. convert after space or something
  2. for infinity, use oo

I get what you’re saying, but I think that having a dropdown/autocomplete might be more robust and faster.

Perhaps enabling both options could also be a fine way to go.

Maybe use \ to mean this is a symbol. And press enter to show it. The \ won’t be written in the real source code.