TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to demonstrate the special formula for the determinants of 3 by 3 matrices, http://www.purplemath.com/modules/determs2.htm. That is

\documentclass{article}
\begin{document}
$$
\begin{array}{ccc|cc}
a & b & c & a & b\\ d & e & f & d & e\\ g & h & i & g & h  
\end{array}.
$$ 
\end{document}

adding two columns and draw diagonal lines. In the question, Draw a vertical line over the entries of a column in an array, it is answered how to draw vertical lines. The method I believe can be applied to my case. But I am wondering if there is any recent dedicated package that handles this.

share|improve this question
    
duplicate:tex.stackexchange.com/questions/30032/… – kba Feb 14 at 4:21
    
@kba: I am hereby saying that this cannot be done by the previous answers. I am in fact looking for if there has been a development of a dedicated package for this. – Youngsu Feb 14 at 5:49
    
@Andrew That link is already in my original post. – Youngsu Feb 14 at 5:49
up vote 5 down vote accepted

Here is a quick hack using a matrix of math nodes and tikz:

enter image description here

Code

\documentclass[border=5mm,tikz]{standalone}
\usepackage{tikz}
\usetikzlibrary{matrix}
\begin{document}
    \begin{tikzpicture}[auto]
      \matrix (M)[matrix of math nodes,row sep=1cm,column sep=16mm]{
       a & b & c & a & b\\ d & e & f & d & e\\ g & h & i & g & h\\&&[blue]adi&[red]-bfg&[blue]cdh\\
       };
       \draw[blue](M-1-1)--(M-2-2)--(M-3-3)--(M-4-3);
       \draw[blue](M-1-2)--(M-2-3)--(M-3-4)--(M-4-4);
       \draw[blue](M-1-3)--(M-2-4)--(M-3-5)--(M-4-5);
    \end{tikzpicture}
\end{document}
share|improve this answer
1  
Thank you very much. What I wanted was (M-1-1)--(M-3-3) in your code. This is very helpful. – Youngsu Feb 14 at 7:43

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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