mathlive icon indicating copy to clipboard operation
mathlive copied to clipboard

Matrix bracets is not rendered

Open alexprey opened this issue 4 years ago • 7 comments

Description

When I'm use matrix bracets and then try to fill content of that, brecets are removed

image

I'm use following editor instance https://mathlive.io/examples/basic/index.esm.html

Steps to Reproduce

  1. Place matrix bracets from keyboard
  2. Enter the first value
  3. Press Ctrl + , and type new value (the same when I'm use Enter to place a new row in the matrix)

Actual Behavior

Matrix bracets removed from editor

Expected Behavior

Matrix bracets must be in place

Environment

Operating System [macOS, Windows, iOS. Include the version if possible]

Browser [Safari, Chrome, IE, Firefox, etc...]

alexprey avatar Nov 24 '20 10:11 alexprey

I can't figure out how to reproduce this. Could you clarify exactly which keys on the keyboard you are pressing?

arnog avatar Nov 24 '20 15:11 arnog

According to the reference page of LaTeX operators (wikibooks and mathlive) for the \begin{matrix}...\end{matrix} syntax it's expected to brackets to be not rendered so I think it's not a bug.

Kydyralin avatar Dec 02 '20 05:12 Kydyralin

Oh, OK... I think I understand this report now. @Kydyralin is correct: \begin{matrix}...\end{matrix} display its content in tabular form, but without fences.

For square brackets use \begin{bmatrix}...\end{bmatrix} and for parentheses use \begin{pmatrix}...\end{pmatrix}

arnog avatar Dec 02 '20 09:12 arnog

Ok, sorry for late response. Initially braces was placed in mathlive by virtual keyboard, but when I add a new column or row - braces disappears from input. I'm record gif, please check it for details

matrix-issue

alexprey avatar Dec 03 '20 12:12 alexprey

Oh, OK, I really got it now. The problem is in the tabular promotion algorithm (when you add a column/row the existing expression gets "promoted" to a tabular environment). It seems like it's getting promoted to a matrix, while in his case it should get promoted to a bmatrix.

arnog avatar Dec 03 '20 14:12 arnog

@arnog any updates on this? I was able to reproduce this bug differently (not sure if it's the same problem, but I thought that commenting here would be a better option than opening a new issue):

  1. Insert a pmatrix: \begin{pmatrix}1 & 2 \\ 3 & 4\end{pmatrix} Screenshot from 2022-05-25 13-16-03
  2. Copy the matrix via CTRL+C or via keyboard shortcut
  3. Press = Screenshot from 2022-05-25 13-16-52
  4. Paste the previously copied pmatrix
  5. So far, the bracets are still visibile Screenshot from 2022-05-25 13-17-11
  6. Insert another =. The bracets disappear. Screenshot from 2022-05-25 13-17-50

The latex code output (the pmatrix tags are still there, but the bracets are gone): \begin{equation*} \begin{pmatrix}1 & 2 \\ 3 & 4\end{pmatrix}=\begin{pmatrix}1 & 2 \\ 3 & 4\end{pmatrix}= \end{equation*}

Note: this happens only if the editor has been focused the whole time. If you click outside it (thus losing its focus) before step 6, the bracets are stil there.

ImGelu avatar May 25 '22 10:05 ImGelu

@ImGelu that's a different issue

arnog avatar May 25 '22 15:05 arnog

Note: right now, no promotion is done at all (regression)

arnog avatar Oct 03 '22 14:10 arnog

This is now working correctly. Typing [ a followed by alt+Tab will promote the parenthesis to a bmatrix

arnog avatar Apr 19 '23 05:04 arnog