4

How can i improve the representation of this matrix? The problem is that the \ddots in the middle are not properly aligned. It should say that a and b gets succesively gets moved one column further to the right.

Maybe there is \ddots with a smaller slope?

enter image description here

\documentclass[]{article}
\usepackage{subcaption}
\usepackage{tikz}
\usetikzlibrary{shapes.misc}
%opening

\begin{document}

\[
\left(\begin{array}[c]{c|cccccc}
            &   & c      & \ldots & c      & c \\ \hline
            & 0 &        &        &        & 0 \\
     d      & a & b      &        &        &   \\
     \vdots &   & \ddots &        & \ddots &   \\
     d      &   &        &        & a      & b
\end{array}\right)
\]

\end{document}
5
  • 1
    Move the first \ddots to the next cell and it looks just fine. If you align all the & it is easier to see where everything goes. You might even want to remove the last \ddots
    – daleif
    Apr 6, 2020 at 20:02
  • there an automatic way to do this? Apr 6, 2020 at 20:49
  • What are you referring to?
    – daleif
    Apr 6, 2020 at 20:50
  • the alignment of the & Apr 6, 2020 at 20:55
  • My editor (emacs) has a build in feature for it. There might be other editors who can do the same
    – daleif
    Apr 6, 2020 at 20:57

3 Answers 3

8

Here's a different suggestion: simplify the matrix from a 5x5 to a 4x4 structure, to emphasize that the lower-right block of the full-matrix is (to my understanding) a triangular matrix, with zeroes above the diagonal.

enter image description here

There seems to be an implicit assumption that your readers "know" what's in the top-left block and in the first positions of row- and column vectors. Is this assumption justified?

\documentclass{article}
\usepackage{array}
\begin{document}
\[
\left(\begin{array}{c|cccc}
       &   & c      & \ldots & c \\ 
\hline
       & 0 &        &        & 0\\
d      & a & b      &        &  \\
\vdots &   & \ddots & \ddots &  \\
d      &   &        & a      & b
\end{array}\right)
\]
\end{document}
6

You can also use nicematrix:

\documentclass{article}
\usepackage{nicematrix}
\usepackage{booktabs}

\begin{document}
\[
\begin{pNiceArray}{c|ccccc}
        &   & c      & \Ldots & c & c \\ \cmidrule(rl){1-6}
        & 0 &        &        &   & 0 \\
 d      & a & b      &        &   &   \\
 \Vdots &   & \Ddots & \Ddots \\
\\
 d      &   &        &        & a & b
\end{pNiceArray}
\]
\end{document}

Output of the above code

2
  • I think the top horizontal rule should be shortened on both sides a bit to not be connected with the parantheses.
    – Diaa
    Oct 26, 2020 at 9:24
  • @Diaa: You are right. I have modified my answer. Oct 26, 2020 at 9:44
4

You can rotate the dots a bit and possibly put them higher using the \rotatebox and \raisebox commands from the graphicx package. Note that this requires the dots to be put in math mode explicitly, even if they are already in a math environment. With \smash you can prevent the rotated/raised boxes from increasing the height of the array row.

However, I agree with the comments that a single \ddots is probably better.

MWE:

\documentclass[]{article}
\usepackage{graphicx}

\begin{document}

\[
\left(\begin{array}[c]{c|cccccc}
        &   & c                                & \ldots                                           & c & c \\ \hline
        & 0 &                                  &                                                  &   & 0 \\
 d      & a & b                                &                                                  &   &   \\
 \vdots &   & \smash{\rotatebox{20}{$\ddots$}} & \smash{\raisebox{3pt}{\rotatebox{20}{$\ddots$}}} &   &   \\
 d      &   &                                  &                                                  & a & b
\end{array}\right)
\]

\[
\left(\begin{array}[c]{c|cccccc}
       &   & c & \ldots & c & c \\ \hline
       & 0 &   &        &   & 0 \\
d      & a & b &        &   &   \\
\vdots &   &   & \ddots &   &   \\
d      &   &   &        & a & b
\end{array}\right)
\]
\end{document}

Result:

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .