mathlive
mathlive copied to clipboard
Matrix bracets is not rendered
Description
When I'm use matrix bracets and then try to fill content of that, brecets are removed
I'm use following editor instance https://mathlive.io/examples/basic/index.esm.html
Steps to Reproduce
- Place matrix bracets from keyboard
- Enter the first value
- 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...]
I can't figure out how to reproduce this. Could you clarify exactly which keys on the keyboard you are pressing?
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.
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}
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
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 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):
- Insert a
pmatrix
:\begin{pmatrix}1 & 2 \\ 3 & 4\end{pmatrix}
- Copy the matrix via
CTRL+C
or via keyboard shortcut - Press
=
- Paste the previously copied
pmatrix
- So far, the bracets are still visibile
- Insert another
=
. The bracets disappear.
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 that's a different issue
Note: right now, no promotion is done at all (regression)
This is now working correctly. Typing [
a
followed by alt
+Tab
will promote the parenthesis to a bmatrix