Live data from Hacker News

Math on GitHub: Following Up

nschloe.github.io

41–46 of 46 posts

Re: Math on GitHub: Following Up

#41
post #25

Just spotted this on the GitHub blog, posted 33 minutes ago: https://github.blog/changelog/2022-06-28-fenced-block-syntax... > Users can now delineate mathematical expressions using ```math fenced code block syntax in addition to the already supported delimiters.

I really don't like overloading ```X as a way to render the output of running the code, because now you have no way to display a block of raw mermaid or math code which is the whole point of ``` in the first place. I would be much happier if they introduced a syntax variation to enable this feature more generally instead of overloading the purpose of backticks, something like ```!X (```!math or ```!mermaid) for "run…

The big advantage of using code blocks is that is guarantees that their sanitizer doesn't mess with the contents. This is a pretty big plus.

Also, you can of course still have mermaid code blocks; just don't put `mermaid` after the three backticks. The code block won't have any syntax highlighting, but in the case of `math`, this wouldn't make sense anyway.

Re: Math on GitHub: Following Up

#42
post #25

Just spotted this on the GitHub blog, posted 33 minutes ago: https://github.blog/changelog/2022-06-28-fenced-block-syntax... > Users can now delineate mathematical expressions using ```math fenced code block syntax in addition to the already supported delimiters.

This is great news! It's not working for me quite yet, but I'm refreshing my browser every 5 minutes. Next stop: Proper inline math.

Re: Math on GitHub: Following Up

#43

Markdown is just generally awful because it’s not designed to be extensible. And so people make a total hash of things like this when trying to add custom inline syntax (because it’s not possible to do it compatibly), and abuse preformatted code blocks to do something other than show code. (Seriously, if you make ```mermaid … ``` turn it into a diagram, how am I supposed to show syntax-highlighted Mermaid code? Or ``…

An interesting take, thanks for the input! As a layman (pretty much), I had always a bit frowned upon reST since I never got used to syntax. That was probably because Markdown was already so popular when I started using it.

One little remark: You can still have highlighted math code blocks in gh's Markdown. The lang here is ```latex. Anyway, I see this might not be satisfactory.

Re: Math on GitHub: Following Up

#44
post #25

Just spotted this on the GitHub blog, posted 33 minutes ago: https://github.blog/changelog/2022-06-28-fenced-block-syntax... > Users can now delineate mathematical expressions using ```math fenced code block syntax in addition to the already supported delimiters.

I wonder if the initial choice to $ and $$ syntax was to keep the syntax identical to VSCode's built-in KaTeX rendering for Markdown preview? You'd think that they could just port over the VSCode implementation directly which already works quite well without most of the inconsistency issues in the website's MathJax counterpart, especially considering that VSCode is their own Electron product too.

Re: Math on GitHub: Following Up

#45

The `$...$' and `$$...$$' delimiters are used in TeX. LaTeX uses the more superior delimiter as `\(...\)' and `\[...\]'. All the MathJax and KaTeX related markdown for math should use the LaTeX delimiters and avoid the TeX delimiters. For more info see https://docs.mathjax.org/en/v2.5-latest/tex.html#tex-and-lat...

[deleted]

Re: Math on GitHub: Following Up

#46

The `$...$' and `$$...$$' delimiters are used in TeX. LaTeX uses the more superior delimiter as `\(...\)' and `\[...\]'. All the MathJax and KaTeX related markdown for math should use the LaTeX delimiters and avoid the TeX delimiters. For more info see https://docs.mathjax.org/en/v2.5-latest/tex.html#tex-and-lat...

I understand this is useful for people who doesn't type math regularly, but as someone who write a huge amount of math, `$...$` is so much less friction than the LaTeX one `\(...\)`.

Even in LaTeX, mix and match. `$...$` for normal mode, and `\[...\]` for display math, and it works well for two reasons. Inline math are generally short, less prone to mistakes, so `$` saves a lot of time.

Post reply on HN