I'm trying visualize a very large matrix. To do so, I'm trying to use \vdots
and \ddots
in a bsmallmatrix
enviroment. It works but they do not scale properly as \cdots
do.
Now, in the minimal reproducible example below, I have found a fix here which works, but only the vertical dots and not the diagonal dots.
I do not understand why it does not work for \ddots
.
\documentclass{article}
\usepackage{mathtools}
\newcommand{\svdots}{\raisebox{3pt}{\scalebox{.75}{\vdots}}} % <- Works
\newcommand{\sddots}{\raisebox{3pt}{\scalebox{.75}{\ddots}}} % <- Do not work
\begin{document}
\begin{equation*}
\begin{bsmallmatrix}
a_{11} & a_{12} & \cdots & a_{1m} \\
a_{21} & a_{22} & \cdots & a_{2m} \\
\svdots & \svdots & \sddots & \svdots \\
a_{n1} & a_{n2} & \cdots & a_{nm}
\end{bsmallmatrix}
\end{equation*}
\end{document}
The compilation errors revolves around missing $
and brackets.
The document complies fine when substituting \sddots
for \ddots
but, obviously, the ddots have the wrong size.
How do I best accomplish my desired result?
Best Answer
The following example redefines
\vdots
and\ddots
to get a resizable version according to the current math style. The vertical space between the dots is taken from the horizontal dots. Also the dots in\ddots
match the vertical spacing of\vdots
and the horizontal spacing of the horizontal dots in\cdots
.\cdots
adds a thin space at the right side. For a better alignment in matrices, the redefined\ddots
also adds this space.The space above
\vdots
and\ddots
is not fixed, the space between the dots is used for the additional vertical space above the symbol. It's a tiny bit smaller in\textstyle
and\displaystyle
than the original symbols, but the resizing in\scriptstyle
and\scriptscriptstyle
is much better as thebsmallmatrix
example shows.The following example shows the
bsmallmatrix
with the resizable dots. Then a normalbmatrix
follows to show the symbols in the normal larger style. Then thebmatrix
follows with the original\vdots
and\ddots
, saved in\orgvdots
and\orgddots
.At the end of the example, the bounding boxes for the symbols in the different math styles are shown, first the original symbols, then the redefined symbols.