6

I need to create a determinant (vmatrix) as shown in this picture.enter image description here So, I wrote a simple LaTEX file for testing purposes as follows:

\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                                      &\cdot &\cdot &\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                                      &\cdot &\cdot &\cdot \\
                0     &\cdot &\cdot &-1    &\alpha_{n}                                 &\cdot &\cdot &\kappa_{n}
        \end{vmatrix}
\end{equation*}

\end{document}

When the above file gets compiled with TeXLive on a Linux desktop computer, it produces the following ugly result:enter image description here I thought using \hdotsfor{} for the horizontal line, but the spacing between the dots is too close. If there is a simple way to tell \hdotsfor{} to skip every dot, I believe that would do. However, perhaps someone here knows a much better way.

  • \hdotsfor has an optional argument which is a multiplier for the amount of space between consecutive dots, so you could try \hdotsfor[2]{<number of rows>}. I'm not sure if it'd look good though, since they wouldn't align with the dots in your first row. – Circumscribe Dec 8 '18 at 21:47
8

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

  • Although I may not be able to decipher how your code works, it looks like the one with the capability of hiding the with of -1 fits my need. I have a feeling after perusing your code, I will understand better. Thank you. – user91822 Dec 9 '18 at 0:18
4

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}
  • Honestly, I had never thought of using '\hfil'. Thank you for the pointer. – user91822 Dec 9 '18 at 0:20
3

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

  • This looks pretty simple and good solution. Since there is still some gaps that seems to be able to put one more dot when using the `\fivedts' command, I wonder if this command can be modded to accommodate the gap. I tried to modify with a "\sixdots" and it does not work, unfortunately. Anyway, thank you too. – user91822 Dec 9 '18 at 0:24
  • Please see my update for doing this. – AboAmmar Dec 9 '18 at 16:31
1

Would this be acceptable?

enter image description here

\documentclass[a4paper,10pt]{article}

\usepackage{amsmath}

\begin{document}

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

\end{document}
  • 1
    This is I usually do and I don't think it will do for me. Sorry and I try to stick closer to the example I posted above. Anyway, thank you. – user91822 Dec 9 '18 at 0:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.