summaryrefslogtreecommitdiff
path: root/texmf-dist/source/latex/mathtime-ltx/mathtime.dtx
blob: 53adb580603a313f43f7ff8b1b8e37afff37ce9a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
%
% \iffalse
%% Copyright 1996 1997 Frank Mittelbach and David Carlisle.
%%
%% Development of this package was commissioned by Y&Y Inc.
%% http://www.yandy.com
%% This package may be distributed under the terms of the LaTeX Project Public
%% License, as described in lppl.txt in the base LaTeX distribution.
%% Either version 1.0 or, at your option, any later version.
%%
%
%
%<*dtx>
          \ProvidesFile{mathtime.dtx}
%</dtx>
%<package>\NeedsTeXFormat{LaTeX2e}[1995/01/01]
%<mathtime>\ProvidesPackage{mathtime}
%<mathpi>\ProvidesPackage{mathpi}
%<driver>\ProvidesFile{mathtime.drv}
% \fi
%         \ProvidesFile{mathtime.dtx}
 [1999/03/29 v1.1%
%<mathtime> mathtime
%<mathpi> mathpi
 font support (FMi/DPC)]
%
% \iffalse
%<*driver>
\documentclass{ltxdoc}
%\usepackage{mathtime}
\DocInput{mathtime.dtx}
\end{document}
%</driver>
% \fi
%
% \CheckSum{853}
%
% \GetFileInfo{mathtime.dtx}
% \begin{document}
% \title{The \textsf{mathtime} and \textsf{mathpi} packages\thanks
%          {This file has version number \fileversion,
%           last revised \filedate.}\ \thanks{Development of
%          this package was commissioned by Y\&Y.}}
%
% \date{\filedate}
% \author{Frank Mittelbach with support by David Carlisle}
%  \maketitle
%
% \section{The mathtime package}
%
% The mathtime package contains the code to support the Math Time fonts.
%
% \subsection{Usage and options}
%
% To load support for the Math Time fonts add the following
% declaration to the preamble of your \LaTeX{} document:
% \begin{quote}
%   \verb=\usepackage[=\meta{options}\verb=]{mathtime}=
% \end{quote}
% This package supports several options:
% \begin{description}
% \item[nobold] default.
%
% \item[cmbold] use cm bold fonts (not recommended, the bold fonts
% will then be encoded differently to the normal weight ones, and
% no account of this will be taken).
%
% \item[mtbold] This provides bold and heavy math versions coming
%  with the Math Time Plus fonts.
%
% \item[heavybold] Also requires the Math Time Plus font set, just
% define bold math version (not heavy) but use the heavy fonts where
% available.
%
% In all cases the user level command |\heavymath| is defined to be
% |\boldmath| if the heavy math version is not defined.
%
% \item[slantedgreek] Make the lowercase greek letters slanted
% (by default).
% Note that the uppercase greek letters are always upright.
%
% \item[uprightgreek] Make the lowercase greek letters upright.
%
% \item[subscriptcorrection]
%  Redefine |_| so that it automatically adds negative kerns in
%  subscripts if they start with either
%  \texttt{j}, \texttt{p}, or \texttt{f}.
%  This option might generate problems if other packages are
%  loaded as well.
%
%  The subscript correction also be be turned on and off within the
%  document using the commands:\\
%  |\enablesubscriptcorrection| and
%  |\disablesubscriptcorrection|.
%
% \item[nosubscriptcorrection]
%    Disable the the subscript correction (default).
%
% \item[cmcal]
%    This option uses the Computer Modern calligraphic alphabet
%    for |\mathcal| --- a bad choice, but what do you do if nothing else
%    is at your disposal. We make this the default as we know that it is
%    always around.
%
% \item[lucidacal] This options sets up |\mathcal| to load the Lucida
%  calligraphic font as a math alphabet. It also defines |\mathbcal| to
%  always refer to the bold series of this alphabet.
%
% \item[lucidascr] Like \texttt{lucidacal} but puts the font into
%  |\mathscr|. This might be useful if for some reason |\mathcal|
%  already contains some special calligraphic alphabet.
%
% \item[mtplusscr] This options sets up |\mathscr| to load the Math Time
%  Plus script font as a math alphabet. It also defines |\mathbscr| to
%  always refer to the bold series of this alphabet.
%
% \item[mtpluscal] Like \texttt{mtplusscr} but puts the font into the
%  |\mathcal| alphabet.
%
% \item[noTS1]
% The use of the mathtime fonts with text fonts encoded in the
% standard OT1 or T1 encodings leaves a few symbols (section and
% paragraph marks, and dagger symbols) undefined.
% By default the TS1 `text companion encoding' will be used to access
% these symbols, but this option suppresses that.
% If the LY1 option (below) is used this option
% will be implied and dagger etc will be drawn from the operators font.
%
% \item[OT1] Use OT1 encoing for the operators font. This is the
% normal behaviour, but in this package the default behaviour is to
% use the default text encoding for the operators font.
%
% \item[T1] Use T1 encoding for the operators font.
%
% \item[LY1] Use LY1 (Y\&Y's `locally' defined texnansi encoding)
% In the operators font. This option implies the noTS1 option.
% Dagger etc will be drawn from the operators font in this case.
%
% \end{description}
%
% Not all options can be used together, e.g., one can at most select one
% of the options setting up |\mathcal|, if both options are given
% \texttt{mtpluscal} will win over \texttt{luciadcal} and in case of
% |\mathscr|,
% \texttt{lucidascr} will be the winner over \texttt{mtplusscr}.
%
% This package makes a lot of font re-assignments. Normally these
% generate warning messages on the terminal, however getting so many
% messages would be distracting, so a further three options control the
% font tracing. Even more control may be obtained by loading the
% \textsf{tracefnt} package.
%
% \begin{description}
% \item[errorshow] Only show font \emph{errors} on the terminal.
% Warnings are just sent to the log file. This is the default
% for this package.
%
% \item[warningshow] Show font warnings on the terminal. This
% corresponds to the usual \LaTeX\ behaviour.
%
% \item[nofontinfo] Suppress all font warnings, even from the log file.
% \end{description}
%
%
%
% \subsection{Text fonts}
% The package sets up Times, Helvetica, and Courier as the default
% text fonts (selected through |\textrm|, |\textsf|, and |\texttt|)
% unless the text fonts have been explicitly set, e.g., by loading a
% package like \texttt{newcent} before loading the \texttt{mathtime}
% package.
% More exactly the package checks if |\rmdefault| refers to \texttt{cmr}
% and in that case changes all three defaults.
%
% To support a few symbols not available in the Math Time fonts (but
% normally available with \LaTeX) the \texttt{mathtime} package has to
% load the the symbol companion font for Times (i.e., the TS1 encoded
% font).
% To preserve space we do not load the corresponding package
% (\texttt{texcomp}) but only declare those characters we do need.
% If you do want all symbols from this font available in your text load
% the \texttt{textcomp} package in the preamble. Conversely you
% may suppress the declaration of these symbols from the TS1 encoded
% fonts by use of the \texttt{nots1} package option, in which case
% the default definitions refering to the standard \TeX\ encodings
% and hence possibly the Computer Modern fonts will be used.
%
% \subsection{Provided math alphabets}
%
% The package provides be default the five  standard math alphabets
% |\mathrm|, |\mathbf|, |\mathit|, |\mathsf| and |\mathtt| pointing
% to the document text fonts, the first three to the roman font
% in normal, bold, and italic, the others to the sans serif and the
% typewriter font.
%
% The |\mathcal| and |\mathbcal| defaults to the Computer Modern
% calligraphic alphabet but can be modified with options as decribed
% above.
%
% Script alphabets with |\mathscr| and |\mathbscr| are only available
% if explicitly selected by an option.
%
% Alternatively one can select other fonts for |\mathscr| and
% |\mathcal|, for example, by loading the \texttt{mathpi} package
% described below.
% An alternative (although not blending very well) would be the
% the Euler Script fonts from the AMS font collection which can be
% loaded as either |\mathcal| or |\mathscr| using the \texttt{eucal}
% package.
%
% A Fraktur alphabet (|\mathfrak|) can be loaded with the
% \texttt{mathpi} fonts (a good match) or by loading the \texttt{eufrak}
% package from the AMS font collection.
%
%
% \subsection{Additional or changed symbols}
%
% The Math Time fonts contain a small number of additional symbols which
% are made available by the \texttt{mathtime} package.
% See the general documentation of the Math Time fonts.
%
% \subsection{Font sizes}
%
% \LaTeX{} is set up in a way that the user normally uses commands
% that hide font sizes rather than specifying font sizes explicitly,
% e.g., instead of |\fontsize{17pt}{19pt}|\allowbreak|\selectfont|
% a command like |\LARGE| is used (which does in fact a bit more than
% just setting the font size).
%
% It is the task of a document class and not that task of a support
% package like this one to decide about the absolute sizes used in a
% document.
% The task of a package like \texttt{mathtime} is to provide sensible
% values for math sizes given some text size.
%
% The default ratio for script fonts is 0.76
% and for scriptscript fonts 0.6.
%
%
% \section{The mathpi package}
%
% The mathpi package provides support for the Adobe math pi fonts by
% declaring a number of math alphabets. It can be used independly of the
% mathtime package. At least one option has to be given, otherwise
% loading this package will have no effect.
% \begin{description}
% \item[mathfrak] Defines |\mathfrak| to refer to the fraktur alphabet
%    from the Math Pi Two font.
% \item[mathscr] Defines |\mathscr| to refer to the script alphabet
%    from the Math Pi Two font. This needs the font especially encoded,
%    see \texttt{mtfonts.fdd} for details.
% \item[mathcal] Defines the script alphabet under the math alphabet
%    command usually used for a calligraphic font, otherwise like
%    \texttt{mathscr}.
% \item[mathbb] Defines |\mathbb| to refer to the blackboard bold math
%     alphabet from Math Pi Six.
% \end{description}
%
%
% \StopEventually{}
%
%
%
% \section{The implementation of mathtime}
%
% \changes{v0.2}{1996/12/12}
%      {nobold cmbold mtbold and heavybold options}
% \changes{v0.3}{1996/12/17}
%      {nobold cmbold mtbold and heavybold options}
% \changes{v0.7}{1997/01/10}
%      {Add font tracing control options}
% \changes{v0.9}{1997/01/16}
%      {First public release}
% \changes{v1.0a}{1997/02/14}
%      {First ctan release}
% \changes{v1.0d}{1997/09/01}
%      {Remove use of double quote hex convention}
%
% \subsection{Options}
%
% We start with declaring the options. For the (un)slanted greek we need
% store the shape information in a macro. For the various bold options
% we use |\boldmath| as a marker since this needs redefinition anyway.
%    \begin{macrocode}
%<*mathtime>
\newcommand\greekshape{}
%    \end{macrocode}
%
%    \begin{macrocode}
\DeclareOption{slantedgreek}{\renewcommand\greekshape{it}}
\DeclareOption{uprightgreek}{\renewcommand\greekshape{n}}
\DeclareOption{nobold}{\let\boldmath=u}
\DeclareOption{cmbold}{\let\boldmath=c}
\DeclareOption{mtbold}{\let\boldmath=m}
\DeclareOption{heavybold}{\let\boldmath=h}
%    \end{macrocode}
%
%    \begin{macrocode}
\newcommand\enablesubscriptcorrection {\catcode`\_=12\relax}
\newcommand\disablesubscriptcorrection{\catcode`\_=8\relax}
%    \end{macrocode}
%
%    \begin{macrocode}
\DeclareOption{nosubscriptcorrection}{\disablesubscriptcorrection}
\DeclareOption{subscriptcorrection}  {\enablesubscriptcorrection}
%    \end{macrocode}
%
% We signal that we want Lucida calligraphic by defining |\mathcal|
% to be the letter |l|. In a similar fashion we handle |\mathscr|.
%    \begin{macrocode}
\DeclareOption{cmcal}    {\let\mathcal=c}
\DeclareOption{lucidacal}{\let\mathcal=l}
\DeclareOption{mtplusscr}{\let\mathscr=s}
\DeclareOption{mtpluscal}{\let\mathcal=s}
\DeclareOption{lucidascr}{\let\mathscr=l}
%    \end{macrocode}
%
%
% The use of the mathtime fonts with text fonts encoded in the standard
% OT1 or T1 encodings leaves a few symbols (section and paragraph marks,
% and dagger symbols) undefined. By default the TS1 `text companion
% encoding' will be used to access these symbols, but this option
% suppresses that. (Leaving you to define these symbols yourself
% some other way, or to accept the default definitions, from
% Computer Modern.)
% \changes{v0.9b}{1997/01/31}
%      {option name change nots1 noTS1}
%    \begin{macrocode}
\DeclareOption{noTS1}    {\let\symtextcomp\relax}
%    \end{macrocode}
%
% The next few options control the encoding used for the `operators'
% font. When using Computer Modern Math fonts an OT1 font must be used
% even if an alternative encoding, such as T1, is used for the text
% fonts. This is due to the fact that the default math setup assumes
% that certain symbols (such as uppercase Greek) are available from the
% text font used for the operators symbol font. With this package
% this restriction is not needed as all symbols are accessed from the
% mathtime fonts.
% \changes{v0.9b}{1997/01/31}
%      {New options for operator font encoding}
% By default use the current text encoding.
%    \begin{macrocode}
\let\operator@encoding\encodingdefault
%    \end{macrocode}
%
% Use OT1 encoded `operators' fonts.
%    \begin{macrocode}
\DeclareOption{OT1}{\def\operator@encoding{OT1}}
%    \end{macrocode}
%
% Use T1 encoded `operators' fonts.
%    \begin{macrocode}
\DeclareOption{T1}{\def\operator@encoding{T1}}
%    \end{macrocode}
%
% Use LY1 (The local `texnansi' encoding used by the Y\&Y \TeX\ system)
% encoded `operators' fonts. This option implies the `noTS1' option
% as the LY1 encoding includes the dagger and other symbols.
%    \begin{macrocode}
\DeclareOption{LY1}{\def\operator@encoding{LY1}\ExecuteOptions{noTS1}}
%    \end{macrocode}
%
% This package makes a lot of redefinitions. The warnings can be rather
% annoying so some package options control whether the information
% is printed to the terminal or log file. More control can be obtained
% by loading the \textsf{tracefnt} package.
%
% Just show font errors; Warning and info to the log file.
% The default for this package.
%    \begin{macrocode}
\DeclareOption{errorshow}{%
   \def\@font@info#1{%
         \GenericInfo{(Font)\@spaces\@spaces\@spaces\space\space}%
                     {LaTeX Font Info: \space\space\space#1}}%
    \def\@font@warning#1{%
         \GenericInfo{(Font)\@spaces\@spaces\@spaces\space\space}%
                        {LaTeX Font Warning: #1}}}
%    \end{macrocode}
%
% The normal \LaTeX\ default, Font Info to the log file and Font
% Warning to the terminal.
%    \begin{macrocode}
\DeclareOption{warningshow}{%
   \def\@font@info#1{%
         \GenericInfo{(Font)\@spaces\@spaces\@spaces\space\space}%
                     {LaTeX Font Info: \space\space\space#1}}%
    \def\@font@warning#1{%
         \GenericWarning{(Font)\@spaces\@spaces\@spaces\space\space}%
                        {LaTeX Font Warning: #1}}}
%    \end{macrocode}
%
% On some machines writing all the log info may slow things down
% so extra option not to log font changes at all.
%    \begin{macrocode}
\DeclareOption{nofontinfo}{%
   \let\@font@info\@gobble
   \let\@font@warning\@gobble}
%    \end{macrocode}
%
% The defaults:
%    \begin{macrocode}
\ExecuteOptions{%
  slantedgreek,nobold,nosubscriptcorrection,cmcal,errorshow}
%    \end{macrocode}
%
%    \begin{macrocode}
\ProcessOptions
%    \end{macrocode}
%
% If the text font default for roman is CMR we switch to Times,
% otherwise we assume that the user has already added a package
% selecting the text font faces.
%    \begin{macrocode}
\edef\@tempa{\rmdefault}
\def\@tempb {cmr}
\ifx\@tempa\@tempb
  \renewcommand*\sfdefault{phv}
  \renewcommand*\rmdefault{ptm}
  \renewcommand*\ttdefault{pcr}
  \renewcommand*\bfdefault{b}
\fi
%    \end{macrocode}
%
% \subsection{Math Font Declarations}
%
% As the Math Time fonts unfortunately do come with their private
% encoding we need to make those encodings known to \LaTeX.
%    \begin{macrocode}
\DeclareFontEncoding{MY1}{}{}
\DeclareFontEncoding{MY2}{}{}
\DeclareFontEncoding{MY3}{}{}
\DeclareFontSubstitution{MY1}{mtt}{m}{it}
\DeclareFontSubstitution{MY2}{mtt}{m}{n}
\DeclareFontSubstitution{MY3}{mtt}{m}{n}
%    \end{macrocode}
%
% Not clear if we should use |\rmdefault| or fix the operator symbol
% font to Times --- probably the latter.
%
% The main four symbol fonts are already declared in the \LaTeX{}
% format. Thus we don't need to declare them but simply change he
% relevant slots in the normal and bold math version.
%
% \changes{v0.9b}{1997/01/31}
%      {Dont force OT1 encoding for operators}
%    \begin{macrocode}
%\DeclareSymbolFont{operators}   {\operator@encoding}{\rmdefault}{m}{n}
%\DeclareSymbolFont{letters}     {MY1}{mtt}{m}{it}
%\DeclareSymbolFont{symbols}     {MY2}{mtt}{m}{n}
%\DeclareSymbolFont{largesymbols}{MY3}{mtt}{m}{n}
%    \end{macrocode}
%
% The normal weight fonts are availble by default.
%    \begin{macrocode}
\SetSymbolFont{operators}   {normal}{\operator@encoding}{ptm}{m}{n}
\SetSymbolFont{letters}     {normal}{MY1}{mtt}{m}{it}
\SetSymbolFont{symbols}     {normal}{MY2}{mtt}{m}{n}
\SetSymbolFont{largesymbols}{normal}{MY3}{mtt}{m}{n}
%    \end{macrocode}
%
% If the |cmbold| package option is specified then the
% Computer Modern Bold math fonts will be used (as is the
% normal \LaTeX\ default). The mathtime fonts are \emph{differently}
% encoded, and so the use of this option may produce some incorrect
% characters (with no warning). However it may be useful if the
% `mathtime plus' bold fonts are not available, and a few bold
% symbols are needed for special circumstances. (However CM bold
% is not much bolder than mathtime normal weight, and is not really
% visually compatible).
%    \begin{macrocode}
\ifx\boldmath c
  \SetSymbolFont{operators}   {bold}{\operator@encoding}{cmr}{bx}{n}
  \SetSymbolFont{letters}     {bold}{OML}{cmm}{b}{it}
  \SetSymbolFont{symbols}     {bold}{OMS}{cmsy}{b}{n}
  \SetSymbolFont{largesymbols}{bold}{MY3}{mtt}{m}{n}
\PackageWarningNoLine{mathtime}
  {The use of the `cmbold' option will result\MessageBreak
   in incorrect characters in some circumstances\MessageBreak
   without any warning as the Math Time fonts and the\MessageBreak
   Computer Modern fonts have incompatible encodings.\MessageBreak
   Please use this option with care!\@gobble}
%    \end{macrocode}
%
%    \begin{macrocode}
  \renewcommand\boldmath{\@nomath\boldmath\mathversion{bold}}
  \let\heavymath\boldmath
\fi
%    \end{macrocode}
%
% This is the default behaviour for this package, |\boldmath| is
% not available. As it is no longer available save some space
% by removing it from the internal list of math versions.
% (Then waste most of the saving on the text of an error message.)
%    \begin{macrocode}
\ifx\boldmath u
  \let\@tempa\version@elt
    \def\version@elt#1{%
      \ifx\mv@bold#1\else\noexpand\version@elt\noexpand#1\fi}
    \edef\version@list{\version@list}
  \let\version@elt\@tempa
  \let\mv@bold\@undefined
  \renewcommand\boldmath{\PackageError{mathtime}%
               {Bold math is not supported}%
               {Use cmbold or mtbold options}}
  \let\heavymath\boldmath
\fi
%    \end{macrocode}
%
% If the bold (and heavy) mathtime fonts are available then they
% can be assigned to the appropriate math versions by specifying the
% |mtbold| package option.
%    \begin{macrocode}
\ifx\boldmath m
  \SetSymbolFont{operators}{bold}{\operator@encoding}{\rmdefault}{b}{n}
  \SetSymbolFont{letters}     {bold}{MY1}{mtt}{b}{\greekshape}
  \SetSymbolFont{symbols}     {bold}{MY2}{mtt}{b}{n}
  \SetSymbolFont{largesymbols}{bold}{MY3}{mtt}{b}{n}
%    \end{macrocode}
%
%    \begin{macrocode}
  \DeclareMathVersion{heavy}
  \SetSymbolFont{operators}{heavy}{\operator@encoding}{\rmdefault}{b}{n}
  \SetSymbolFont{letters}     {heavy}{MY1}{mtt}{ub}{\greekshape}
  \SetSymbolFont{symbols}     {heavy}{MY2}{mtt}{ub}{n}
  \SetSymbolFont{largesymbols}{heavy}{MY3}{mtt}{ub}{n}
%    \end{macrocode}
%
% \changes{v0.9a}{1997/01/17}
%      {Redeclare colon etc to the symbols font}
% As the bold font is available, use these symbols from
% the symbols font rather than operators, so they are made
% bold by |\boldmath|.
%    \begin{macrocode}
  \DeclareMathSymbol{:}{\mathrel}{symbols}{86}
  \DeclareMathSymbol{!}{\mathclose}{symbols}{87}
  \DeclareMathSymbol{[}{\mathopen}{symbols}{84}
  \DeclareMathSymbol{]}{\mathclose}{symbols}{85}
%    \end{macrocode}
%
%    \begin{macrocode}
  \renewcommand\boldmath{\@nomath\boldmath\mathversion{bold}}
  \newcommand\heavymath{\@nomath\heavymath\mathversion{heavy}}
\fi
%    \end{macrocode}
%
% Alternatively, you may specify the |heavybold| option, which
% instead of having a `heavy' math version, places the heavy
% fonts in the `bold' math version, to get greater visual
% contrast.
%    \begin{macrocode}
\ifx\boldmath h
  \SetSymbolFont{operators}{bold}{\operator@encoding}{\rmdefault}{b}{n}
  \SetSymbolFont{letters}     {bold}{MY1}{mtt}{ub}{\greekshape}
  \SetSymbolFont{symbols}     {bold}{MY2}{mtt}{ub}{n}
  \SetSymbolFont{largesymbols}{bold}{MY3}{mtt}{ub}{n}
%    \end{macrocode}
%
% As above, use these symbols from
% the symbols font rather than operators, so they are made
% bold by |\boldmath|.
%    \begin{macrocode}
  \DeclareMathSymbol{:}{\mathrel}{symbols}{86}
  \DeclareMathSymbol{!}{\mathclose}{symbols}{87}
  \DeclareMathSymbol{[}{\mathopen}{symbols}{84}
  \DeclareMathSymbol{]}{\mathclose}{symbols}{85}
%    \end{macrocode}
%
%    \begin{macrocode}
  \renewcommand\boldmath{\@nomath\boldmath\mathversion{bold}}
  \let\heavymath\boldmath
\fi
%    \end{macrocode}
%
%
% \subsection{Math alphabet declarations}
%
% The standard   alphabets first.
%
% We don't have to declare |\mathrm| as \LaTeX{} declares it as
% a math symbol alphabet pointing to ``operators'' symbol font.
% But if we redeclare it it will then use the text fonts which might
% not be Times.
%
% As standard \LaTeX{} provides a couple of alphabets we better change
% them all \ldots
%    \begin{macrocode}
\SetMathAlphabet{\mathrm}{normal}{\encodingdefault}{\rmdefault}{m}{n}
\SetMathAlphabet{\mathbf}{normal}{\encodingdefault}{\rmdefault}{b}{n}
\SetMathAlphabet{\mathit}{normal}{\encodingdefault}{\rmdefault}{m}{it}
\SetMathAlphabet{\mathsf}{normal}{\encodingdefault}{\sfdefault}{m}{n}
\SetMathAlphabet{\mathtt}{normal}{\encodingdefault}{\ttdefault}{m}{n}
%    \end{macrocode}
%
% If a bold or heavy version exists add appropriate values.
% Right now |\mathbf| is the same in all versions.
%    \begin{macrocode}
\ifx\mv@bold\@undefined
\else
  \SetMathAlphabet{\mathrm}{bold} {\encodingdefault}{\rmdefault}{b}{n}
  \SetMathAlphabet{\mathbf}{bold} {\encodingdefault}{\rmdefault}{b}{n}
  \SetMathAlphabet{\mathit}{bold} {\encodingdefault}{\rmdefault}{b}{it}
  \SetMathAlphabet{\mathsf}{bold} {\encodingdefault}{\sfdefault}{b}{n}
%    \end{macrocode}
% If the typewriter is Computer Modern the next declaration will revert
% to normal (with a warning) but such is life.
%    \begin{macrocode}
  \SetMathAlphabet{\mathtt}{bold} {\encodingdefault}{\ttdefault}{b}{n}
\fi
%    \end{macrocode}
%
%    \begin{macrocode}
\ifx\mv@heavy\@undefined
\else
  \SetMathAlphabet{\mathrm}{heavy}{\encodingdefault}{\rmdefault}{b}{n}
  \SetMathAlphabet{\mathbf}{heavy}{\encodingdefault}{\rmdefault}{b}{n}
  \SetMathAlphabet{\mathit}{heavy}{\encodingdefault}{\rmdefault}{b}{it}
  \SetMathAlphabet{\mathsf}{heavy}{\encodingdefault}{\sfdefault}{b}{n}
  \SetMathAlphabet{\mathtt}{heavy}{\encodingdefault}{\ttdefault}{b}{n}
\fi
%    \end{macrocode}
%
% \subsubsection{Script alphabets}
%
% If the \texttt{mtplusscr} option was selected
% we make |\mathscr| point to Spivak's script font.
%
% Declaring the bold version first takes care of bold and heavy
% version.
% So far this doesn't allow for alternatives but I think the best
% solution here would be to provide input ligatures \texttt{*A}
% etc.\ in the font itself. However as \TeX{} doesn't handle math
% accents correctly in that case that idea might not be so good after
% all.
% Perhaps defining a |\variant| command might be better, e.g.,
% |\mathscr{\variant A}| --- we'll see.
% \changes{v1.0b}{1997/02/24}
%      {clear existing definitions of \cs{mathscr} and \cs{mathcal}}
%    \begin{macrocode}
\ifx\mathscr s
  \let\mathscr\relax
  \DeclareMathAlphabet\mathscr{U}        {mtms}{b}{n}
  \SetMathAlphabet    \mathscr{normal}{U}{mtms}{m}{n}
%    \end{macrocode}
%
% The |\mathbscr| is bold in all versions.
%    \begin{macrocode}
  \DeclareMathAlphabet\mathbscr{U}{mtms}{b}{n}
\fi
%    \end{macrocode}
%
% If \texttt{lucidascr} was selected we put the Lucida calligraphic
% font in |\mathscr|:
%    \begin{macrocode}
\ifx\mathscr l
  \let\mathscr\relax
  \DeclareMathAlphabet{\mathscr}          {OMS}{lby}{b}{n}
  \SetMathAlphabet    {\mathscr}{normal}  {OMS}{lby}{m}{n}
%    \end{macrocode}
% |\mathbscr| will be bold in all math versions.
%    \begin{macrocode}
  \DeclareMathAlphabet{\mathbscr}         {OMS}{lby}{b}{n}
\fi
%    \end{macrocode}
%
% \subsubsection{Calligraphic alphabets}
%
% If the \texttt{lucidacal} option was selected we set up |\mathcal|.
%    \begin{macrocode}
\ifx\mathcal l
  \let\mathcal\relax
  \DeclareMathAlphabet{\mathcal}          {OMS}{lby}{b}{n}
  \SetMathAlphabet    {\mathcal}{normal}  {OMS}{lby}{m}{n}
%    \end{macrocode}
% |\mathbcal| will be bold in all math versions.
%    \begin{macrocode}
  \DeclareMathAlphabet{\mathbcal}         {OMS}{lby}{b}{n}
\fi
%    \end{macrocode}
%
% The code below refers to the \texttt{mtpluscal} option:
%    \begin{macrocode}
\ifx\mathcal s
  \let\mathcal\relax
  \DeclareMathAlphabet\mathcal{U}        {mtms}{b}{n}
  \SetMathAlphabet    \mathcal{normal}{U}{mtms}{m}{n}
%    \end{macrocode}
%
% The |\mathbcal| is bold in all versions.
%    \begin{macrocode}
  \DeclareMathAlphabet\mathbcal{U}{mtms}{b}{n}
\fi
%    \end{macrocode}
% The code below will be used if no calligraphic option has been
% selected. We need to redeclare that alphabet as by default it points
% to the symbols alphabet that in case of the Math Time fonts simply
% doesn't contain a  math alphabet any longer.
%    \begin{macrocode}
\ifx\mathcal c
  \let\mathcal\relax
  \DeclareMathAlphabet\mathcal{OMS}        {cmsy}{b}{n}
  \SetMathAlphabet    \mathcal{normal}{OMS}{cmsy}{m}{n}
%    \end{macrocode}
%
% The |\mathbcal| is bold in all versions.
%    \begin{macrocode}
  \DeclareMathAlphabet\mathbcal{OMS}       {cmsy}{b}{n}

\fi
%    \end{macrocode}
%
% \subsection{Math Symbol Declarations}
%
% In MathT\i me, italic upper case Greek found in math italic font
% and we don't make them changable with the font.
%    \begin{macrocode}
\DeclareMathSymbol\Gamma  {\mathord}{letters}{48}
\DeclareMathSymbol\Delta  {\mathord}{letters}{49}
\DeclareMathSymbol\Theta  {\mathord}{letters}{50}
\DeclareMathSymbol\Lambda {\mathord}{letters}{51}
\DeclareMathSymbol\Xi     {\mathord}{letters}{52}
\DeclareMathSymbol\Pi     {\mathord}{letters}{53}
\DeclareMathSymbol\Sigma  {\mathord}{letters}{54}
\DeclareMathSymbol\Upsilon{\mathord}{letters}{55}
\DeclareMathSymbol\Phi    {\mathord}{letters}{56}
\DeclareMathSymbol\Psi    {\mathord}{letters}{57}
\DeclareMathSymbol\Omega  {\mathord}{letters}{127}
%    \end{macrocode}
%
%    \begin{macrocode}
\DeclareMathSymbol\varGamma    {\mathord}{letters}{0}
\DeclareMathSymbol\varDelta    {\mathord}{letters}{1}
\DeclareMathSymbol\varTheta    {\mathord}{letters}{2}
\DeclareMathSymbol\varLambda   {\mathord}{letters}{3}
\DeclareMathSymbol\varXi       {\mathord}{letters}{4}
\DeclareMathSymbol\varPi       {\mathord}{letters}{5}
\DeclareMathSymbol\varSigma    {\mathord}{letters}{6}
\DeclareMathSymbol\varUpsilon  {\mathord}{letters}{7}
\DeclareMathSymbol\varPhi      {\mathord}{letters}{8}
\DeclareMathSymbol\varPsi      {\mathord}{letters}{9}
\DeclareMathSymbol\varOmega    {\mathord}{letters}{10}
%    \end{macrocode}
% The next setting all need to be checked for correctness
% (with a test file).
% Those settings where I think the \LaTeX{} defaults are the same, are
% commented out.
%
%    \begin{macrocode}
\DeclareMathSymbol{(}{\mathopen}{letters}{46}	% was 028
\DeclareMathSymbol{)}{\mathclose}{letters}{47} % was 029
%    \end{macrocode}
%
% Not sure this version of |\DeclareMathDelimiter| is documented or
% used anywhere, but like |\DeclareMathSymbol| it can take
% a character token (and one less argument).
% \changes{v0.2}{1996/12/12}{use \cs{DeclareMathDelimiter}}
%    \begin{macrocode}
\DeclareMathDelimiter{(}{letters}{46}{largesymbols}{0}
\DeclareMathDelimiter{)}{letters}{47}{largesymbols}{1}
%    \end{macrocode}
%
%    \begin{macrocode}
%\DeclareMathSymbol{.}{\mathord}{letters}{58}
%\DeclareMathSymbol{,}{\mathpunct}{letters}{59}
%\DeclareMathSymbol{\ldotp}{\mathpunct}{letters}{58}
%    \end{macrocode}
%
%    \begin{macrocode}
\DeclareMathSymbol{\triangleleft}{\mathbin}{symbols}{71}  % was 12F
\DeclareMathSymbol{\triangleright}{\mathbin}{symbols}{70} % was 12E
%    \end{macrocode}
%
% \changes{v0.9c}{1997/02/07}
%      {Add \cs{varkappa}}
%    \begin{macrocode}
\DeclareMathSymbol{\comp}{\mathbin}{symbols}{66}       % new?
\DeclareMathSymbol{\setdif}{\mathbin}{symbols}{88}     % new
\DeclareMathSymbol{\cupprod}{\mathbin}{symbols}{89}    % new
\DeclareMathSymbol{\capprod}{\mathbin}{symbols}{90}    % new
\DeclareMathSymbol{+}{\mathbin}{symbols}{67}           % was 02B
\DeclareMathSymbol{=}{\mathrel}{symbols}{68}           % was 03D
\let\Relbar\@undefined
\DeclareMathSymbol{\Relbar}{\mathrel}{symbols}{72}     % was a macro
\DeclareMathSymbol{;}{\mathpunct}{symbols}{73}         % was 13B
\DeclareMathSymbol{\varkappa}{\mathord}{letters}{126}   % new (AMS)
%    \end{macrocode}
%
% We make all accents |\mathord|; as they are placed in strange
% positions it is really not feasible to support changing them.
%    \begin{macrocode}
\DeclareMathAccent{\vec}{\mathord}{symbols}{69}
\DeclareMathAccent{\grave}{\mathord}{symbols}{74}
\DeclareMathAccent{\acute}{\mathord}{symbols}{75}
\DeclareMathAccent{\check}{\mathord}{symbols}{76}
\DeclareMathAccent{\breve}{\mathord}{symbols}{77}
\DeclareMathAccent{\bar}{\mathord}{symbols}{78}
\DeclareMathAccent{\hat}{\mathord}{symbols}{79}
\DeclareMathAccent{\dot}{\mathord}{symbols}{80}
\DeclareMathAccent{\tilde}{\mathord}{symbols}{81}
\DeclareMathAccent{\ddot}{\mathord}{symbols}{82}
\DeclareMathAccent{\widebar}{\mathord}{symbols}{83}		% new
%    \end{macrocode}
%
% Next two are the same as in standard \LaTeX{}.
%    \begin{macrocode}
%\DeclareMathAccent{\widetilde}{\mathord}{largesymbols}{101}
%\DeclareMathAccent{\widehat}{\mathord}{largesymbols}{98}
%    \end{macrocode}
%
% \subsection{AMS double accent commands}
%
% Unfortunately the AMS double accent commands such as |\Hat|
% assume that the math accents come from an `OT1' encoded
% font in the `operators' math symbol font. To use
% these commands with mathtime you may need to place code
% such as the following into a package file and load that after
% loading the \textsf{amsmath} package. This section is commented out
% here as it would not work without several other sections of
% \textsf{amsmath}, and a future release of the AMS package may anyway
% remove some of these encoding assumptions.
%
%\begin{verbatim}
% \def\@math@ccent#1#2#3{%
%  \RIfM@
%  \xdef\thefam@{\ifnum\mathgroup=\m@ne1\else\the\mathgroup\fi}%
%  \accentdimen@\z@
%  \setboxz@h{\unbracefonts@$\m@th\mathgroup\thefam@\relax#3$}%
%  \ifdim\accentdimen@=\z@\DN@{#2{#3}}%
%   \setbox\@ne\hbox{\unbracefonts@
%     $\m@th\mathgroup\thefam@\relax#3\theskewchar@$}
%   \setbox\tw@\hbox{$\m@th\ifnum\skewcharcount@=\m@ne\else
%    \mathchar\skewcharcount@\fi$}%
%   \global\accentdimen@\wd\@ne\global\advance\accentdimen@-\wdz@
%   \global\advance\accentdimen@-\wd\tw@
%   \global\multiply\accentdimen@\tw@
%   \dimentomu@\global\advance\accentmu@\@ne
%  \else\DN@{{#2{#3\mkern\accentmu@ mu}%
%     \mkern-\accentmu@ mu}{}}\fi
%  \next@
%  \else
%    \nonmatherr@#1%
%  \fi}
% 
% 
% \def\Hat{\@math@ccent\Hat\hat}
% \def\Dot{\@math@ccent\Dot\dot}
% \def\Check{\@math@ccent\Check\check}
% \def\Tilde{\@math@ccent\Tilde\tilde}
% \def\Acute{\@math@ccent\Acute\acute}
% \def\Grave{\@math@ccent\Grave\grave}
% \def\Dot{\@math@ccent\Dot\dot}
% \def\Ddot{\@math@ccent\Ddot\ddot}
% \def\Breve{\@math@ccent\Breve\breve}
% \def\Bar{\@math@ccent\Bar\bar}
% \def\Vec{\@math@ccent\Vec\vec}
%\end{verbatim}
%
% \subsection{Math font sizes}
%
% Math Time, like most other type 1 fonts uses the same font at all
% sizes. For such fonts the default ratios (.7 and .5) produce
% unreadably small superscripts.
%    \begin{macrocode}
\def\defaultscriptratio{.76}
\def\defaultscriptscriptratio{.6}
%    \end{macrocode}
%
% These default ratios are not used for any sizes that have been
% explicitly declared, so redeclare the sizes used by the standard
% classes. At least for the lower sizes this is important as we don't
% want to end up with a 5pt font being reduced even further.
%
% The table below might need some further tweaking. I selected the
% numbers partly on a few visual tests (but not many) and partly on the
% idea that resusing sizes is better than introducing many new
% ones. Even with Type~1 fonts many people will produce pk versions of
% the fonts in their document (using gftopk, for example).
%
%    \begin{macrocode}
\DeclareMathSizes{5}     {6}   {6}  {6}
\DeclareMathSizes{6}     {6}   {6}  {6}
\DeclareMathSizes{7}     {6.8} {6}  {6}
\DeclareMathSizes{8}     {8}   {6.8}{6}
\DeclareMathSizes{9}     {9}   {7.6}{6}
\DeclareMathSizes{10}   {10}   {7.6}{6}
\DeclareMathSizes{10.95}{10.95}{7.6}{6}
\DeclareMathSizes{12}   {12}   {9}  {7}
\DeclareMathSizes{14.4} {14.4} {10} {8}
\DeclareMathSizes{17.28}{17.28}{12} {9}
\DeclareMathSizes{20.74}{20.74}{14.4}{10}
\DeclareMathSizes{24.88}{24.88}{17.28}{12}
%    \end{macrocode}
%
%
% \subsection{Strange Commands}
% |\vdots| and |\ddots| take their ``dots'' from the math fonts.
% In fact this is something that should be corrected in base format
% of \LaTeX{} as well.
%
%    \begin{macrocode}
\newcommand\hb@xmdot{\hbox{$\m@th.$}}
\def\vdots{\vbox{\baselineskip4\p@ \lineskiplimit\z@
  \kern6\p@\hb@xmdot\hb@xmdot\hb@xmdot}}
\def\ddots{\mathinner{\mkern1mu\raise7\p@\vbox{\kern7\p@
  \hb@xmdot}\mkern2mu
  \raise4\p@\hb@xmdot\mkern2mu\raise\p@\hb@xmdot\mkern1mu}}
%    \end{macrocode}
%
% |\angle| needs a thicker horizontal rule (what a mess).
%
%    \begin{macrocode}
\def\angle{{\vbox{\ialign{$\m@th\scriptstyle##$\crcr
      \not\mathrel{\mkern14mu}\crcr
      \noalign{\nointerlineskip}%
      \mkern2.5mu%
      \leaders\hrule\@height.48\p@\hfill\mkern2.5mu\crcr}}}}
%    \end{macrocode}
%
% Awful many tokens are wasted to define to lower horizontal bar in
% |\hbar|. The definition below uses \={} from the symbol font to
% avoid problems with different text encodings in the operators
% font.
% \changes{v0.2}{1996/12/12}{save a few tokens here}
% \changes{v0.9b}{1997/01/31}
%      {New \cs{hbar} getting bar from symbol font not operators}
% \changes{v1.0e}{1997/10/10}{Make \cs{hbar} robust}
%    \begin{macrocode}
\DeclareRobustCommand\hbar{{%
 \dimen@.12em%
 \dimen@ii.1em%
 \def\@tempa##1##2{{%
   \lower##1\dimen@\rlap{\kern##1\dimen@ii\the##2\tw@\char78}}}%
 \mathchoice\@tempa\@ne\textfont
            \@tempa\@ne\textfont
            \@tempa\defaultscriptratio\scriptfont
            \@tempa\defaultscriptscriptratio\scriptscriptfont
  h}}
%    \end{macrocode}
%
% Redefine |\@fnsymbol| to use |\mathsection| and |\mathparagraph|
% (Should be done in base \LaTeX\ as well).
% \changes{v1.0c}{1997/03/14}
%      {Make footnote symbols work with other encodings}
%    \begin{macrocode}
\def\@fnsymbol#1{\ensuremath{\ifcase#1\or *\or \dagger\or \ddagger\or
	   \mathsection\or \mathparagraph\or \|\or **\or \dagger\dagger
	   \or \ddagger\ddagger \else\@ctrerr\fi}}
%    \end{macrocode}
%
% Wasting a full symbol font just to have |\dagger| and friends. Here
% we pay part of the price for fact that the math time fonts have their
% own encoding incompatible with the CM fonts.
%
% If the |noTS1| option is used, this whole section is skipped unless
% LY1 or T1 encodings are being used, in which case the symbols can be 
% accessed from the operators font.
%    \begin{macrocode}
\ifx\symtextcomp\relax
  \def\@tempa{LY1}
  \ifx\operator@encoding\@tempa
    \DeclareMathSymbol\dagger {\mathbin}{operators}{134}
    \DeclareMathSymbol\ddagger{\mathbin}{operators}{135}
    \DeclareMathSymbol\mathsection{\mathord}{operators}{'247}
    \DeclareMathSymbol\mathparagraph{\mathord}{operators}{'266}
    \DeclareMathSymbol\mathsterling{\mathord}{operators}{163}
    \let\mathunderscore\@undefined
    \DeclareMathSymbol\mathunderscore{\mathord}{operators}{95}
  \fi
%    \end{macrocode}
% If we have T1 encoded operators but are nt using TS1 can at least
% get pounds sign and underscore, but not dagger etc.
%    \begin{macrocode}
  \def\@tempa{T1}
  \ifx\operator@encoding\@tempa
    \DeclareMathSymbol\mathsterling{\mathord}{operators}{191}
    \let\mathunderscore\@undefined
    \DeclareMathSymbol\mathunderscore{\mathord}{operators}{95}
  \fi
%    \end{macrocode}
%
%    \begin{macrocode}
\else
  \DeclareFontEncoding{TS1}{}{}
  \DeclareSymbolFont{textcomp}{TS1}{ptm}{m}{n}
  \ifx\mv@bold\@undefined
  \else
    \SetSymbolFont    {textcomp}{bold}{TS1}{ptm}{b}{n}
  \fi
%    \end{macrocode}
%
%    \begin{macrocode}
  \ifx\mv@heavy\@undefined
  \else
    \SetSymbolFont    {textcomp}{heavy}{TS1}{ptm}{b}{n}
  \fi
%    \end{macrocode}
%
%    \begin{macrocode}
  \DeclareMathSymbol\dagger {\mathbin}{textcomp}{'204}
  \DeclareMathSymbol\ddagger{\mathbin}{textcomp}{'205}
%    \end{macrocode}
%
% The math versions for \textsection{} and \textparagraph{}
% are also not in the symbol fonts so we pick them up as well.
%    \begin{macrocode}
  \DeclareMathSymbol\mathsection{\mathord}{textcomp}{'247}
  \DeclareMathSymbol\mathparagraph{\mathord}{textcomp}{'266}
%    \end{macrocode}
%
%    \begin{macrocode}
\fi
%    \end{macrocode}
%
% \subsection{Encoding Specific Text Commands}
%
% Some encoding specific commands default to the OML or OMS encoding.
% As these encodings are not used with this package, we need to change
% the defaults.
%
% These ones used to default to OML
%    \begin{macrocode}
\DeclareTextSymbolDefault{\textless}{MY1}
\DeclareTextSymbolDefault{\textgreater}{MY1}
\DeclareTextAccentDefault{\t}{MY2}
%    \end{macrocode}
%
% Important is to not only set the default the default but also declare
% the symbols itself. If this is forgotten calling the command will
% generate a loop. Or to quote David:
% \begin{quote}
%  [hmm, otherwise you waste an hour or two staring at |\tracingall|
%     output trying to work out what the heck is happening:-]
% \end{quote}
%
%    \begin{macrocode}
\DeclareTextSymbol{\textless}{MY1}{`\<}
\DeclareTextSymbol{\textgreater}{MY1}{`\>}
\DeclareTextAccent{\t}{MY2}{65}
%    \end{macrocode}
%
% These ones used to default to OMS
%    \begin{macrocode}
\DeclareTextSymbolDefault{\textasteriskcentered}{MY2}
\DeclareTextSymbolDefault{\textbackslash}{MY2}
\DeclareTextSymbolDefault{\textbar}{MY2}
\DeclareTextSymbolDefault{\textbraceleft}{MY2}
\DeclareTextSymbolDefault{\textbraceright}{MY2}
\DeclareTextSymbolDefault{\textbullet}{MY2}
\DeclareTextSymbolDefault{\textperiodcentered}{MY2}
\DeclareTextAccentDefault{\textcircled}{MY2}
%    \end{macrocode}
%
%    \begin{macrocode}
\DeclareTextSymbol{\textasteriskcentered}{MY2}{3}
\DeclareTextSymbol{\textbackslash}{MY2}{110}
\DeclareTextSymbol{\textbar}{MY2}{106}
\DeclareTextSymbol{\textbraceleft}{MY2}{102}
\DeclareTextSymbol{\textbraceright}{MY2}{103}
\DeclareTextSymbol{\textbullet}{MY2}{15}
\DeclareTextSymbol{\textperiodcentered}{MY2}{1}
\DeclareTextCommand{\textcircled}{MY2}[1]{{%
   \ooalign{%
      \hfil \raise .07ex\hbox {\upshape#1}\hfil \crcr
      \char13}}}
%    \end{macrocode}
%
% These also normally default to OMS, but are not available
% in MY1 or MY2, so get them from the TS1 encoded font.
%    \begin{macrocode}
\ifx\symtextcomp\relax
\else
  \DeclareTextSymbolDefault{\textsection}{TS1}
  \DeclareTextSymbolDefault{\textparagraph}{TS1}
%    \end{macrocode}
%
%    \begin{macrocode}
  \DeclareTextSymbol{\textsection}{TS1}{'247}
  \DeclareTextSymbol{\textparagraph}{TS1}{'266}
\fi
%    \end{macrocode}
%
%
% \subsection{Subscript correction}
%
% We provide a definition for |_| as active character. This definition
% in itself is not changing \LaTeX's behaviour as by default |_| has
% catcode 8, i.e., subscript character. Only if we change this catcode
% or if we change the |\mathcode| of |_| \TeX{} is going to look at it.
%    \begin{macrocode}
\begingroup
 \catcode`\_=13
 \gdef_#1{\sb{\test@sb#1}}
\endgroup
%    \end{macrocode}
%
% The |\test@sb| gets passed the argument of a subscript and tests with
% |\@ifnextchar| if the first non-space token  is a \texttt{p}.
% If not it will look at |\@let@token| (set by |\@ifnextchar|) to see
% if it is perhaps \texttt{j} or \texttt{f}. In each case it will add
% a negative kern.
%
% Note that this test will fail if an old \LaTeX{} is used as the old
% definition of |\@ifnextchar| does not use |\@let@token| but
% |\@tempa|.
% However, the worst that would happen is that the kern is not
% inserted. I tried to trap this by requesting a \LaTeX{} not older
% than 1995/01/01.
%    \begin{macrocode}
\def\test@sb{%
  \@ifnextchar p%
    {\mkern\m@ne mu}%
    {\ifx\@let@token j%
       \mkern-\tw@ mu%
     \else
       \ifx\@let@token f%
         \mkern-\tw@ mu%
       \fi
     \fi}}
%    \end{macrocode}
%
% Finally we set the |\mathcode| of |_| to ``active''. However, as long
% as its |\catcode| is not changed this |\mathcode| is never looked at,
% in other words we can now turn the feature on and off by changing the
% |\catcode| to |12| (that is done in the option section above).
%    \begin{macrocode}
\mathcode`\_=\string"8000
%    \end{macrocode}
%
%
%
%    \begin{macrocode}
%</mathtime>
%    \end{macrocode}
%
%
%
%
% \section{Math Pi}
%
% This package consist only of options declaring math alphabets:
%    \begin{macrocode}
%<*mathpi>
\DeclareOption{mathfrak}{%
  \DeclareMathAlphabet\mathfrak{U}{mh2}{m}{n}}
%    \end{macrocode}
%
%    \begin{macrocode}
\DeclareOption{mathcal}{%
  \DeclareMathAlphabet\mathcal{U}{mh2scr}{m}{n}}
\DeclareOption{mathscr}{%
  \DeclareMathAlphabet\mathscr{U}{mh2scr}{m}{n}}
%    \end{macrocode}
%
%    \begin{macrocode}
\DeclareOption{mathbb}{%
  \DeclareMathAlphabet\mathbb{U}{mh6}{m}{n}}
%    \end{macrocode}
%
%    \begin{macrocode}
\ProcessOptions
%    \end{macrocode}
%
%    \begin{macrocode}
%</mathpi>
%    \end{macrocode}
%
% \subsection{Unused Declarations}
% The following declarations may be extracted from this source
% file, but they are not used in the \textsf{mathpi} package
% as equivalent code is called in the options section.
%    \begin{macrocode}
%<*mpifrak>
\DeclareMathAlphabet\mathfrak{U}{mh2}{m}{n}
%</mpifrak>
%
%<*mpiscr>
\DeclareMathAlphabet\mathscr{U}{mh2scr}{m}{n}
%</mpiscr>
%
%<*mpibb>
\DeclareMathAlphabet\mathbb{U}{mh6}{m}{n}
%</mpibb>
%    \end{macrocode}
%
% \Finale
%