Quarto not rendering HTML coded math formula--bug, not bug, workaround? #4997
-
I'm a content writer working with scientists and developers. so I'll disclose that up front. We migrated from Visual Studio and Markdown to R Studio and Quarto, most went well exception if several mathbox formulas don't render. Is this a bug, or is there something I need to do it make it work? Here is one that does not work other like this work fine: Attached is how the old set up rendered the exact same (top) formula and how it renders wrong in Quarto |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 6 replies
-
Can you share a full document that exhibits the behavior? The solution will be different depending on the rest of your document (in particular, the front matter, format, etc.) |
Beta Was this translation helpful? Give feedback.
-
...well and it looks like I was using an illegal character ("_") though it says it's allowed in Math Mode which I believe is what I am using |
Beta Was this translation helpful? Give feedback.
-
Do you know what was used in your previous workflow to render Math in HTML ? This would help to know how to configure Quarto document. Let me explain why below I can reproduce your issue with this simple document ---
title: "Math"
format: html
---
$$
\mbox{FMV}_{GAP}^{implied} = 100* (\frac{\mbox{Implied_Interest_Rate}}{\mbox{FMV_Interest_Rate}} - 1)
$$
By default this is rendered using MathJax 3. But if I change the math method to be Mathml for example, then it works ---
title: "Math"
format: html
html-math-method: mathml
---
$$
\mbox{FMV}_{GAP}^{implied} = 100* (\frac{\mbox{Implied_Interest_Rate}}{\mbox{FMV_Interest_Rate}} - 1)
$$ It seems Mathjax does not know how to render
but this does not
It seems like a Mathjax bug, or regression or else as I can make your equation works if you use version 2.7.2 ---
title: "Math"
format: html
html-math-method:
method: mathjax
url: https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/MathJax.js?config=TeX-AMS-MML_HTMLorMML
---
$$\mbox{FMV}_{GAP}^{implied} = 100* (\frac{\mbox{Implied_Interest_Rate}}{\mbox{FMV_Interest_Rate}} - 1)$$
About Math in Quarto https://quarto.org/docs/output-formats/html-basics.html#latex-equations Hope this helps. We can't do much on this unfortunately. |
Beta Was this translation helpful? Give feedback.
-
For me, the solution was much simpler: I just had to escape the underscores with a |
Beta Was this translation helpful? Give feedback.
Do you know what was used in your previous workflow to render Math in HTML ? This would help to know how to configure Quarto document. Let me explain why below
I can reproduce your issue with this simple document
By default this is rendered using MathJax 3. But if I change the math method to be Mathml for example, then it works
It se…