TransWikia.com

Better positioning of ddots in matrix

TeX - LaTeX Asked on February 27, 2021

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}

3 Answers

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}

Correct answer by Mico on February 27, 2021

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

Answered by Marijn on February 27, 2021

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

Answered by F. Pantigny on February 27, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP