question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Enable display math inside paragraphs

See original GitHub issue

Is 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

image

while

line

$$∫$$

another line

correctly renders as

image

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:closed
  • Created 3 years ago
  • Comments:10 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
chrisjsewellcommented, Nov 6, 2021

This is already closed by myst_dmath_double_inline = True (https://myst-parser.readthedocs.io/en/latest/syntax/optional.html#dollar-delimited-math)

0reactions
jedbrowncommented, Nov 6, 2021

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?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Display style in math mode - Overleaf, Online LaTeX Editor
This article explains how to manually adjust the style of typeset mathematics—but we'll start with a quick reminder of the visible differences between...
Read more >
How do I add a line break in display math mode? - TeX
With display math environments if you leave blank lines in between you get additional vertical spacing and the possibility of a page break ......
Read more >
LaTeX Tutorial-Math Mode
It will not be covered here. Paragraph mode is the default mode for the document environment and does not need to be called...
Read more >
Displays - Math
Multiline display environments generate the appropriate amount of spacing between the lines of the display and enable alignments.
Read more >
LATEX Math Mode
LATEX has a special mode for formatting mathematical formulas. In addition to displaying complicated mathematical notations, this mode allows the use of:.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found