Mathjax behaviour on GitHub
GitHub supports rendering Mathjax. However, its implelementation appears to be very strict and often fails when other renderers are fine.
Here are some examples of successful and unsuccessful usage of Mathjax in GitHub markdown.
Success
When
\eqalign{..}
can work with \\
Another example
Broken
a space between $ and the content
When $ a \ne 0$, there are two solutions to $(ax^2 + bx + c = 0) $ and they are
When $ a \ne 0$, there are two solutions to $(ax^2 + bx + c = 0) $ and they are
no space between $ and the surrounding
When$a \ne 0$, there are two solutions to $(ax^2 + bx + c = 0) $and they are
When$a \ne 0$, there are two solutions to $(ax^2 + bx + c = 0) $and they are
\\
is not recognized for virtually no reason
$$
f=\\
1 \\
$$
$$
\sin \theta =\\
1 \\
$$
$$
\sin \theta = \tan \theta \cdot \cos \theta \\
\tan ^2 \theta \cdot \cos^2 \theta + \cos ^2 \theta = 1 \\
1 + \tan ^2 \theta = \frac {1} {\cos^2 \theta}
$$
\\
is not recognized in \color {gray} {....}
$$
\color{gray}{\sin \theta = \tan \theta \cdot \cos \theta より} \\
\color{gray}{\tan^2 \theta \cdot \cos^2 \theta + \cos ^2\theta = 1} \\
1 + \tan ^2 \theta = \frac{1}{\cos^2 \theta}
$$
$$
No blank line above abcde
$$
\color{gray}{\sin \theta = \tan \theta \cdot \cos \theta より} \\
\color{gray}{\tan^2 \theta \cdot \cos^2 \theta + \cos ^2\theta = 1} \\
1 + \tan ^2 \theta = \frac{1}{\cos^2 \theta}
$$
abcde $$ \color{gray}{\sin \theta = \tan \theta \cdot \cos \theta より} \ \color{gray}{\tan^2 \theta \cdot \cos^2 \theta + \cos ^2\theta = 1} \ 1 + \tan ^2 \theta = \frac{1}{\cos^2 \theta} $$
$$
and the content
Existence of a blank line between $$
\eqalign{\sin(90˚ - \theta) &= \cos\theta \\
\cos(90˚ - \theta) &= \sin\theta \\
\tan(90˚ - \theta) &= \frac{1}{\tan\theta} \\
}
$$
\eqalign{\sin(90˚ - \theta) &= \cos\theta \ \cos(90˚ - \theta) &= \sin\theta \ \tan(90˚ - \theta) &= \frac{1}{\tan\theta} \ } $$
$$
\eqalign{\sin(90˚ - \theta) &= \cos\theta \\
\cos(90˚ - \theta) &= \sin\theta \\
\tan(90˚ - \theta) &= \frac{1}{\tan\theta} \\
}
$$
$$ \eqalign{\sin(90˚ - \theta) &= \cos\theta \ \cos(90˚ - \theta) &= \sin\theta \ \tan(90˚ - \theta) &= \frac{1}{\tan\theta} \ }