I uploaded a Markdown file to GitHub, but the inline math formulas are not displaying correctly. For example, $v=\begin{bmatrix}1 & 3\end{bmatrix}^T$ does not render as expected.

After some trial and error, I discovered that using $`v=\begin{bmatrix}1 & 3\end{bmatrix}^T`$ works correctly, although I'm unsure why.

Now, I have another issue I haven't resolved: the font for the math formulas. I want to display $\mathbb{R}$, but whether it's in an inline formula or a block formula, it does not render correctly and just looks like $R$ (the default font).
Expectation: 
Reality: 
Any insights on how to fix the font rendering issue for $\mathbb{R}$ in GitHub Markdown would be greatly appreciated. Thanks!
GitHub is now translating the LaTeX input into MathML rather than using MathJax in the browser (it may use MathJax behind the scenes to do that translation, but I'm not sure). That means the math is being rendered by the browser's native MathML implementation. Chrome implements MathML-Core, which is a limited version of MathML. In particular, it only allows the mathvariant attribute on <mi> elements, and then only to set mathvariant="normal" when it would otherwise have been italic for content that is a single letter. Safari does handle mathvariant, but it appears that Chrome removes the attribute entirely. MathML-Core expects you to use the Unicode characters in the Mathematical Alphanumerics and Letter-like Symbols blocks directly, so you would have to use U+211D for the double-struck capital R. Because GitHub Markdown isn't making that translation for you, you would have to use the U+211D character explicitly: ℝ. That's a pain, and it is an unfortunate result of their deciding to go with native MathML rendering rather than MathJax.
As for the $`...`$ delimiters, that is one of the mechanisms they have used to avoid Markdown processing the contents of the mathematics, where things like underscores and backslashes should be left verbatim instead of having their usual Markdown meanings. They had originally tried to modify the math to quote the special characters, but botched it rather badly, and this was their way of rectifying that. See their blog post about writing mathematics in GitHub, which is no longer accurate in saying they are using MathJax for rendering, but gives you the right delimiters to use for in-line and displayed math.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With