Math bugs in note editor

This discussion was created from comments split from: Available for beta testing: Markdown export of notes.
  • edited November 20, 2022
    This is a long due nice addition, but the md editor is still quite buggy.

    For instance,

    1). enclosing an expression in $expression$ works as expected but when you try to edit that expression, e.g., simply trying to delete the $ sign in order to be left only with the expression is almost impossible unless you re-write the whole expression.

    2). trying to add math notes in display mode, e.g., $$expression$$ doesn't work as expected no display mode and the expression is not even being properly rendered.

    3.) tables in markdown notation are not properly rendered in the note editor, and, also old md notes with math in them they seem to be rendered as images, i.e. not editable any more.
  • @kirk86
    1) Do you mean you want to convert a math node back into plain text or what?
    2) Does it work as expected if you type $$ and press space?
    3) Markdown tables aren't supported currently. Do you mean you were able edit math in old MD notes? How?
  • 1) Yes, since we are talking about notes after all, that means that folks we'll have to constantly update or change things in notes. Imagine the following scenario, you've written some expression in inline math mode markdown and now you revisit that note after a while and you decide to change that in display mode or vice versa, how do you do that without deleting the whole expression or copy pasting whatever is inside the $expression$?

    2) Yes it does, which might be an indication of why things are not being parsed correctly. I don't know the inner workings of the note editor but seems like its looking for $ followed by a space to render properly the the math expression. If so this could explain the issue in 1). Usually you'd expect that any expression $expression$ or $$expression$$ regardless of space would be appropriately rendered and editing and changing expressions from $expression$ to $$expression$$ or vise versa should be easy and hassle free by just adding or removing additional $ signs.

    3) Yes, I was able to edit math and tables in old note editor by using an external plugin (Markdown Here) that would toggle markdown mode in note editor on and off. By toggling markdown off in note editor you were able to write/edit/update notes in markdown, and, toggling markdown on would properly render that markdown including tables, but now after the MD note editor update the math expressions are rendered as images when I use this plugin and cannot edit them anymore.

    Hope that clarifies things a bit!
  • Re: (1), can you explain the exact Steps to Reproduce what you're seeing? I'm able to 1) left-arrow back into the expression, 2) backspace into it, or 3) click on it. All trigger edit mode, after which I can make changes and arrow-key out to switch back to display mode.

    For (2), you toggle block mode with$$ + space on a new line. For inline mode, it will be rendered when you press space after the closing $.
  • Goal: change between inline and display mode in math notation and vise versa

    Steps to reproduce:
    1) start with a simple expression $y = x^2$
    2) after either right arrow out of the expression or adding space the expression is properly rendered as inline math
    3) edit the expression $y = x^2$ to change it to a display mode by adding additional $ like $$ y = x^2 $$.
    4) as can be seen I've added additional $ + space in the inline expression but is not being rendered correctly, it shows the original expression $y = x^2$ as un-rendered
    5) starting with $$ + space does provide a display mode, but that's not what we want, want to be able to change between inline and display mode by adding additional $ signs without having start on a new line or rewrite the expression y=x^2 on a different line.
  • Oh, sorry, by "display mode" you mean what we call "block mode". I'm not sure why LaTeX calls it that — to me, "display mode" implies the rendered state (as opposed to the editable state).

    So you're talking about switching between inline mode and block mode. I'll let @martynas_b comment on the feasibility of switching between the two modes. As far as I know, the only way to do that now would be by copying and pasting, as you say.
  • It's unlikely that we allow converting inline to block (display) node just by typing additional $. There're too many complications with that.

    But we could consider adding a context menu option for that. I.e. "Turn Into Block".
  • Any option is better than no option at all, as I said I don't know the internal workings of the note editor but in markdown + latex engine (pandoc, mathjax, etc.) this is possible. Similar to what happens in jupyter notebooks. Thanks!
Sign In or Register to comment.