I want to write the above matrix in Latex. Please help.
[Tex/LaTex] How to create the following diagonal matrix in Latex
matrices
Related Solutions
You can nest the matrix
environment:
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{equation}
\mathop{\mathbf{adj}}
\begin{pmatrix}
a_{11} & a_{12} & a_{13} \\
a_{12} & a_{22} & a_{23} \\
a_{31} & a_{32} & a_{33}
\end{pmatrix}
=
\begin{pmatrix}
+
\begin{vmatrix}
a_{22} & a_{23} \\
a_{32} & a_{33}
\end{vmatrix} &
-
\begin{vmatrix}
a_{12} & a_{13} \\
a_{32} & a_{33}
\end{vmatrix} &
+
\begin{vmatrix}
a_{12} & a_{13} \\
a_{22} & a_{23} \\
\end{vmatrix} \\[1.5em]
-
\begin{vmatrix}
a_{21} & a_{23} \\
a_{31} & a_{33}
\end{vmatrix} &
+
\begin{vmatrix}
a_{11} & a_{13} \\
a_{31} & a_{33}
\end{vmatrix}&
-
\begin{vmatrix}
a_{11} & a_{13} \\
a_{21} & a_{23}
\end{vmatrix} \\[1.5em]
+
\begin{vmatrix}
a_{21} & a_{22} \\
a_{31} & a_{32}
\end{vmatrix} &
-
\begin{vmatrix}
a_{11} & a_{12} \\
a_{21} & a_{22}
\end{vmatrix} &
+
\begin{vmatrix}
a_{11} & a_{12} \\
a_{21} & a_{22}
\end{vmatrix}
\end{pmatrix}
\end{equation}
\end{document}
I am sure there must be a better way, but you can combine a rotated rule
with the brackets and a few hspace
s and get kind of close. Note this won't scale vertically so don't try to put fractions (or something else tall) between the brackets. The expression with normal brackets is shown as well for comparison.
\documentclass{article}
\usepackage{rotating}
\newcommand\diagmatrix[1]{[\hspace{-1.6pt}\raisebox{7pt}{\rotatebox{-30}{\rule{1mm}{.15mm}}}\hspace{-1pt}#1\hspace{-1pt}\raisebox{-1pt}{\rotatebox{-30}{\rule{1mm}{.15mm}}}\hspace{-1.6pt}]}
\begin{document}
\[\diagmatrix{m_r}^{-1}\diagmatrix{k_r}\]
\[[m_r]^{-1}[k_r]\]
\end{document}
Best Answer
You can get it by using the pmatrix environment and \dots commands of the mathtools package.
Here is the output: