TeX - LaTeX Asked by user232686 on June 28, 2021
Consider the following code :
I=
begin{bmatrix}
1 & 0 & 0 & cdots & 0 & 0
0 & 1 & 0 & ddots & & vdots
vdots & ddots & ddots & ddots & 0 & 0
0 & cdots & 0 & 1 & 0 & vdots
vdots & & & ddots & ddots & 0
0 & cdots & 0 & cdots & 0 & 1
end{bmatrix}
Which outputs this nxn Identity matrix :
The issue I have is that this matrix doesn’t look quite symmetrical as I thought it should be, I hope someone can help me out fix this tiny issue that I have.
With nicematrix
:
documentclass{article}
usepackage{nicematrix}
begin{document}
$begin{pNiceMatrix}[nullify-dots,xdots/shorten=4pt]
1 & 0 & & Cdots & & 0
0 & 1 & Ddots & & & Vdots
Vdots & Ddots & Ddots
& & & & & 0
0 & Cdots & & & 0 & 1
end{pNiceMatrix}$
end{document}
You need several compilations (because nicematrix
uses PGF/Tikz nodes).
Correct answer by F. Pantigny on June 28, 2021
documentclass{article}
usepackage{amsmath}
begin{document}
[ I=
begin{bmatrix}
1 & 0 & 0 & cdots & 0
0 & 1 & 0 & cdots & 0
0 & 0 & 1 & cdots & 0
vdots& & & ddots &
0 & 0 & 0 & cdots & 1
end{bmatrix}
]
end{document}
Answered by gernot on June 28, 2021
The problem is probably some package (or newcommand) you are using. You have too many dots in cdots
, vdots
and ddots
, and because that the symmetry is lost. In the following code I have your matrix (I_1, with just 3 dots per command) and another matrix I_2. The latter is what I'd do.
documentclass{article}
usepackage {amsmath}
begin{document}
[I_1=begin{bmatrix}
1 & 0 & 0 & cdots & 0 & 0
0 & 1 & 0 & ddots & & vdots
vdots & ddots & ddots & ddots & 0 & 0
0 & cdots & 0 & 1 & 0 & vdots
vdots & & & ddots & ddots & 0
0 & cdots & 0 & cdots & 0 & 1
end{bmatrix},quad I_2=begin{bmatrix}
1 & 0 & 0 & cdots & 0 & 0
0 & 1 & 0 & cdots & 0 & 0
0 & 0 & 1 & cdots & 0 & 0
vdots & vdots & vdots & ddots & vdots & vdots
0 & 0 & 0 & cdots & 1 & 0
0 & 0 & 0 & cdots & 0 & 1
end{bmatrix}.]
end{document}
Answered by Juan Castaño on June 28, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP