Enable display math inside paragraphs
See original GitHub issueIs your feature request related to a problem? Please describe.
Right now any text which has no line breaks between $$ and the surrounding text is not parsed as a math directive, but rather a math role:
line
$$∫$$
another line
yields
while
line
$$∫$$
another line
correctly renders as
I understand that from the spec point of view it makes sense:
$$
is a crappy delimiter- The myst syntax is what it is
However in latex world $$
is still unfortunately common, and it’s seldom separated by newlines (since those mean new paragraphs). Therefore this behavior may be confusing and undesirable. Furthermore the current render result is hard to justify regardless the syntax.
Describe the solution you’d like
I’d like to propose relaxing the rules for $$ matches and not expect that they should be separated by blank lines.
Alternatively at the very least I suggest to clearly document the current behavior and warn about it.
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (9 by maintainers)
Top GitHub Comments
This is already closed by
myst_dmath_double_inline = True
(https://myst-parser.readthedocs.io/en/latest/syntax/optional.html#dollar-delimited-math)I run into this often when rendering a static site from Jupyter notebooks. In particular, the extra newlines required for MyST to render correctly introduce extra (unnecessary) vertical space when rendered in a notebook. Since I use the same content for slides (with RISE) and it needs to fit on 16:9 displays, vertical space is precious. Also, I sometimes write the slides live or under time pressure and would like that if it renders correctly in Jupyter/RISE, it’ll be somehow reasonable on the JB site.
Is there a way we could make math parsing put display math (via
\begin{equation}
or$$
) into its own paragraph if needed for correct handling, even when the blank lines don’t exist in the source?