Inline Math Rendering with two dollar signs $$ $$

Use case or problem

Is it yet possible to create inline math when using two dollar signs like so:

This should be inline math:
Test $$ x = 5 $$, x is 5.

This should be multi-line math:
Test
$$ x = 5 $$
not inline.

I think this is jekyll/kramdown behavior and it is also the default way in logseq.

Is this something that can be achieved?

Why can’t you use single dollar signs for inline math, and double dollar signs for the block variant, which is the current behaviour?

Because with the double dollar sign, I render for instance my website.
The way I have it configured is that only double dollar sign is supported and I further like the auto-detection with double dollar sign tbh…

I am not familiar with kramdown, however I can tell you that the single dollar inline and double dollar out of line comes from latex.

That I know. I use it myself quite frequently but as I have these different syntax/rendering right now (which is indeed quite annoying) I just wanted to know if there is the option to change this.
For instance, in VS Code it is also possible to change the way these formulas are rendered.

However, I also understand if there is not sufficient need to implement this

Isn’t this however also the default behaviour of mathjax 3.2+ ?

https://docs.mathjax.org/en/latest/input/tex/delimiters.html#tex-delimiters

It’s not what that page says.

What does this page say in your opinion?

It also recognizes the TeX delimiters $$...$$ for displayed equations, but it does not define $...$ as in-line math delimiters.

Doesn’t this mean the default behavior is to use two dollar signs?

This means $…$ for inline-math is not defined for inline equations as default, but it can be enabled in the configuration. The alternative code for inline and display math, which is available by default, is \(...\) and \[...\], respectively.

I see…
Thanks for the clarifications.

So then - for some reason - some frameworks decided to opt for making $$ … $$ the default behavior for both - inline and display math.

I was generally surprised seeing this deviation from latex syntax…

I just changed now the way my side renders and will keep the consistent style $ … $ : inline math, $$ … $$ : display math.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.