Diagonal dots spanning multiple lines/columns of a matrix

It's not difficult with TikZ. I have just removed the ddots

\documentclass{article}
\usepackage{amsmath,tikz}
\usetikzlibrary{matrix}
\begin{document}
Following quadratic form involves a skew symmetric matrix. 
\begin{equation}
\begin{pmatrix}
    a\\b\\\vdots\\z
\end{pmatrix}^T
\begin{tikzpicture}[baseline=(current bounding box.center)]
\matrix (m) [matrix of math nodes,nodes in empty cells,right delimiter={]},left delimiter={[} ]{
0  & -2 & 1  &  & -1 & 2  \\
2  & & & & & -1 \\
-1 & & & & &    \\
   & & & & & 1  \\
1  & & & & & -2 \\
-2 &1 & & -1 & 2 & 0\\
} ;
\draw[loosely dotted] (m-1-1)-- (m-6-6);
\draw[loosely dotted] (m-1-2)-- (m-5-6);
\draw[loosely dotted] (m-2-1)-- (m-6-5);
\end{tikzpicture}\begin{pmatrix}
    a\\b\\\vdots\\z
\end{pmatrix}=0
\label{eq:eqq1}
\end{equation}

\end{document}

enter image description here

It looks slightly faint in the picture but if you wish you can add the option thick to the draw commands.


Such diagonals are definitely possible using graphic packages like tikz/pgf or pstricks. However, here's one using TeX leaders:

enter image description here

\documentclass{article}

\usepackage{amsmath,graphicx}

\newcommand{\diagdots}[3][-25]{%
  \rotatebox{#1}{\makebox[0pt]{\makebox[#2]{\xleaders\hbox{$\cdot$\hskip#3}\hfill\kern0pt}}}%
}

\begin{document}

\[
  \begin{bmatrix}
     0 & -2 & 1 &    & -1 &  2 \\
     2 &    &   &    &    & -1 \\
    -1 &    &   &    &    &    \\
       &    &  \multicolumn{2}{c}{\smash{\raisebox{.5\normalbaselineskip}{\diagdots{8em}{.5em}}}} &    &  1 \\
     1 &    &   &    &    & -2 \\
    -2 &  1 & \phantom{-2}  & -1 &  2 &  0
  \end{bmatrix}
\]

\end{document}

The minimal example provides \diagdots[<angle>]{<len>}{<skip>} that draws a diagonal array of dots (actually \cdots) of length <len> at an angle of <angle> (default is -25). The <skip> defines the approximate length between dots.

I've placed \diagdots in the middle of your bmatrix (horizontally by using \multicolumn{2}{c}{...} and vertically by using \raisebox{.5\normalbaselineskip}{...}), and \smashed it to remove any vertical height distortion. The \diagdots output has zero width (by virtue of \makebox[0pt]).

You can play around with the lengths and angles so see what suits you.


Ellipses are usually used to indicate that something is repeated. In this case you want to indicate that the 0 entry is repeated, and hence should show that there is a 0 on either end of the ellipses.

So, assuming that there are a fixed number of rows (as your example seems to indicate), then I would just use \cdots in either one column or both:

enter image description here

If the number of rows is not fixed, then I would use one of the following. My preference would be the last one as then there is no confusion as to where the 0s are.

enter image description here

\documentclass{article}
\usepackage{amsmath}

\begin{document}
\[
\begin{bmatrix}
 0 & -2 & 1 & 0      & -1 &  2 \\
 2 &  0 &   & \cdots &  0 & -1 \\
-1 &  0 &   & \cdots &  0 &  0 \\
 0 &  0 &   & \cdots &  0 &  1 \\
 1 &  0 &   & \cdots &  0 & -2 \\
-2 &  1 & 0 & -1     &  2 &  0
\end{bmatrix}
%
\begin{bmatrix}
 0 & -2 &  1     &  0     & -1 &  2 \\
 2 &  0 & \cdots & \cdots &  0 & -1 \\
-1 &  0 & \cdots & \cdots &  0 &  0 \\
 0 &  0 & \cdots & \cdots &  0 &  1 \\
 1 &  0 & \cdots & \cdots &  0 & -2 \\
-2 &  1 &  0     & -1     &  2 &  0
\end{bmatrix}
\]

If the number of rows is not fixed:
\[
\begin{bmatrix}
 0 & -2 & 1 & 0      & -1 &  2 \\
 2 &  0 &   & \cdots &  0 & -1 \\
-1 &  0 &   & \cdots &  0 &  0 \\
 0 &  0 &   & \cdots &  0 &  0 \\
 \vdots &  \vdots &   & \vdots &  \vdots &  \vdots \\
 0 &  0 &   & \cdots &  0 &  0 \\
 0 &  0 &   & \cdots &  0 &  1 \\
 1 &  0 &   & \cdots &  0 & -2 \\
-2 &  1 & 0 & -1     &  2 &  0
\end{bmatrix}
%
\begin{bmatrix}
 0      & -2     &  1     & 0      & -1     &  2 \\
 2      &  0     & \cdots & \cdots &  0     & -1 \\
-1      &  0     & \cdots & \cdots &  0     &  0 \\
 0      &  0     & \cdots & \cdots &  0     &  0 \\
 \vdots & \vdots & \ddots &        &  \vdots &  \vdots \\
 \vdots & \vdots &        & \ddots &  \vdots &  \vdots \\
 0      &  0     & \cdots & \cdots &  0     &  0 \\
 0      &  0     & \cdots & \cdots &  0     &  1 \\
 1      &  0     & \cdots & \cdots &  0     & -2 \\
-2      &  1     &  0     & -1     &  2     &  0
\end{bmatrix}
\]

\end{document}