mathlive icon indicating copy to clipboard operation
mathlive copied to clipboard

One dimensional vectors cause confusion

Open Khazuar opened this issue 5 years ago • 6 comments

Describe the bug Pressing ENTER within parentheses converts them into a vector. Removing the newline again doesn't convert it back, so you're stuck with a one-dimensional vector.

To Reproduce [Steps to reproduce the behavior, for example:]

  1. mathlive.io and open the code section
  2. Insert (, a
  3. Hit ENTER
  4. Notice how your latex content in the code section shows \begin{pmatrix}a \\ \end{pmatrix} now.
  5. Hit BACKSPACE
  6. Notice your latext content now is \begin{pmatrix}a\end{pmatrix}

Expected behavior I am not quite sure. I'd be great if a one-dimensional vector would be converted back to simple parentheses around the single entry. I am worried though I am asking to introduce lots of complications there. In older versions of mathlive there were no vectors, so I did not encounter the problem previously. I see us using the vectors at some point, too, though, so I'm happy to have that feature. It's just very undiscoverable for users when their parentheses have become matrix-markup and we cannot expect them to inspect the raw latex markup. The main problem there might be that these 1x1-matrices are not visually distinctive from simple parentheses.

Khazuar avatar Jan 15 '20 10:01 Khazuar

I think it's reasonable that in this case once the "row" has been deleted, you get back "(a)" (i.e. no longer a vector).

arnog avatar Jan 15 '20 20:01 arnog

I think this is the same problem I had with #225. I think the auto vector behaviour is a bit of a problem here. Is there some way to turn it off?

saivan avatar Mar 07 '20 12:03 saivan

Similar editors avoid this in the first place by using [ ] for vectors and matrices instead of ( ). It's less ambiguous that way.

stefnotch avatar Jul 09 '20 14:07 stefnotch

I have another problem with the vectors. For expression in latex \begin{pmatrix}a & b & c\end{pmatrix} the ASCIIMath output is empty. This problem is the same for vectors of all types and sizes.

yorologo avatar Sep 30 '20 05:09 yorologo

@yorologo good catch! That sounds like a different issue, though. Do you want me to open a new issue or would you rather do it?

arnog avatar Sep 30 '20 06:09 arnog

Issue #654 tracks the ASCIIMath problem

arnog avatar Nov 10 '20 14:11 arnog