The in-line preview of display-mode math looks fine in all of the examples below but when the document is rendered to HTML, the math is not rendered properly in several cases, or even consistently for a copied set of code . The attached image shows an extract from a much longer document where this issue occurs multiple times and I cannot figure out a pattern. I am using the latest versions of RStudio, Quarto, and knitr. It is using the quarto default for mathjax.
Appreciate any suggestions.
Thanks - It is similar but in my case, the formatting is off and some symbols are not displayed at all (from the first line).
The answer on the other appears in correct as I show both cases the same exact code with $$ on the same line, not a separate line, works and then when copied and pasted below does not work and then works again on the next paste.
I was able to get it all to work when I got rid of every line break inside a display math (leading to some long, unreadable lines). As I fixed one, the next display math would stop working until I got rid of all line breaks in every display math in the document.
Something funning is going on that the preview works fine but the render does not.