在MathJax中显示长除法符号的方法)~~~~~~

时间:2014-04-04 16:09:00

标签: latex mathjax

有没有办法在MathJax中格式化长除法,所以它看起来像这样:

     125     (Explanations)
   4)500
     4        (4 ×  1 = 4)
     10       (5 -  4 = 1)
      8       (4 ×  2 = 8)
      20      (10 -  8 = 2)
      20      (4 ×  5 = 20)
       0      (20 - 20 = 0)

但显然格式正确?

2 个答案:

答案 0 :(得分:14)

以下是Werner答案的修改,可以帮助您获得所需内容。它使用MathJax的附加扩展来插入处理长除法符号的MathML <menclose>元素。

$$
\require{enclose}
\begin{array}{rll}
    125 && \hbox{(Explanations)} \\[-3pt]
   4 \enclose{longdiv}{500}\kern-.2ex \\[-3pt]
      \underline{4\phantom{00}} && \hbox{($4 \times 1 = 4$)} \\[-3pt]
      10\phantom{0} && \hbox{($5 - 4 = 1$)} \\[-3pt]
      \underline{\phantom{0}8\phantom{0}} && \hbox{($4 \times 2 = 8$)} \\[-3pt]
      \phantom{0}20 && \hbox{($10 - 8 = 2$)} \\[-3pt]
      \underline{\phantom{0}20} && \hbox{($4 \times 5 = 20$)} \\[-3pt]
      \phantom{00}0
  \end{array}
$$

结果是

enter image description here

答案 1 :(得分:2)

您可以使用

$$
  \begin{array}{rl}
    \underline{125} & \hbox{(Explanations)} \\[-5pt]
    4 | 500 \\
      \underline{4\phantom{00}} & \hbox{($4 \times 1 = 4$)} \\
      10\phantom{0} & \hbox{($5 - 4 = 1$)} \\
      \underline{\phantom{0}8\phantom{0}} & \hbox{($4 \times 2 = 8$)} \\
      \phantom{0}20 & \hbox{($10 - 8 = 2$)} \\
      \underline{\phantom{0}20} & \hbox{($4 \times 5 = 20$)} \\
      \phantom{00}0
  \end{array}
$$

这就是它在Math.SE上呈现的方式:

enter image description here