Debian Codegraph @

texmf-dist/source/generic/mathdots/mathdots.dtx

raw
1 % \iffalse
2 % -------------------------------------------------------------------
3 %
4 % Copyright 2001--2006, Daniel H. Luecking
5 %
6 % Mathdots may be distributed and/or modified under the conditions of the
7 % LaTeX Project Public License, either version 1.3c of this license or (at
8 % your option) any later version. The latest version of this license is in
9 % <http://www.latex-project.org/lppl.txt>
10 % and version 1.3c or later is part of all distributions of LaTeX version
11 % 2008/05/04 or later.
12 %
13 % Mathdots has maintenance status "author-maintained". The Current
14 % Maintainer is Daniel H. Luecking. The Base Interpreters associated with
15 % mathdots are TeX and LaTeX.
16 %
17 %<*sty|tex>
18 %<*driver>
19 \ProvidesFile{mathdots.dtx}%
20 %</driver>
21 %<sty>\ifx\documentclass\UndEfInEd\input mathdots \expandafter\endinput\fi
22 %<sty>\ProvidesPackage{mathdots}
23 %<*sty>
24 [2014/06/11 v0.9 Improve and add various macros for dots in math.]%
25 %</sty>
26 %<tex>\def\mathdotsfiledate{2014/06/11}%
27 %<tex>\def\mathdotsfileversion{0.9}%
28 %<*driver>
29 \documentclass{ltxdoc}
30 \usepackage{amsmath}
31 \usepackage{mathdots}
32 \addtolength{\textwidth}{.5878pt}
33
34 \def\mytt{\upshape\mdseries\ttfamily}
35 \renewcommand\marg[1]{{\mytt \{#1\}}}
36 \renewcommand\oarg[1]{{\mytt [#1]}}
37 \renewcommand\parg[1]{{\mytt (#1)}}
38 \renewcommand\arg[1]{{\mytt\##1}}
39 \renewcommand{\meta}[1]{{$\langle$\rmfamily\itshape#1\/$\rangle$}}
40 \DeclareRobustCommand\cs[1]{{\mytt\char`\\#1}}
41 \def\prog#1{{\mdseries\scshape #1}}
42 \def\opt#1{{\sffamily\upshape#1}}
43 \def\mtt#1{{\mytt#1}}
44 \let\env\mtt
45 \let\file\mtt
46 \def\MD{\prog{mathdots}}
47 \renewcommand\{{\mtt{\char`\{}}
48 \renewcommand\}{\mtt{\char`\}}}
49 \renewcommand\|{${}\mathrel{|}{}$}
50
51 \makeatletter
52 \newcommand\bsl{{\mytt\@backslashchar}}
53 % Stupid lists!
54 \def\@listi{\leftmargin\leftmargini
55 \parsep \z@ \@plus\p@ \@minus\z@
56 \topsep 4\p@ \@plus\p@ \@minus2\p@
57 \itemsep\parsep}
58 \let\@listI\@listi \@listi
59 \renewcommand\labelitemi{\normalfont\bfseries \textendash}
60 \renewcommand\labelitemii{\textasteriskcentered}
61 \renewcommand\labelitemiii{\textperiodcentered}
62 \leftmargini\parindent
63 % Stupid index!
64 \def\usage#1{\textrm{#1}}
65 \def\index@prologue{\section*{Index}\markboth{Index}{Index}%
66 Numbers refer to the page(s) where the corresponding entry is described.
67 }
68 \def\IndexParms{%
69 \parindent \z@ \columnsep 15pt
70 \parskip 0pt plus 1pt
71 \rightskip 5pt plus2em \mathsurround \z@
72 \parfillskip-5pt \small
73 % less hanging:
74 \def\@idxitem{\par\hangindent 20pt}%
75 \def\subitem{\@idxitem\hspace*{15pt}}%
76 \def\subsubitem{\@idxitem\hspace*{25pt}}%
77 \def\indexspace{\par\vspace{10pt plus 2pt minus 3pt}}}
78 \makeatother
79
80 \title{The \MD{} package\thanks{This file has version number
81 \fileversion, last revised \filedate.}}
82 \author{Dan Luecking}
83 \date{\filedate}
84 \DisableCrossrefs
85 \CodelineIndex
86 \AlsoImplementation
87 \begin{document}
88 \DeleteShortVerb{\|}
89 \DocInput{mathdots.dtx}
90 \end{document}
91 %</driver>
92 %\fi
93 % \CheckSum{364}
94 % \CharacterTable
95 % {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
96 % Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
97 % Digits \0\1\2\3\4\5\6\7\8\9
98 % Exclamation \! Double quote \" Hash (number) \#
99 % Dollar \$ Percent \% Ampersand \&
100 % Acute accent \' Left paren \( Right paren \)
101 % Asterisk \* Plus \+ Comma \,
102 % Minus \- Point \. Solidus \/
103 % Colon \: Semicolon \; Less than \<
104 % Equals \= Greater than \> Question mark \?
105 % Commercial at \@ Left bracket \[ Backslash \\
106 % Right bracket \] Circumflex \^ Underscore \_
107 % Grave accent \` Left brace \{ Vertical bar \|
108 % Right brace \} Tilde \~}
109 %
110 % \catcode`\_=12
111 % \GetFileInfo{mathdots.dtx}
112 % \maketitle
113 %
114 % \begin{abstract}
115 % This package provides vertical dots and diagonal dots in math, slanting
116 % in either direction. It should work equally well in \LaTeX{} or plain
117 % \TeX{}. It improves on the default definitions of plain \TeX{} and
118 % \LaTeX{}. Similar improvements are provided for the triple and
119 % quadruple dot accents of AMS\TeX{}/AMS\LaTeX{}.
120 % \end{abstract}
121 %
122 % \StopEventually{\PrintIndex}
123 %
124 % \section{Introduction}
125 %
126 % Running \LaTeX{} or \TeX{} on \file{mathdots.ins} generates
127 % \file{mathdots.sty}, a \LaTeX{} package, and \file{mathdots.tex} a plain
128 % \TeX{} input file. If one puts \verb"\input mathdots.sty" in a plain
129 % \TeX{} file, it will cause \file{mathdots.tex} to be input. This is for
130 % backward compatibility.
131 %
132 % Unlike the commands \cs{ddots} and \cs{vdots} provided by \LaTeX{},
133 % the versions defined by \MD{} change size with \LaTeX{} size
134 % changing commands, as well as in \{sub[sub]\|super[super]\}scripts.
135 % After \MD{} is loaded, \verb"{\large$\ddots$}" will be larger and
136 % \verb"{\small$\ddots$}" will be smaller than \verb"$\ddots$" at normal
137 % size. Moreover, \verb"$2^{2^\ddots}$" will also produce a smaller
138 % symbol. This last example is very unlikely to be needed, but the version
139 % with the opposite slant is very common (and is provided by \MD{}).
140 %
141 % The \prog{amsmath} accents \cs{dddot} and \cs{ddddot} have similar
142 % problems that \MD{} attempts to correct when \prog{amsmath} is loaded.
143 %
144 % See Table~\ref{examples} for examples of the \MD{} commands at
145 % different sizes and in exponents. See Table~\ref{compare} for
146 % comparison, showing the results without \MD{}.
147 %
148 % \def\dott#1{$#1$}
149 % \def\dotts#1{$2^{#1}\quad 2^{2^{#1}}$}
150 % \begin{table}[htbp]
151 % \centering \renewcommand\arraystretch{1.4}
152 % \begin{tabular}{c|cccc}
153 % \multicolumn{1}{l}{\large With \MD{}:}\\[4pt]
154 % \multicolumn{1}{c}{\textbf{Command}}%
155 % &\textbf{Large} &\textbf{normal} &\textbf{scriptsize}
156 % &\textbf{in exponents}\\
157 % \hline
158 % \verb$\ddots$ & \Large\dott{\ddots} & \dott{\ddots} & \scriptsize\dott{\ddots}
159 % & \dotts{\ddots}\\
160 % \verb$\vdots$ & \Large\dott{\vdots} & \dott{\vdots} & \scriptsize\dott{\vdots}
161 % & \dotts{\vdots}\\
162 % \verb$\iddots$ & \Large\dott{\iddots} & \dott{\iddots} & \scriptsize\dott{\iddots}
163 % & \dotts{\iddots}\\
164 % \verb$\dddot{X}$ & \Large\dott{\dddot{X}} & \dott{\dddot{X}} & \scriptsize\dott{\dddot{X}}
165 % & \dotts{\dddot{X}}\\
166 % \verb$\ddddot{X}$& \Large\dott{\ddddot{X}}& \dott{\ddddot{X}}& \scriptsize\dott{\ddddot{X}}
167 % & \dotts{\ddddot{X}}
168 % \end{tabular}
169 % \caption{Dots at different sizes and in exponents.}
170 % \label{examples}
171 % \end{table}
172 %
173 % \begin{table}[htbp]
174 % \centering \renewcommand\arraystretch{1.4}
175 % \begin{tabular}{c|cccc}
176 % \multicolumn{1}{l}{\large Without \MD{}:}\\[4pt]
177 % \multicolumn{1}{c}{\textbf{Command}}%
178 % &\textbf{Large} &\textbf{normal} &\textbf{scriptsize}
179 % &\textbf{in exponents}\\
180 % \hline
181 % \verb$\ddots$ & \Large\dott{\originalddots} & \dott{\originalddots} & \scriptsize\dott{\originalddots}
182 % & \dotts{\originalddots}\\
183 % \verb$\vdots$ & \Large\dott{\originalvdots} & \dott{\originalvdots} & \scriptsize\dott{\originalvdots}
184 % & \dotts{\originalvdots}\\
185 % \verb$\dddot{X}$ & \Large\dott{\originaldddot{X}} & \dott{\originaldddot{X}} & \scriptsize\dott{\originaldddot{X}}
186 % & \dotts{\originaldddot{X}}\\
187 % \verb$\ddddot{X}$& \Large\dott{\originalddddot{X}} & \dott{\originalddddot{X}}& \scriptsize\dott{\originalddddot{X}}
188 % & \dotts{\originalddddot{X}}
189 % \end{tabular}
190 % \caption{Dots without \MD{}.}
191 % \label{compare}
192 % \end{table}
193 %
194 % \DescribeMacro{\ddots}
195 % The default \LaTeX{} (and plain \TeX) definition changes the size of the
196 % dots, and the horizontal dimensions, but not the vertical dimensions,
197 % giving them different slants at different sizes. Also, using the default
198 % version in 'scripts produces symbols identical to those produced
199 % elsewhere. Finally, the default takes the dots from the current text
200 % font, whereas the \MD{} package takes them from the current math symbol
201 % font, so they should match other dots in math mode. This is only really
202 % a concern in \mtt{17pt} sizes or larger where \file{cmr17} is scaled to
203 % get text dots, but \file{cmsy12} is scaled to get math dots.
204 %
205 % \DescribeMacro{\iddots}
206 % \MD{} supplies also \cs{iddots}, with behavior similar to \cs{ddots},
207 % except it produces the other diagonal. This command is not provided in
208 % basic \TeX{} or \LaTeX{}.
209 %
210 % \DescribeMacro{\vdots}
211 % \cs{vdots} produces vertical dots (as in standard \TeX{} or \LaTeX{}),
212 % but again, the \MD{} version will change size with size
213 % changing commands.
214 %
215 % \DescribeMacro{\fixedddots}
216 % \DescribeMacro{\fixedvdots}
217 % \DescribeMacro{\fixediddots}
218 % The old behavior is stored in \cs{fixedddots} and \cs{fixedvdots}.
219 % If you wish \cs{iddots} to behave similarly then use \cs{fixediddots}.
220 %
221 % The \cs{fixed...} versions try to maintain the (awful) default behavior,
222 % which is to let the horizontal dimensions change size, as well as the
223 % dots themselves, but hard code unchanging vertical dimensions. The
224 % `fixed' part of the name does not mean `corrected', but rather
225 % `unchanging' or `frozen'.
226 %
227 % \DescribeMacro{\originalddots}
228 % \DescribeMacro{\originalvdots}
229 % \DescribeMacro{\originaliddots}
230 % On the chance that some other package changes the behavior before \MD{}
231 % is loaded, use \cs{originalddots}, \cs{originalvdots}, and
232 % \cs{originaliddots} to obtain the versions in force before \MD{} is
233 % loaded.
234 %
235 % \DescribeMacro{\dddot}
236 % \DescribeMacro{\ddddot}
237 % If the \prog{amsmath} package is detected in \LaTeX{}, the commands
238 % \cs{dddot} and \cs{ddddot} are modified to get the same size changing
239 % behavior in 'scripts. They also correct a positioning bug in the
240 % \prog{amsmath} code. Compare the old and new versions and the 2-dot accent
241 % (from basic \LaTeX{}): $\originaldddot{X},\dddot{X},\ddot{X}$. I have
242 % also taken the liberty of changing the spacing between dots to match
243 % that in the 2-dot accent.
244 %
245 % \DescribeMacro{\originaldddot}
246 % \DescribeMacro{\originalddddot}
247 % Some of the changes to \cs{dddot} and \cs{ddddot} require the command
248 % \cs{text}, and so is only applied if \prog{amsmath} has been loaded
249 % \emph{before} \MD{}. The old amsmath commands are saved in
250 % \cs{originaldddot} and \cs{originalddddot}. Similar comments apply to
251 % plain \TeX{} with regard to \file{amstex.tex}.
252 %
253 % \DescribeMacro{\MDoprekern}
254 % \DescribeMacro{\MDodotkern}
255 % \DescribeMacro{\MDopostkern}
256 % Different math fonts have different metrics for the \cs{dot} and
257 % \cs{ddot} accents. If you use a math font family other than the CM
258 % fonts, you can adjust the positioning and spacing of the the dots in
259 % \cs{dddot} and \cs{ddddot} to better match the spacing in \cs{ddot}
260 % with the following length commands: \cs{MDoprekern}, \cs{MDodotkern} and
261 % \cs{MDopostkern}. These adjust the space before the first dot, between
262 % the dots and after the last dot, respectively. They are in units of
263 % \texttt{mu}, which is $1/3$ the size of the space made by \cs{,}.
264 % Reducing the first and/or increasing the last one cause the dots to be
265 % shifted left. Reducing the middle one causes the dots to be closer
266 % together. As there is usually a bit of white on either side of the dot
267 % character, these usually have to be given negative values (so ``reduce''
268 % means ``make more negative''). The defaults for the CM fonts are
269 % accomplished by the commands
270 % \begin{verbatim}
271 % \MDoprekern=0mu
272 % \MDodotkern=-1.3mu
273 % \MDopostkern=-1mu \end{verbatim}
274 % I have found that the \prog{mathptmx} package (Times fonts in text and
275 % math) benefits from changing these via the following commands
276 % \begin{verbatim}
277 % \MDoprekern=-1mu
278 % \MDodotkern=-2mu
279 % \MDopostkern=0mu \end{verbatim}
280 % \cs{MDoprekern}, \cs{MDodotkern}, and \cs{MDopostkern} were made
281 % user-accessible commands in version 0.9.
282 %
283 % \DescribeMacro{\MDoddots}
284 % \DescribeMacro{\MDovdots}
285 % \DescribeMacro{\MDoiddots}
286 % \DescribeMacro{\MDodddot}
287 % \DescribeMacro{\MDoddddot}
288 % In \LaTeX{}, all these commands have been made robust as of version 0.6.
289 % On the chance that some later loaded package changes things, the \MD{}
290 % versions can be obtained with \cs{MDoddots}, \cs{MDovdots},
291 % \cs{MDoiddots}, \cs{MDodddot} and \cs{MDoddddot} (as of version 0.9).
292 %
293 % \section{The implementation}
294 %
295 % The following are commands for plain \TeX{} that prevent double loading,
296 % announce the package name, and change/restore the category of \mtt{@}.
297 % \begin{macrocode}
298 %<*tex>
299 \expandafter
300 \ifx\csname MathDots\mathdotsfileversion\endcsname\relax
301 \else
302 \immediate\write16{Mathdots already loaded.}\expandafter\endinput
303 \fi
304 \immediate\write16{Package mathdots, \mathdotsfiledate\space version
305 \mathdotsfileversion.}%
306 \expandafter\edef\csname MathDots\mathdotsfileversion\endcsname{%
307 \catcode`\noexpand\@=\the\catcode`@}%
308 \catcode`\@=11
309 \def\@nameuse#1{\csname#1\endcsname}%
310 %</tex>
311 % \end{macrocode}
312 %
313 % Now various shorthands. For example `\cs{MDo@us}\cs{MDo@t}' becomes
314 % `\cs{textstyle}' and `\cs{MDo@uf}\cs{MDo@ss}' produces
315 % `\cs{scriptscriptfont0}'.
316 % \begin{macrocode}
317 \def\MDo@us#1{\@nameuse{#1style}}%
318 \def\MDo@uf#1{\@nameuse{#1font}0}%
319 \def\MDo@t{text}\def\MDo@s{script}\def\MDo@ss{scriptscript}%
320 \newdimen\MDo@unit \MDo@unit\p@
321 % \end{macrocode}
322 %
323 % The following are the main utility macros to implement changes of style.
324 % Since most of our symbols are built with boxes, they have to exit math
325 % mode and need \cs{mathchoice} so we know the current style (i.e., size)
326 % when we re-enter math mode.
327 %
328 % We detect differences in sizes (for example, after \cs{large}) by
329 % examining the appropriate \cs{fontdimen} of family 0. Instead of the
330 % hard coded \mtt{1pt}, we use \mtt{0.1em} from this family.
331 %
332 % We pass along the current style via \cs{everymath}.
333 %
334 % In \cs{MDo@palette}, \arg1 is a command which we feed the current
335 % style name. For example, \cs{MDo@palette}\cs{MDo@ddots} will be our
336 % definition of \cs{ddots}. Then \cs{MDo@ddots} will see the current style
337 % as its first argument.
338 % \begin{macrocode}
339 \def\MDo@changestyle#1{\relax\[email protected]\fontdimen6\MDo@uf{#1}%
340 \everymath\expandafter{\the\everymath\MDo@us{#1}}}%
341 \def\MDo@dot{$\m@th\ldotp$}%
342 \def\MDo@palette#1{\mathchoice{#1\MDo@t}{#1\MDo@t}{#1\MDo@s}{#1\MDo@ss}}%
343 % \end{macrocode}
344 %
345 % In the following commands, \arg1 is the current style (supplied via
346 % \cs{MDo@palette}). Except for the change in the unit used and the dot
347 % used, the first two definitions are essentially the same as plain's
348 % \cs{ddots} and \cs{vdots}, and the third is the same as the first with
349 % the boxes reversed.
350 % \begin{macrocode}
351 \def\MDo@ddots#1{{\MDo@changestyle{#1}%
352 \mkern1mu\raise7\MDo@unit\vbox{\kern7\MDo@unit\hbox{\MDo@dot}}%
353 \mkern2mu\raise4\MDo@unit\hbox{\MDo@dot}%
354 \mkern2mu\raise \MDo@unit\hbox{\MDo@dot}\mkern1mu}}%
355 \def\MDo@vdots#1{\vbox{\MDo@changestyle{#1}%
356 \baselineskip4\MDo@unit\lineskiplimit\z@
357 \kern6\MDo@unit\hbox{\MDo@dot}\hbox{\MDo@dot}\hbox{\MDo@dot}}}%
358 \def\MDo@iddots#1{{\MDo@changestyle{#1}%
359 \mkern1mu\raise \MDo@unit\hbox{\MDo@dot}%
360 \mkern2mu\raise4\MDo@unit\hbox{\MDo@dot}%
361 \mkern2mu\raise7\MDo@unit\vbox{\kern7\MDo@unit\hbox{\MDo@dot}}}}%
362 % \end{macrocode}
363 %
364 % \DescribeMacro{\fixedddots}
365 % \DescribeMacro{\fixedvdots}
366 % We include current (as of 2014/06/11) \LaTeX{}/plain\TeX{} definitions
367 % so a user can choose them. \LaTeX{} and plain\TeX{} don't have the other
368 % diagonal, so we provide a \DescribeMacro{fixediddots}\cs{fixediddots}
369 % which is just \cs{fixedddots} with the boxes reversed.
370 %
371 % \DescribeMacro{\originalvdots}
372 % \DescribeMacro{\originalddots}
373 % We save the versions at load time so user can use them in case he
374 % loads \MD{} for its other features. Chances are the original
375 % \DescribeMacro{\originaliddots}\cs{iddots} is undefined.
376 % \begin{macrocode}
377 %<sty>\DeclareRobustCommand\fixedvdots{%
378 %<tex>\def\fixedvdots{%
379 \vbox{\baselineskip4\p@ \lineskiplimit\z@
380 \kern6\p@\hbox{.}\hbox{.}\hbox{.}}}%
381 %<sty>\DeclareRobustCommand\fixedddots{%
382 %<tex>\def\fixedddots{%
383 \mathinner{\mkern1mu
384 \raise7\p@\vbox{\kern7\p@\hbox{.}}\mkern2mu
385 \raise4\p@\hbox{.}\mkern2mu
386 \raise\p@\hbox{.}\mkern1mu}}%
387 %<sty>\DeclareRobustCommand\fixediddots{%
388 %<tex>\def\fixediddots{%
389 \mathinner{\mkern1mu
390 \raise\p@\hbox{.}\mkern2mu
391 \raise4\p@\hbox{.}\mkern2mu
392 \raise7\p@\vbox{\kern7\p@\hbox{.}}\mkern1mu}}%
393 \let\originalddots=\ddots
394 \let\originalvdots=\vdots
395 \let\originaliddots=\iddots
396 % \end{macrocode}
397 %
398 % \DescribeMacro{\ddots}
399 % \DescribeMacro{\vdots}
400 % \DescribeMacro{\iddots}
401 % Here are the actual (re)definitions of these three commands. The
402 % plain\TeX{} version emits messages similar to that produced by
403 % \LaTeX{}'s \cs{DeclareRobustCommand}.
404 %
405 % Since \cs{ddots} et al.\ are defined in \LaTeX{} with
406 % \cs{DeclareRobustCommand}, saving the original definition with
407 % \verb$\let\originalddots\ddots$ will not work unless the internal
408 % command ``\verb*$\ddots $'' is unchanged. Thus we can't use
409 % \verb$\DeclareRobustCommand\ddots$ directly because it changes that
410 % internal. Instead we define \cs{MDoddots} and then do
411 % \verb$\let\ddots\MDoddots$
412 % \begin{macrocode}
413 %<sty>\DeclareRobustCommand\MDoddots{%
414 %<tex>\def\MDoddots{%
415 \mathinner{\MDo@palette\MDo@ddots}}%
416 %<sty>\DeclareRobustCommand\MDoiddots{%
417 %<tex>\def\MDoiddots{%
418 \mathinner{\MDo@palette\MDo@iddots}}%
419 %<sty>\DeclareRobustCommand\MDovdots{%
420 %<tex>\def\MDovdots{%
421 \mathinner{\MDo@palette\MDo@vdots}}%
422 %<tex>\wlog{Mathdots Info: Redefining \string\ddots.}%
423 %<tex>\wlog{Mathdots Info: Redefining \string\vdots.}%
424 \let\ddots \MDoddots
425 \let\iddots\MDoiddots
426 \let\vdots \MDovdots
427 % \end{macrocode}
428 %
429 % Now we try to get AMS \cs{dddot} and \cs{ddddot} accents to behave
430 % nicely.
431 %
432 % \DescribeMacro{\dddot}
433 % \DescribeMacro{\ddddot}
434 % We add a \verb"\kern\z@" to prevent \TeX{} from vertically centering
435 % \arg1. I don't know if the \cs{text} command is necessary, but it
436 % doesn't seem to hurt. I included it in the original version because that
437 % one used text dots and needed the text to change size. Now I use a math
438 % symbol (the dot accent) and \cs{mathpalette} to implement the change.
439 % Still, I don't really understand how \cs{ex@} works in the AMS packages,
440 % so I leave it in.
441 % \DescribeMacro{MDoprekern}
442 % \DescribeMacro{MDodotkern}
443 % \DescribeMacro{MDopostkern}
444 % For possible fine tuning, I have used two macros that
445 % represent the math spacing placed before and after the sequence of
446 % dots (\cs{MDoprekern} and \cs{MDopostkern}). Also, the actual dot is in
447 % the definition of \cs{MDo@D} where another spacing command follows the
448 % dot (\cs{MDodotkern}). In fact, by redefining \cs{MDo@D} and changing
449 % the spacing, one can define other multiple ``dot'' accent commands.
450 %
451 % \DescribeMacro{\originaldddot}
452 % \DescribeMacro{\originalddddot}
453 % We also save the original \prog{amsmath} versions.
454 % \begin{macrocode}
455 \newbox\MDo@dotsbox
456 \newmuskip\MDoprekern
457 \newmuskip\MDopostkern
458 \newmuskip\MDodotkern
459 \MDoprekern 0mu
460 \MDopostkern -1mu
461 \MDodotkern -1.3 mu
462 \def\MDo@dotsaccent#1{\mathpalette{\MDo@@dotsaccent{#1}}}%
463 \let\originaldddot \dddot
464 \let\originalddddot\ddddot
465 %<*sty>
466 \def\MDo@@dotsaccent#1#2#3{%
467 {\setbox\MDo@dotsbox\hbox{$#2\mkern\MDoprekern#1\mkern\MDopostkern$}%
468 \mathop{#3\kern\z@}\limits^{%
469 \text{\vbox to-1.4\ex@{\kern-1.8\ex@\copy\MDo@dotsbox\vss}}}}%
470 }%
471 \@ifpackageloaded{amsmath}{%
472 \def\MDo@D{\mathchar"5F\mkern\MDodotkern}%
473 \DeclareRobustCommand\MDodddot {%
474 \MDo@dotsaccent{\MDo@D\MDo@D\MDo@D}}%
475 \DeclareRobustCommand\MDoddddot{%
476 \MDo@dotsaccent{\MDo@D\MDo@D\MDo@D\MDo@D}}%
477 \let\dddot \MDodddot
478 \let\ddddot\MDoddddot
479 }{}%
480 %</sty>
481 % \end{macrocode}
482 %
483 % For plain tex + amstex: \cs{ex@} is set in \file{amstex.tex} to
484 % \texttt{.2326ex}, so its value depends on the value of \texttt{ex} when
485 % \prog{amstex} is loaded. Unlike \prog{amsmath}, it doesn't seem to be
486 % recalculated with size changes. Thus, in plain TeX we add a reset.
487 % \begin{macrocode}
488 %<*tex>
489 \def\MDo@@dotsaccent#1#2#3{%
490 {%
491 \setbox\MDo@dotsbox\hbox{$#2\mkern\MDoprekern#1\mkern\MDopostkern$}%
492 \mathop{#3\kern\z@}\limits^{\text{\[email protected]
493 \vbox to-1.4\ex@{\kern-1.8\ex@\copy\MDo@dotsbox\vss}}}%
494 }}%
495 \ifx\amstexloaded@\relax % true if amstex has been loaded
496 % A backup test in case \amstexloaded@ became \relax by accident:
497 \ifx\ddddot\UndEfInEd
498 \else
499 \def\MDo@D{\mathchar"5F\mkern\MDodotkern}%
500 \wlog{Mathdots Info: Redefining \string\dddot.}%
501 \wlog{Mathdots Info: Redefining \string\ddddot.}%
502 \def\MDodddot {\MDo@dotsaccent{\MDo@D\MDo@D\MDo@D}}%
503 \def\MDoddddot{\MDo@dotsaccent{\MDo@D\MDo@D\MDo@D\MDo@D}}%
504 \let\dddot \MDodddot
505 \let\ddddot\MDoddddot
506 \fi
507 \fi
508 \csname MathDots\mathdotsfileversion\endcsname
509 %</tex>
510 %</sty|tex>
511 % \end{macrocode}
512 %\Finale