Skip to content

The line break(\\) is not work #2312

Open
@woody-li

Description

@woody-li

The latex:
x = a + b \\ y = b + c
The line-break isn't effect and it renders as single line.
However, it works fine and renders as two lines at verision 2.

Activity

dpvc

dpvc commented on Oct 2, 2019

@dpvc
Member

Linebreaks are not yet implemented in version 3. This is one of the significant features from version 2 that has not yet been ported to version 3.

woody-li

woody-li commented on Oct 3, 2019

@woody-li
Author

Is it possible to update the support information in the symbols table at http://docs.mathjax.org/en/v3.0-latest/input/tex/macros/index.html .
Any schedule to implement the linebreak?

dpvc

dpvc commented on Oct 4, 2019

@dpvc
Member

I'm not sure what you want changed there. The macros are simply listed, and since \\ is used within multi-line environments, it needs to be listed there. There is a link to Carol Fisher's page about the macros (written for v2), but that is not something we maintain, so she would have to maintain it.

In any case, it is not a TeX issue, but an output issue, and the fact that line breaking isn't implemented is documented in several places.

Any schedule to implement the linebreak?

It will be next year, probably in the first half of the year, but there is no specific timetable at the moment.

dpvc

dpvc commented on Oct 4, 2019

@dpvc
Member

In the meantime, you can do something like

\displaylines{x = a + b \\ y = b + c}

to get multiple lines

woody-li

woody-li commented on Oct 4, 2019

@woody-li
Author

Thanks for your reply.
The \displaylines solved my problem.

The information I said that adding a column in the macros table to show the support version.

SeanFlemingMathsPathway

SeanFlemingMathsPathway commented on Oct 9, 2019

@SeanFlemingMathsPathway

I'm not sure if it is helpful, but I also found the use of \display{align} honours the newline instruction as well.

\begin{align}2x+y&=5\\y&=-2x+5\end{align}

This also requires the addition of the '&' before the alignment point, and has the benefit of making the equations more readable in our use case.

T-Kuhn

T-Kuhn commented on Feb 4, 2020

@T-Kuhn

For some reason, I had to add a third / on my environment (Japanese WordPress blog.)
This didn't work (everything was rendered on the same line):

\displaylines{x = a + b \\ y = b + c}

This worked (2 lines):

\displaylines{x = a + b \\\ y = b + c}
dpvc

dpvc commented on Feb 4, 2020

@dpvc
Member

@T-Kuhn, WordPress uses \ as a special character, and it is often stripped out of WordPress posts (depending on what editor you are using). As an escape character, it can prevent the normal action of the character that follows it, so to get an explicit backslash into your post, you need to double it. That is why you need an extra backslash (because the first two equal a single backslash in the output). You probably should double the second one as well, but apparently that is not required.

dpvc

dpvc commented on Feb 4, 2020

@dpvc
Member

I'm moving this issue to the main MathJax issue tracker so that it can be found more readily by others.

transferred this issue frommathjax/MathJax-srcon Feb 4, 2020
T-Kuhn

T-Kuhn commented on Feb 5, 2020

@T-Kuhn

@dpvc Thanks for your reply. In the meantime, I figured out that the third backslash is only required if the "Using Markdown" toggle on our specific WordPress blog is set to "on". So, at least in my case, this was a problem between different plugins interfering with each other. Seems like the backslash get's handled as an escape character in Markdown mode on our blog.

dpvc

dpvc commented on Feb 5, 2020

@dpvc
Member

@T-Kuhn, yes, Markdown uses the backslash as an escape character. You may also need to be concerned about underscores, as these are used to indicate italics. So you may need to do things like x\_1 rather than x_1 in some situations.

107 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Code ExampleContains an illustrative code example, solution, or work-aroundv3

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @cdwilson@jmhammond@jasongrout@pkra@dpvc

        Issue actions

          The line break(\\) is not work · Issue #2312 · mathjax/MathJax