# No ReRender of all subsequent Math environments when typing inline math in live preview

I type alot of math equations, standalone as well as inline ones. And I add them in the middle of the file sometimes. But when I start doing $$ for inline it assumes, i want to start a new multiline math environment and recalculates all subsequent text, making math to text and text to math. This makes obsidian freeze like half a second. Which is not much, but annoying, cause when I start typing inside the ., obsidian realises, that its inline math and re-renders the subsequent stuff AGAIN. (actualy same applies for the code environment '''...''' ) ### Proposed solution When there is already text in the same line, and $$ comes up, interpret it as inline math:

really useful text, now comes math $$this MUST be text, as it is in the same line!  When someone wants a whole math multiline environment, I guess its always clean to put these on seperate new lines like: $$
\frac{1}{2} .. math stuff
$$ The following line should just display an error, as there is an empty line inside the math environment: $$ // ERROR
\frac{1}{2} .. math stuff

$$ And if there is no matching closing braket, just dont render this and mark it as an error, but please leave the rest of the page alone as it is: $$ // ERROR
\frac{1}{2} .. math stuff // ERROR

Here text continues, but its not bothered, as well as this inline text $\PI=5?$.
Furthermore, the following 500 Lines of math environments also dont get re-rendered/interpreted.

$$E=mc^2$$


I hope, I made it clear, what I mean. Thanks and Cheers

just escape the dollar sign

really useful text, now comes math \$\$ this MUST be text, as it is in the same line!

No thats not what I meant. I dont want to use the dollar sign, I actually want to make an inline math statement. And it works, but if i havent typed anything in between the two delimiters, obsidian thinks i want to start a new environment and reinterprets the following lines as math.
This has nothing to do with escaping the symbols.

If you want to do inline statement, use a single dollar sign.

Ok, i get the problem. We are not gonna change this behavior and the editor parser operates line by line at the moment.

Okay, what a pity. But how about, when you parse line by line, and there are characters in the same line before , then only th rest of the same line, and the next are interpreted and look for the closing of the math environment, and not the whole rest of the document?

No because you could close in one of the following lines. You need to look ahead.

I think even latex works this way.

The same thing happens with codeblocks.

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