GitHub math bugs
Math on GitHub is buggy. (See my blog posts [https://nschloe.github.io/2022/05/20/math-on-github.html, https://nschloe.github.io/2022/06/27/math-on-github-follow-up.html] posts about it.)
To keep track of what's working and what isn't, I've created this repo with some MWEs. If you have any more examples, let me know or PR!
Inline and display math in same list item doesn't render
- https://github.com/orgs/community/discussions/17325
- https://github.com/orgs/community/discussions/18817
- https://github.com/orgs/community/discussions/39545
- https://github.com/orgs/community/discussions/40775
- $`a`$
```math
a
```
- ```math
b
```
$a$ a
b
<details>
Inline and display math in
<details>
$`A = 5`$
```math
A = 5
```
</details>
$A = 5$ A = 5
<
without surrounding whitespace
$`a<b`$
```math
a<b
```
$a<b$ $$a<b$$
Math doesn't render in footnotes
[^a]
[^a]: Lorem $`a`$
Math doesn't render in links
[$`a`$](x)
Math doesn't render if preceeded by an alphabetic character
a$`x`$
-$`x`$
1$`x`$
a$
x
$-
$x$ 1
$x$
%\n
Inline math with
$`a+%
b`$
$a+% b$
Comments before bracket delimiters
```math
\left%
(a+b\right)
```
$$\left% (a+b\right)$$
Sum/product signs in inline mode or fractions
- https://github.com/orgs/community/discussions/17051
- https://github.com/orgs/community/discussions/39432
$`f(x) = \sum_{i=0}^{n} \prod_{j=0}^{n} a_{i,j}`$
```math
\frac{\sum_{i=1}^n a_i \prod_{i=1}^n b_i}{2}
```
$f(x) = \sum_{i=0}^{n} \prod_{j=0}^{n} a_{i,j}$ $$\frac{\sum_{i=1}^n a_i \prod_{i=1}^n b_i}{2}$$
\operatorname
not working
```math
\operatorname*{Min}_{x}
```
$$\operatorname*{Min}_{x}$$
Inline math at the end of italic text
_$`a`$ equals $`b`$_
*$`a`$ equals $`b`$*
**$`a`$ equals $`b`$**
$a$ equals $b
$
$a$ equals $b
$
$a$ equals$b$
\text
Dollar in
```math
a
```
- ```math
\text{$b$}
```
$$a$$
\text{$b$}
50 or more colors in a block
49 color
s:
50 color
s:
```math
10: {\color{red}a}{\color{red}a}{\color{red}a}{\color{red}a}{\color{red}a}{\color{red}a}{\color{red}a}{\color{red}a}{\color{red}a}{\color{red}a}
10: {\color{red}a}{\color{red}a}{\color{red}a}{\color{red}a}{\color{red}a}{\color{red}a}{\color{red}a}{\color{red}a}{\color{red}a}{\color{red}a}
10: {\color{red}a}{\color{red}a}{\color{red}a}{\color{red}a}{\color{red}a}{\color{red}a}{\color{red}a}{\color{red}a}{\color{red}a}{\color{red}a}
10: {\color{red}a}{\color{red}a}{\color{red}a}{\color{red}a}{\color{red}a}{\color{red}a}{\color{red}a}{\color{red}a}{\color{red}a}{\color{red}a}
10: {\color{red}a}{\color{red}a}{\color{red}a}{\color{red}a}{\color{red}a}{\color{red}a}{\color{red}a}{\color{red}a}{\color{red}a}{\color{red}a}
```
$$10: {\color{red}a}{\color{red}a}{\color{red}a}{\color{red}a}{\color{red}a}{\color{red}a}{\color{red}a}{\color{red}a}{\color{red}a}{\color{red}a} 10: {\color{red}a}{\color{red}a}{\color{red}a}{\color{red}a}{\color{red}a}{\color{red}a}{\color{red}a}{\color{red}a}{\color{red}a}{\color{red}a} 10: {\color{red}a}{\color{red}a}{\color{red}a}{\color{red}a}{\color{red}a}{\color{red}a}{\color{red}a}{\color{red}a}{\color{red}a}{\color{red}a} 10: {\color{red}a}{\color{red}a}{\color{red}a}{\color{red}a}{\color{red}a}{\color{red}a}{\color{red}a}{\color{red}a}{\color{red}a}{\color{red}a} 10: {\color{red}a}{\color{red}a}{\color{red}a}{\color{red}a}{\color{red}a}{\color{red}a}{\color{red}a}{\color{red}a}{\color{red}a}{\color{red}a}$$
100 or more bracketed exponents or subscripts
```math
a^{1} a^{2} a^{3} a^{4} a^{5} a^{6} a^{7} a^{8} a^{9} a^{10}
a^{1} a^{2} a^{3} a^{4} a^{5} a^{6} a^{7} a^{8} a^{9} a^{10}
a^{1} a^{2} a^{3} a^{4} a^{5} a^{6} a^{7} a^{8} a^{9} a^{10}
a^{1} a^{2} a^{3} a^{4} a^{5} a^{6} a^{7} a^{8} a^{9} a^{10}
a^{1} a^{2} a^{3} a^{4} a^{5} a^{6} a^{7} a^{8} a^{9} a^{10}
a^{1} a^{2} a^{3} a^{4} a^{5} a^{6} a^{7} a^{8} a^{9} a^{10}
a^{1} a^{2} a^{3} a^{4} a^{5} a^{6} a^{7} a^{8} a^{9} a^{10}
a^{1} a^{2} a^{3} a^{4} a^{5} a^{6} a^{7} a^{8} a^{9} a^{10}
a^{1} a^{2} a^{3} a^{4} a^{5} a^{6} a^{7} a^{8} a^{9} a^{10}
a^{1} a^{2} a^{3} a^{4} a^{5} a^{6} a^{7} a^{8} a^{9} a^{10}
```
$$a^{1} a^{2} a^{3} a^{4} a^{5} a^{6} a^{7} a^{8} a^{9} a^{10} a^{1} a^{2} a^{3} a^{4} a^{5} a^{6} a^{7} a^{8} a^{9} a^{10} a^{1} a^{2} a^{3} a^{4} a^{5} a^{6} a^{7} a^{8} a^{9} a^{10} a^{1} a^{2} a^{3} a^{4} a^{5} a^{6} a^{7} a^{8} a^{9} a^{10} a^{1} a^{2} a^{3} a^{4} a^{5} a^{6} a^{7} a^{8} a^{9} a^{10} a^{1} a^{2} a^{3} a^{4} a^{5} a^{6} a^{7} a^{8} a^{9} a^{10} a^{1} a^{2} a^{3} a^{4} a^{5} a^{6} a^{7} a^{8} a^{9} a^{10} a^{1} a^{2} a^{3} a^{4} a^{5} a^{6} a^{7} a^{8} a^{9} a^{10} a^{1} a^{2} a^{3} a^{4} a^{5} a^{6} a^{7} a^{8} a^{9} a^{10} a^{1} a^{2} a^{3} a^{4} a^{5} a^{6} a^{7} a^{8} a^{9} a^{10}$$
$
-math
Backslashes in https://github.com/orgs/community/discussions/16993https://github.com/orgs/community/discussions/17143https://github.com/orgs/community/discussions/31812https://github.com/orgs/community/discussions/46788https://github.com/orgs/community/discussions/47295
$\{a\,b\}$
${a,b}$
Fixed by using backtick delimiters:
$\{a\,b\}$
Math vs. HTML mix-up
https://github.com/orgs/community/discussions/17022https://github.com/orgs/community/discussions/36915https://github.com/orgs/community/discussions/41087- https://github.com/orgs/community/discussions/54934
$a <b > c$
$[(a+b)c](d+e)$
${a}_b c_{d}$
$a c$
$(a+b)c$
${a}b c{d}$
Some fixed by using backtick delimiters:
$a <b > c$
$[(a+b)c](d+e)$
${a}_b c_{d}$
Dollar-math with spaces
This is the example from GitHub's announcement blog post.
When $a \ne 0$, there are two solutions to $(ax^2 + bx + c = 0)$ and they are
$$ x = {-b \pm \sqrt{b^2-4ac} \over 2a} $$
When
$a \ne 0$ , there are two solutions to$(ax^2 + bx + c = 0)$ and they are $$ x = {-b \pm \sqrt{b^2-4ac} \over 2a} $$
Fixed by using backtick delimiters:
When
$a \ne 0$ , there are two solutions to$(ax^2 + bx + c = 0)$ and they are$$x = {-b \pm \sqrt{b^2-4ac} \over 2a}$$
Spacing around dollar sign in math mode
$x = \$$
$x = $ $
Fixed by using backtick delimiters:
$x = \$$
Math in italic text
_Equation $\Omega(69)$ in italic text_
Equation $\Omega(69)$ in italic text
Fixed by using backtick delimiters:
Equation
$\Omega(69)$ in italic text
Inline math can't be preceded by brackets, quotation marks etc.
https://github.com/orgs/community/discussions/28115https://github.com/orgs/community/discussions/30157
$\pi$
'$\pi$
"$\pi$
($\pi$
[$\pi$
{$\pi$
/$\pi$
$\pi$ '$\pi$ "$\pi$ ($\pi$ [$\pi$ {$\pi$ /$\pi$
Fixed by using backtick delimiters:
$\pi$ '$\pi$ "$\pi$ ($\pi$ [$\pi$ {$\pi$ /$\pi$
Oversized sqrt symbol around fractions
```math
\sqrt{\frac{1}{2}}
```
$$\sqrt{\frac{1}{2}}$$
Matrices without line breaks in $$-math
$$
\begin{pmatrix}a & b\\ c & d\end{pmatrix}
$$
$$ \begin{pmatrix}a & b\ c & d\end{pmatrix} $$
What works: Using triple-backtick delimiters, or inserting a linebreak after the \\
.
$$\begin{pmatrix}a & b\\ c & d\end{pmatrix}$$
Footnotes
-
Lorem $
a
$ ↩