Matrix in Latex

You must read at least lshort (page 58) or amsldoc.pdf Section 4.

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\[
\begin{bmatrix}
    x_{11}       & x_{12} & x_{13} & \dots & x_{1n} \\
    x_{21}       & x_{22} & x_{23} & \dots & x_{2n} \\
    \hdotsfor{5} \\
    x_{d1}       & x_{d2} & x_{d3} & \dots & x_{dn}
\end{bmatrix}
=
\begin{bmatrix}
    x_{11} & x_{12} & x_{13} & \dots  & x_{1n} \\
    x_{21} & x_{22} & x_{23} & \dots  & x_{2n} \\
    \vdots & \vdots & \vdots & \ddots & \vdots \\
    x_{d1} & x_{d2} & x_{d3} & \dots  & x_{dn}
\end{bmatrix}
\]
\end{document}

enter image description here


From the link @TobyStack gave:

I don't use the document/array package because I'm not very experienced.

new row:\\ (btw, you can use that for $\displaystyle\sum_{j=0\\j\ne i}^m\sum_{i=0}^n$) output: enter image description here

new column: &

Also, use

    line:     \ldots 
    diagonal: \ddots 
    vertical: \vdots

output:enter image description here

Depending on your preference:

    brackets: \begin{bmatrix}\end{bmatrix}
    parentheses: \begin{pmatrix}\end{pmatrix}

Screenshoot:enter image description here

Tags:

Matrices