Can not render the $$...$$ block of KaTex if the first $$ is not the beginning of the line.
For example, if there are words before the first $$
abc $$
a = b
$$ def
it cannot render the math formula.
If I recall correctly, it was by design.
Personally, allowing to embed display math area inside normal Markdown paragraphs would be extremely dangerous.
From the perspective of rendering, markdown-it-katex would be much more error-prone.
From the perspective of editing, creating TextMate grammars for such syntax is also a bad idea.
I'd recommend you to have a look at
If you really need display style math in a paragraph, a nice practice is the \displaystyle command. For example:
The optical path length in such medium is ${ \displaystyle [l] = \sum_{i}^{k}{ n_i l_i } }$.
Most helpful comment
If I recall correctly, it was by design.
Personally, allowing to embed display math area inside normal Markdown paragraphs would be extremely dangerous.
From the perspective of rendering,
markdown-it-katexwould be much more error-prone.From the perspective of editing, creating TextMate grammars for such syntax is also a bad idea.
I'd recommend you to have a look at
If you really need display style math in a paragraph, a nice practice is the
\displaystylecommand. For example: