A package for using the MathTıme and MathTımeplus fonts^{∗}

Drahoslav Lím

drahoslav.lim@isi.ee.ethz.ch

1997/01/30

Abstract

mt11p is a package to relatively painlessly get access to everything available in the MathTıme and MathTımeplus commercial math fonts in L^{A}TEX 2ε. It is compatible with the AMS packages. This package is selfcontained and only the Type 1 font programs need to be copied off of the distribution media.

Contents

1 Introduction 1

2 Installation 1 2.1 Previewing . . . . . . . . 2

3 Usage & Package Options 3 3.1 List of options . . . . . . 3 3.2 Interaction with

AMS macros and other math packages . . . . . . 5

3.3 Math Accents . . . . . . . 6 3.4 Script and calligraphy

math fonts . . . . . . . . . 6 3.5 The symbols †, ‡, §, and ¶ 7 3.6 “New” symbols . . . . . . 8 3.7 Avoiding the use of

bitmap fonts . . . . . . . 8 3.8 Subscript spacing . . . . . 8 3.9 Upright Greek lower case

letters . . . . . . . . . . . 9 3.10 Oldstyle Digits . . . . . . 9 3.11 Mixing math versions . . 9 3.12 Local Configuration … 10 4 Bugs 10

5 Acknowledgment & Misc. 10

6 Implementation 11 6.1 Option Declarations … 11 6.2 Text Encoding . . . . . . 13 6.3 Text font setup . . . . . . 13 6.4 Font Sizing . . . . . . . . 14 6.5 Fetch the MathTıme and

MathTımeplus fonts… 14 6.6 Math declarations …. 16 6.7 Bold & heavy font substi-

tutions . . . . . . . . . . . 19 6.8 Mathcodes . . . . . . . . . 20 6.9 Auxiliary macro . . . . . 34 6.10 Assorted Fixes, Odds &

Ends . . . . . . . . . . . . 34

6.11 \boldsymbol  and
    \heavysymbol . . . . . . . 37

6.12 Examples of new math

symbol definitions …. 38 6.13 Unused glyphs . . . . . . 41 6.14 muskip Assignments … 41 6.15 Local Configuration File . 41 6.16 Cleanup . . . . . . . . . . 42

∗This file has version number 0.4, last revised 1997/01/27. This file has no connection with the mathtime package commisioned by Y&Y.

1 Introduction

The use of Computer Modern fonts for equations has been one of the tell-tale signs indicating a document was typeset by TEX. The reasons for this are that there are no good freely available substitute fonts, and that even if there were, changing TEX’s math fonts is a tedious and somewhat cryptic exercise. The first problem can be overcome by purchasing math fonts such as MathTıme or Lucida. This package is one of the ways overcoming the second, though not the only one. It provides everything except the fonts themselves. (You have shell out money and buy those, sorry).

It is assumed you are running TEX 3.x and a recent release of L^{A}TEX, and that you have the standard ‘resident’ PostScript fonts installed for use as text fonts in TEX (“PSNFSS”).

2 Installation

This package is useless unless you buy the fonts called MathTıme and MathTımePLUS from Y&Y; the address is listed in Sec. 5.

Prerequisites The “8r-based” version of PSNFSS must be installed on your system to use this package, because the VFs refer to the 8r “raw” fonts. Search on CTAN for the string “psnfss”, consult the L^{A}TEX Companion, and/or the L^{A}TEX 2ε distribution on how to do this. You can check if your system already has the relevant files by searching for the TEX metric file “ptmr8r.tfm” in the tfm file area, and for the file “T1ptm.fd” (or maybe “t1ptm.fd”) in the TEX input file area; if both are present you are probably ok and everything will work.

This dtx file should have come with several sets of accompanying files, whose installation should be routine:

Run TEX on mt11p.ins; that will generate the package “style” file, mt11p.sty. Copy that file to the TEX input file area. Run L^{A}TEX on mt11p.drv to get commented source code (that’s what you’re reading now).

The .tfm metric files should be copied to the area where TEX and the dvi driver program search for font metrics. The .vf definition files should be copied to the area where the dvi driver program searches for virtual font definitions. Note that the metric files supplied are not identical to the ones distributed with the MathTıme fonts.

The file mt11p.map should be “passed” to the dvi driver program to tell it that the MathTıme fonts are downloadable PostScript fonts and what the relevant invocation commands are, or perhaps the file should be passed to a Post-Script rasterizer (“PS–to–PK”) program if the dvi driver must use PK bitmaps. For Rokicki’s dvips driver, the contents of mt11p.map can be appended to the

“psfonts.map” file.

Copy the Type 1 font “programs”—files with extension pfa or pfb—from Y&Y’s distribution media to the area where your dvi driver or rasterizer searches for downloadable fonts. Some fonts may be provided in both pfa and pfb formats; just pick one, most systems can deal with either. (The pfb format is more compact, albeit binary. dvips will convert .pfb to .pfa “on the fly”.) There are two versions of the normal weight symbol font, mtsy and mtsyn. The difference is minor, but you might as well use the newer mtsyn. See the paragraph called “Symbols” in the documented source code.^{1}

The names and types (pfa/pfb) of the downloadable files in mt11p.map should be made consistent with the actual names and types under which the Type 1 font programs are stored on your system. Either rename and/or convert the Type 1 fonts, or simply edit the contents of mt11p.map; beware of case sensitivity.

The dvi driver program will probably not need the afm files from the distribution medea, but a “PS–to–PK” rasterizer might; consult the rasterizer documentation. Note that afm files are ascii files, convert line endings as appropriate.

At least for this package, no other files from the distribution medea are required.

2.1 Previewing

Whether or not you can preview dvi files which use MathTıme fonts depends on your setup. If you can preview dvi files containing other PostScript fonts, chances are you can preview with MathTıme as well, perhaps after running some utility to generate bitmaps, resolve VF references, etc. Otherwise, it is possible to view the final PostScript output of the dvi driver on practically all platforms using viewers based on the GhostScript rasterizer, or perhaps using DisplayPostScript.

3 Usage & Package Options

To switch to Times text and math, it should suffice to say \usepackage{mt11p} in the preamble. The oder of packages should not matter, with one exception: mt11p should be loaded after AMS math packages. Any reasonably cleanly written L^{A}TEX input file will then be typeset with MathTıme being used for all standard mathematical symbols that would have otherwise been typeset in Computer Modern. There are two notable exceptions, see Sec. 3.2.

Expect a few dozen lines of warnings as this package is being read, and a notice about substituted fonts at the end of the run. I think it is better to live with these NFSS warnings rather than do some hacks to turn them off.

At the end of the run expect a warning about size substitutions if the resize option was in effect (it is by default). They are are due to the Computer Modern fonts usually having a set of sizes available rather than being declared scalable in the .fd file, i.e., a \DeclareFontShape argument of something like <10><10.95><12><14.4> rather than <->. Whether or not something should be done about this depends on what Computer Modern glyphs were used. It may be the case that, in fact, none were—the warnings come from NFSS having loaded fonts for. e.g., \oldstylenums for math, eventhough you never actually used them. You can change the .fd files if you system is capable of generating bitmaps on-the-fly or if you’re using PostScript versions of the Computer Modern fonts. Consult the L^{A}TEX Companion or the standard documentation file fntguide.tex.

1Run L^{A}TEX on the file mt11p.drv to get the commented source code; it follows after Sec. 5.

3.1 List of options

This packages has lots of options controlling some detailed aspects of font and math character handling. In general, use the defaults, unless you have some idea of what the implications of a particular option are.

Options in effect by default are indicated by a double dagger (‡).

‡T1 reset the \encodingdefault (applicable to text fonts and some math operators, symbols and accents) to T1.

OT1 reset the \encodingdefault to the archaic OT1 encoding; upper case Greek letters are never taken from the text font, so the only reasons to do this are human inertia and legacy code.

noenc assume the current \encodingdefault is the desired one; see the commented source code if you use something other than T1 or OT1.

‡opsafe use symbols and accents from the operators math family only when it is safe to do so.

opnone do not use the operators math family for accents or symbols, except when this can’t be helped; if \encodingdefault is not recognized, this option is auto-invoked.

opmax take as much from the operators math family as possible. Doing so can produce problematic output in some circumstances, but it will make the maximum use of printer resident fonts; don’t use this option unless you know why you are doing so. See the paragraph “Symbols from either operators or from elsewhere” in the documented source code.

‡opaccents take math accents from the operators math family, and make them follow math alphabet changes where possible; see Sec. 3.3.

symaccents take math accents from the a fixed (within a math version) font; if \encodingdefault is not recognized, this option is auto-invoked; see Sec. 3.3.

‡mtcal make the MathTıme script font the math alphabet \mathcal and make \mathscr and synonym of \mathcal; see Sec. 3.4.

cmcal make the MathTıme script font the math alphabet \mathscr and the Computer Modern symbol font the \mathcal alphabet; see Sec. 3.4.

nomtms use the Computer Modern symbol font as the \mathcal alphabet and do not load the MathTıme script font at all; see Sec. 3.4.

‡dohbar overwrite any existing definition of the \hbar (h̄) symbol with one synthesized from an “h” and a bar accent. The definition here is actually rather decent, unlike the simple one usually used. (At least try it before resorting to the glyph in the AMS fonts…) nohbar do nothing with the \hbar definition, retain the existing one (if any); e.g.,

the AMS fonts have \hbar as a single Computer Modern-like glyph.

‡subs the bold and heavy math versions in principle need some ‘ultra’ and ‘poster’ weight fonts; usually no such fonts are available, so define substitutes.

nosubs assume suitable fonts are available and will be loaded, e.g., using a configuration file mt11p.cfg; do not declare any font substitutions. If should be apparent from the commented source code or from mt11p.sty what family/series/shape NFSS declaration the extra fonts should get. Search for the string “SUBS” in the .dtx or .sty file.

‡do8r use the raw 8r fonts for the four symbols §, ¶, †, ‡. The math italic fonts use the italic 8r raw fonts, so it’s not unreasonable to assume the upright ones are also available; no support for using the 8r encoding need be installed on the system, though we make use of it if it is. 8r is not used for anything other than these four symbols; see Sec. 3.5.

no8r do not use the raw fonts, and take the four symbols §, ¶, †, ‡ from a Computer Modern font; see Sec. 3.5.

nodag don’t touch the definitions of §, ¶, †, ‡ at all; assume suitable definitions have been or will be supplied. See Sec. 3.5.

‡bsy load the AMS packages needed to define the \boldsymbol macro, and define

analogous \heavysymbol and \normalsymbols macros.

nobsy don’t load the AMS packages for \boldsymbol and define \boldsymbol and \heavysymbol to produce messages and behave as no-ops.

‡mathgr get upright Greek letters as the math alphabet \mathgr; see Sec. 3.9.

nomathgr do not load the math alphabet \mathgr; this is only useful if you are running out of math families, in which case you can use \greekshape in an \hbox with the obvious limitations. See ec. 3.9.

‡mathOS get oldstyle digits as a math alphabet; Computer Modern oldstyle digits are always available in text.

nomathOS do not load Computer Modern oldstyle digits as a math alphabet. See the

nomathgr option.

‡resize change the subscript and text font sizing to better account for the fact that we are using linearly (not optically) scaled fonts.

noresize don’t touch the math subscript and text font sizing.

‡activesb to improve the spacing in certain subscript situations, the subscript character “_” (an underscore) is made active; this might break some macros; see Sec. 3.8 noactivesb don’t do anything with the underscore.

‡times assume the package (style file) which changes the roman, sans and typewriter text families to “Times & Helvetica & Courier” is called “times.sty”; this package is loaded via \RequirePackage.

* any other option will be interpreted as the name of the style file to use instead of times; e.g., the option “btdutch” will attempt to ‘require’ the btdutch package instead of the times package.

3.2 Interaction with AMS macros and other math packages

This package does nothing terribly anti-social and can co-exist with AMS packages, e.g., amsmath, amsfonts, etc., provided those packages are read before (i.e., prior to) reading this package. Some types of macros are hardwired to Computer Modern fonts, e.g., the “AMS” logo and would have to be redefined. The fonts msam and msbm will, or course, still be used for the more uncommon math symbols. See below about math accents.

The default TEX math setup treats upper case Greek letters as mathematical “letters” and lower case Greek letters as mathematical “symbols”. Hence \mathbf{\Gamma\gamma} produces a bold upper case Γ, but does not affect the lower case γ; similarly for \mathit. This package uses the same conventions as the AMS macros: names like “\varGamma” are used for italic upper case Greek (Γ ), and math version switching is needed (\boldsymbol) to get bold Greek. The ‘legacy’ input code \mathbf{\Delta}\mathit{\Gamma} (“ΔΓ ”) does not work with the AMS L^{A}TEX macros nor with this package. See Sec. 3.3 about accents in math.

It is likely that other math font related packages can co-exist with mt11p, particularly if they merely add a math alphabet or symbol font, e.g., mathbbol, stmaryrd or wasysym. The chances of running out of math symbol font families are slim unless you also load the oldlfont package. Note that the AMS symbol packages need two math families. Of course it makes no sense to use mt11p together with another complete math setup package like euler.

One package that will clash with mt11p is yhmath. If you load that package after mt11p, all largesymbols in all math versions will be taken from the fixed size font yhcmex10; loading yhmath before mt11p will break yhmath’s wide math accents. If you only need the extra-wide accents, change all instances of the word “largesymbols” in the file yhmath.sty to something else, e.g., YHlargesymbols, and input that altered file. If you want the extra delimiter sizes, you’re on your own, but see the paragraph “Declaring additional math delimiters” towards the end of the commented source code.

3.3 Math Accents

MathTıme provides an additional accent called \widebar or \overbar. It’s about 1em long. If the AMS macros \Hat, etc., are defined, we also define the

similar \Overbar and \Widebar.

The Computer Modern layout causes some encoding-related problems with math accents and math alphabets. NFSS has hooks to fix the problems, but does not actually do it; the AMS package amsmath does fix them by redefining most math accents.

mt11 incorporates fixes similar to the AMS ones, and overwrites any existing math accent definitions (it pretty much has to), so that any combination of math alphabets and accents (and accents options: opaccents or symaccents) will output the expected glyphs. Some curious combinations will, however, lead to odd-looking accent positioning. In a contsruct such as \mathit{\hat{x}} the accent positioning will always be “wrong”, because the accent is a text accent— the (text) italic font implied by \mathit doesn’t have the appropriate font metrics. because it’s assumed that \mathit will be used when a group of letters (a ‘word’) is to be treated as a math symbol, e.g., x_{initial} or ˆfinal. However, “x” is a mathematical symbol by itself. If you want an italic hat on the symbol x you have to say \mathit{\hat{\mathnormal{x}} (assuming it’s a big deal to have an italic \hat…). Even then the spacing will not be optimal and will usually require some fiddling with the \skew macro.

3.4 Script and calligraphy math fonts

This package makes the distinction between two “calligraphy” math alphabets: calligraphy and script. This is necessitated by the fact that the Computer Modern fonts only have upper case “calligraphy” letters, and that you perhaps may not like the MathTıme mtms* fonts or that you may want to use letters from both fonts.

Irrespective of the options in use, the two math alphabet commands \mathcal and \mathscr will be defined. (The old “\mit” is not defined.)

The default (mtcal) is to make both alphabets refer to a mtms* font. The variant forms of some letters are available with the commands \varA, \varE, \varG,

\varvarG, \varI, \varL, \varQ, \varS, \varr, \varz, \iscript and \jscript.

(\i and \j are invalid in math mode and \imath and \jmath cannot be redefined.) Both upper and lower case letters will work in \mathcal.

Another possibility, cmcal, is to have both Computer Modern and MathTıme fonts available; \mathscr will be the latter, and \mathcal the former. \mathcal will then not have lower case letters.

A third setting, nomtms, avoids using the MathTıme mtms* fonts entirely. \mathcal is then the Computer Modern symbols font, and \mathscr gives a warning before calling \mathcal.

A certain amount of “reasonableness” is assumed with respect to the usage of “calligraphic” alphabets. The mtcal option does not give any warning about the fact that \mathcal and \mathscr are identical. With the cmcal or nomtms options in effect you will get warnings if you try to use a \varX letter in \mathcal, but \mathcal will never try to check its argument to verify that it consists of upper case letters only, even when no font with “calligraphy” lower case letters is available. Consider using \mathcal when the argument is known to contain nothing but upper case letters and use \mathscr when using lower case letters as well; that way you will at least get a warning pertaining to script math alphabets if the options are set to avoid the use of mtms* or if the document is reset without MathTıme fonts.

The MathTıme manuals describe a \script macro; mt11p defines an equivalent macro. Note that \script should only be followed by white space, an optional “*”, and then a single letter, with no space between the asterisk and the

letter, e.g., \script␣*AB is equivalent to \mathscr{\varA}B, not \mathscr{AB},

and \script*␣AB is an error.

3.5 The symbols †, ‡, §, and ¶

The standard L^{A}TEX setup takes these symbols, in both text and math from the Computer Modern symbols font. The MathTıme symbols font does not have these glyphs, so something must be done to have them available for footnote markers, etc.

There is a fairly standard PostScript text symbol font setup, which uses the TS1 encoding, but it seems to not (yet) be in general use.

This package offers three relevant options. The option nodag does absolutly nothing with the four symbols, but this can only be used if they’ve already been or are about to be redefined, because the default definitions assume the use of Computer Modern fonts and will produce incorrect glyphs after switching to MathTıme.

The default option do8r takes these four symbols (and only these four symbols) from the “raw” 8r encoded fonts, upon which the virtual T1 and OT1 PostScript fonts are built. If .fd files or an 8r.sty are available, we use them; if they’re not, we supply just enough code to be able to use the symbols in NFSS. It is not unreasonable to do so, because the 8r metric file ptmri8r.tfm must be on the system (the mtmi.vf virtual font uses it), so the upright font ptmr8r.tfm is probably available too. Note that 8r is an “unsupported” encoding.

The option no8r overwrites any existing definition and forces the use of Computer Modern for these four symbols (without affecting anything else) and avoids the direct use of 8r raw fonts.

3.6 “New” symbols

MathTıme has a few mathematical symbols that aren’t available in Computer Modern. Here is the list, with alternate names in parentheses: \overbar (\widebar),

\openclubsuit, \shadedclubsuit, \openspadesuit, \shadedspadesuit, \triangleleft,
\triangleright, \cupprod, \capprod, \varcirc (\comp).

3.7 Avoiding the use of bitmap fonts

Often the point of buying the MahtTıme fonts is not just to get something other than Computer Modern math, but also to avoid the use of bitmap (Type 3) fonts and use scalable (Type 1) fonts nstead. The default option are set so that this condition is satisfied, as long as you don’t use glyphs that are not available in either the resident fonts nor in MathTıme, i.e., oldstyle digits, or you force the use of Computer Modern or other MetaFont fonts in some situations (the cmcal, nomtms, or no8r options, AMS packages, etc.) and you do not have substitute outline fonts. See the MathTıme licence agreement about “exporting” files containing outline fonts.

3.8 Subscript spacing

The sidebearings of math italic letters with descenders are such that a spacing adjustment is required in certain contexts, in particular in the very common case of j subscripts. The MathTıme distribution suggests using an active subscript character, which checks if the first thing in a subscript is one of the letters f, j or p, and inserts a small negative kern if is it. The macro \jadjust can be used if the correction needs to be done by hand; see Appendix B.2 of the MathTıme Reference Manual.

Changing category codes is akin to Russian roulette: we can try to make the magazine larger, but it will still hold a bullet somewhere. It is unreasonable to assume that other people’s packages will take steps to work even when the underscore is a macro. underscores can crop up in font names or reference labels, for example.

The macro we use is slightly different from the original one in the MathTıme distribution. The \catcode of the underscore ends up being 12, i.e., “other” rather than 13 (“active”), which is much more forgiving. We rely on the fact that the underscore’s \mathcode is "8000 to get subscripts in math mode. This seems to be ok when used in most contexts. In text mode this will produce whatever the current font has in slot `\_, but you shouldn’t be using a ‘naked’ underscore in text anyway…

Nothing is done with the underscore unless its \catcode is “subscript” (8), and its \mathcode is "8000; if both conditions are not fulfilled, someone has presumably already fiddled with the underscore, so we don’t touch it.

The option noactivesb keeps the underscore as it was, in order to quickly ascertain whether the active underscore is braking some macros. Reports of such cases are welcome.

3.9 Upright Greek lower case letters

MathTıme contains an upright Greek letters (text) which are used in some disciplines to designate units or particles. Such letters are normally not used as math symbols. We provide three relevant commands: \greekshape, which is a font switch like \itshape), \textgr, which takes an argument similarly to \textit, and the math alphabet command \mathgr.

Alternate forms of some letters can be obtained as ligatures—see Section 8 of the MathTımeplus reference manual. However, in math (\mathgr) it is not possible to use the ligatures with the asterisk character (*) suggested in the manual, because the asterisk will not be interpreted as a character from the same font as the Greek letters. The TFM metric files accompanying this package contain extra ligatures which produce the variants: in lieu of O* or o*, write vO or vo, respectively; in place of e* write vev.

This package does not define any \gr font switch. \greekshape performs the same function in text; use the \mathgr form in math.

MathTımeplus comes with two “hybrid” fonts, mtmub and mtmuh, which are math letters fonts with upright (instead of sloping) lower case Greek letters. The two fonts contain both upright and italic upper case Greek letter. For reasons listed in the reference manual, there is no font mtmu. This package comes with a mtmu font, created as a VF using mtmi and mtgu, in case you decide to use such a font after all.

See the commented source about declaring upright Greek letters as math symbols and about using mtgu.

3.10 Oldstyle Digits

None of the “standard 35” PostScript fonts has oldstyle digits (1234567890) and neither do any of the MathTıme fonts. The standard TEX math letters font has such digits, and some packages make use of the glyphs. mt11p defines an \oldstylenums macro which is essentially equivalent to the one provided in L^{A}TEX, but note that the Computer Modern oldstyle digits don’t go well with Times text fonts. A mt11p.cfg file or a subsequent package could redefine the macro to use a more suitable font.

3.11 Mixing math versions

Like both the standard TEX math setup and the AMS math setup, we assume that it will be relatively rare to require bold (unbold) symbols^{2} in a formula set in the unbold (bold) math version. We load the AMS amsbsy package which defines a \boldsymbol macro, that sets its argument using the bold math version, and define corresponding corresponding \heavysymbol and \normalsymbol macros.

However, it’s awkward to use the \boldsymbol, etc., macros in situations where alignment is critical (accents) or for large delimiters. For those cases one could declare additional symbol fonts and define things like \boldalpha, \boldhat or \Lheavybrace, and then an input text like

\[\left\Lheavybrace 2\boldalpha ⟨some big formula⟩ \right\Rheavybrace\]

would do what would otherwise take unreadable input code (\vphantom constructs) to produce. This requires some knowledge of the details of TEX’s math workings, but nothing too esoteric. For a simple example the commented source code. Such a setup could be placed in mt11p.cfg. Consult also the standard L^{A}TEX documentation file fntguide.tex. Note that the AMS macros do not provide such a setup, because it’s somewhat rare to actually need it, but it can be done.

3.12 Local Configuration

After setting everything up but before ‘undefining’ internal auxiliary macros and flags, and before changing the subscript sizing this package inputs the file mt11p.cfg, if it can find one. Further definitions (bold or upright Greek letters as symbols, etc.) could be placed in such a file.

4 Bugs

Any reports about bugs, suspected bugs or package clashes are welcome provided you also send just enough TEX code to reproduce the bug and your TEX .log file— use the e-mail address given on the title page of this document and at various places in the files. Report of usage are also welcome;-).

2The arguments of \mathbf are not considered ‘symbols’. The input text \mathbf{a} produces a bold upright “a” not the bold math symbol “a”.

5 Acknowledgment & Misc.

This section has been put here, in case you don’t print out the commented source code.

Thanks to the authors and maintainers of L^{A}TEX, and particularly to the authors of NFSS.

Portions of this package were stolen from the mathtimy package by Aloysius Helminck, and from the TEX files provided with the MathTıme distribution.

The “operative” part of this package was written before the release of the mathtime package by Y&Y.

MathTıme is a trademark of Publish or Perish, Inc.

A bunch of other names are trademarks or registered trademarks, as everybody knows…

The contact address for Y&Y is

Y&Y, Inc.

45 Walden Street Concord, MA 01742 USA tel.: (508) 371–3286

     http://www.yandy.com

This software is provided “as-is”, with no warranty of any kind; the user assumes all responsibility for its use.

The author has no association with Y&Y, Inc., other than having purchased the MathTıme fonts. (Actually, I got them as a present. Thank you, YouKnowWho.)

6 Implementation

We start by the usual identifications. We need a few commands not present in early versions of NFSS 2, so check for the date.

 1 \NeedsTeXFormat{LaTeX2e}[1994/12/01]
 2 \ProvidesPackage{mt11p}%
 3  [\filedate: setup\space for\space Times\space
 4  +\space MathTime\space +\space MathTimePlus]

Before we do anything real, check the catcodes of a few characters in case some fanatic changed them already. These are the characters I’ve seen activated in various packages.

We hope the the single left quote wasn’t…

 5 \chardef\mt@quotedbl   \catcode`\"
 6 \chardef\mt@quotesinglr\catcode`\'
 7 \chardef\mt@colon      \catcode`\:
 8 \chardef\mt@question   \catcode`\?
 9 \chardef\mt@semicolon  \catcode`\;
10 \chardef\mt@exclam     \catcode`\!
11 \@makeother\"
12 \@makeother\'
13 \@makeother\:

14 \@makeother\?
15 \@makeother\;
16 \@makeother\!

6.1 Option Declarations

We will need the option setting in conditionals at various points, so use integers (\chardefs) as flags.

There are three options relevant to text font encodings: either make the default T1, or make the default OT1, or don’t touch \encodingdefault. The upright “roman” (\rmdefault) is used for the operators math family, so the choice of text encoding has implications for math. This package can handle (in as much as it needs to) with any of the following: T1, OT1 or a superset thereof, 8r and 8a. See the commented source code if you need more information, Sec. 6.8.

17 \DeclareOption{T1}{\def\mt@enc{\def\encodingdefault{T1}}}
18 \DeclareOption{OT1}{\def\mt@enc{\def\encodingdefault{OT1}}}
19 \DeclareOption{noenc}{\let\mt@enc\relax}

Next the options for dealing with what math symbols to take from the operator family. Either take everything from elsewhere, or take ‘safe’ things from operators, or take as much as possible from operators, which could be dangerous in some circumstances; see Sec. 6.8.

20 \DeclareOption{opnone}{\chardef\mt@ops0␣}
21 \DeclareOption{opsafe}{\chardef\mt@ops1␣}
22 \DeclareOption{opmax}{\chardef\mt@ops2␣}

Accents can either come from operators and follow math alphabets (usual case), or be always taken from symbols.

23 \DeclareOption{opaccents}{\chardef\mt@accs0␣}
24 \DeclareOption{symaccents}{\chardef\mt@accs1␣}

We need options to control the handling of script/calligraphy fonts.

25 \DeclareOption{mtcal}{\chardef\mt@cal0␣}
26 \DeclareOption{cmcal}{\chardef\mt@cal1␣}
27 \DeclareOption{nomtms}{\chardef\mt@cal2␣}

In order to cooperate with AMS macros, we provide a switch to not define \hbar, i.e., retain the present definition (if any). You may want to use this to keep \hbar pointing to the glyph in the msbm fonts, rather than use the faked one we define here, though then you’ll have a Computer Modern “h” which looks too light among Times, and the one provided herein isn’t too shabby…

28 \DeclareOption{dohbar}{\chardef\mt@hbar1␣}
29 \DeclareOption{nohbar}{\chardef\mt@hbar0␣}

The bold and heavy math versions will probably need some font substitutions, but if you have the additional fonts, you can skip the substitutions contained herein.

30 \DeclareOption{subs}{\chardef\mt@sub1␣}
31 \DeclareOption{nosubs}{\chardef\mt@sub0␣}

For historical reasons the \dag, \ddag, \S and \P symbols have to be dealt with. The mtmi virtual fonts use ptmi8r raw fonts, so at least the TFM files should be available, and we include just enough code to use them for these four symbols. Provide an option to explicitly avoid using 8r for these symbols; in that case we’ll have to use OMS. A subsequent package could redefine them to use the TS1 encoding or something. Also provide an option that does nothing at all with any of the relevant definitions.

32 \DeclareOption{no8r}{\chardef\mt@eightR0␣}
33 \DeclareOption{do8r}{\chardef\mt@eightR1␣}
34 \DeclareOption{nodag}{\chardef\mt@eightR2␣}

It may be convenient to get the \boldsymbol macro from the AMS style files.

35 \DeclareOption{nobsy}{\chardef\mt@bsy0␣}
36 \DeclareOption{bsy}{\chardef\mt@bsy1␣}

Before exiting this package should reset the subscript sizing, because we’re using linearly scaled fonts. Provide an option to switch that off.

37 \DeclareOption{resize}{\def\mt@exit{\MathTimeSizes}}
38 \DeclareOption{noresize}{\let\mt@exit\relax}

This is mainly to test if the active underscore is causing any problems.

39 \DeclareOption{activesb}{\chardef\mt@sb1␣}
40 \DeclareOption{noactivesb}{\chardef\mt@sb0␣}

Now a few options to save math families. The default leaves room for four, which may be too little if you also load AMS, etc.

41 \DeclareOption{nomathgr}{\chardef\mt@mgr0␣}
42 \DeclareOption{mathgr}{\chardef\mt@mgr1␣}
43 \DeclareOption{nomathOS}{\chardef\mt@osdg0␣}
44 \DeclareOption{mathOS}{\chardef\mt@osdg1␣}

The package to get “Times/Helvetica/Courier” might have some wiered name:

45 \DeclareOption{times}{\def\times@style{times}}
46 \DeclareOption*{\edef\times@style{\CurrentOption}}

The defaults are

• T1 encoding;

• assume the text font package is called times.sty;

• use operators for safe glyphs and accents;

• use mtms as the \mathcal font;

• declare substitutions for the bold and heavy math versions;

• overwrite any existing definition of \hbar;

• use 8r for \dag, etc.;

• fetch the \boldsymbol AMS macro;

• get upright Greek and oldstyle digits;

• switch to different subscript sizing; and

• use the active underscore character.

Then read the option list.

47 \ExecuteOptions{T1,times,opsafe,opaccents,mtcal,%
48  dohbar,subs,do8r,bsy,resize,mathgr,mathOS,activesb}
49 \ProcessOptions*

6.2 Text Encoding

We have to know that the text \encodingdefault is, because accents in math mode may get taken from the operators font. We make \encodingdefault either T1 (default, and preferred), or OT1, or do nothing with \encodingdefault.

50 \mt@enc

6.3 Text font setup

Here we fetch “Times + Helvetica + Courier” using the times package, or whatever we were told to use, or just do it by hand. On exit \rmdefault, \sfdefault and \ttdefault should be ok.

51 \IfFileExists{\times@style.sty}%
52  {\RequirePackage{\times@style}}%
53  {\PackageWarning{mt11p}{No file `\times@style.sty' found.%
54  \MessageBreak
55  Guessing what the text
56  font familes \MessageBreak
57  are called}
58  \renewcommand{\sfdefault}{phv}
59  \renewcommand{\rmdefault}{ptm}
60  \renewcommand{\ttdefault}{pcr}
61  \renewcommand{\bfdefault}{b}}

6.4 Font Sizing

The documentation accompanying MathTıme suggests different subscript sizing. We do it the same way the mathtimy package does it, by redefining things like \@ixpt to actually be something other than what the name implies. Then we reset all math sizes, from \tiny to \Huge. This is the sizing used in mathtimy, which appeares to be taken from the files in the MathTıme distribution. This macro gets called just before we exit. Switching between MathTıme sizing and the default Computer Modern sizing on the fly makes little sense, so we don’t try to preserve the original settings. The standard sizes are, in sequence, 5, 6, 7, 8, 9, 10, 10.95, 12, 14.4, 17.28, 20.74 and 24.88 points, i.e., we decrease the ‘spread’ somewhat.

62 \def\MathTimeSizes{%
63 \def\@vpt{6.0}%
64 \def\@vipt{6.8}%
65 \def\@viipt{7.6}%
66 \def\@viiipt{8.4}%
67 \def\@ixpt{9.2}%
68 \def\@xpt{10.0}%
69 \def\@xipt{10.8}%
70 \def\@xiipt{11.6}%
71 \def\@xivpt{13.2}%
72 \def\@xviipt{15.6}%
73 \def\@xxpt{18.0}%
74 \def\@xxvpt{22.0}%
75 \DeclareMathSizes\@vpt   \@vpt   \@vpt   \@vpt
76 \DeclareMathSizes\@vipt  \@vipt  \@vpt   \@vpt
77 \DeclareMathSizes\@viipt \@viipt \@vpt   \@vpt
78 \DeclareMathSizes\@viiipt\@viiipt\@vipt  \@vpt

79 \DeclareMathSizes\@ixpt  \@ixpt  \@vipt  \@vpt
80 \DeclareMathSizes\@xpt   \@xpt   \@viipt \@vpt
81 \DeclareMathSizes\@xipt  \@xipt  \@viipt \@vpt
82 \DeclareMathSizes\@xiipt \@xiipt \@viiipt\@vipt
83 \DeclareMathSizes\@xivpt \@xivpt \@xpt   \@viipt
84 \DeclareMathSizes\@xviipt\@xviipt\@xiipt \@xpt
85 \DeclareMathSizes\@xxpt  \@xxpt  \@xivpt \@xiipt
86 \DeclareMathSizes\@xxvpt \@xxvpt \@xxpt  \@xviipt
87 \PackageInfo{mt11p}{Adjusting math subscript sizing}}

6.5 Fetch the MathTıme and MathTımeplus fonts.

We don’t create .fd files, since the fonts are not for general use. We declare them as separate encodings, called Lmt*, because they differ quite a bit from the OM* encodings, which might lead to trouble if, e.g., someone assumed the letters font has oldstyle digits or that the symbols font has calligraphic letters.

There will be a heavy series for some fonts, which we denote by the macro \hvdefault, and an upright italic shape, \uidefault. For the bold and heavy math versions we would need additional bold, ultra (\uldefault) and poster (\psdefault) weight fonts; pretend they exist, and then define substitutes. For the off chance that these are already defined, we “provide” them, rather than define them. Only the macros are used in the rest of this file, i.e., “{ui}” never appears again, so no font designations are hardwired into this file (except those for common Computer Modern fonts).

88 \providecommand{\hvdefault}{h}
89 \providecommand{\uidefault}{ui}
90 \providecommand{\uldefault}{u}
91 \providecommand{\psdefault}{p}

Letters Declare the letters fonts. Include \noaccents@ so math accents don’t

break in \mathnormal.
92 \DeclareFontEncoding{LmtL}{}{\noaccents@}
93 \DeclareFontFamily{LmtL}{mtl}{\skewchar\font=45␣}
94 \DeclareFontShape{LmtL}{mtl}{\mddefault}{\itdefault}{<->mtmi}{}
95 \DeclareFontShape{LmtL}{mtl}{\bfdefault}{\itdefault}{<->mtmib}{}
96 \DeclareFontShape{LmtL}{mtl}{\hvdefault}{\itdefault}{<->mtmih}{}% see dtx SUBS

Note that the font mtmih is a virtual font that uses ptmbi8r, so even if you have a “heavy” weight Times italic font, you can’t use it as a math letters font unless you know how to create a suitable raw font and change mtmih.vf and mtmih.vf. The same applies to mtmuh.

Declare the letters font with upright lower case Greek letters too; we won’t do anything with them, but we will describe how to set them up, if someone wants to use them as symbols (Sec. 6.12).

97 \DeclareFontShape{LmtL}{mtl}{\mddefault}{\uidefault}{<->mtmu}{}
98 \DeclareFontShape{LmtL}{mtl}{\bfdefault}{\uidefault}{<->mtmub}{}
99 \DeclareFontShape{LmtL}{mtl}{\hvdefault}{\uidefault}{<->mtmuh}{}

Symbols Now the symbols font:

100 \DeclareFontEncoding{LmtS}{}{\no@accents}%
101 \DeclareFontFamily{LmtS}{mts}{}% the fonts have no skewkerns

Why do we say \no@accents when this is the one font that will have accents if we don’t find any elsewhere?—because they are in non-standard slots. There is no “\mathsy” alphabet, but someone could try to be clever and define one. Since we said \noaccents@, we might as well do the following re-declarations (AMS does them too).

102 \DeclareFontEncoding{OML}{}{\noaccents@}
103 \DeclareFontEncoding{OMS}{}{\noaccents@}

mtsyn and the older mtsy differ only in the radical1 glyph (C132, ′204 ), which is a surd/radical at the baseline (as opposed to below it), otherwise identical to the other radical sign at ′160 ; see Sec. 6.13.

104 \DeclareFontShape{LmtS}{mts}{\mddefault}{\updefault}{<->mtsyn}{}
105 \DeclareFontShape{LmtS}{mts}{\bfdefault}{\updefault}{<->mtsyb}{}
106 \DeclareFontShape{LmtS}{mts}{\hvdefault}{\updefault}{<->mtsyh}{}

Script Letters The letters-only mtms* fonts, which we use for \mathcal

and/or \mathscr.
107 \DeclareFontEncoding{LmtW}{}{\noaccents@}
108 \DeclareFontFamily{LmtW}{mtw}{\skewchar\font=42␣\hyphenchar\font=-1␣}
109 \DeclareFontShape{LmtW}{mtw}{\mddefault}{\updefault}{<->mtms}{}
110 \DeclareFontShape{LmtW}{mtw}{\bfdefault}{\updefault}{<->mtmsb}{}

Math Extention The largesymbols and math extension fonts mtex* are compatible with OMX; the only difference is an extra radical in slot ′237 , which we don’t use, because it is identical to the one in the symbols font (′160 ).

111 \DeclareFontFamily{OMX}{mtx}{}% this really is OMX, thank you
112 \DeclareFontShape{OMX}{mtx}{\mddefault}{\updefault}{<->mtex}{}
113 \DeclareFontShape{OMX}{mtx}{\bfdefault}{\updefault}{<->mtexb}{}
114 \DeclareFontShape{OMX}{mtx}{\hvdefault}{\updefault}{<->mtexh}{}

Greek Text MathTıme includes a font with upright Greek letters, upper and lower case, meant for use as letters (as opposed to symbols). The fonts have ligatures with empty slots to get alternate forms—see Section 8 of the MathTımeplus reference manual.

115 \DeclareFontEncoding{LmtG}{}{\noaccents@}
116 \DeclareFontFamily{LmtG}{mtg}{}
117 \DeclareFontShape{LmtG}{mtg}{\mddefault}{\updefault}{<->mtgu}{}
118 \DeclareFontShape{LmtG}{mtg}{\bfdefault}{\updefault}{<->mtgub}{}

Lastly, declare default for the new encodings, so NFSS is happy.

119 \DeclareFontSubstitution{LmtL}{mtl}{\mddefault}{\itdefault}
120 \DeclareFontSubstitution{LmtS}{mts}{\mddefault}{\updefault}
121 \DeclareFontSubstitution{LmtW}{mtw}{\mddefault}{\updefault}
122 \DeclareFontSubstitution{LmtG}{mtg}{\mddefault}{\updefault}

6.6 Math declarations

We assume the usual math setup was loaded into the format and change things around to use MathTıme. If for some reason you don’t read a standard math setup into the format, you’ll have to read the setup in before loading this package. Note that it is not necessary to “preload” the standard Computer Modern font metrics, if font memory is a problem.

Math Versions We use three math versions, normal, bold, and heavy, and keep everything separate, as if there really were three sets of fonts available for everything. Actually, they’re not, but one could use the hooks to supply such fonts if one had them.

Give a notice so people don’t freak when they see all the warnings messages NFSS emits.

123 \PackageWarning{mt11p-Font}{Expect LOTS of NFSS warnings}

Some of the code that follows is redundant.

124 \DeclareMathVersion{normal}
125 \DeclareMathVersion{bold}
126 \DeclareMathVersion{heavy}
127 \def\normalmath{\@nomath\normalmath\mathversion{normal}}
128 \def\boldmath{\@nomath\boldmath\mathversion{bold}}
129 \def\heavymath{\@nomath\heavymath\mathversion{heavy}}
130 \def\unboldmath{\normalmath}
131 \let\unheavymath\unboldmath

This is a private joke…

132 \let\unnormalmath\relax

Declare Math Font Families The following does not depend on any options:

133 \DeclareSymbolFont{operators}{\encodingdefault}%
134  {\rmdefault}{\mddefault}{\updefault}
135 \DeclareSymbolFont{letters}{LmtL}%
136  {mtl}{\mddefault}{\itdefault}
137 \DeclareSymbolFont{symbols}{LmtS}%
138  {mts}{\mddefault}{\updefault}
139 \DeclareSymbolFont{largesymbols}{OMX}%
140  {mtx}{\mddefault}{\updefault}
141 \DeclareSymbolFontAlphabet \mathnormal {letters}
142 \DeclareSymbolFontAlphabet \mathrm     {operators}
143 \DeclareMathAlphabet \mathbf {\encodingdefault}%
144  {\rmdefault}{\bfdefault}{\updefault}
145 \DeclareMathAlphabet \mathsf {\encodingdefault}%
146  {\sfdefault}{\mddefault}{\updefault}
147 \DeclareMathAlphabet \mathit {\encodingdefault}%
148  {\rmdefault}{\mddefault}{\itdefault}
149 \DeclareMathAlphabet \mathtt {\encodingdefault}%
150  {\ttdefault}{\mddefault}{\updefault}

The calligraphy stuff depends on what ‘cal’ option is being used; we either use mtms as the \mathcal font, or we make cmsy the \mathcal font and make mtms a “script” font \mathscr, or we make cmsy the \mathcal font and don’t use mtms for anything.

151 \ifcase\mt@cal % case 0
152 \DeclareMathAlphabet \mathcal {LmtW}{mtw}{\mddefault}{\updefault}
153 \or            % case 1
154 \DeclareMathAlphabet \mathscr {LmtW}{mtw}{\mddefault}{\updefault}
155 \DeclareMathAlphabet \mathcal {OMS}{cmsy}{m}{n}
156 \or            % case 2
157 \DeclareMathAlphabet \mathcal {OMS}{cmsy}{m}{n}
158 \else % oops
159 \PackageError{mt11p}{PANIC: Unexpected value of \string\mt@cal}%

160  {The \string\mathcal/\string\mathscr setup is hosed.}
161 \fi

We’ll have to deal with more \mathcal-related stuff later.

Note that things defined via \DeclareSymbolFontAlphabet switch math versions automatically with \SetSymbolFont; these include \mathnormal and

 \mathrm.

Normal Math Version This is largely redundant.

162 \SetSymbolFont{operators}{normal}{\encodingdefault}%
163  {\rmdefault}{\mddefault}{\updefault}
164 \SetSymbolFont{letters}{normal}{LmtL}%
165  {mtl}{\mddefault}{\itdefault}
166 \SetSymbolFont{symbols}{normal}{LmtS}%
167  {mts}{\mddefault}{\updefault}
168 \SetSymbolFont{largesymbols}{normal}{OMX}%
169  {mtx}{\mddefault}{\updefault}
170 \SetMathAlphabet \mathsf {normal}%
171  {\encodingdefault}{\sfdefault}{\mddefault}{\updefault}
172 \SetMathAlphabet \mathtt {normal}%
173  {\encodingdefault}{\ttdefault}{\mddefault}{\updefault}
174 \SetMathAlphabet \mathit {normal}%
175  {\encodingdefault}{\rmdefault}{\mddefault}{\itdefault}
176 \SetMathAlphabet \mathbf {normal}%
177  {\encodingdefault}{\rmdefault}{\hvdefault}{\updefault}

\mathcal and \mathscr have several cases.

178 \ifcase\mt@cal % case 0
179 \SetMathAlphabet \mathcal {normal}{LmtW}{mtw}{\mddefault}{\updefault}
180 \or            % case 1
181 \SetMathAlphabet \mathscr {normal}{LmtW}{mtw}{\mddefault}{\updefault}
182 \SetMathAlphabet \mathcal {normal}{OMS}{cmsy}{m}{n}
183 \or            % case 2
184 \SetMathAlphabet \mathcal {normal}{OMS}{cmsy}{m}{n}
185 \fi

Bold Math Version Same story as above.

186 \SetSymbolFont{operators}{bold}{\encodingdefault}%
187  {\rmdefault}{\bfdefault}{\updefault}
188 \SetSymbolFont{letters}{bold}{LmtL}%
189  {mtl}{\bfdefault}{\itdefault}
190 \SetSymbolFont{symbols}{bold}{LmtS}%
191  {mts}{\bfdefault}{\updefault}
192 \SetSymbolFont{largesymbols}{bold}{OMX}%
193  {mtx}{\bfdefault}{\updefault}
194 \SetMathAlphabet \mathsf {bold}{\encodingdefault}%
195  {\sfdefault}{\bfdefault}{\updefault}
196 \SetMathAlphabet \mathtt {bold}{\encodingdefault}%
197  {\ttdefault}{\bfdefault}{\updefault}
198 \SetMathAlphabet \mathit {bold}{\encodingdefault}%
199  {\rmdefault}{\bfdefault}{\itdefault}
200 \SetMathAlphabet \mathbf {bold}{\encodingdefault}%
201  {\rmdefault}{\uldefault}{\updefault}

And the cases

202 \ifcase\mt@cal % case 0
203 \SetMathAlphabet \mathcal {bold}{LmtW}{mtw}{\bfdefault}{\updefault}
204 \or            % case 1
205 \SetMathAlphabet \mathscr {bold}{LmtW}{mtw}{\bfdefault}{\updefault}
206 \SetMathAlphabet \mathcal {bold}{OMS}{cmsy}{b}{n}
207 \or            % case 2
208 \SetMathAlphabet \mathcal {bold}{OMS}{cmsy}{b}{n}
209 \fi

Heavy Math Version Still more of the same.

210 \SetSymbolFont{operators}{heavy}{\encodingdefault}%
211  {\rmdefault}{\hvdefault}{\updefault}
212 \SetSymbolFont{letters}  {heavy}{LmtL}%
213  {mtl}{\hvdefault}{\itdefault}
214 \SetSymbolFont{symbols}  {heavy}{LmtS}%
215  {mts}{\hvdefault}{\updefault}
216 \SetSymbolFont{largesymbols}{heavy}{OMX}%
217  {mtx}{\hvdefault}{\updefault}
218 \SetMathAlphabet \mathsf {heavy}{\encodingdefault}%
219  {\sfdefault}{\hvdefault}{\updefault}
220 \SetMathAlphabet \mathtt {heavy}{\encodingdefault}%
221  {\ttdefault}{\hvdefault}{\updefault}
222 \SetMathAlphabet \mathit {heavy}{\encodingdefault}%
223  {\rmdefault}{\hvdefault}{\itdefault}
224 \SetMathAlphabet \mathbf {heavy}{\encodingdefault}%
225  {\rmdefault}{\psdefault}{\updefault}%

And the cases for script,

226 \ifcase\mt@cal % case 0
227 \SetMathAlphabet \mathcal {heavy}{LmtW}{mtw}{\hvdefault}{\updefault}
228 \or            % case 1
229 \SetMathAlphabet \mathscr {heavy}{LmtW}{mtw}{\hvdefault}{\updefault}
230 \SetMathAlphabet \mathcal {heavy}{OMS}{cmsy}{\hvdefault}{\updefault}
231 \or            % case 2
232 \SetMathAlphabet \mathcal {heavy}{OMS}{cmsy}{\hvdefault}{\updefault}
233 \fi

6.7 Bold & heavy font substitutions

We pretended there are all sorts of weights available, but, in fact, they’re not. Declare substitutions, unless we were told not to. NFSS will complain if we use an as-of-yet undeclared font as a substitute, so we explicitly read in the .fd files (this happens later for other fonts too). No harm will be done if they have already been read. Read in even OMScmsy.fd, in case the format has zilch preloaded.

234 \ifcase\mt@sub % case 0
235 \PackageWarning{mt11p}{No math font substitutions set}

Check for and read in the files ⟨\encodingdefault⟩⟨\xydefault⟩.fd for the three text families. Be nice and check for the all-lower case name too.

236 \or % case 1
237 \def\mt@fd@check#1{%
238  \edef\reserved@a{\lowercase{\noexpand

239  \InputIfFileExists{\encodingdefault #1.fd}}}%
240  \reserved@a\relax{\InputIfFileExists{\encodingdefault #1.fd}\relax
241  {\PackageError{mt11p}%
242  {No file `\encodingdefault#1.fd' found}%
243  {Your text \string#1 setup looks inconsistent.}}}}
244 \mt@fd@check\rmdefault
245 \mt@fd@check\sfdefault
246 \mt@fd@check\ttdefault
247 \edef\reserved@a{\lowercase{\noexpand\InputIfFileExists{omscmsy.fd}}}%
248 \reserved@a\relax{\InputIfFileExists{OMScmsy.fd}\relax
249  {\PackageError{mt11p}{No OMScmsy.fd file}%
250  {Your are missing a basic distribution file. %
251  Check the LaTeX installation.}}}
252 \DeclareFontShape{\encodingdefault}%
253  {\rmdefault}{\hvdefault}{\updefault}% heavy \rm SUBS
254  {<->ssub*\rmdefault/\bfdefault/\updefault}{}
255 \DeclareFontShape{\encodingdefault}%
256  {\sfdefault}{\hvdefault}{\updefault}% heavy \sf SUBS
257  {<->ssub*\sfdefault/\bfdefault/\updefault}{}
258 \DeclareFontShape{\encodingdefault}%
259  {\ttdefault}{\hvdefault}{\updefault}% heavy \tt SUBS
260  {<->ssub*\ttdefault/\bfdefault/\updefault}{}
261 \DeclareFontShape{\encodingdefault}%
262  {\rmdefault}{\psdefault}{\updefault}% poster \rm SUBS
263  {<->ssub*\rmdefault/\bfdefault/\updefault}{}
264 \DeclareFontShape{LmtW}%
265  {mtw}{\hvdefault}{\updefault}%      heavy mtms SUBS
266  {<->ssub*mtw/\bfdefault/\updefault}{}
267 \DeclareFontShape{OMS}{cmsy}{\hvdefault}{\updefault}%
268  {<->ssub*cmsy/b/n}{}%               heavy cmsy SUBS
269 \else % oops
270 \PackageError{mt11p}{PANIC: Unexpected value of \string\mt@sub}%
271  {No math font substitutions set.}
272 \fi

6.8 Mathcodes

The MathTıme fonts are nearly replacements for Computer Modern, but there are a few things to fix up. We also make it possible to take some symbols and accents from either operators or from elsewhere, depending on the options; this will be done later.

letters Font Upright upper case Greek no longer comes from the operators font, but from the letters font, so upper and lower case Greek letters now behave identically, namely as math symbols. This means that something like

 $\mathit{\Delta\Gamma}\mathbf{\Xi}$ no longer works—upper case Greek let-

ters are not affected by math alphabet changes. There is no simple fix.

Upright upper case Greek:

273 \DeclareMathSymbol\Gamma      {\mathord}{letters}{'060}
274 \DeclareMathSymbol\Delta      {\mathord}{letters}{'061}
275 \DeclareMathSymbol\Theta      {\mathord}{letters}{'062}
276 \DeclareMathSymbol\Lambda     {\mathord}{letters}{'063}
277 \DeclareMathSymbol\Xi         {\mathord}{letters}{'064}

278 \DeclareMathSymbol\Pi         {\mathord}{letters}{'065}
279 \DeclareMathSymbol\Sigma      {\mathord}{letters}{'066}
280 \DeclareMathSymbol\Upsilon    {\mathord}{letters}{'067}
281 \DeclareMathSymbol\Phi        {\mathord}{letters}{'070}
282 \DeclareMathSymbol\Psi        {\mathord}{letters}{'071}
283 \DeclareMathSymbol\Omega      {\mathord}{letters}{'177}

Italic upper case Greek; AMS calls these \var⟨Greek Letter⟩.

284 \DeclareMathSymbol\varGamma   {\mathord}{letters}{'000}
285 \DeclareMathSymbol\varDelta   {\mathord}{letters}{'001}
286 \DeclareMathSymbol\varTheta   {\mathord}{letters}{'002}
287 \DeclareMathSymbol\varLambda  {\mathord}{letters}{'003}
288 \DeclareMathSymbol\varXi      {\mathord}{letters}{'004}
289 \DeclareMathSymbol\varPi      {\mathord}{letters}{'005}
290 \DeclareMathSymbol\varSigma   {\mathord}{letters}{'006}
291 \DeclareMathSymbol\varUpsilon {\mathord}{letters}{'007}
292 \DeclareMathSymbol\varPhi     {\mathord}{letters}{'010}
293 \DeclareMathSymbol\varPsi     {\mathord}{letters}{'011}
294 \DeclareMathSymbol\varOmega   {\mathord}{letters}{'012}

Lower case Greek letters are ok, except for

295 \DeclareMathSymbol\varkappa   {\mathord}{letters}{'176}
296 \DeclareMathSymbol\omicron    {\mathord}{letters}{`\o}% for completeness

symbols Font There are a few new symbols, and the fonts no longer contain calligraphic letters. Easy things (those where no alternatives are available) first; the new names are those used in the MathTıme distribution.

297 \DeclareMathSymbol\openclubsuit   {\mathord}{symbols}{"78}
298 \DeclareMathSymbol\shadedclubsuit {\mathord}{symbols}{"79}
299 \DeclareMathSymbol\openspadesuit  {\mathord}{symbols}{"7A}
300 \DeclareMathSymbol\shadedspadesuit{\mathord}{symbols}{"7B}
301 \DeclareMathSymbol\triangleleft   {\mathbin}{symbols}{"47}
302 \DeclareMathSymbol\triangleright  {\mathbin}{symbols}{"46}
303 \DeclareMathSymbol\cupprod        {\mathbin}{symbols}{"59}
304 \DeclareMathSymbol\capprod        {\mathbin}{symbols}{"5A}

The \varcirc symbol is slightly smaller than the ‘open bullet’. mathtimy calls it

 “\comp”.
305 \DeclareMathSymbol\varcirc{\mathbin}{symbols}{"42}
306 \let\comp=\varcirc

\vec used to be in letters, now it’s in symbols.

307 \DeclareMathAccent\vec    {\mathord}{symbols}{"45}

mtsy has an accent glyph called overbar, which mathtimy calls \widebar.

308 \DeclareMathAccent\overbar{\mathord}{symbols}{"53}
309 \let\widebar\overbar

The glyph called backslash in the AFM file of mtsyn is the one usually used for \setminus, and the format file has a definition for it (symbols, slot "6E). There is a setminus in the AFM file, but it looks somewhat like a tilted minus sign. AMS packages call that glyph “\smallsetminus”.

310 \DeclareMathSymbol\varsetminus{\mathbin}{symbols}{"58}
311 \let\smallsetminus\varsetminus

Calligraphic letters and their variants Irrespective of the options, both \mathcal and \mathscr get defined; warn only when the nomtms option is used.

312 \ifcase\mt@cal % case 0
313 \let\mathscr\mathcal % don't warn
314 \or            % case 1
315 \or            % case 2
316 \def\mathscr#1{\mathcal{#1}%
317  \PackageWarning{mt11p}{no \string\mathscr\space available;
318  \MessageBreak using OMScmsy \string\mathcal}}
319 \fi

We don’t try to trap cases like \mathcal{a} when the \mathcal alphabet is OMS (and hence has no lowercase letters!). Presumably by writing \mathcal{a} you know that \mathcal is LmtW, i.e., the mtcal option is in effect. Writing \mathscr{a} when \mathscr is essentially a synonym for \mathcal will at least produce a warning.

mtms* has alternate forms of a few letters. We define math commands to fetch them, assuming we have an mtms* font as \mathscr. (The script letters have sidebearings which make them unsuitable for text; use math mode for logos and such.) The auxiliary macro will be defined later.

320 \def\varA   {\mt@al@hexsy\mathscr{30}}
321 \def\varE   {\mt@al@hexsy\mathscr{31}}
322 \def\varG   {\mt@al@hexsy\mathscr{32}}
323 \def\varvarG{\mt@al@hexsy\mathscr{33}}
324 \def\varI   {\mt@al@hexsy\mathscr{34}}
325 \def\varL   {\mt@al@hexsy\mathscr{35}}
326 \def\varQ   {\mt@al@hexsy\mathscr{36}}
327 \def\varS   {\mt@al@hexsy\mathscr{37}}
328 \def\varr   {\mt@al@hexsy\mathscr{38}}
329 \def\varz   {\mt@al@hexsy\mathscr{39}}
330 \def\iscript{\mt@al@hexsy\mathscr{7B}}% can't use \imath
331 \def\jscript{\mt@al@hexsy\mathscr{7C}}% can't use \jmath

The MathTıme distribution defines the macro \script, which is supposed to produce the script letter “A” and its alternate form with “\script A” and “\script*A”, respectively. The argument of \script had better be a single token (or an asterisk and a single token), else we get a mess; in order to get the expected output that token should be a single letter_{11}, one of those that have variant forms.

332 \DeclareRobustCommand\script{\@ifstar\@varscript\@script}
333 \ifnum\mt@cal<2 % mtms available
334 \def\@script#1{\mathscr{#1}}
335 \def\@varscript#1{%
336  \ifx#1A\varA
337  \else\ifx#1E\varE
338  \else\ifx#1G\varG
339  \else\ifx#1g\varvarG
340  \else\ifx#1I\varI
341  \else\ifx#1L\varL
342  \else\ifx#1Q\varQ
343  \else\ifx#1S\varS
344  \else\ifx#1r\varr
345  \else\ifx#1z\varz

346  \else\ifx#1i\iscript
347  \else\ifx#1j\jscript
348  \else       \PackageWarning{mt11p}{#1: no such variant letter}%
349  \mathscr{#1}%
350  \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi}
351 \else % OMS only
352 \def\@script#1{\mathscr{#1}}
353 \def\@varscript#1{\PackageWarning{mt11}%
354  {no variant letters available in OMS}%
355  \@script{#1}}
356 \fi

The above will produce two warnings if you say $\mathcal{a}$ with the nomtms option in effect.

Symbols from either operators or from elsewhere Many symbols and punctuation marks can be taken from either the operators math family, or from letters/symbols. Most of the glyphs are virtually identical in either font. The ‘optimal’ choice depends on several things, e.g., do you wish to use as few glyphs from the MathTıme fonts as possible, do you prefer ‘thinner’ symbols, etc. The opmax option will take as many things from operators as possible, but risk, e.g., that the = sign will not line up with double arrows, etc. The opsafe option uses operators glyphs only when absolutly nothing can go wrong; the opnone option avoids operators whenever possible and uses MathTıme glyphs instead.

The operators font is uses the encoding \encodingdefault. We must recognize that encoding in order to take any symbols from operators. The only encodings I know of that someone might possibly be using with L^{A}TEX 2ε are T1, OT1 or a superset thereof, 8r and 8a. It’s easy to hack in another encoding, if required, as would be the case with a superset or OT1. If we don’t recognize the encoding, stick to using symbols and letters.

NFSS has a “\DeclareMathDelimiter” but nothing to assign \delcodes. We try to make a general macro and insist on saying “\symletters” rather than just saying “1”, eventhough it’s pretty much out of the question that \symoperators,

\symletters, \symsymbols and \symlargeoperators are something other than

0, 1, 2 and 3, respectively, since TEX itself checks for extra fontdimens of \fam2 and \fam3 before it agrees to typeset math. (The second and fourth arguments should be hexadecimal numbers without the “"”.)

357 \def\mt@assign@del#1#2#3#4#5{%
358  \edef\reserved@a{\expandafter\the\csname sym#2\endcsname}%
359  \edef\reserved@b{\expandafter\the\csname sym#4\endcsname}%
360  \delcode#1="\reserved@a#3\reserved@b#5 \relax}

This code is read once and not stored, so we just write the whole thing out case by case. \colon is defined in some of the AMS packages, so don’t overwrite an existing definition.

Here’s the overly conservative option:

361 \ifcase\mt@ops % case 0
362 \DeclareMathSymbol{(}{\mathopen}{letters}{"2E}
363 \mt@assign@del{`\(}{letters}{2E}{largesymbols}{00}
364 \DeclareMathSymbol{)}{\mathclose}{letters}{"2F}
365 \mt@assign@del{`\)}{letters}{2F}{largesymbols}{01}
366 \DeclareMathSymbol{+}{\mathbin}{symbols}{"43}

367 \DeclareMathSymbol{=}{\mathrel}{symbols}{"44}% identical one at "48
368 \DeclareMathSymbol{;}{\mathpunct}{symbols}{"49}
369 \DeclareMathSymbol{[}{\mathopen}{symbols}{"54}
370 \mt@assign@del{`\[}{symbols}{54}{largesymbols}{02}
371 \DeclareMathSymbol{]}{\mathclose}{symbols}{"55}
372 \mt@assign@del{`\]}{symbols}{55}{largesymbols}{03}
373 \DeclareMathSymbol{:}{\mathrel}{symbols}{"56}
374 \ifx\colon\undefined
375  \DeclareMathSymbol{\colon}{\mathpunct}{symbols}{"56}
376 \fi
377 \DeclareMathSymbol{!}{\mathclose}{symbols}{"57}
378 \DeclareMathSymbol{.}{\mathord}{letters}{"3A}
379 \DeclareMathSymbol{\period}{\mathpunct}{letters}{"3A}
380 \DeclareMathSymbol{,}{\mathpunct}{letters}{"3B}
381 %\DeclareMathSymbol{<}{\mathrel}{letters}{"3C}% format defaults
382 %\DeclareMathSymbol{>}{\mathrel}{letters}{"3E}
383 %\DeclareMathSymbol{|}{\mathord}{symbols}{"6A}
384 %\DeclareMathSymbol{/}{\mathord}{letters}{"3D}
385 %\DeclareMathSymbol{-}{\mathbin}{symbols}{"00}

Now the safe version; the stuff we take from operators never gets used in “synthesized” or extensible symbols.

386 \or           % case 1
387 \DeclareMathSymbol{(}{\mathopen}{operators}{`\(}
388 \mt@assign@del{`\(}{operators}{28}{largesymbols}{00}
389 \DeclareMathSymbol{)}{\mathclose}{operators}{`\)}
390 \mt@assign@del{`\)}{operators}{29}{largesymbols}{01}
391 \DeclareMathSymbol{+}{\mathbin}{symbols}{"43}
392 \DeclareMathSymbol{=}{\mathrel}{symbols}{"44}% identical one at "48
393 \DeclareMathSymbol{;}{\mathpunct}{operators}{`\;}
394 \DeclareMathSymbol{[}{\mathopen}{operators}{`\[}
395 \mt@assign@del{`\[}{operators}{5B}{largesymbols}{02}
396 \DeclareMathSymbol{]}{\mathclose}{operators}{`\]}
397 \mt@assign@del{`\]}{operators}{5D}{largesymbols}{03}
398 \DeclareMathSymbol{:}{\mathrel}{operators}{`\:}
399 \ifx\colon\undefined % AMS defines it differently; don't overwrite that
400  \DeclareMathSymbol{\colon}{\mathpunct}{operators}{`\:}
401 \fi
402 \DeclareMathSymbol{!}{\mathclose}{operators}{`\!}
403 \DeclareMathSymbol{.}{\mathord}{operators}{`\.}
404 \DeclareMathSymbol{\period}{\mathpunct}{operators}{`\.}
405 \DeclareMathSymbol{,}{\mathpunct}{operators}{`\,}
406 %\DeclareMathSymbol{<}{\mathrel}{letters}{"3C}% format defaults
407 %\DeclareMathSymbol{>}{\mathrel}{letters}{"3E}
408 %\DeclareMathSymbol{|}{\mathord}{symbols}{"6A}
409 %\DeclareMathSymbol{/}{\mathord}{letters}{"3D}
410 %\DeclareMathSymbol{-}{\mathbin}{symbols}{"00}

Now opmax. This is risky, or more exactly some glyphs will be flawed, because the minus and equal signs won’t line up with arrows, etc. On the other hand, this will minimize the use of non-resident fonts, so it may make the final output marginally smaller if you have partial font downloading or if you include the MathTıme fonts as bitmaps.

411 \or           % case 2
412 \PackageWarning{mt11p}{opmax enabled}

413 \DeclareMathSymbol{(}{\mathopen}{operators}{`\(}
414 \mt@assign@del{`\(}{operators}{28}{largesymbols}{00}
415 \DeclareMathSymbol{)}{\mathclose}{operators}{`\)}
416 \mt@assign@del{`\)}{operators}{29}{largesymbols}{01}
417 \DeclareMathSymbol{+}{\mathbin}{operators}{`\+}
418 \DeclareMathSymbol{=}{\mathrel}{operators}{`\=}% dangerous
419 \DeclareMathSymbol{;}{\mathpunct}{operators}{`\;}
420 \DeclareMathSymbol{[}{\mathopen}{operators}{`\[}
421 \mt@assign@del{`\[}{operators}{5B}{largesymbols}{02}
422 \DeclareMathSymbol{]}{\mathclose}{operators}{`\]}
423 \mt@assign@del{`\]}{operators}{5D}{largesymbols}{03}
424 \DeclareMathSymbol{:}{\mathrel}{operators}{`\:}
425 \ifx\colon\undefined
426  \DeclareMathSymbol{\colon}{\mathpunct}{operators}{`\:}
427 \fi
428 \DeclareMathSymbol{!}{\mathclose}{operators}{`\!}
429 \DeclareMathSymbol{.}{\mathord}{operators}{`\.}
430 \DeclareMathSymbol{\period}{\mathpunct}{operators}{`\.}
431 \DeclareMathSymbol{,}{\mathpunct}{operators}{`\,}
432 \DeclareMathSymbol{/}{\mathord}{operators}{`\/}
433 \mt@assign@del{`\/}{operators}{2F}{largesymbols}{0E}

Now we have to be careful: <, > and | can be taken from operators if \encodingdefault is anything except OT1. We use an endash instead of a hyphen for the minus sign if we recognize the encoding to get at least something close to a real minus sign. That’s a sloppy kludge, but choosing the opmax option implies you’ve lowered your standards somewhat.

434 \def\reserved@a{OT1}\edef\reserved@b{\encodingdefault}
435 \ifx\reserved@a\reserved@b % unavailable in OT1...
436  %\DeclareMathSymbol{<}{\mathrel}{letters}{"3C}% format defaults
437  %\DeclareMathSymbol{>}{\mathrel}{letters}{"3E}
438  %\DeclareMathSymbol{|}{\mathord}{symbols}{"6A}
439  \DeclareMathSymbol{-}{\mathbin}{operators}{"7B}% dangerous
440 \else
441  \def\reserved@a{T1}%
442  \ifx\reserved@a\reserved@b
443  \DeclareMathSymbol{-}{\mathbin}{operators}{"15}% dangerous
444  \else
445  \def\reserved@a{8r}%
446  \ifx\reserved@a\reserved@b
447  \DeclareMathSymbol{-}{\mathbin}{operators}{150}% dangerous
448  \else
449  \def\reserved@a{8a}%
450  \ifx\reserved@a\reserved@b
451  \DeclareMathSymbol{-}{\mathbin}{operators}{"B1}% dangerous
452  \else
453  % keep symbols, slot "00
454  \fi % 8a
455  \fi % 8r
456  \fi % T1
457  \DeclareMathSymbol{<}{\mathrel}{operators}{`\<}% ascii positions
458  \DeclareMathSymbol{>}{\mathrel}{operators}{`\>}
459  \DeclareMathSymbol{|}{\mathord}{operators}{`\|}
460  \mt@assign@del{`\|}{operators}{7C}%  ascii bar

461  {largesymbols}{0C}
462  \DeclareMathDelimiter\backslash\mathord{operators}{"5C}% ascii backslash
463  {largesymbols}{"0F}
464  \DeclareMathDelimiter\lbrace   \mathopen{operators}{`\{}% ascii `{'
465  {largesymbols}{"08}
466  \DeclareMathDelimiter\rbrace   \mathclose{operators}{`\}}% ascii `}'
467  {largesymbols}{"09}
468 \fi
469 \else % oops
470 \PackageError{mt11p}{PANIC: Unexpected value of \string\mt@ops}%
471  {The mathsymbol setup is hosed; expect bad output.}
472 \fi

Math Accents Accents in math can be made to either use a fixed font, or to obey math alphabets. In order to have accents of the latter type, we must recognize the \encodingdefault (which the operators math family is in) and set the corresponding accent codes up for that encoding. If we don’t recognize the encoding we have to use fixed accents; MathTıme provides suitable accents in the

symbols font.

For some reason the ring accent “å” is always left out, so we define it, but don’t warn if we’re stuck with symbols accents which have no ring accent glyph and just make \ring a no-op.

The code below is written out long hand style, to keep it legible. It does not get stored, it’s read only once, and most of it is skipped, so it would be only a marginal improvement to merge everything.

   The opaccents case:
473 \ifcase\mt@accs % case 0

We do something similar to what AMS does, but rather simple-mindedly: choose between ‘fixed’ (class 0) or ‘variable’ (class 7) based on the value of \mt@acc@class, whose value should be either 0 or 7, depending on whether the (encoding of the) current math alphabet has accents in the expected positions. We could use the AMS hook (\accentclass@), but we ought to make our own… Actually, this is slightly naughty; we could have gone through the \DeclaterMathAccent command, declare two accents, and have the user-level accent command pick the right one based on something \noaccents@ says, but that’s kind of pointless.

All of this works as long as we recognize the encoding. If we don’t, use fixed accents from symbols and complain. The slot specification must be in hex.

474 \def\mt@accent@make#1#2{\def#1{\mathaccent"\mt@acc@class0#2␣}}

Here are the encodings we recognize:

475 \edef\reserved@a{\encodingdefault}
476 \def\reserved@b{T1}% a.k.a Cork or DC or EC
477 \ifx\reserved@a\reserved@b
478  \mt@accent@make{\grave}{00}
479  \mt@accent@make{\acute}{01}
480  \mt@accent@make{\hat}{02}
481  \mt@accent@make{\tilde}{03}
482  \mt@accent@make{\ddot}{04}
483  \mt@accent@make{\ring}{06}
484  \mt@accent@make{\check}{07}

485  \mt@accent@make{\breve}{08}
486  \mt@accent@make{\bar}{09}
487  \mt@accent@make{\dot}{0A}
488 \else
489  \def\reserved@b{OT1}% ``Knuth roman''
490  \ifx\reserved@a\reserved@b
491  \mt@accent@make{\grave}{12}
492  \mt@accent@make{\acute}{13}
493  \mt@accent@make{\check}{14}
494  \mt@accent@make{\breve}{15}
495  \mt@accent@make{\bar}{16}
496  \mt@accent@make{\ring}{17}
497  \mt@accent@make{\hat}{5E}
498  \mt@accent@make{\dot}{5F}
499  \mt@accent@make{\tilde}{7E}
500  \mt@accent@make{\ddot}{7F}
501  \else
502  \def\reserved@b{8r}% TeXBase1
503  \ifx\reserved@a\reserved@b
504  \mt@accent@make{\dot}{01}
505  \mt@accent@make{\ring}{09}
506  \mt@accent@make{\breve}{0B}}
507  \mt@accent@make{\check}{10}
508  \mt@accent@make{\grave}{1E}
509  \mt@accent@make{\hat}{88}
510  \mt@accent@make{\tilde}{98}
511  \mt@accent@make{\ddot}{A8}
512  \mt@accent@make{\bar}{AF}
513  \mt@accent@make{\acute}{B4}
514  \else
515  \def\reserved@b{8a}% AdobeStandard
516  \ifx\reserved@a\reserved@b
517  \mt@accent@make{\grave}{C1}
518  \mt@accent@make{\acute}{C2}
519  \mt@accent@make{\hat}{C3}
520  \mt@accent@make{\tilde}{C4}
521  \mt@accent@make{\bar}{C5}
522  \mt@accent@make{\breve}{C6}
523  \mt@accent@make{\dot}{C7}
524  \mt@accent@make{\ddot}{C8}
525  \mt@accent@make{\ring}{CA}
526  \mt@accent@make{\check}{CF}

If we don’t recognize the encoding, we have to resort to symbols:

527  \else % I give up...
528  \DeclareMathAccent\grave{\mathord}{symbols}{"4A}
529  \DeclareMathAccent\acute{\mathord}{symbols}{"4B}
530  \DeclareMathAccent\check{\mathord}{symbols}{"4C}
531  \DeclareMathAccent\breve{\mathord}{symbols}{"4D}
532  \DeclareMathAccent\bar  {\mathord}{symbols}{"4E}
533  \DeclareMathAccent\hat  {\mathord}{symbols}{"4F}
534  \DeclareMathAccent\dot  {\mathord}{symbols}{"50}
535  \DeclareMathAccent\tilde{\mathord}{symbols}{"51}
536  \DeclareMathAccent\ddot {\mathord}{symbols}{"52}
537  \def\ring#1{{#1}} % no \ring in the symbols font

538  \PackageError{mt11p}%
539  {Unknown \string\encodingdefault\space
540  \encodingdefault. \MessageBreak
541  Reverting to fixed accents
542  from symbols font}%
543  {I had to make math accents ignore alphabet
544  changes,\MessageBreak
545  because I don't recognize the
546  `\encodingdefault' encoding.}
547  \fi % 8a
548  \fi % 8r
549  \fi % OT1
550 \fi % T1

Add the switch to \noaccents@ (and check that that’s defined before hand) and initialize the flag.

551 \ifx\noaccents@\@undefined\let\noaccents@\@empty\fi % be safe
552 \g@addto@macro{\noaccents@}{\def\mt@acc@class{0}}
553 \def\mt@acc@class{7}

The symaccents case is easy; just make everything fixed, and make sure

 \noaccents@ is defined.
554 \or % case 1, accents from symbols
555 \DeclareMathAccent\grave{\mathord}{symbols}{"4A}
556 \DeclareMathAccent\acute{\mathord}{symbols}{"4B}
557 \DeclareMathAccent\check{\mathord}{symbols}{"4C}
558 \DeclareMathAccent\breve{\mathord}{symbols}{"4D}
559 \DeclareMathAccent\bar  {\mathord}{symbols}{"4E}
560 \DeclareMathAccent\hat  {\mathord}{symbols}{"4F}
561 \DeclareMathAccent\dot  {\mathord}{symbols}{"50}
562 \DeclareMathAccent\tilde{\mathord}{symbols}{"51}
563 \DeclareMathAccent\ddot {\mathord}{symbols}{"52}
564 \def\ring#1{{#1}} % no \ring in the symbols font
565 \ifx\noaccents@\@undefined\let\noaccents@\@empty\fi % be safe
566 \else % oops
567 \PackageError{mt11p}{PANIC: Unexpected value of \string\mt@accs}%
568  {The math accent setup is hosed; expect bad output.}
569 \fi

Now another messy part: the AMS package amsmath has the macros \Hat, etc., defined with hard-coded accent positions. We redo the definition to work with whatever encoding or accents we’re using. The code below is basically copied from the AMS package. We omit this patch unless all of the following conditions are satisfied: i) the macro \mathaccent@ exists; iii) the macros \Hat and \Check exist; iii) there exists a macro \accentclass@ whose definition is “7”. If all of that is ok we pretty likely have the amsmath package and the following should be safe. Note that \mathaccent@ is a rather large macro that figures out what skew kern is needed to get double accents to line up.

570 \ifx\mathaccent@\undefine\else % (i)
571 \ifx\Hat\undefine\else         % (iia)
572 \ifx\Check\undefine\else       % (iib)
573 \def\@tempa{7}%
574 \ifx\@tempa\accentclass@       % (iii)
575 \PackageInfo{mt11p}{amsmath detected; redefining double accents}

Define fancy versions of \hat, etc., called “\Hat”, etc., that perform skew calculations. To get a double accent say something like \Hat{\Hat{x}}.

There are two versions of the definition macro: one for fixed accents, another for variable ones.

576 \def\@tempa#1#2{% variable 7/0
577  \def#1{\relax % write it out
578  \ifmmode
579  \def\next@{\mathaccent@{"\accentclass@#2 }}%
580  \else
581  \def\next@{\nonmatherr@{#1}}%
582  \fi
583  \next@}}
584 \def\@tempb#1#2{% fixed
585  \def#1{\relax % write it out
586  \ifmmode
587  \def\next@{\mathaccent@{"0#2 }}%
588  \else
589  \def\next@{\nonmatherr@{#1}}%
590  \fi
591  \next@}}

These two accents are from the symbols fonts:

592 \@tempb\Vec{245}
593 \@tempb\Overbar{253}
594 \def\Widebar{\Overbar}% synonym

Go through the encodings we know and define the accents again… The symaccents option affects this too.

595 \ifnum\mt@accs=0 %
596  \edef\reserved@a{\encodingdefault}
597  \def\reserved@b{T1}% a.k.a Cork or DC or EC
598  \ifx\reserved@a\reserved@b
599  \@tempa\Hat{002}
600  \@tempa\Check{007}
601  \@tempa\Tilde{003}
602  \@tempa\Acute{001}
603  \@tempa\Grave{000}
604  \@tempa\Dot{00A}
605  \@tempa\Ddot{004}
606  \@tempa\Breve{008}
607  \@tempa\Bar{009}
608  \else
609  \def\reserved@b{OT1}% DEK's
610  \ifx\reserved@a\reserved@b
611  \@tempa\Grave{012}
612  \@tempa\Acute{013}
613  \@tempa\Check{014}
614  \@tempa\Breve{015}
615  \@tempa\Bar{016}
616  \@tempa\Hat{05E}
617  \@tempa\Dot{05F}
618  \@tempa\Tilde{07E}
619  \@tempa\Ddot{07F}
620  \else

621  \def\reserved@b{8r}% TeXBase1
622  \ifx\reserved@a\reserved@b
623  \@tempa\Dot{001}
624  \@tempa\Breve{00B}
625  \@tempa\Check{010}
626  \@tempa\Grave{01E}
627  \@tempa\Hat{088}
628  \@tempa\Tilde{098}
629  \@tempa\Ddot{0A8}
630  \@tempa\Bar{0AF}
631  \@tempa\Acute{0B4}
632  \else
633  \def\reserved@b{8a}% AdobeStandard
634  \ifx\reserved@a\reserved@b
635  \@tempa\Grave{0C1}
636  \@tempa\Acute{0C2}
637  \@tempa\Hat{0C3}
638  \@tempa\Tilde{0C4}
639  \@tempa\Bar{0C5}
640  \@tempa\Breve{0C6}
641  \@tempa\Dot{0C7}
642  \@tempa\Ddot{0C8}
643  \@tempa\Check{0CF}
644  \else % beats me...

If we don’t know the encoding use fixed accents from symbols. We already gave an error message before, so just warn.

645  \@tempb\Grave{24A}
646  \@tempb\Acute{24B}
647  \@tempb\Check{24C}
648  \@tempb\Breve{24D}
649  \@tempb\Bar{24E}
650  \@tempb\Hat{24F}
651  \@tempb\Dot{250}
652  \@tempb\Tilde{251}
653  \@tempb\Ddot{252}
654  \PackageWarning{mt11p}{using fixed accents for amsmath}
655  \fi % 8a
656  \fi % 8r
657  \fi % OT1
658  \fi % T1
659 \else % symaccents option
660  \@tempb\Grave{24A}
661  \@tempb\Acute{24B}
662  \@tempb\Check{24C}
663  \@tempb\Breve{24D}
664  \@tempb\Bar{24E}
665  \@tempb\Hat{24F}
666  \@tempb\Dot{250}
667  \@tempb\Tilde{251}
668  \@tempb\Ddot{252}
669 \fi
670 \fi\fi\fi\fi

Upright Greek Text The mtgu* fonts are not meant to be used as symbols, so we provide only text-type support: text mode font changing commands, and a math alphabet. Note that this means you can use the fonts in math with correct subscript sizing, etc.; just say something like \mathgr{m} for an upright μ (Computer Modern does not have such a glyph); in text \textgr{m} will work. Note also that the ligatures involving nonprinting letters for getting variant forms will work inside of \mathgr, but o*, O* or e* will not, which is why we added some ligatures to the tfm file (Sec. 3.9). The text commands are non-fragile, because the components of the macros are robust. See Sec. 6.12 for making upright Greek letters into math symbols. Trap the nomathgr case.

671 \def\greekshape{\fontencoding{LmtG}\selectfont}%
672 \DeclareTextFontCommand{\textgr}{\greekshape}
673 \ifcase\mt@mgr % case 0
674 \def\mathgr#1{\PackageError{mt11p}{upright Greek not loaded for math}%
675  {Don't use the nomathgr option.}%
676  \hbox{\greekshape #1}}% as good as anything else
677 \or % case 1
678 \DeclareMathAlphabet\mathgr {LmtG}{mtg}{\mddefault}{\updefault}
679 \SetMathAlphabet    \mathgr {normal}{LmtG}{mtg}{\mddefault}{\updefault}
680 \SetMathAlphabet    \mathgr {bold}  {LmtG}{mtg}{\bfdefault}{\updefault}
681 \SetMathAlphabet    \mathgr {heavy} {LmtG}{mtg}{\hvdefault}{\updefault}
682 \else % oops
683 \PackageError{mt11p}{PANIC: Unexpected value of \string\mt@mgr}%
684  {The \string\mathgr\space setup is hosed.}
685 \fi
686 \ifnum\mt@sub=1 %
687 \DeclareFontShape{LmtG}{mtg}{\hvdefault}{\updefault}%
688  {<->ssub*mtg/\bfdefault/\updefault}{}% heavy mtgu SUBS
689 \fi

The MathTıme distribution defines the \gk font switch macro, roughly equivalent

 to \greekshape; we don’t.

\hbar needs to be defined a bit carefully. The plainTEX definition is just a macron (bar) accent with an ‘h’ backed up into it: {\mathchar'26\mkern-9muh}. This is pretty horrible, and doesn’t work in Times, no matter what \mkern you use. The definition below actually looks rather decent in all math versions. We define a private bar accent to be taken from the symbols math family, since we don’t know what the \bar accent is (it might follow math alphabets changes). Force the ‘h’ to be taken from letters.

690 \ifnum\mt@hbar=1 %
691 \DeclareMathSymbol \mt@hbar@macron {\mathord}{symbols}{"4E}%
692 \DeclareMathSymbol \mt@hbar@h      {\mathord}{letters}{`\h}
693 \def\hbar@macron#1{\hbox to\z@{\m@th\raisebox{-0.16\height}%
694  {$\csname#1style\endcsname
695  \mkern.65mu\mt@hbar@macron$}\hss}}
696 \def\hbar{\mathord{\mathchoice{\hbar@macron{display}}%
697  {\hbar@macron{text}}%
698  {\hbar@macron{script}}%
699  {\hbar@macron{scriptscript}}%
700  \mt@hbar@h}}

701

702 \fi

\dag, \ddag, \S and \P First a comment: the only reason we are dealing with these symbols at all is that they historically came from math (OMS) fonts; it would be easier to use a text symbol font, but such a font is not yet commonly in use, so we hack around with 8r. If you do have such a setup, the nodag option will skip all of the stuff below and not touch these four symbols, but check that the setup you use does not assume \fam2 is OMS.

The default is to fetch the symbols from 8r. We do not use anything else from 8r, in particular we don’t touch \textregistered, \texttrademark, etc. The 8r.sty “emulation” included herein only deals with the four symbols.

The format files defines these to use text or math versions of the character commands by using definitions similar to^{3}

 \def\P{\ifmmode\mathparagraph\else\textparagraph\fi}

(The actual definition is made robust.) The text versions have declared defaults taken from OMS; the math versions were \mathchars pointing to the (OMS) symbols math family. We do the text versions first, since the handling of the math versions depends on them.

We take the text symbols from 8r fonts, unless we’re told not to (or unless we’re skipping the whole thing). The format file makes the default test encoding for these four symbols OMS, so we don’t have to do anything. 8r fonts.

703 \ifcase\mt@eightR % case 0
704 \PackageInfo{mt11p}{Retaining CM for \string\textdagger, etc}%

We have to be careful here, because the use of 8r fonts is “non-standard”. So check if we have an 8r.fd file for \rmdefault. If so, check for 8r.sty, read that, and (re)declare the four text commands we need. If there’s no 8r.sty, supply just enough to get to the four symbols we need. We assume the TFM files do exist (they have to, because MathTıme virtual fonts use them), but we try loading the tfm file just to make sure.

705 \or % case 1
706 \IfFileExists{8r\rmdefault.fd}%
707  {\IfFileExists{8r.sty}%
708  {\PackageInfo{mt11p}%
709  {MT math using 8r.sty}%
710  \RequirePackage{8r}%
711  \DeclareTextSymbol{\textsection}{8r}{167}%   section
712  \DeclareTextSymbol{\textparagraph}{8r}{182}% paragraph
713  \DeclareTextSymbol{\textdagger}{8r}{134}%    dagger
714  \DeclareTextSymbol{\textdaggerdbl}{8r}{135}% daggerdbl
715  \DeclareTextSymbolDefault{\textsection}{8r}%
716  \DeclareTextSymbolDefault{\textparagraph}{8r}%
717  \DeclareTextSymbolDefault{\textdagger}{8r}%
718  \DeclareTextSymbolDefault{\textdaggerdbl}{8r}%
719  }% using 8r.sty
720  {\PackageWarning{mt11p}%
721  {No file 8r.sty found. Winging it}%
722  \DeclareFontEncoding{8r}{}{\no@accents}%
723  \DeclareFontSubstitution{8r}{\rmdefault}%

3Lines not proceeded by a line number are a part of this description and do not wind up in the sty file!

724  {\mddefault}{\updefault}%
725  \DeclareTextSymbol{\textsection}{8r}{167}%   section
726  \DeclareTextSymbol{\textparagraph}{8r}{182}% paragraph
727  \DeclareTextSymbol{\textdagger}{8r}{134}%    dagger
728  \DeclareTextSymbol{\textdaggerdbl}{8r}{135}% daggerdbl
729  \DeclareTextSymbolDefault{\textsection}{8r}%
730  \DeclareTextSymbolDefault{\textparagraph}{8r}%
731  \DeclareTextSymbolDefault{\textdagger}{8r}%
732  \DeclareTextSymbolDefault{\textdaggerdbl}{8r}%
733  }% faked 8r.sty
734  \input{8r\rmdefault.fd}%
735  }% 8r\rmdefault.fd was available
736  {\PackageWarning{mt11p}%
737  {No fd file for 8r-coded \string\rmdefault\space
738  found; guessing TFM file names}%

If there’s no .fd file for \rmdefault we have to wing it. Just declare the 8r fonts for \rmdefault text family. (That’s all you would have with Computer Modern fonts anyway, and since we’re here, no elaborate setup exists on the system.) Hopefully the TFM files are available and they have the expected names. This will work when someone has the 8r-based fonts installed, but no support for using the raw fonts. To catch the fatal case right now, we just load the 8r font by hand and put a somewhat illuminating comment on the same line in case TEX complains.

739  \font\preloaded=\rmdefault r8r\relax % next time try the `no8r' option
740  \let\preloaded\undefined
741  \DeclareFontEncoding{8r}{}{\no@accents}%
742  \DeclareFontFamily{8r}{\rmdefault}{\hyphenchar\font=-1 }%
743  \DeclareFontSubstitution{8r}{\rmdefault}{\mddefault}{\updefault}%
744  \DeclareFontShape{8r}{\rmdefault}{\mddefault}{\updefault}%
745  {<->\rmdefault  r8r}{}%
746  \DeclareFontShape{8r}{\rmdefault}{\bfdefault}{\updefault}%
747  {<->\rmdefault  b8r}{}%
748  \DeclareFontShape{8r}{\rmdefault}{\mddefault}{\itdefault}%
749  {<->\rmdefault  ri8r}{}%
750  \DeclareFontShape{8r}{\rmdefault}{\bfdefault}{\itdefault}%
751  {<->\rmdefault  bi8r}{}%
752  \DeclareTextSymbol{\textsection}{8r}{167}%   section
753  \DeclareTextSymbol{\textparagraph}{8r}{182}% paragraph
754  \DeclareTextSymbol{\textdagger}{8r}{134}%    dagger
755  \DeclareTextSymbol{\textdaggerdbl}{8r}{135}% daggerdbl
756  \DeclareTextSymbolDefault{\textsection}{8r}%
757  \DeclareTextSymbolDefault{\textparagraph}{8r}%
758  \DeclareTextSymbolDefault{\textdagger}{8r}%
759  \DeclareTextSymbolDefault{\textdaggerdbl}{8r}%
760  }% no 8r\rmdefault.fd

Perhaps we’re skipping this altogether.

761 \or % case 2
762 \PackageInfo{mt11p}{not doing anything with \string\textdagger, etc.}
763 \else % oops
764 \PackageError{mt11p}{PANIC: Unexpected value of \string\mt@eightR}%
765  {\string\dag, \string\ddag, \string\S\space and
766  \string\P\space are probably hosed.}
767 \fi

If we’re told not to use 8r fonts (\mt@eightR = 0) and if \mt@cal = 0, we have no choice but to get OMS as a ‘private’ math alphabet and fetch the symbols from there. The auxiliary macro \mt@al@hexsy gets defined later.

768 \ifcase\mt@eightR % 0: avoid 8r
769 \ifnum\mt@cal=0 %
770  \DeclareMathAlphabet\mt@sy{OMS}{cmsy}{m}{n}
771  \SetMathAlphabet    \mt@sy{normal}{OMS}{cmsy}{m}{n}
772  \SetMathAlphabet    \mt@sy{bold}  {OMS}{cmsy}{b}{n}
773  \SetMathAlphabet    \mt@sy{heavy} {OMS}{cmsy}{\hvdefault}{\updefault}
774  \def\mathsection  {\mt@al@hexsy\mt@sy{78}}
775  \def\dagger       {\mt@al@hexsy\mt@sy{79}}
776  \def\ddagger      {\mt@al@hexsy\mt@sy{7A}}
777  \def\mathparagraph{\mt@al@hexsy\mt@sy{7B}}

(Substitutions have already been declared.) If \mt@cal > 0 we just use \mathcal, which will be OMS.

778 \else % \mt@cal>0
779  \def\mathsection  {\mt@al@hexsy\mathcal{78}}
780  \def\dagger       {\mt@al@hexsy\mathcal{79}}
781  \def\ddagger      {\mt@al@hexsy\mathcal{7A}}
782  \def\mathparagraph{\mt@al@hexsy\mathcal{7B}}
783 \fi

If it’s ok to use the 8r fonts, make them a “private” math alphabet. Here we do need substitution declarations. The .fd file has already been read (or the data supplied).

784 \or % 1: 8r is ok
785 \DeclareMathAlphabet\mt@sy{8r}{\rmdefault}{\mddefault}{\updefault}
786 \SetMathAlphabet \mt@sy {normal}{8r}%
787  {\rmdefault}{\mddefault}{\updefault}
788 \SetMathAlphabet \mt@sy {bold}  {8r}%
789  {\rmdefault}{\bfdefault}{\updefault}
790 \SetMathAlphabet \mt@sy {heavy} {8r}%
791  {\rmdefault}{\hvdefault}{\updefault}
792 \def\mathparagraph{\mt@al@hexsy\mt@sy{B6}}
793 \def\dagger       {\mt@al@hexsy\mt@sy{86}}
794 \def\ddagger      {\mt@al@hexsy\mt@sy{87}}
795 \def\mathsection  {\mt@al@hexsy\mt@sy{A7}}
796 \ifnum\mt@sub=1 %
797  \DeclareFontShape{8r}{\rmdefault}{\hvdefault}{\updefault}% heavy \rm in 8r SUBS
798  {<->ssub*\rmdefault/\bfdefault/\updefault}{}
799 \fi

Or skip it…

800 \or % 2: nothing
801 \PackageInfo{mt11p}{not doing anything with (math) \string\dagger, etc.}
802 \fi

Actually, the code above is suboptimal in the sense that is \encodingdefault happens to be 8r, we waste a math family. Hopefully, no heavy math user is running 8r…

6.9 Auxiliary macro

In a few instances we need a macro to get a specific character from a particular math alphabet, i.e., some thing like “\mathalph{\char"yy}”. You can’t do that though, you would get \mathchar"00yy. The TEX math class 7 and \fam are used to get letters and digits from math alphabets, so we can just say \mathalph{\mathchar"70yy}. The macro below is shorthand for the operation “set character ⟨slot⟩ from the font of the math alphabet \mathalph”.

803 \def\mt@al@hexsy#1#2{#1{\mathchar"70#2}}

where #1 is the math alphabet macro (e.g., \mathcal) and #2 is the hexadecimal number of the slot (no double quote).

6.10 Assorted Fixes, Odds & Ends

Here are a few assorted (sordid;-)) fixes.

Active Underscore Make the underscore character active so we can kern to j, f and p in subscripts. This is rather messy and probably breaks on occasion. The code was basically copied from the MathTıme distribution.

804 \ifcase\mt@sb % case 0
805 \PackageInfo{mt11p}{not using active underscore}
806 \or % case 1
807 \ifnum\the\catcode`\_=8 %
808  \ifnum\the\mathcode`\_=32768 % "8000
809  \PackageInfo{mt11p}{redefining the underscore \string\catcode}
810  \PackageInfo{mt11p}{\string\catcode\space of underscore made 12 (other)}
811  \def\space@.{\futurelet\space@\relax}
812  \space@. %
813  \let\mt@orig@sb_
814  \catcode`\_=\active
815  \def_{\ifmmode\expandafter\sb@\else\expandafter\mt@orig@sb\fi}
816  \let\sb_
817  \def\sb@#1{\mt@orig@sb{\futurelet\next\sb@@#1}}
818  \def\sb@@{\ifx\next\space@\def\next@. {\futurelet\next\sb@@}%
819  \else
820  \def\next@.{\ifx\next j\jadjust
821  \else\ifx\next f\jadjust
822  \else\ifx\next p\mkern-\@ne mu%
823  \fi\fi\fi}%
824  \fi
825  \next@.}
826  \@makeother\_
827  \else % \the\mathcode`\_<>"8000 !
828  \PackageWarning{mt11}{underscore did not have mathcode "8000;
829  \MessageBreak Underscore not made active}
830  \fi
831 \else % \the\catcode`\_<>8 !
832  \PackageWarning{mt11}{underscore was not of category 8;\MessageBreak
833  Underscore not made active}
834 \fi
835 \else % oops
836 \PackageError{mt11p}{PANIC: Unexpected value of \string\mt@sb}%

837  {Underscore not made active.}
838 \fi

\jadjust is just a small negative kern:

839 \def\jadjust{\mkern-\tw@ mu}
\vdots, \ddots and \angle might be missing \m@ths in the \hboxes.
840 \def\vdots{\vbox{\baselineskip4\p@\lineskiplimit\z@\kern6\p@
841  \hbox{$\m@th.$}\hbox{$\m@th.$}\hbox{$\m@th.$}}}
842 \def\ddots{\mathinner{%
843  \mkern1mu\raise7\p@\vbox{\kern7\p@\hbox{$\m@th.$}}\mkern2mu
844  \raise4\p@\hbox{$\m@th.$}\mkern2mu%
845  \raise\p@\hbox{$\m@th.$}\mkern1mu}}

The plainTEX definition of \angle has an \hrule height of 0.34pt; the MathTıme distribution says “0.48pt”. Both of those numbers are suspiciously close to the default rule thickness of the (scaled) extention font. We define \angle to use the default rule thickness, i.e., \fontdimen 8 of the appropriate extention (family 3) font. This does not work in \scriptscriptstyle, but that case is unlikely to occur. The .tfm files have been slightly changed to make \fontdimen 8 really be the rule thickness implied, e.g., by the height of the root glyphs.

846 \def\mt@angle#1#2{{\vbox{\ialign{$\m@th#1##$\crcr
847  \not\mathrel{\mkern14mu}\crcr
848  \noalign{\nointerlineskip}%
849  \mkern2.5mu\leaders\hrule height1.05\fontdimen8#2 3 %
850  \hfill\mkern2.5mu\crcr}}}}
851 \def\angle{\mathchoice{\mt@angle{\scriptstyle}{\scriptfont}}
852  {\mt@angle{\scriptstyle}{\scriptfont}}
853  {\mt@angle{\scriptscriptstyle}{\scriptscriptfont}}
854  {\mt@angle{\scriptscriptstyle}{\scriptscriptfont}}}

The Tie Accent Usually, the \t accent (oo) is taken from an OML font (position "7F). MathTıme has the tie in symbols, so we take it from there, and make it the dafault.

855 \DeclareTextAccent{\t}{LmtS}{"41}
856 \DeclareTextAccentDefault{\t}{LmtS}

\textcircled The large-ish circle for constructing \begin{matrix}c \\ ◯ \end{matrix}, \begin{matrix}r \\ ◯ \end{matrix}, etc., is usually taken from OMS. The LmtS fonts have the same glyph in the same slot, so just redefine the default to point to LmtS. A text symbol font might have \begin{matrix}c \\ ◯ \end{matrix}, etc., available as single characters, e.g., the raw 8r fonts do, but it’s not our business to deal with all that.

857 \DeclareTextAccentDefault{\textcircled}{LmtS}
858 \DeclareTextCommand{\textcircled}{LmtS}[1]{{%
859 \ooalign{\hfil\raise.07ex\hbox{\upshape#1}\hfil\crcr\char13}}}

Misc. text symbols Some text versions of a few symbols (\text⟨symb⟩) point to OM* encodings; change the defaults. Those symbols that exists in T1 will be taken from T1 in text if that’s the \encodingdefault. Try to be nice even if \encodingdefault is OT1 and point the defaults to MathTıme, so we don’t needlessly resort to Computer Modern. Noone uses these definitions directly, but macros might.

860 \DeclareTextSymbol{\textless}{LmtL}{60}% afm names
861 \DeclareTextSymbol{\textgreater}{LmtL}{62}
862 \DeclareTextSymbol{\textperiodcentered}{LmtS}{1}
863 \DeclareTextSymbol{\textasteriskmath}{LmtS}{3}% centered
864 \DeclareTextSymbol{\textopenbullet}{LmtS}{14}
865 \DeclareTextSymbol{\textbullet}{LmtS}{15}
866 \DeclareTextSymbol{\textbraceleft}{LmtS}{102}
867 \DeclareTextSymbol{\textbraceright}{LmtS}{103}
868 \DeclareTextSymbol{\textbar}{LmtS}{106}
869 \DeclareTextSymbol{\textbackslash}{LmtS}{110}

Make these the default:

870 \DeclareTextSymbolDefault{\textperiodcentered}{LmtS}
871 \DeclareTextSymbolDefault{\textasteriskmath}{LmtS}
872 \DeclareTextSymbolDefault{\textopenbullet}{LmtS}
873 \DeclareTextSymbolDefault{\textbullet}{LmtS}
874 \DeclareTextSymbolDefault{\textbraceleft}{LmtS}
875 \DeclareTextSymbolDefault{\textbraceright}{LmtS}
876 \DeclareTextSymbolDefault{\textbar}{LmtS}
877 \DeclareTextSymbolDefault{\textbackslash}{LmtS}
878 \DeclareTextSymbolDefault{\textless}{LmtL}
879 \DeclareTextSymbolDefault{\textgreater}{LmtL}

Oldstyle Digits (See Sec. 3.10). MathTıme has no oldstyle digits, so we grab the ones from OML. I’m not sure it’s useful to have this command in math mode, but we might as well do that too, though not via a math family—we define a private \math@OS alphabet instead. Read the .fd file, in case the format did no preloading. nomathOS disables the math family.

880 \ifcase\mt@osdg % case 0
881 \def\math@OS#1{\PackageError{mt11p}{oldstyle digits not loaded for math}%
882  {Don't use the nomathOS option.}%
883  {\hbox{\oldstylenums{#1}}}}% as good as anything else
884 \or % case 1
885 \DeclareMathAlphabet\math@OS {OML}{cmm}{m}{it}
886 \SetMathAlphabet    \math@OS {normal}{OML}{cmm}{m}{it}
887 \SetMathAlphabet    \math@OS {bold}  {OML}{cmm}{b}{it}
888 \SetMathAlphabet    \math@OS {heavy} {OML}{cmm}{\hvdefault}{\itdefault}
889 \else % oops
890 \PackageError{mt11p}{PANIC: Unexpected value of \string\mt@osdg}%
891  {Oldsyle digits in math are hosed.}
892 \fi
893 \ifnum\mt@sub=1 %
894 \InputIfFileExists{omlcmm.fd}\relax % grrr...
895  {\InputIfFileExists{OMLcmm.fd}\relax
896  {\PackageError{mt11p}{No OMLcmm.fd file}%
897  {Your are missing a basic distribution file. %
898  Check the LaTeX installation.}}}
899 \DeclareFontShape{OML}{cmm}{\hvdefault}{\itdefault}%
900  {<->ssub*cmm/b/it}{}%      heavy cmmi SUBS
901 \fi

The \oldstylenums macro just picks between using the OML font as a text font, or the \math@OS math alphabet. If the argument contains things other than digits, the result will be amusing…

902 \def\oldstylenums#1{%
903  \ifmmode
904  \math@OS{#1}%
905  \else
906  {\usefont{OML}{cmm}{\f@series}{it}#1}%
907  \fi}

 6.11 \boldsymbol and \heavysymbol

As mentioned above, we assumed that formulæ do not require simultaneous access to fonts in different math versions, or, more precisely, that a single math list need not contain several weights of, e.g., the symbols fonts. In other words, that it is not worth while to simultaneously have several weights of, e.g., the symbols fonts available as “\mathchars”. Instead we fetch the AMS package amsbsy, which defines a “\boldsymbol” macro and define a similar “\heavysymbol” macro. Don’t do it if we’re told not to, or if we can’t find amsbsy.sty and don’t overwrite existing definitions.

908 \ifcase\mt@bsy % case 0
909 \providecommand{\boldsymbol}[1]{\PackageError{mt11p}%
910  {Get or load the package amsbsy
911  to use \string\boldsymbol}{See above.}#1\relax}
912 \providecommand{\heavysymbol}[1]{\PackageError{mt11p}%
913  {Get or load the package amsbsy
914  to use \string\heavysymbol}{See above.}#1\relax}
915 \providecommand{\normalsymbol}[1]{\PackageError{mt11p}%
916  {Get or load the package amsbsy
917  to use \string\normalsymbol}{See above.}#1\relax}
918 \or % case 1
919 \IfFileExists{amsbsy.sty}%
920  {\RequirePackage{amsbsy}%
921  \DeclareRobustCommand{\heavysymbol}[1]{%
922  \begingroup
923  \let\@nomath\@gobble \mathversion{heavy}%
924  \math@atom{##1}{%
925  \mathchoice
926  {\hbox{$\m@th\displaystyle##1$}}%
927  {\hbox{$\m@th\textstyle##1$}}%
928  {\hbox{$\m@th\scriptstyle##1$}}%
929  {\hbox{$\m@th\scriptscriptstyle##1$}}}%
930  \endgroup}%
931  \DeclareRobustCommand{\normalsymbol}[1]{%
932  \begingroup
933  \let\@nomath\@gobble \mathversion{normal}%
934  \math@atom{##1}{%
935  \mathchoice
936  {\hbox{$\m@th\displaystyle##1$}}%
937  {\hbox{$\m@th\textstyle##1$}}%
938  {\hbox{$\m@th\scriptstyle##1$}}%
939  {\hbox{$\m@th\scriptscriptstyle##1$}}}%
940  \endgroup}%

941  }% using amsbsy.sty
942  {\PackageError{mt11p}{No file `amsbsy.sty' found}%
943  {Use the `nobsy' option if you don't have or \MessageBreak
944  don't want the AMS \string\boldsymbol\space macro.}
945  \let\boldsymbol\@firstofone
946  \let\heavysymbol\@firstofone
947  \let\normalsymbol\@firstofone
948  }% no amsbsy.sty
949 \else % oops
950 \PackageError{mt11p}{PANIC: Unexpected value of \string\mt@bsy}%
951  {The \string\boldsymbol\space macro is probably hosed.}
952 \fi

6.12 Examples of new math symbol definitions

Note that code in this section, and some of the code in the following sections is not included in the package .sty file. It’s meant as an example of things that could be put into a mt11p.cfg file.

Here follow a few examples of defining more math symbols in order to easily and efficiently mix symbols normally found in different math versions. Note that it is rarely worth it perform such definitions—not even the AMS document classes do it. For more details about NFSS see the standard L^{A}TEX documentation

file fntguide.tex.

Upright lower case Greek letters as symbols. The font set includes a letters font with upright lower case Greek letters (l.c.G.). Usually italic or slanted l.c.G. are used as symbols, though recently it’s possible see the Post-Script Symbols font (upright; noone bothers to skew it) used a lot, but that is a more a sign of weak software. The upright l.c.G. letters are made available in both text and math (Sec. 3.9). It would be possible to make them available as math symbols by using the code below. (The code is not available as an option, because there is no common definition for how the symbols should be named; for illustration we call the symbols \upalpha, \upbeta, etc.)

First define a math symbol font:

 \DeclareSymbolFont{upgreek}{LmtL}{mtl}{\mddefault}{\uidefault}

Don’t redefine \mathgr to point to the upgreek family, because the encodings aren’t even close.

Next set the math versions:

 \SetSymbolFont{upgreek}{normal}{LmtL}{mtl}{\mddefault}{\uidefault}
 \SetSymbolFont{upgreek}{bold}{LmtL}{mtl}{\bfdefault}{\uidefault}
 \SetSymbolFont{upgreek}{heavy}{LmtL}{mtl}{\hvdefault}{\uidefault}

If this step is omitted, the upgreek symbol font family will be the same in all math versions.

Lastly, make the symbol declarations (choose names that don’t conflict with existing symbols):

 \DeclareMathSymbol{\upalpha}{\mathord}{upgreek}{"0B}

\DeclareMathSymbol{\upbeta}{\mathord}{upgreek}{"0C}
\DeclareMathSymbol{\upgamma}{\mathord}{upgreek}{"0D}
\DeclareMathSymbol{\updelta}{\mathord}{upgreek}{"0E}
\DeclareMathSymbol{\upepsilon}{\mathord}{upgreek}{"0F}
\DeclareMathSymbol{\upzeta}{\mathord}{upgreek}{"10}
\DeclareMathSymbol{\upeta}{\mathord}{upgreek}{"11}
\DeclareMathSymbol{\uptheta}{\mathord}{upgreek}{"12}
\DeclareMathSymbol{\upiota}{\mathord}{upgreek}{"13}
\DeclareMathSymbol{\upkappa}{\mathord}{upgreek}{"14}
\DeclareMathSymbol{\uplambda}{\mathord}{upgreek}{"15}
\DeclareMathSymbol{\upmu}{\mathord}{upgreek}{"16}
\DeclareMathSymbol{\upnu}{\mathord}{upgreek}{"17}
\DeclareMathSymbol{\upxi}{\mathord}{upgreek}{"18}
\DeclareMathSymbol{\uppi}{\mathord}{upgreek}{"19}
\DeclareMathSymbol{\uprho}{\mathord}{upgreek}{"1A}
\DeclareMathSymbol{\upsigma}{\mathord}{upgreek}{"1B}
\DeclareMathSymbol{\uptau}{\mathord}{upgreek}{"1C}
\DeclareMathSymbol{\upupsilon}{\mathord}{upgreek}{"1D}
\DeclareMathSymbol{\upphi}{\mathord}{upgreek}{"1E}
\DeclareMathSymbol{\upchi}{\mathord}{upgreek}{"1F}
\DeclareMathSymbol{\uppsi}{\mathord}{upgreek}{"20}
\DeclareMathSymbol{\upomega}{\mathord}{upgreek}{"21}
\DeclareMathSymbol{\upvarepsilon}{\mathord}{upgreek}{"22}
\DeclareMathSymbol{\upvartheta}{\mathord}{upgreek}{"23}
\DeclareMathSymbol{\upvarpi}{\mathord}{upgreek}{"24}
\DeclareMathSymbol{\upvarrho}{\mathord}{upgreek}{"25}
\DeclareMathSymbol{\upvarsigma}{\mathord}{upgreek}{"26}
\DeclareMathSymbol{\upvarphi}{\mathord}{upgreek}{"27}
\DeclareMathSymbol{\upvarkappa}{\mathord}{upgreek}{'176}

That is the complete set; of course, you need not define them all.

Additional math accents can be defined in an entirely analogous way by using \DeclareMathAccent. NFSS can define two types of accents: \mathord, which are taken from a fixed font, and \mathalpha, which change with math alphabets. A specially declared accent will probably be \mathord; do not use \mathalpha unles you know what you’re doing. An example for a math symbol font family called boldsyms which has an accent in slot "52 is

\DeclareMathAccent{\boldddot}{\mathord}{boldsyms}{"52}

Declaring additional math delimiters Although any combination of symbols from various math versions can be achieved through the use of \boldsymbol and \heavysymbol, it can be inefficient and awkward to have to do so frequently. Particularly tedious are delimiters, which either require freezing their size (\boldsymbol{\Bigg(}), or cryptic constructs involving \vphantoms. In this case it is also possible to define special math symbols that work as expected. The procedure is similar to the one for declaring upright Greek letters as symbols, an outline follows. TEX’s math workings are described in D. E. Knuth’s The TEXbook and, e.g., in TEX by topic by V. Eijkhout.

First declare a new symbol font, e.g.,

 \DeclareSymbolFont{hvlargesymbols}{OMX}{mtx}{\hvdefault}{\updefault}

Next define the delimiter itself:

\DeclareMathDelimiter{⟨cmd⟩}{⟨math type⟩} {⟨small⟩}{⟨small slot⟩}{⟨large⟩}{⟨large slot⟩}

where {⟨small⟩} and {⟨large⟩} are two symbol font math families. If you’re defining a new delimiter from some special font, you probably only have one variant (or more precisely one chain of linked delimiters). This command does not allow making a variant null (000) without assuming that operators is math family 0, but it is possible to make sure the small variant “succeeds” in finding a delimiter (e.g., an extensible delimiter will always terminate a search), so that the large variant is irrelevant.

For example, assuming there is a math symbol font family called hvlargesymbols (see above), \lbraceHV and \rbraceHV will produce correctly sized heavy braces:

 \DeclareMathDelimiter{\lbraceHV}{\mathopen}{hvlargesymbols}{"08}%
                                            {hvlargesymbols}{"08}
 \DeclareMathDelimiter{\lbraceHV}{\mathclose}{hvlargesymbols}{"09}%
                                            {hvlargesymbols}{"09}

(The small and large variants are identical, but since the small one will always succeed—the last delimiter in the chain is extendible—the large one never comes into play.) \delcodes are not normally changed.

Running out of math families TEX with NFSS is limited to 16 math font families in any single math version, and it’s not all too difficult to run into the limit. With the default options, it’s possible to load four more math symbol fonts/alphabets. (A \DeclareSymbolFont and an accompanying

\DeclareSymbolFontAlphabet take up one family.) The options nomathgr and

nomathOS will each cause one less math family to be used. The cmcal option uses one math family more than mtcal or nomtms (as long as 8r is ok for the four infamous symbols). If you do run out of math families, declare a new math version, or define infrequently used symbols as explicit font/character references in text mode (in an \hbox), possibly wrapped in \mathchoice and an explicit class

command, e.g., \mathbin. See fntguide.tex.

6.13 Unused glyphs

This package leaves no unique MathTıme glyphs inaccessible. A few glyphs are repeated more than once in a font, or are present in more than one font. It makes no difference to TEX whether a font is taken from letters or symbols.

It would be possible to take the small square root sign from the largesymbols font, rather than from the symbols font. That largesymbols radical ("9F) is, however, completely identical to the one in symbols, so it’s rather pointless. The command would be

 \DeclareMathRadical{\sqrtsign}{largesymbols}{"9F}{largesymbols}{"70}

The extra root sign in mtsyn (not present in mtsy) is identical to the usual one, except for a vertical shift. Since a ‘radical’ sign is normally of class 1 (\mathop), it gets vertically centered anyway. This alternate radical glyph could be used by defining something like

  \DeclareMathSymbol{\varsurd}{\mathop}{symbols}{"84}

6.14 muskip Assignments

A little smaller than for Computer Modern. The original setting is

  \thinmuskip=3mu
  \medmuskip=4mu plus 2mu minus 4mu
  \thickmuskip=5mu plus 5mu

and we’ll use

953 \thinmuskip=2mu␣\relax
954 \medmuskip=2.5mu␣plus␣1mu␣minus␣1mu␣\relax
955 \thickmuskip=4mu␣plus␣1.5mu␣minus␣1mu␣\relax

6.15 Local Configuration File

Provide a hook to load anything important or complicated enough to be inappropriate for the main input file.

956 \InputIfFileExists{mt11p.cfg}%
957  {\typeout{**************************************^^J%
958  * Local config file mt11p.cfg loaded *^^J%
959  **************************************}%
960  }{}

6.16 Cleanup

Do the resizing now:

961 \mt@exit

Restore any crazy catcodes.

962 \catcode`\"\mt@quotedbl
963 \catcode`\'\mt@quotesinglr
964 \catcode`\:\mt@colon
965 \catcode`\?\mt@question
966 \catcode`\;\mt@semicolon
967 \catcode`\!\mt@exclam

Make the various scratch macros, etc., we used \undefined, but keep \mt@cal and \mt@ops, in case we need to decide something based on them. A ‘real’ input file should not do such a thing, but a demo document might.

968 \let\mt@quotedbl  \undefined
969 \let\mt@quotesinglr\undefined
970 \let\mt@colon     \undefined
971 \let\mt@question  \undefined
972 \let\mt@semicolon \undefined
973 \let\mt@exclam    \undefined

974 \let\mt@exit      \undefined
975 \let\MathTimeSizes\undefine
976 \let\mt@enc       \undefined
977 \let\times@style  \undefined
978 \let\mt@fd@check  \undefined
979 \let\mt@accs      \undefined
980 \let\mt@accent@make\undefined
981 \let\mt@hbar      \undefined
982 \let\mt@eightR    \undefined
983 \let\mt@bsy       \undefined
984 \let\mt@sb        \undefined
985 \let\mt@mgrs      \undefined
986 \let\mt@osdg      \undefined
987 \let\mt@assign@del\undefined
988 %\let\mt@cal       \undefined
989 %\let\mt@ops       \undefined

… and we’re done.