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

Multiline shortcut produces invalid LaTeX #2000

Closed
AllyMarthaJ opened this issue Jun 1, 2023 · 9 comments
Closed

Multiline shortcut produces invalid LaTeX #2000

AllyMarthaJ opened this issue Jun 1, 2023 · 9 comments
Assignees
Labels

Comments

@AllyMarthaJ
Copy link

Description

When using the inline shortcut for inserting multiline content, invalid MathLive content is produced.

Steps to Reproduce

  1. Go to MathLive demo at https://cortexjs.io/mathlive/demo/.
  2. Enter some text, e.g. a. Then use the inline shortcut e.g. Mod-Enter and type b.
  3. Copy the resultant LaTeX, refresh, and input the LaTeX into the field. (It is something of the form \begin{lines}a\\ b\end{lines})
  4. Observe the MathLive field no longer renders the multiline content.

Associated screenshots:

Before:
image

After:
image

This is reproducible on an external platform too.

Actual Behavior

Invalid MathLive LaTeX is produced.

Expected Behavior

The LaTeX should be able to be re-used within the MathLive editor.

Environment

MathLive version
0.94.6

@arnog arnog self-assigned this Jul 4, 2023
@arnog arnog added the bug label Jul 4, 2023
@arnog
Copy link
Owner

arnog commented Jul 4, 2023

Fixed with e992548

@arnog arnog closed this as completed Jul 4, 2023
@AllyMarthaJ
Copy link
Author

This is still an issue on latest version.

@arnog
Copy link
Owner

arnog commented Jul 5, 2023

I cannot reproduce it. Can you check you are using 0.95.0? (On the MathLive Demo page the version is indicated at the bottom of the page).

I followed the steps in the issue report. Is there something missing?

When you say "reproducible on external platform", what do you mean?

@arnog arnog reopened this Jul 5, 2023
@AllyMarthaJ
Copy link
Author

AllyMarthaJ commented Jul 5, 2023

If you paste the above LaTeX on the demo page, it still fails to render with the same failure points as pictured. I was also able to replicate from scratch the same bug on the demo page.

Unless I'm misunderstanding the fix, the environment shouldn't have changed right?

@arnog
Copy link
Owner

arnog commented Jul 5, 2023

What OS/browser are you using?

And so that we’re on the same page, the issue occurs not when following the steps in the original report, but if you copy \begin{lines}a\\ b\end{lines} and paste it into the mathfield?

@AllyMarthaJ
Copy link
Author

AllyMarthaJ commented Jul 5, 2023

Yeah; I followed the same steps as before. Just to clarify with a video:

Screen.Recording.2023-07-06.at.9.00.50.am.mov

Chrome 114.0.5735.198 (Official Build) (arm64)
macOS 13.2.1 (22D68)

@AllyMarthaJ
Copy link
Author

As for why pasting is relevant: this same issue occurs when you programatically load in the LaTeX via setValue or otherwise (so for my usage, I have an editor, which when previewed will render the LaTeX incorrectly as above)

@arnog
Copy link
Owner

arnog commented Jul 5, 2023

Ah, OK, I get it now. I thought you were copying and pasting from the mathfield, which was broken but is working now. I thought that was the issue.

There is indeed another issue when pasting LaTeX copied from elsewhere (or when setting the value directly). Thank you, this helps.

@AllyMarthaJ
Copy link
Author

No, thank you! Sorry for the ambiguity haha

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

2 participants