Forgot password?
 Create new account
View 230|Reply 1

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

[Copy link]

3147

Threads

8493

Posts

610K

Credits

Credits
66163
QQ

Show all posts

hbghlyj Posted at 2022-4-12 15:22:38 |Read mode
Last edited by hbghlyj at 2022-7-22 12:05:00$\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. }
Copy the Code
测试:
Screenshot 2022-04-12 083137.png

类似问题:MathJax issue 2535

3147

Threads

8493

Posts

610K

Credits

Credits
66163
QQ

Show all posts

 Author| hbghlyj Posted at 2022-7-22 19:09:19
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?

手机版Mobile version|Leisure Math Forum

2025-4-20 22:16 GMT+8

Powered by Discuz!

× Quick Reply To Top Return to the list