Live data from Hacker News

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

nschloe.github.io

1–10 of 71 posts

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

#4
> 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 is a category error. It isn't text and if you try to paste it, you'll get something other than what you wanted.

Just to be sure I'm not crazy, I tried copying the output of the demo on the KaTeX homepage. Here it is:

> f(x)=∫−∞∞f^(ξ) e2πiξx dξ

This is much, much, much worse, if you want a textual representation, than copying the LaTeX source:

    \f\relax{x} = \int_{-\infty}^\infty
        \f\hat\xi\,e^{2 \pi i \xi x}
        \,d\xi
And it's worse even though the raw source includes the quirk that LaTeX isn't able to provide proper spacing for the differential over which an integral is being calculated, so you have to space it yourself with \, commands.

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

#5

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.

Especially since this approach has already been tried and proven by competitors like GitLab.

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

#6
I completely agree with the conclusions, GitHub repositories can really be the focal point of scientific publishing in years to come.

I always wondered why it took so long to implement math. There are better implementations out there for sure, it's weird they waited for so long and implemented something that is below the standard of alternatives.

The next step is to render citations from .bib files. I hope they get that right in the future.

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

#7

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.

I prefer the $ $ way, as it makes it possible to do inline equations, while keeping the source easily readable.

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

#8
post #7

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.

I prefer the $ $ way, as it makes it possible to do inline equations, while keeping the source easily readable.

They suggest this for inline using combination of the code back tick and dollar syntaxes:

Inline math: $`a^2 + b^2 = c^2`$.

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

#9
post #7

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.

I prefer the $ $ way, as it makes it possible to do inline equations, while keeping the source easily readable.

you can do both, the normal markdown way:

  `$a$` squared is `$a^2$`, which is good to know for the pythagorean theorem:
  ```equation
  a^2+b^2\eq c^2
  ```
Post reply on HN