Empty elements as dots in matrix

This seems a good approximation:

\documentclass[a4paper,10pt]{article}

\usepackage{amsmath}

\newcommand{\widedots}{%
  .\cleaders\hbox to 2\tabcolsep{\hss.\hss}\hfill.%
  \hspace*{0pt}%
}

\begin{document}

\begin{equation*}
\newcommand{\ak}[2]{%
  \makebox[14\tabcolsep][s]{$\displaystyle a_{#2}#1_1+\dots+k_{#2}#1_n$}%
}
\begin{vmatrix}
 0 & . & . &  0 & \ak{\alpha}{1} & . & . & \ak{\kappa}{1} \\
 . & . & . &  . & \widedots      & . & . & \widedots      \\
 0 & . & . &  0 & \ak{\alpha}{n} & . & . & \ak{\kappa}{n} \\
-1 & . & . &  0 & \alpha_{1}     & . & . & \kappa_{1}     \\
 . & . & . &  . & \widedots      & . & . & \widedots      \\
 0 & . & . & -1 & \alpha_{n}     & . & . & \kappa_{n}
\end{vmatrix}
\end{equation*}

\end{document}

enter image description here

The value 14\tabcolsep has been determined by first looking at the entries at their natural width.

Even better than the original if we make -1 to hide its width.

\documentclass[a4paper,10pt]{article}

\usepackage{amsmath}

\newcommand{\widedots}{%
  .\cleaders\hbox to 2\tabcolsep{\hss.\hss}\hfill.%
  \hspace*{0pt}%
}

\begin{document}

\begin{equation*}
\newcommand{\ak}[2]{%
  \makebox[14\tabcolsep][s]{$\displaystyle a_{#2}#1_1+\dots+k_{#2}#1_n$}%
}
\newcommand{\?}{\makebox[0pt]{$-1$}}
\begin{vmatrix}\mspace{8mu}
\begin{matrix}
 0 & . & . &  0 & \ak{\alpha}{1} & . & . & \ak{\kappa}{1} \\
 . & . & . &  . & \widedots      & . & . & \widedots      \\
 0 & . & . &  0 & \ak{\alpha}{n} & . & . & \ak{\kappa}{n} \\
\? & . & . &  0 & \alpha_{1}     & . & . & \kappa_{1}     \\
 . & . & . &  . & \widedots      & . & . & \widedots      \\
 0 & . & . & \? & \alpha_{n}     & . & . & \kappa_{n}
\end{matrix}\mspace{3mu}
\end{vmatrix}
\end{equation*}

\end{document}

enter image description here

With \dots and \hdotsfor:

\begin{equation*}
\newcommand{\ak}[2]{a_{#2}#1_1+\dots+k_{#2}#1_n}
\begin{vmatrix}
 0 & \dots &  0 & \ak{\alpha}{1} & \dots & \ak{\kappa}{1} \\
\hdotsfor{6} \\
 0 & \dots &  0 & \ak{\alpha}{n} & \dots & \ak{\kappa}{n} \\
-1 & \dots &  0 & \alpha_{1}     & \dots & \kappa_{1}     \\
\hdotsfor{6} \\
 0 & \dots & -1 & \alpha_{n}     & \dots & \kappa_{n}
\end{vmatrix}
\end{equation*}

enter image description here


One way is to manually put dots with some horizontal space.

enter image description here

\documentclass[a4paper,10pt]{article}
\usepackage{amsmath}
\begin{document}

\begin{equation*}
        \begin{vmatrix}
                0     &\cdot &\cdot &0     &a_{1} \alpha_{1}+ \cdots +k_{1} \alpha_{n} &\cdot &\cdot &a_{1} \kappa_{1}+ \cdots +k_{1} \kappa_{n} \\
                \cdot &\cdot &\cdot &\cdot &\cdot \hfil \hfil \cdot \hfil \cdot \hfil \cdot \hfil \cdot                               &\cdot &\cdot &\cdot \hfil \hfil \cdot \hfil \cdot \hfil \cdot \hfil \cdot  \\
                0     &\cdot &\cdot &0     &a_{n} \alpha_{1}+ \cdots +k_{n} \alpha_{n} &\cdot &\cdot &a_{n} \kappa_{1}+ \cdots +k_{n} \kappa_{n} \\
                -1    &\cdot &\cdot &0     &\alpha_{1}                                 &\cdot &\cdot &\kappa_{1} \\
                \cdot &\cdot &\cdot &\cdot &\cdot \hfil \hfil \cdot \hfil \cdot \hfil \cdot \hfil \cdot                                      &\cdot &\cdot &\cdot \hfil \hfil \cdot \hfil \cdot \hfil \cdot \hfil \cdot  \\
                0     &\cdot &\cdot &-1    &\alpha_{n}                                 &\cdot &\cdot &\kappa_{n}
        \end{vmatrix}
\end{equation*}

\end{document}

Defining two newcommands \twodts and \fivedts for empty columns and rows can simplify the table.

\documentclass[a4paper,10pt]{article}
\usepackage{amsmath}

\begin{document}

\newcommand{\twodts}{\begin{tabular}{@{}cc@{}}$\cdot$&$\cdot$\end{tabular}}
\newcommand{\fivedts}{\begin{tabular}{@{}*5{c}@{}}$\cdot$&$\cdot$&$\cdot$&$\cdot$&$\cdot$\end{tabular}}

\begin{equation*}
  \begin{array}{|cccccc|}
    0     & \twodts & 0     & a_1 \alpha_1+ \cdots +k_1 \alpha_n & \twodts & a_1 \kappa_1+ \cdots +k_1 \kappa_n \\
    \cdot & \twodts & \cdot & \fivedts                           & \twodts & \fivedts                           \\
    0     & \twodts & 0     & a_n \alpha_1+ \cdots +k_n \alpha_n & \twodts & a_n \kappa_1+ \cdots +k_n \kappa_n \\
    -1    & \twodts & 0     & \alpha_1                           & \twodts & \kappa_1                           \\
    \cdot & \twodts & \cdot & \fivedts                           & \twodts & \fivedts                           \\
    0     & \twodts & -1    & \alpha_n                           & \twodts & \kappa_n
  \end{array}
\end{equation*}

\end{document}

enter image description here

Update:

You can easily adapt my answer to add six dots instead of five like this:

\documentclass[a4paper,10pt]{article}
\usepackage{amsmath,array}

\begin{document}

\def\twocdots{$\cdot$&$\cdot$}
\newcommand{\twodts}{\begin{tabular}{@{}cc@{}}\twocdots\end{tabular}}
\newcommand{\sixdts}{\begin{tabular}{@{}*6{c}@{}}\twocdots&\twocdots&\twocdots\end{tabular}}

\begin{equation*}
  \begin{array}{|cccccc|}
    0     & \twodts & 0     & a_1 \alpha_1+ \cdots +k_1 \alpha_n & \twodts & a_1 \kappa_1+ \cdots +k_1 \kappa_n \\
    \cdot & \twodts & \cdot & \sixdts                            & \twodts & \sixdts                            \\
    0     & \twodts & 0     & a_n \alpha_1+ \cdots +k_n \alpha_n & \twodts & a_n \kappa_1+ \cdots +k_n \kappa_n \\
    -1    & \twodts & 0     & \alpha_1                           & \twodts & \kappa_1                           \\
    \cdot & \twodts & \cdot & \sixdts                            & \twodts & \sixdts                            \\
    0     & \twodts & -1    & \alpha_n                           & \twodts & \kappa_n
  \end{array}
\end{equation*}

\end{document}

enter image description here

Tags:

Matrices