Forgot password?
 Create new account
View 168|Reply 1

[MathJax]编号居左/居右

[Copy link]

3148

Threads

8494

Posts

610K

Credits

Credits
66173
QQ

Show all posts

hbghlyj Posted at 2022-5-9 04:57:56 |Read mode
根据MathJax文档,在配置中,tagSide: 'right'可以将全局的公式居右 $$x+1\over\sqrt{1-x^2}\label{ref1}\tag{1}$$ 但是有没有办法可以将局部的公式编号居左呢?尤其是已经有了一个CMS(如Discuz)给每一个页面加上相同的配置的情况下.
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
  <mtable displaystyle="true">
    <mlabeledtr>
      <mtd id="mjx-eqn:ref1">
        <mtext>(1)</mtext>
      </mtd>
      <mtd>
        <mfrac>
          <mrow>
            <mi>x</mi>
            <mo>+</mo>
            <mn>1</mn>
          </mrow>
          <msqrt>
            <mn>1</mn>
            <mo>&#x2212;</mo>
            <msup>
              <mi>x</mi>
              <mn>2</mn>
            </msup>
          </msqrt>
        </mfrac>
      </mtd>
    </mlabeledtr>
  </mtable>
</math>
如果把tagSide改为left后,经过MathJax处理得到MathML为
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
  <mtable side="left" displaystyle="true">
    <mlabeledtr>
      <mtd id="mjx-eqn:ref1">
        <mtext>(1)</mtext>
      </mtd>
      <mtd>
        <mfrac>
          <mrow>
            <mi>x</mi>
            <mo>+</mo>
            <mn>1</mn>
          </mrow>
          <msqrt>
            <mn>1</mn>
            <mo>−</mo>
            <msup>
              <mi>x</mi>
              <mn>2</mn>
            </msup>
          </msqrt>
        </mfrac>
      </mtd>
    </mlabeledtr>
  </mtable>
</math>
可见,只增加了一个 side="left"

3148

Threads

8494

Posts

610K

Credits

Credits
66173
QQ

Show all posts

 Author| hbghlyj Posted at 2022-7-4 00:00:28
\leqalignno
$$\leqalignno{
    f_1(x)&=a_1x^2+b_1x+c_1&(1)\\
    f_2(x)&=a_2x^2+b_2x+c_2&(2)
}$$
BaseMappings.ts第654行
  leqalignno:        ['Matrix', null, null, 'right left',
                      em(MATHSPACE.thickmathspace), '.5em', 'D', null,
                      'left'],

手机版Mobile version|Leisure Math Forum

2025-4-21 01:04 GMT+8

Powered by Discuz!

× Quick Reply To Top Return to the list