Forgot password?
 Register account
Author: kuing

今起用新的 MathJax 3 支持数学公式

[Copy link]

682

Threads

110K

Posts

910K

Credits

Credits
90973
QQ

Show all posts

 Author| kuing Posted 2022-7-16 14:16
hbghlyj 发表于 2022-7-16 03:05
👌已提交MathJax issue
这感觉没必要提交 issue 吧……
mathjax 与真 latex 有区别的细节多了去了,这种不常用的东西没必要纠结……

3152

Threads

7905

Posts

610K

Credits

Credits
64068
QQ

Show all posts

hbghlyj Posted 2022-7-16 15:14
kuing 发表于 2022-7-16 07:16
这感觉没必要提交 issue 吧……
mathjax 与真 latex 有区别的细节多了去了,这种不常用的东西没必要纠结 ...
mathjax用于批量转换latex会出现像这样的问题啊,如果有其他的问题也报告一下吧

3152

Threads

7905

Posts

610K

Credits

Credits
64068
QQ

Show all posts

hbghlyj Posted 2022-7-19 05:38
kuing 发表于 2022-7-15 19:53
真 latex 里,只是 \newcommand 不允许,\def 是可以的。

以下代码报错:
dpvc回复说
Note that TeX control sequences can't contain numbers, so what you are actually doing is defining \b with a template that requires it to be followed by 0.
好像说,指令名不允许包含数字,上面的\def是定义了\b的一个模板,该模板要求其后跟 0.

682

Threads

110K

Posts

910K

Credits

Credits
90973
QQ

Show all posts

 Author| kuing Posted 2022-7-19 14:26
hbghlyj 发表于 2022-7-19 05:38
dpvc回复说

好像说,指令名不允许包含数字,上面的\def是定义了\b的一个模板,该模板要求其后跟 0. ...
嗯,准确的说法的确是这样。

就像 \def\xxx[#1]{...} 这种定义方式,也是模板,命令就是 \xxx,不包括中括号,只是后面一定要匹配中括号。

但是 mathjax 的 \def 的确是不一样。

3152

Threads

7905

Posts

610K

Credits

Credits
64068
QQ

Show all posts

hbghlyj Posted 2022-10-24 03:16
hbghlyj 发表于 2022-3-4 21:49
回复 84# kuing
那个应该本来就是两个字符吧,参考下面的网站:
U+03A9是Greek Capital Letter Omega
U+2126是Ohm sign(电阻单位)
對某些檔案而言,區分一個字元是資訊單位而非任何特定的視覺顯示是很重要的。如aleph(א)這個希伯來字母常用於數學中,表示某種無窮,但它同時又用於原本的希伯來檔案中。在統一碼中,儘管這兩種用法有一樣外形,但它們是不同的字元,而且由不同的碼位來區分。相對地,如「水」這個中文表意文字,在日文檔案會和中文檔案中有些微不一樣的外觀,這會反映在不同地區的字體。但它們仍代表相同的資訊,即視為一樣的字元,並且在統一碼中使用一樣的碼位。

682

Threads

110K

Posts

910K

Credits

Credits
90973
QQ

Show all posts

 Author| kuing Posted 2023-1-7 21:35
n次根号有点问题:
  1. $(\sqrt[3]{n})$
  2. $(\sqrt[3+3]{n})$
  3. $(\sqrt[3+3+3]{n})$
Copy the Code
效果:
$(\sqrt[3]{n})$
$(\sqrt[3+3]{n})$
$(\sqrt[3+3+3]{n})$

然而在 mathjax 官网的 demo 里测试却没问题,似乎只是在论坛上有问题原因未明。

=====
经更详细测试,在 mathjax 官网的 demo 里如果切换到 SVG 输出也会如此,用 CHTML 是没问题的,所以不是论坛的问题。
另外,切换版本测试,3.2.0 版正常,3.2.1 和 3.2.2 才有此问题。

3152

Threads

7905

Posts

610K

Credits

Credits
64068
QQ

Show all posts

hbghlyj Posted 2023-1-10 00:11
kuing 发表于 2023-1-7 14:35
n次根号有点问题: 效果:
This is a duplicate of #2923, which is resolved in the upcoming version 4.0.
dpvc commented 1 hour ago

682

Threads

110K

Posts

910K

Credits

Credits
90973
QQ

Show all posts

 Author| kuing Posted 2023-1-10 00:18
hbghlyj 发表于 2023-1-10 00:11
This is a duplicate of #2923, which is resolved in the upcoming version 4.0.
dpvc commented 1 hour ...
O,那就是得等 V4.0 出来?

3152

Threads

7905

Posts

610K

Credits

Credits
64068
QQ

Show all posts

hbghlyj Posted 2023-1-10 01:14
kuing 发表于 2023-1-9 17:18
O,那就是得等 V4.0 出来?
一般dpvc会在issue下面写一个临时解决方案, 但是这个issue他没有写

3152

Threads

7905

Posts

610K

Credits

Credits
64068
QQ

Show all posts

hbghlyj Posted 2023-1-23 00:09
kuing 发表于 2022-1-31 17:58
ΩΩ
这两个本身就是不同的字符,前者 %u2126 后者 %u03a9。
刚才用Google Doc把一个数学文档 OCR 并导出 HTML 读到了这样一段:
  1. Show that α ∶ Q[X] → Q[X]; p(X) ↦ Xp(X) is an element of E, and that there is β ∈ E such that βα = 1E, but no γ ∈ E such that αγ = 1E.
Copy the Code
这里的∶即不是普通的冒号:
查了一下这个Unicode码点是专门表示比率的, 属于Mathematical Operators.

3152

Threads

7905

Posts

610K

Credits

Credits
64068
QQ

Show all posts

hbghlyj Posted 2023-1-23 00:17
hbghlyj 发表于 2023-1-22 17:09
刚才用Google Doc把一个数学文档 OCR 并导出 HTML 读到了这样一段:这里的∶即不是普通的冒号
查了一 ...
texlive.net测试了一下,在LaTeX中直接输入冒号和\colon生成的pdf复制出来的文本都是普通的冒号.
然而在这个PDF Page 8 可以复制出文本Proposition 1.23. Suppose that φ ∶ F → R is a ring homomorphism and R is non-trivial.这个就是专门表示ratio的码点, 不是普通的冒号.

3152

Threads

7905

Posts

610K

Credits

Credits
64068
QQ

Show all posts

hbghlyj Posted 2023-1-23 02:46
hbghlyj 发表于 2023-1-22 17:09
刚才用Google Doc把一个数学文档 OCR 并导出 HTML 读到了这样一段:这里的∶即不是普通的冒号
查了一 ...
OCR是“光学字符识别”, 用在这里有点不准确: Google Doc把原文档内嵌的罕见符号∶照样输出了, 说明它是使用原文档内嵌的文本, 而不是看上去像什么就识别成什么(光学识别).

3152

Threads

7905

Posts

610K

Credits

Credits
64068
QQ

Show all posts

hbghlyj Posted 2023-2-16 20:43
问一下, MathJax允许错误代码
  1. $\def\f\mathrm{f}$
Copy the Code
这里的\f的定义是什么呢? \f依然显示为斜体$f$, 没有被定义?

682

Threads

110K

Posts

910K

Credits

Credits
90973
QQ

Show all posts

 Author| kuing Posted 2023-2-16 22:18
hbghlyj 发表于 2023-2-16 20:43
问一下, MathJax允许错误代码

这里的的定义是什么呢? 依然显示为斜体$f$, 没有被定义? ...
我猜可能 mathjax 只是接受 \def\xxx{...}(其中 xxx 必须全英文)的形式,对它认为不合理的部分会跳过,于是 \def\f\mathrm{f} 变成了 \def\f{f}
正如你前面发现过的 \def\b0{{\boldsymbol{0}}} 也是跳过了 0,只定义了 \b

682

Threads

110K

Posts

910K

Credits

Credits
90973
QQ

Show all posts

 Author| kuing Posted 2023-3-21 04:02
hbghlyj 发表于 2023-3-21 03:16
Hosting Your Own Copy of MathJax
手机访问时, 多次看到Waiting for unpkg...
若把MathJax放在Infinityfre ...
早就放了,现在还在的,可以访问 mathjax3/es5/(版本好像还是 3.2.0)
但当时实测发现似乎还不如 unpkg 快,所以后来还是用回 unpkg。
你在英国感觉或许会不同,你平时访问 Infinityfree 一直很快是吧?

3152

Threads

7905

Posts

610K

Credits

Credits
64068
QQ

Show all posts

hbghlyj Posted 2023-3-21 04:24
GET https://kuing.cjhb.site/mathjax3/es5/input/tex/extensions/mathtools.js
测试5次延时为 22ms, 47ms, 45ms, 51ms, 72ms
GET https://unpkg.com/mathjax@3.2.2/es5/input/tex/extensions/mathtools.js
测试5次延时为 1067ms, 2764ms, 635ms, 4517ms, 60ms
🤔

3152

Threads

7905

Posts

610K

Credits

Credits
64068
QQ

Show all posts

hbghlyj Posted 2023-4-3 19:54
kuing 发表于 2022-2-4 03:52
已自动加空格(汉字与公式、英文、数字)
Paranoid text spacing in JavaScript
這個外掛(支援 Chrome 和 Firefox)正是你在網路世界走跳所需要的東西,它會自動替你在網頁中所有的中文字和半形的英文、數字、符號之間插入空白。
Chinese document typesetting specification spacing
Chinese copywriting guidelines for better written communication
在汉字与西文之间插入一个半角空格的工具

谢益辉的博客:
说回来,XeLaTeX 对空格的处理也不够不理想,特别是两种字体的内容在一起时,比如verb||左右的空格我现在都习惯手工添加了。pdfLaTeX 时代的 CJKspace 感觉还不错。

682

Threads

110K

Posts

910K

Credits

Credits
90973
QQ

Show all posts

 Author| kuing Posted 2023-8-29 17:38
BUG:积分的上标如果深度太深,会出现错位。
测试代码:
\[
\int_0^{\frac1{\frac2{\frac34}}}
+
\int_0^{\frac1{\frac2{\frac3{\frac45}}}}
\]
  1. \[
  2. \int_0^{\frac1{\frac2{\frac34}}}
  3. +
  4. \int_0^{\frac1{\frac2{\frac3{\frac45}}}}
  5. \]
Copy the Code

上标高度太高是没问题的,看起来大概就是当上标的深度达到下标所在水平面的时候,就出现问题。

但是下标太高又不会这样。

继续代码测试:
\[
\int_0^{1+\frac1{\frac2{\frac34}}+1}
+
\int_0^{1+\frac1{\frac2{\frac3{\frac45}}}+1}
+
\int_0^{1+\frac1{\frac2{\frac3{\frac4{\frac5{\frac67}}}}}+1}
+
\int_0^{1+\frac{\frac{\frac{\frac{\frac{\frac76}5}4}3}2}1+1}
+
\int^0_{1+\frac{\frac{\frac{\frac{\frac{\frac76}5}4}3}2}1+1}
\]
  1. \[
  2. \int_0^{1+\frac1{\frac2{\frac34}}+1}
  3. +
  4. \int_0^{1+\frac1{\frac2{\frac3{\frac45}}}+1}
  5. +
  6. \int_0^{1+\frac1{\frac2{\frac3{\frac4{\frac5{\frac67}}}}}+1}
  7. +
  8. \int_0^{1+\frac{\frac{\frac{\frac{\frac{\frac76}5}4}3}2}1+1}
  9. +
  10. \int^0_{1+\frac{\frac{\frac{\frac{\frac{\frac76}5}4}3}2}1+1}
  11. \]
Copy the Code

3152

Threads

7905

Posts

610K

Credits

Credits
64068
QQ

Show all posts

hbghlyj Posted 2023-8-29 19:57
Last edited by hbghlyj 2023-8-29 20:11
kuing 发表于 2023-8-29 17:38
继续代码测试:
提交了issue,不知是否明确表达了117#的意思
用MathJax转MathML在Firefox中下标0有些错位 Screenshot 2023-08-29 at 19-59-49 MathML Tester.png
temml转MathML在Firefox中下标0有些错位 Screenshot 2023-08-29 at 19-56-48 Temml - Convert TeX to MathML.png

3152

Threads

7905

Posts

610K

Credits

Credits
64068
QQ

Show all posts

hbghlyj Posted 2024-6-29 07:23
kuing 发表于 2023-1-9 16:18
O,那就是得等 V4.0 出来?
我們可以測試了V4.0。昨日提交了一个问题报告github.com/mathjax/MathJax/issues/3250

Mobile version|Discuz Math Forum

2025-6-4 20:09 GMT+8

Powered by Discuz!

× Quick Reply To Top Edit