How can I add cross line in determinant?

42 views
Skip to first unread message

ABIR HASAN ZOHA

unread,
Aug 4, 2016, 6:26:33 AM8/4/16
to MathJax Users
I am working with Mathjax. How can I make the determinant looks like the picture I have attached.

$ \begin{array}{|ccc|cc} 
1 & 2 &4 & 1 &2\\ 
3& 1 & 2 & 3 & 1\\
 2 & 4 & 0 & 2 & 4\
 \end{array} = (0 + 8 + 48) - ( 8 + 8 + 0) = 40 $



Peter Krautzberger

unread,
Aug 9, 2016, 11:01:38 AM8/9/16
to mathja...@googlegroups.com
Hi Abir,

I'm afraid that's not possible with MathJax at this time. 

MathJax's internal format is (essentially) MathML which cannot produce this overlapping strike-through layout. Realizing this in HTML/CSS would be somewhat difficult I think, see e.g., http://jsbin.com/oqibus/1/edit?html,css,output for a related use case.

Regards,
Peter.

--
You received this message because you are subscribed to the Google Groups "MathJax Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mathjax-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Davide Cervone

unread,
Aug 28, 2016, 10:08:05 AM8/28/16
to mathja...@googlegroups.com
Peter is right that there is no natural way to do it, but there is a hack that can be used to get what you want:

$$
\require{enclose}
\def\ddown{\smash{\rlap{\!\enclose{downdiagonalstrike}{\Space{3.2em}{.5em}{2.7em}}}}}
\def\dup{\smash{\rlap{\!\enclose{updiagonalstrike}{\Space{3.2em}{.5em}{2.7em}}}}}
\begin{array}{|ccc|cc} 
\ddown\dup 1 & \ddown\dup 2 &\ddown\dup 4 & 1 &2\\ 

3& 1 & 2 & 3 & 1\\
 2 & 4 & 0 & 2 & 4\
 \end{array} = (0 + 8 + 48) - ( 8 + 8 + 0) = 40
$$

This uses the "enclose" extension to produce diagonal lines, and the \Space macro to produce a blank area of the desired size for the diagonal.  It's not great, but it works.

Davide


--
You received this message because you are subscribed to the Google Groups "MathJax Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mathjax-user...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages