[Tex/LaTex] How to draw the calculation of a determinant

alignmentequationsmath-modematrices

I'm trying to reproduce the following calculation of a determinant in LaTeX:

example image

Any ideas? I thought of using the tabular environment but unfortunately I'm not able to align the "=" correctly.

Best Answer

I just have one question: The numbers in the determine itself are all right aligned. You can see it in column 3, row 1 and 2 in the picture I posted. The 2 is just above the -2 and they are both right aligned, no matter if there is a minus or not. Do you have any idea how to realize that? -- user24295

No, I don't, but according to comments by percusse and Manuel you can do that by loading mathtools instead of amsmath and use \begin{vmatrix*}[r] … \end{vmatrix*}. I haven't checked though by myself. But I do recomment keep the standard alignement provided by \begin{vmatrix} ... \end{vmatrix}.


UPDATE with align. Thanks to cmhughes's advice I've replaced eqnarray with alignand &=& with &=. ADDED. As commented by egreg eqnarray should be avoided (see e.g. here and here) due to spacing discrepancies.

The updated code is:

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\begin{align}
\det A &=\left. 
\begin{array}{c}
\;\;\text{*)} \\ 
-1\text{)} \\ 
-2\text{)} \\ 
-2\text{)}
\end{array}
\right. 
\begin{vmatrix}
1 & 3 & 2 & -6 \\ 
1 & 2 & -2 & -5 \\ 
2 & 4 & -2 & -9 \\ 
2 & 4 & -6 & -9  \notag
\end{vmatrix}
=
\begin{vmatrix}
1 & 3 & 2 & -6 \\ 
0 & -1 & -4 & 1 \\ 
0 & -2 & -6 & 3 \\ 
0 & -2 & -10 & 3
\end{vmatrix}
\\ \notag
&& \\ 
&=\left. 
\begin{array}{c}
\;\;\text{*)} \\ 
-2\text{)} \\ 
-2\text{)}
\end{array}
\right. 
\begin{vmatrix}
1 & 4 & 1 \\ 
2 & 6 & 3 \\ 
2 & 10 & 3
\end{vmatrix}
=
\begin{vmatrix}
1 & 4 & 1 \\ 
0 & -2 & 1 \\ 
0 & 2 & 1
\end{vmatrix}
=
\begin{vmatrix}
-2 & 1 \\ 
2 & 1
\end{vmatrix}
=-4\notag
\end{align}

\end{document} 

The Output is:

enter image description here


We can use the following code (with eqnarray)

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\begin{eqnarray*}
\det A\; &=&\left. 
\begin{array}{c}
\;\;\text{*)} \\ 
-1\text{)} \\ 
-2\text{)} \\ 
-2\text{)}
\end{array}
\right. 
\begin{vmatrix}
1 & 3 & 2 & -6 \\ 
1 & 2 & -2 & -5 \\ 
2 & 4 & -2 & -9 \\ 
2 & 4 & -6 & -9
\end{vmatrix}
=
\begin{vmatrix}
1 & 3 & 2 & -6 \\ 
0 & -1 & -4 & 1 \\ 
0 & -2 & -6 & 3 \\ 
0 & -2 & -10 & 3
\end{vmatrix}
\\
&& \\
&=&\left. 
\begin{array}{c}
\;\;\text{*)} \\ 
-2\text{)} \\ 
-2\text{)}
\end{array}
\right. 
\begin{vmatrix}
1 & 4 & 1 \\ 
2 & 6 & 3 \\ 
2 & 10 & 3
\end{vmatrix}
=
\begin{vmatrix}
1 & 4 & 1 \\ 
0 & -2 & 1 \\ 
0 & 2 & 1
\end{vmatrix}
=
\begin{vmatrix}
-2 & 1 \\ 
2 & 1
\end{vmatrix}
=-4
\end{eqnarray*}

\end{document}

to type

enter image description here

Related Question