-
Notifications
You must be signed in to change notification settings - Fork 75
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
There should be no new line after equation/math block in tex document #787
Comments
Arriving here from #819 (a duplicate of this issue). Also relevant is sphinx-doc/sphinx#8166 because myst-parser should stay compatible with sphinx, which doesn't have a math role. Some considerations:
Therefore a reasonable balance seems to be:
|
I don't think the special treatment of This is a text with equation
:::math
a + b = c,
:::
which continues without paragraph
Here we have a new paragraph:
:::math
c = a + b.
:::
And we want to break the paragraph above Should be converted to: This is a text with equation
\begin{equation}
a + b = c,
\end{equation}
which continues without paragraph.
Here we have a new paragraph:
\begin{equation}
c = a + b.
\end{equation}
And we want to break the paragraph above I was looking at where the newlines are inserted, but it seems further up in the middle layers 1. Not a straightforward patch thus far. Footnotes |
Hi all - I have put a fix for this together in #1032. The way that I decided to go in that PR is to track the spacing directly on the math node, this allows us to have markdown act the same as latex for the output (i.e. no extra space generated if it is part of the same paragraph). I decided not to to do this by nesting the math inside of a paragraph, as that is rendered as a div and in html I have tested this for amsmath, math directives, and dollar-math. (The dollar-math has a bug if it is the start of a paragraph which I haven't yet tracked down.) |
This will be released in the next version, hopefully in the next few days! |
@rowanc1 before opening a new issue on this. It seems Paragraph
$$Ax=b$$
Paragraph does work, but Paragraph
$$
Ax=b
$$
Paragraph does not :-/ Neither of them work well with jupyter-book, so I'll switch everything to \begin{equation} and \end{equation}, which seems to work well both for latex genertion 8and* jupyter-book. |
Could you open a new issue on this please! The former is tested, but not the dollars on new lines. Should be an easy fix. |
Description
I have come across a bug in the layout of equations and text when building latex files. It is identical to this issue in
pandoc
that was solved in 2015/2016, jgm/pandoc#2171. The issue is thatmystmd
is adding a return after the equation when createing the latex file. An axample,In markdown I have:
and this gets converted into latex as,
The markdown version has a paragraph with an equation in the paragraph, while in latex the extra return means a new paragraph is started either side of the equation. I want the markdown to tex conversion to look like this:
I'm using myst v1.1.29
Proposed solution
Perhaps a similar solution as used in
pandoc
, something to do with defining inline and block equations? I am however not sure as I don't know anything about this.The text was updated successfully, but these errors were encountered: