1

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

closed as off topic by Jake, Alan Munn, Lev Bishop, Xavier, lockstep May 19 '13 at 8:33

Questions on TeX - LaTeX Stack Exchange are expected to relate to TeX, LaTeX or related typesetting systems within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here. If this question can be reworded to fit the rules in the help center, please edit the question.

  • Does MathML provide any tagging scheme for lines striking through row and column? – CV Radhakrishnan Sep 16 '12 at 3:44
  • I found "verticalstrike" and "horizontalstrike", but I do not know how to use it with matrices. developer.mozilla.org/en-US/docs/MathML/Element/menclose – Pan Sep 16 '12 at 9:23
  • Thanks, have given a try and provided an example. Does that sound good enough? – CV Radhakrishnan Sep 16 '12 at 11:17
  • Yes, of course. – Pan Sep 17 '12 at 8:39
2

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.