Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

\left[...\right] should get promoted to bmatrix environment, not matrix #724

Closed
alexprey opened this issue Nov 24, 2020 · 9 comments
Closed
Assignees
Labels

Comments

@alexprey
Copy link
Contributor

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...]

@arnog
Copy link
Owner

arnog commented Nov 24, 2020

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

@Kydyralin
Copy link
Contributor

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.

@arnog
Copy link
Owner

arnog commented Dec 2, 2020

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}

@alexprey
Copy link
Contributor Author

alexprey commented Dec 3, 2020

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

@arnog
Copy link
Owner

arnog commented Dec 3, 2020

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 arnog added the bug label Dec 3, 2020
@ImGelu
Copy link

ImGelu commented May 25, 2022

@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.

@arnog
Copy link
Owner

arnog commented May 25, 2022

@ImGelu that's a different issue

@arnog arnog changed the title Matrix bracets is not rendered \left[...\right] should get promoted to bmatrix environment, not matrix Oct 3, 2022
@arnog
Copy link
Owner

arnog commented Oct 3, 2022

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

@arnog arnog self-assigned this Oct 3, 2022
@arnog
Copy link
Owner

arnog commented Apr 19, 2023

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

@arnog arnog closed this as completed Apr 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants