Live data from Hacker News

Math on GitHub: The Good, the Bad and the Ugly

nschloe.github.io

21–30 of 71 posts

Re: Math on GitHub: The Good, the Bad and the Ugly

#21

My theory is that there’s already a lot of existing content using $ and $$ that GitHub wants to start rendering without requiring any changes. I agree the code block approach would be less ambiguous, but there is an advantage in going where people already are.

The pick of $ and $$ as delimiters seems rushed, to be frank. Although I’m not a big fan of mixing LaTeX in Markdown, I understand that choice (alternatively you could go with ascii-math like syntax which mixes way better with Markdown IMO). But $ and $$ makes not a lot of sense other then LaTeX does it this way. It would have been easy e.g. to use $$ for inline math and $$$ + newline or ```math for block, and that would have gotten rid of many of the warts of mixing Markdown and LaTeX.

In my opinion the familiarity of $ and $$ is sacrificing a lot for not much benefit.

Re: Math on GitHub: The Good, the Bad and the Ugly

#23
post #12

> Its main advantage over MathJax is that it isn’t dead. Check out the repo activity on the two projects: I know this is a common view, but this is such a strange mindset to me. Unless you add scope, a project is eventually just mostly done. It's not that MathJax has zero commits, it just has fewer. That _in itself_ isn't a bad sign to me. It could just mean it's a mature project.

[deleted]

Re: Math on GitHub: The Good, the Bad and the Ugly

#24
I’m very happy they went with simple $..$ and $$…..$$

This is much more natural for anyone doing math or science and also makes it easy to copy and paste math from elsewhere

It’s better that the parser works harder than to force an inconvenient syntax on the user.

Re: Math on GitHub: The Good, the Bad and the Ugly

#25

My theory is that there’s already a lot of existing content using $ and $$ that GitHub wants to start rendering without requiring any changes. I agree the code block approach would be less ambiguous, but there is an advantage in going where people already are.

The pick of $ and $$ as delimiters seems rushed, to be frank. Although I’m not a big fan of mixing LaTeX in Markdown, I understand that choice (alternatively you could go with ascii-math like syntax which mixes way better with Markdown IMO). But $ and $$ makes not a lot of sense other then LaTeX does it this way. It would have been easy e.g. to use $$ for inline math and $$$ + newline or ```math for block, and that w…

Given that the main point of using LaTeX in Markdown is familiarity of users, using $ and $$ is actually the ONLY proper choice. But yeah, it leads to problems, which is why I would not use Markdown in the first place, but some Markdown inspired format which mixes better with $ and $$.

Re: Math on GitHub: The Good, the Bad and the Ugly

#28

The author fails to mention MathML as an alternative choice. The options aren’t just MathJax and KaTeX, but also raw MathML. MathML gives you extremely fast rendering, more font choices, copy-paste, a11y, etc. out of the box. The only downside is that Chrome is lagging behind in implementation, for that they could use MathJaX as a polyfill—as MathJax understands and is able to transform MathML—and allow Safari and Fi…

It isn't mentioned because because they aren't really the same thing. MathML is a web native math markup language and being XML is meant to be written by machines rather humans[^0]. TeX is a markup language that MathJax and KaTeX render to a web suitable format but meant to be written by humans[^0]. Both MathJax and KaTeX have support for rendering TeX to MathML.

[^0]: Compare Pythagorean theorem written in MathML and TeX.

MathML:

  
    a 2
  + b 2
  = c 2
  .
TeX:

  $$
  a^2 + b^2 = c^2
  $$
I'll be surprised if someone preferred to write the first rather the second.

Re: Math on GitHub: The Good, the Bad and the Ugly

#29

A source block type would have been a very natural fit, it’s surprising that isn’t how they chose to go. ```equation e^{i\pi}+1\eq0 ``` feels like what i’d try to do right off the bat.

Yes, could use different tags for literal display and rendering eg ```tex and ```eq.

Re: Math on GitHub: The Good, the Bad and the Ugly

#30

> advantages of KaTeX: > It’s faster. > You can copy-and-paste math. Someone mentioned that you can theoretically copy-and-paste KaTeX output in an earlier thread about GitHub's new math rendering too. But I think calling that an "advantage" is crazy. LaTeX will transform your one-dimensional textual formula specification into a two-dimensional graphical formula. The concept of copying and pasting the output as text…

KaTeX also supports only susbset of the features of MathJaX. Some of them are really important. While speed is great, missing basic features is the worse. I'm happy with GitHub's choice.
Post reply on HN