Live data from Hacker News

Render mathematical expressions in Markdown On GitHub

github.blog

31–40 of 114 posts

Re: Render mathematical expressions in Markdown On GitHub

#31

Math doesn't render inside a bullet list item. I don't know how to file an issue against Github itself, somewhat ironically.

I feel like being in a bullet list item restricts a lot of the rendering you can do.

It doesn't in HTML/CSS.

Re: Render mathematical expressions in Markdown On GitHub

#32
post #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…

> I'm sure they had their reasons They do, accessibility being one of them. Rendering math in the way you describe makes it difficult, or impossible, to understand for all sorts of audiences, including those relying on screen reading software.

KaTeX includes hidden MathML for screen readers.

https://github.com/KaTeX/KaTeX/issues/38

Re: Render mathematical expressions in Markdown On GitHub

#33

My one complaint about these new mark down features with github is the lock-in. I’m trying to build a gist compatible service and theres quite a bit to cover. MathJax is fine, but now I (and gitlab, bitbucket, etc) will need to support it

Fyi, GitLab has supported[0] this since quite a while[1].

[0]: https://gitlab.com/gitlab-org/gitlab-foss/-/blob/master/doc/... [1]: https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/8...

Re: Render mathematical expressions in Markdown On GitHub

#34
post #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…

The last I knew, KaTeX had issues with accessibility. But honestly it is probably just best to ship raw MathML, translated from LaTeX on the server, and use MathJax as a polyfill for Chrome and Edge users. That way you get extremely fast rendering in Safari and Firefox without any extra javascript, and eventually Chrome will catch up.

Re: Render mathematical expressions in Markdown On GitHub

#35
post #16

Earlier quoted context omitted.

No idea, but if you have only two backslashes instead of four, the matrix would appear as a single row, like [a bc d]. That said, \\begin renders the same as \begin.

Oh, this is an experimental result? You've found a bug in Github's parser. You should call it a "bug", not an "annoyance".

This is a pretty aggressive tone. I don't think it's warranted.

As a data point: I have the same experience using MathJax in my own blog (Hugo, Goldmark markdown engine), so I'm assuming there's some structural reason for it, not blaming Github.

Re: Render mathematical expressions in Markdown On GitHub

#36
I'm having a Baader-Meinhof (frequency illusion) moment, because I was just Googling for equation syntax support in markdown for my Riemann Zeta Function visualization project this past week.

Pluging project here if anyone is interested: https://github.com/atonalfreerider/riemann-zeta-visualizatio...

Re: Render mathematical expressions in Markdown On GitHub

#37
post #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 Mat…

I’m a big fan of Linux Libertine, and I was pleasantly surprised to learn that there is a fork(Libertinus; https://github.com/alerque/libertinus), which includes a math family (Libertinus Math).

They work brilliantly together as well, and in my opinion, a little better fit for the web then TeX Gyre—which is optimized for the printed page.

You can see an example on the doc for my project Mathup: https://runarberg.github.io/mathup/ (you might need firefox or safari to see the font though, as you need the native MathML to render the equations)

Re: Render mathematical expressions in Markdown On GitHub

#38

Looks like it works with `.org` documents as well! I've been authoring my README files in org-mode for a while now (richer formatting options than Markdown) and GitHub does a great job rendering the org-mode.

I'll have to test AsciiDoc (my markup of choice) when I get a chance. Now, if only GitHub mobile would start rendering my AsciiDoc files, I could use it as my mobile knowledgebase/notes viewer instead of the website version.

Re: Render mathematical expressions in Markdown On GitHub

#39
post #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).

In my opinion LaTeX is a poor fit for markdown, although it is the logical—and probably the only—choice. Markdown documents are supposed to be easy to read and quick to type. LaTeX is neither. When I include a matrix in my markdown document I want to type it something like:

    ## Example Matrix

    $$$
    [a, b; c, d]
    $$$
Although I realize that we are probably stuck with LaTeX for the foreseeable future as the only way to type math in text files.

Disclaimer, I am an author of an alternative math markup language specifically designed to be a good fit in Markdown.

Re: Render mathematical expressions in Markdown On GitHub

#40
KeenWrite, my desktop editor for Markdown and R Markdown documents, provides real-time rendering of TeX equations:

https://github.com/DaveJarvis/keenwrite/blob/master/docs/scr...

The choice of using TeX over LaTeX is deliberate. Documents written using plain TeX can be rendered by either ConTeXt or LaTeX. I prefer ConTeXt because it makes separating content from presentation easier. One of the benefits of using Markdown, IMO, is to be agnostic as to how the documents are presented. Math could be rendered using ConTeXt, LaTeX, KaTeX, MathJax, JMathTeX, XeTeX, or any other compatible TeX typesetter.

https://wiki.contextgarden.net/Installation

Post reply on HN