找回密码
 快速注册
搜索
查看: 150|回复: 1

[MathJax]添加字符映射delimiter(定界符)

[复制链接]

3149

主题

8386

回帖

6万

积分

$\style{scale:11;fill:#eff}꩜$

积分
65391
QQ

显示全部楼层

hbghlyj 发表于 2022-4-12 15:22 |阅读模式
本帖最后由 hbghlyj 于 2022-7-22 12:05 编辑 $\left\{\frac12\right\}$(\left\{\frac12\right\})显示出来与$\left\lbrace\frac12\right\rbrace$(\left\lbrace\frac12\right\rbrace)一样.
$\left[\frac12\right]$(\left[\frac12\right])显示出来与$\left\lbrack\frac12\right\rbrack$(\left\lbrack\frac12\right\rbrack)一样.
但是\left⟨\frac12\right⟩会报错:$\left⟨\frac12\right⟩$
使用以下代码就可以使得\left⟨\frac12\right⟩显示出来与$\left\langle\frac12\right\rangle$(\left\langle\frac12\right\rangle)一样:
  1. MathJax = {
  2.   startup: {
  3.     ready() {
  4.       MathJax.startup.defaultReady();
  5.       const {Symbol} = MathJax._.input.tex.Symbol.Symbol;
  6.       const {MapHandler} = MathJax._.input.tex.MapHandler.MapHandler;
  7.       const delimiter = MapHandler.getMap('delimiter');
  8.       delimiter.add('⟨', new Symbol('⟨', '⟨'));
  9.       delimiter.add('⟩', new Symbol('⟩', '⟩'));
  10.     }
  11.   }
  12. }
复制代码
测试:
Screenshot 2022-04-12 083137.png

类似问题:MathJax issue 2535

3149

主题

8386

回帖

6万

积分

$\style{scale:11;fill:#eff}꩜$

积分
65391
QQ

显示全部楼层

 楼主| hbghlyj 发表于 2022-7-22 19:09
The parallel operator (also known as reduced sum, parallel sum or parallel addition), a mathematical function modeling parallel resistors.

MathJax.tex2mml('∥')
"<math xmlns=\"http://www.w3.org/1998/Math/MathML\" display=\"block\">
  <mo>&#x2225;</mo>
</math>"

MathJax.tex2mml('\
\parallel')
"<math xmlns=\"http://www.w3.org/1998/Math/MathML\" display=\"block\">
  <mo>&#x2225;</mo>
</math>"


For the similarly looking doubled vertical line notation ‖ in mathematics, see Norm (mathematics).

MathJax.tex2mml('‖')
"<math xmlns=\"http://www.w3.org/1998/Math/MathML\" display=\"block\">
  <mrow data-mjx-texclass=\"ORD\">
    <mo stretchy=\"false\">&#x2016;</mo>
  </mrow>
</math>"

MathJax.tex2mml('\
\Vert')
"<math xmlns=\"http://www.w3.org/1998/Math/MathML\" display=\"block\">
  <mo data-mjx-texclass=\"ORD\" fence=\"false\" stretchy=\"false\">&#x2016;</mo>
</math>"

MathJax.tex2mml('\
\|')
"<math xmlns=\"http://www.w3.org/1998/Math/MathML\" display=\"block\">
  <mo data-mjx-texclass=\"ORD\" fence=\"false\" stretchy=\"false\">&#x2016;</mo>
</math>"


Why does and \| yield different results? An inconsistency of MathJax?

手机版|悠闲数学娱乐论坛(第3版)

GMT+8, 2025-3-4 15:46

Powered by Discuz!

× 快速回复 返回顶部 返回列表