%%% mathdots.sty
%%% Copyright 2001 by Daniel H. Luecking
%%% This file may be distributed and/or modified under the conditions
%%% of the LaTeX Project Public License, either version 1.2 of this
%%% license or (at your option) any later version. The latest version
%%% of this license is in http://www.latex-project.org/lppl.txt and
%%% version 1.2 or later is part of all distributions of LaTeX version
%%% 1999/12/01 or later.
%%%
%%% This style file provides vertical dots and diagonal dots slanting
%%% in either direction. Unlike the commands \vdots and \ddots provided
%%% by LaTeX, these commands change size with LaTeX size changing
%%% commands, as well as in {sub[sub]|super[super]}scripts.
%%%
%%% Documentation after \endinput
%%%
\def\mathdotsfiledate{2001/02/28}%
\def\mathdotsfileversion{0.3}%
\expandafter\ifx\csname MathDots\mathdotsfileversion\endcsname\relax
\else\message{(already loaded)}\expandafter\endinput\fi
%
%
\begingroup
\expandafter\ifx\csname ProvidesPackage\endcsname\relax
  % not latex2e
  \def\ProvidesPackage#1[#2]{%
  \immediate\write16{Package #1, #2}}%
\fi
\expandafter\endgroup\ProvidesPackage{mathdots}[\mathdotsfiledate\space
  version \mathdotsfileversion.]%
\expandafter\edef\csname MathDots\mathdotsfileversion\endcsname{%
    \catcode`\noexpand\@=\the\catcode`@}%
\catcode`\@=11
%
%%
\def\MD@us#1{\csname#1style\endcsname}% e.g., \MD@us{text} -> \textstyle
\def\MD@uf#1{\csname#1font\endcsname}%        \MD@uf{text} -> \textfont
\def\MD@t{text}%                              \MD@uf{\MD@t} -> \textfont
\def\MD@s{script}%
\def\MD@ss{scriptscript}%
%% #1 is a command which we feed the current style name
%% (not distinguishing display from text)
\def\MD@palette#1{\mathchoice{#1\MD@t}{#1\MD@t}{#1\MD@s}{#1\MD@ss}}%
%
%% Save version at load time so user can use them.
\let\originalddots=\ddots
\let\originalvdots=\vdots
%% Include current (2002/02/28) LaTeX/plainTeX definitions
%% so user can opt for them.
\def\fixedvdots{\vbox{\baselineskip4\p@ \lineskiplimit\z@
    \kern6\p@\hbox{.}\hbox{.}\hbox{.}}}%
\def\fixedddots{\mathinner{\mkern1mu\raise7\p@
    \vbox{\kern7\p@\hbox{.}}\mkern2mu
    \raise4\p@\hbox{.}\mkern2mu\raise\p@\hbox{.}\mkern1mu}}%
%% LaTeX/plainTeX don't have the other diagonal, so here's a version
%% which is just \ddots with the boxes reversed:
\def\fixediddots{\mathinner{\mkern1mu\raise\p@
    \hbox{.}\mkern2mu\raise4\p@\hbox{.}\mkern2mu
    \raise7\p@\vbox{\kern7\p@\hbox{.}}\mkern1mu}}%
%
\newdimen\MD@unit
\MD@unit1pt
%
%% #1 is the current style (fed to \MD@ddots via \MD@palette):
\def\MD@ddots#1{%
    %% we set \MD@unit to 0.1em of family 0 in the current size
    %% (to replace \p@ in the old definition):
  {\relax\MD@unit0.1\fontdimen6\MD@uf{#1}0
    %% Another change is to use the dot from the math font. So we
    %% pass the current style via \everymath:
  \everymath\expandafter{\the\everymath\MD@us{#1}}%
    %% otherwise the definition is the same as plain \ddots
  \mkern1mu\raise7\MD@unit\vbox{\kern7\MD@unit\hbox{$.$}}%
  \mkern2mu\raise4\MD@unit\hbox{$.$}%
  \mkern2mu\raise \MD@unit\hbox{$.$}\mkern1mu}}%
%
\def\ddots{\mathinner{\MD@palette\MD@ddots}}%
%
%% \iddots is same as \ddots but with the box order reversed:
\def\MD@iddots#1{{\relax\MD@unit0.1\fontdimen6\MD@uf{#1}0
  \everymath\expandafter{\the\everymath\MD@us{#1}}%
  \mkern1mu\raise \MD@unit\hbox{$.$}\mkern2mu\raise4\MD@unit\hbox{$.$}%
  \mkern2mu\raise7\MD@unit\vbox{\kern7\MD@unit\hbox{$.$}}}}%
%
\def\iddots{\mathinner{\MD@palette\MD@iddots}}%
%
%% We transform \vdots in the same fashion as \ddots and \iddots:
\def\MD@vdots#1{%
  \vbox{\relax\MD@unit0.1\fontdimen6\MD@uf{#1}0
    \baselineskip4\MD@unit\lineskiplimit\z@
    \everymath\expandafter{\the\everymath\MD@us{#1}}%
    \kern6\MD@unit\hbox{$.$}\hbox{$.$}\hbox{$.$}}}%
%
\def\vdots{\mathinner{\MD@palette\MD@vdots}}%

\csname MathDots\mathdotsfileversion\endcsname
\endinput
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
mathdots.sty provides \verb|\ddots|, \verb|\vdots|, and \verb|iddots|.
\verb|\ddots| (the same command as LaTeX provides) gives three dots on a
diagonal from upper left to lower right. It differs from LaTeX's command
in that it will change size within the scope of LaTeX size changing
commands. That is, {\verb|\Large$\ddots$|} will be larger and
{\verb|\small$\ddots$|} will be smaller than \verb|$\ddots$|.

LaTeX's definition would change the size of the dots, and the horizontal
dimensions, but not the vertical dimensions. The command from the
mathdots package also changes size in sub/superscripts. LaTeX's would
not change at all in those cases. Finally, LaTeX would take the dots
from the current text font, where the mathdots package takes them from
the current math symbol font, so they should match other dots in math
mode. This is only really a concern in 17pt sizes or larger where cmr17
is scaled to get text dots, but cmsy12 is scaled to get math dots.

\verb|\iddots| is similar, except it produces the other diagonal.

\verb|\vdots| produces vertical dots (as in standard TeX or LaTeX), but
again, it will change size with size changing commands.

The old behavior is stored in \verb|\fixedddots| and \verb|\fixedvdots|.
If you wish \verb|\iddots| to behave similarly then use \fixediddots.

On the off chance that some other package changes LaTeX's behavior
before this file is loaded, use \verb|\originalddots| and
\verb|\originalvdots| to obtain the versions in force when the mathdots
package is loaded.

Note: The \fixed... versions try to maintain LaTeX's (awful) behavior,
which is to let the horizontal dimensions change size, as well as the
dots themselves, but hard code unchanging vertical dimensions.

\end{document}
