# #69Remove MathJax?

닫힘
hz1 개월 전을 오픈 · 7개의 코멘트
코멘트됨, 1 개월 전

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?
maybe
label 1 개월 전
discussion
label 1 개월 전
코멘트됨, 1 개월 전
소유자

#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.
closed this issue 3 주 전
코멘트됨, 3 주 전

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.
코멘트됨, 3 주 전
소유자

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).
코멘트됨, 3 주 전

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?
코멘트됨, 3 주 전
소유자

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.
코멘트됨, 3 주 전

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.
코멘트됨, 3 주 전
소유자

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 :)
로그인하여 이 대화에 참여
마일스톤 없음
담당자 없음
참여자 2명
알림
마감일

마감일이 설정되지 않았습니다.

의존성

이 이슈는 어떠한 의존성도 가지지 않습니다.

불러오는 중...
아직 콘텐츠가 없습니다.