cocreate icon indicating copy to clipboard operation
cocreate copied to clipboard

Cursor in LaTeX equations

Open diomidov opened this issue 3 years ago • 2 comments

When the text cursor is inside an equation, it is shown before the equation: image It would be nice if the cursor was shown correctly inside the equation.

Related: when you hover your mouse over an equation in VS Code, it renders it with the cursor: image It does this by inserting {\color{...}\!|\!} at the cursor position before calling the LaTeX renderer (source). Unfortunately this approach can occasionally fail: image

I'm not sure if this is better or worse than what we currently have in Cocreate...

diomidov avatar Jun 20 '21 17:06 diomidov

As the LaTeX rendering is expensive in Cocreate (as it uses MathJax instead of KaTeX like VSCode does), I'd rather not rerender as the cursor moves. I think the current behavior is best, unless you think an underline of or box around the formula would be better?

edemaine avatar Jun 20 '21 23:06 edemaine

Maybe the cursor shouldn't render at all when it's inside the formula? That'd still be better than what we have now.

diomidov avatar Jun 21 '21 01:06 diomidov