#69 Remove MathJax?

Slēgta
hz atvēra pirms 1 mēnesi · 7 komentāri
hz komentēja pirms 1 mēnesi

It seems like KaTeX is getting pretty good now, and MathJax recently released version 3.0, which changes roughly everything about how one interacts with it. Maybe this is the time to remove MathJax from the distribution, rather than trying to upgrade it?

It seems like KaTeX is getting pretty good now, and MathJax recently released version 3.0, which changes roughly everything about how one interacts with it. Maybe this is the time to remove MathJax from the distribution, rather than trying to upgrade it?
hz pievienoja etiķeti
maybe
pirms 1 mēnesi
hz pievienoja etiķeti
discussion
pirms 1 mēnesi
hz komentēja pirms 1 mēnesi
Īpašnieks

#73 implements the necessary changes for this, but I’m still not 100% sure that removing MathJax is actually the right thing to do as of right now.

On the whole, I think KaTeX is in a really good place and will only get better, and the only real benefit from MathJax is that it is better at handling some less standard forms (\cases and \eqalign come to mind). MathJax also takes up a lot of space in the distribution and is super slow by comparison, so maybe more trouble than it’s worth.

One potential downside is that people may be surprised when certain incantations don’t work. We could point people to the KaTeX support table or something like that, though.

@edemaine or @ichuang, any thoughts on this? If not, I’ll probably go ahead with merging #73.

FWIW, I expect 6.036 and 6.003 are likely to be the hardest-hit of the subjects using catsoop, and maybe 6.002 as well.

#73 implements the necessary changes for this, but I'm still not 100% sure that removing MathJax is actually the right thing to do as of right now. On the whole, I think KaTeX is in a really good place and will only get better, and the only real benefit from MathJax is that it is better at handling some less standard forms (`\cases` and `\eqalign` come to mind). MathJax also takes up a lot of space in the distribution and is super slow by comparison, so maybe more trouble than it's worth. One potential downside is that people may be surprised when certain incantations don't work. We could point people to the [KaTeX support table](https://katex.org/docs/support_table.html) or something like that, though. @edemaine or @ichuang, any thoughts on this? If not, I'll probably go ahead with merging #73. FWIW, I expect 6.036 and 6.003 are likely to be the hardest-hit of the subjects using catsoop, and maybe 6.002 as well.
hz slēdza šo problēmu pirms 1 mēnesi

Feel free to open issues for missing features on the KaTeX side -- but it also probably exists as a long-standing issue. :) But if something comes up as a priority, let me know...

By the way, are you using KaTeX to do server-side rendering? Now that you’re without MathJax, this is an option... but maybe a little more difficult because the server is in Python, so you’d need Node installed.

Feel free to open issues for missing features on the KaTeX side -- but it also probably exists as a long-standing issue. :) But if something comes up as a priority, let me know... By the way, are you using KaTeX to do server-side rendering? Now that you're without MathJax, this is an option... but maybe a little more difficult because the server is in Python, so you'd need Node installed.
hz komentēja pirms 1 mēnesi
Īpašnieks

Feel free to open issues for missing features on the KaTeX side -- but it also probably exists as a long-standing issue. :) But if something comes up as a priority, let me know...

The most common things I’ve seen missing from subjects I’ve looked at (6.002, 6.036, 6.003) are \eqalign and \cases (and \cal, but iirc you added that already and it just hasn’t made it into a release yet). So I don’t think there’s a pressing need for anything there. Maybe \cases and \eqalign might be easy, since they’re so similar to {cases} and {aligned}, but I don’t know enough to say for sure. I can open issues on the KaTeX side for those.

Also the \begin{align} within $$...$$ is really common in those subjects, but that’s easily fixed by changing to {aligned} or removing the $$...$$.

By the way, are you using KaTeX to do server-side rendering? Now that you’re without MathJax, this is an option... but maybe a little more difficult because the server is in Python, so you’d need Node installed.

Doing the rendering on the server side would be neat, but I haven’t looked into it seriously because it would involve adding node (and I’m not sure the benefits would outweigh that). Maybe we could add it as an option in the case where Node is already installed (and a flag is set).

I’m not sure there’s a clear win there, though, given that the client-side rendering is super fast for 99% of pages, to the extent where you probably wouldn’t even notice a difference. Obviously people with Javascript disabled would notice a big difference, but, at least for now, CAT-SOOP is pretty much unusable with Javascript disabled anyway (fixing that situation is a long-term stretch goal of mine, but not a priority).

> Feel free to open issues for missing features on the KaTeX side -- but it also probably exists as a long-standing issue. :) But if something comes up as a priority, let me know... The most common things I've seen missing from subjects I've looked at (6.002, 6.036, 6.003) are `\eqalign` and `\cases` (and `\cal`, but iirc you added that already and it just hasn't made it into a release yet). So I don't think there's a pressing need for anything there. Maybe `\cases` and `\eqalign` might be easy, since they're so similar to `{cases}` and `{aligned}`, but I don't know enough to say for sure. I can open issues on the KaTeX side for those. Also the `\begin{align}` within `$$...$$` is really common in those subjects, but that's easily fixed by changing to `{aligned}` or removing the `$$...$$`. > By the way, are you using KaTeX to do server-side rendering? Now that you're without MathJax, this is an option... but maybe a little more difficult because the server is in Python, so you'd need Node installed. Doing the rendering on the server side would be neat, but I haven't looked into it seriously because it would involve adding node (and I'm not sure the benefits would outweigh that). Maybe we could add it as an option in the case where Node is already installed (and a flag is set). I'm not sure there's a clear win there, though, given that the client-side rendering is super fast for 99% of pages, to the extent where you probably wouldn't even notice a difference. Obviously people with Javascript disabled would notice a big difference, but, at least for now, CAT-SOOP is pretty much unusable with Javascript disabled anyway (fixing that situation is a long-term stretch goal of mine, but not a priority).

I believe \cases is a macro defined in 6.006 macros.tex only, and it should really die. It overwrites \begin{cases} (which LaTeX expands to \cases) so breaks amsmath.

\eqalign does look easy... I’d never heard of that one. Indeed, it seems to be defined in plain TeX, but not LaTeX. Is it in a LaTeX package or something?

I believe `\cases` is a macro defined in 6.006 `macros.tex` only, and it should really die. It overwrites `\begin{cases}` (which LaTeX expands to `\cases`) so breaks amsmath. [`\eqalign`](https://www.tutorialspoint.com/tex_commands/eqalign.htm) does look easy... I'd never heard of that one. Indeed, it seems to be defined in plain TeX, but not LaTeX. Is it in a LaTeX package or something?
hz komentēja pirms 1 mēnesi
Īpašnieks

I believe \cases is a macro defined in 6.006 macros.tex only

Both \cases and \eqalign are listed on the KaTeX support table as not being supported, but I’m not sure whether their not being supported is an intentional “wontfix,” versus just not having been implemented yet

6.003 uses \cases and \eqalign all over the place. They use conTeXt rather than LaTeX for their other internal pieces (lecture slides/notes, etc), and that seems to have transferred over to the way they write their math in catsoop as well. As a side-effect, this meant that a lot of their math was being rendered with MathJax before and is broken now.

\eqalign does look easy... I’d never heard of that one. Indeed, it seems to be defined in plain TeX, but not LaTeX. Is it in a LaTeX package or something?

\cases, similarly, seems to be defined in plain TeX but not in LaTeX (so it’s not just a 6.006 creation!).

I’m not sure what KaTeX’s philosophy is on TeX vs LaTeX, so I’m not sure how likely those are to be included in KaTeX. If they’re not likely to be supported, that’s fine, and I can just rewrite 6.003’s math.

> I believe `\cases` is a macro defined in 6.006 `macros.tex` only Both `\cases` and `\eqalign` are listed on the [KaTeX support table](https://katex.org/docs/support_table.html) as not being supported, but I'm not sure whether their not being supported is an intentional "wontfix," versus just not having been implemented yet 6.003 uses `\cases` and `\eqalign` all over the place. They use [conTeXt](https://en.wikipedia.org/wiki/ConTeXt) rather than LaTeX for their other internal pieces (lecture slides/notes, etc), and that seems to have transferred over to the way they write their math in catsoop as well. As a side-effect, this meant that a lot of their math was being rendered with MathJax before and is broken now. > [`\eqalign`](https://www.tutorialspoint.com/tex_commands/eqalign.htm) does look easy... I'd never heard of that one. Indeed, it seems to be defined in plain TeX, but not LaTeX. Is it in a LaTeX package or something? [`\cases`](https://www.tutorialspoint.com/tex_commands/cases.htm), similarly, seems to be defined in plain TeX but not in LaTeX (so it's not just a 6.006 creation!). I'm not sure what KaTeX's philosophy is on TeX vs LaTeX, so I'm not sure how likely those are to be included in KaTeX. If they're not likely to be supported, that's fine, and I can just rewrite 6.003's math.

Ah, I see, both plain TeX features... That explains where the 6.006 macro came from. :)

Their listing on the KaTeX support table probably comes from those being supported by MathJax and not KaTeX, so are worth considering. I’m not sure there’s an official policy on TeX vs. LaTeX -- I don’t recall it coming up -- but there is a policy toward behaving like (La)TeX does. This is tricky here, because \cases already has a meaning in LaTeX (with amsmath), namely, the same as \begin{cases}. Ah, luckily, it turns out that \cases actually produces an error in LaTeX:

Package amsmath Error: Old form `\cases' should be \begin{cases}.

So it would be reasonable (and I think easy) to support both \cases and \eqalign in KaTeX, as they don’t have another inconsistent behavior in LaTeX.

Ah, I see, both plain TeX features... That explains where the 6.006 macro came from. :) Their listing on the KaTeX support table probably comes from those being supported by MathJax and not KaTeX, so are worth considering. I'm not sure there's an official policy on TeX vs. LaTeX -- I don't recall it coming up -- but there is a policy toward behaving like (La)TeX does. This is tricky here, because `\cases` already has a meaning in LaTeX (with amsmath), namely, the same as `\begin{cases}`. Ah, luckily, it turns out that `\cases` actually produces an error in LaTeX: ``` Package amsmath Error: Old form `\cases' should be \begin{cases}. ``` So it would be reasonable (and I think easy) to support both `\cases` and `\eqalign` in KaTeX, as they don't have another inconsistent behavior in LaTeX.
hz komentēja pirms 1 mēnesi
Īpašnieks

Ah, luckily, it turns out that \cases actually produces an error in LaTeX:

Package amsmath Error: Old form `\cases' should be \begin{cases}.

Looks like it errors out more completely without amsmath, just the usual “undefined control sequence” for both \cases and \eqalign. So at least it looks like they don’t produce inconsistent output; they just both error out.

If it seems like there’s no fundamental philosophical issue with those being included in KaTeX, it would certainly remove some of the tedium from prepping for 6.003 in the fall :)

> Ah, luckily, it turns out that `\cases` actually produces an error in LaTeX: > ``` > Package amsmath Error: Old form `\cases' should be \begin{cases}. > ``` Looks like it errors out more completely without amsmath, just the usual "undefined control sequence" for both `\cases` and `\eqalign`. So at least it looks like they don't produce inconsistent output; they just both error out. If it seems like there's no fundamental philosophical issue with those being included in KaTeX, it would certainly remove some of the tedium from prepping for 6.003 in the fall :)
Pierakstieties, lai pievienotos šai sarunai.
Nav atskaites punktu
Nav atbildīgo
2 dalībnieki
Paziņojumi
Izpildes termiņš

Izpildes termiņš nav uzstādīts.

Atkarības

Šai problēmai pagaidām nav nevienas atkarības.

Notiek ielāde…
Vēl nav satura.