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

Using \newline instead of \\ causes rendering failure #2141

Closed
Strilanc opened this issue Apr 24, 2019 · 2 comments
Closed

Using \newline instead of \\ causes rendering failure #2141

Strilanc opened this issue Apr 24, 2019 · 2 comments
Labels
Accepted Issue has been reproduced by MathJax team Feature Request Fixed Test Available v2
Milestone

Comments

@Strilanc
Copy link

Strilanc commented Apr 24, 2019

This latex input:

a = b \newline c =d

produces this mathjax error output:

image

But it should produce the same output as this input:

a = b \\ c =d

which produces:

image

Somewhat surprisingly, \newline starts working when inside of bmatrix blocks or aligned blocks.

@dpvc
Copy link
Member

dpvc commented Apr 24, 2019

Currently in MathJax, \newline is equivalent to \cr, and so it can only be used inside alignments. If you disabled the noErrors extension, you would get the message "Misplaced \newline", indicating the problem is that the \newline is used in a location where it is not allowed.

Of course, in actual LaTeX, neither \\ nor \newline produce line breaks in math mode, and so what these "should" do is debatable. But I suspect that for the purposes of MathJax, producing the actual line break would be a reasonable result.

@dpvc dpvc added Accepted Issue has been reproduced by MathJax team Feature Request labels Apr 24, 2019
@dpvc dpvc added this to the v2.7.8 milestone Feb 17, 2020
dpvc added a commit to dpvc/MathJax that referenced this issue Feb 18, 2020
dpvc added a commit to mathjax/MathJax-src that referenced this issue Feb 18, 2020
@dpvc dpvc added the v2 label Feb 19, 2020
dpvc added a commit that referenced this issue Feb 19, 2020
[v2] Allow \newline to work like \\.  (#2141)
@dpvc dpvc added Merged Merged into develop branch and removed Ready for Review labels Feb 19, 2020
dpvc added a commit to mathjax/MathJax-test that referenced this issue Feb 22, 2020
@dpvc
Copy link
Member

dpvc commented Feb 22, 2020

In testsuite:

LaTeXToMathML/issue2141.html

dpvc added a commit to mathjax/MathJax-src that referenced this issue Mar 30, 2020
@dpvc dpvc closed this as completed Apr 10, 2020
@dpvc dpvc added the Fixed label Apr 10, 2020
@dpvc dpvc removed the Merged Merged into develop branch label Sep 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Accepted Issue has been reproduced by MathJax team Feature Request Fixed Test Available v2
Projects
None yet
Development

No branches or pull requests

2 participants