2

I have a problem with MathML.

How can I draw a line through a column (row and column at the same time) in a matrix?

An example in TEX: Draw a line through one column of a matrix

Pan
  • 29
  • 2

1 Answers1

3

The following code seems to work:

   \def\vs#1{\Tg<menclose notation="verticalstrike">#1\Tg</menclose>}
   \Css{.array mtd{padding-top: 0em; padding-bottom:0em;}}

   \begin{equation}
   \begin{pmatrix}
   \vs{a+b} & 12 & a+b+c\\
   \vs{c-d} & \gamma^2 & 0\\
   \vs{a}   & \alpha-\beta & abc\\
   \vs{c-d} & \psi_n & d\\
   \end{pmatrix}
   \end{equation}

If you have a working version of TeX4ht, you will get the following MathML output:

          <math xmlns="http://www.w3.org/1998/Math/MathML" display="block"
          class="equation">
            <mfenced separators="" open="(" close=")">
              <mrow>
                <mtable style="text-align:axis;" equalrows="false"
                columnlines="none none none none none none none none none"
                equalcolumns="false" class="array">
                  <mtr>
                    <mtd class="array" columnalign="center">
                      <menclose notation="verticalstrike">
                        <mi>a</mi>
                        <mo class="MathClass-bin">+</mo>
                        <mi>b</mi>
                      </menclose>
                    </mtd>
                    <mtd class="array" columnalign="center">
                      <mn>1</mn>
                      <mn>2</mn>
                    </mtd>
                    <mtd class="array" columnalign="center">
                      <mi>a</mi>
                      <mo class="MathClass-bin">+</mo>
                      <mi>b</mi>
                      <mo class="MathClass-bin">+</mo>
                      <mi>c</mi>
                    </mtd>
                  </mtr>
                  <mtr>
                    <mtd class="array" columnalign="center">
                      <menclose notation="verticalstrike">
                        <mi>c</mi>
                        <mo class="MathClass-bin">-</mo>
                        <mi>d</mi>
                      </menclose>
                    </mtd>
                    <mtd class="array" columnalign="center">
                      <msup>
                        <mrow>
                          <mi>&#947;</mi>
                        </mrow>
                        <mrow>
                          <mn>2</mn>
                        </mrow>
                      </msup>
                    </mtd>
                    <mtd class="array" columnalign="center">
                      <mn>0</mn>
                    </mtd>
                  </mtr>
                  <mtr>
                    <mtd class="array" columnalign="center">
                      <menclose notation="verticalstrike">
                        <mi>a</mi>
                      </menclose>
                    </mtd>
                    <mtd class="array" columnalign="center">
                      <mi>&#945;</mi>
                      <mo class="MathClass-bin">-</mo>
                      <mi>&#946;</mi>
                    </mtd>
                    <mtd class="array" columnalign="center">
                      <mi>a</mi>
                      <mi>b</mi>
                      <mi>c</mi>
                    </mtd>
                  </mtr>
                  <mtr>
                    <mtd class="array" columnalign="center">
                      <menclose notation="verticalstrike">
                        <mi>c</mi>
                        <mo class="MathClass-bin">-</mo>
                        <mi>d</mi>
                      </menclose>
                    </mtd>
                    <mtd class="array" columnalign="center">
                      <msub>
                        <mrow>
                          <mi>&#968;</mi>
                        </mrow>
                        <mrow>
                          <mi>n</mi>
                        </mrow>
                      </msub>
                    </mtd>
                    <mtd class="array" columnalign="center">
                      <mi>d</mi>
                    </mtd>
                  </mtr>
                  <mtr>
                    <mtd class="array" columnalign="center"></mtd>
                  </mtr>
                </mtable>
              </mrow>
            </mfenced>
          </math>

The above MathML rendered in Firefox as here

David Carlisle
  • 757,742
CV Radhakrishnan
  • 1,031
  • 7
  • 11