Live data from Hacker News

Render mathematical expressions in Markdown On GitHub

github.blog

1–10 of 114 posts

Re: Render mathematical expressions in Markdown On GitHub

#3
Finally a long-awaited feature. Works nicely in dark mode too. However, it simply uses MathJax.

Also there are some minor annoyances. For example you need to escape the backslashes, so it takes 4 backslashes to make a newline in your matrix.

    $$\begin{bmatrix} a & b \\\\ c & d\end{bmatrix}$$
I found that the inline math doesn't quite match the font size of the surrounding text too (it's smaller).

Re: Render mathematical expressions in Markdown On GitHub

#5
Big picture it's interesting how GitHub + Markdown is basically becoming a major content publishing product. Albeit for a technical niche market. Of course I'm not saying this is GitHub's main goal. More like a P1. Instant publishing, diagrams, and now math expressions.

Re: Render mathematical expressions in Markdown On GitHub

#7
> **The Cauchy-Schwarz Inequality**

> $$left( \sum_{k=1}^n a_k b_k \right)^2 \leq left( \sum_{k=1}^n a_k^2 \right) left( \sum_{k=1}^n b_k^2 \right)$$

I wonder why their syntax highlighting on this example highlights `left` but not `right`? (I can't seem to reproduce it here, since the HN parser tries to outsmart me.)

Re: Render mathematical expressions in Markdown On GitHub

#8
Nice! A welcome addition!

Too bad they're not using KaTeX [0] instead.

It renders the maths server-side, so there's no runtime needed.

An additional bonus is that the resulting math is copy-pasteable, which in the case of disply math might not be that useful (since most equations are to complex to be meaningfully copy-pasted with unicode), but it helps from inline math dissappearing when copy pasting texts.

But, that being said, I'm sure they had their reasons to do so. For one, MathJax seems more well-known by quite a bit so maybe it's the safer option.

1: https://katex.org/

Re: Render mathematical expressions in Markdown On GitHub

#9
I wonder if, at all, other fonts will ever be used for MathJax max display?

The 'default MathJax font' is also just the 'default LaTeX font' (CM?). There are countless other, high-quality math fonts, for example the TeX Gyre Math fonts. I'd like to see those one day, I prefer them. It would be not more out of place than the current version.

There are font pairs, too, like TeX Gyre Pagella and its TeX Gyre Pagella Math accompanying font. So you have the same font for both, which is simply beautiful and even more readable I'd argue. I think most people have accepted that text and math fonts are always distinct, when in fact they needn't be.

Post reply on HN