The microtype package

An interface to the micro-typographic extensions of pdfTEX

            R Schlicht w.m.l@gmx.net

v1.6a — 2005/02/02

Abstract

The microtype package provides an interface to the micro-typographic extensions of pdfTEX: character protrusion and font expansion. It allows to restrict font expansion and/or character protrusion to a customizable set of fonts, and to configure all micro-typographic aspects of the fonts in a straight-forward and flexible way. Settings for various fonts are provided.^{1}

Note that font expansion and character protrusion will only work with pdfTEX, at least version 0.14f. Automatic font expansion requires version 1.20a or newer. The package will by default enable the features that can safely be assumed to work.

Contents

1 Micro-Typography with pdfTEX 3

2 Invoking the Package 4 2.1 General Options . . . . . . . . . . . . . . . . . . . . . . . . 4 2.2 Option for Character Protrusion . . . . . . . . . . . . . . . 5 2.3 Options for Font Expansion . . . . . . . . . . . . . . . . . . 6

3 User Command 7

4 Configuration 7 4.1 Declaring Font Sets . . . . . . . . . . . . . . . . . . . . . . . 7 4.2 Micro Fine Tuning . . . . . . . . . . . . . . . . . . . . . . . 9

4.2.1 Character Protrusion . . . . . . . . . . . . . . . . . . 9 4.2.2 Font Expansion . . . . . . . . . . . . . . . . . . . . . 11

4.3 Character Inheritance . . . . . . . . . . . . . . . . . . . . . 12 4.4 Configuration Files . . . . . . . . . . . . . . . . . . . . . . . 12 5 Caveats 14

1 Currently, this package provides settings for Computer Modern Roman, Palatino,

Times, Adobe Garamond and Minion, and Bitstream Charter, as well as some generic settings for unknown fonts.

6 Contributions 14

7 Acknowledgments 15

8 References 15

9 Short History 15

10 Implementation 17 10.1 Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . 18 10.2 Auxiliary macros . . . . . . . . . . . . . . . . . . . . . . . . 20 10.3 Setting up a font . . . . . . . . . . . . . . . . . . . . . . . . 23

10.3.1 Protrusion . . . . . . . . . . . . . . . . . . . . . . . . 25 10.3.2 Expansion . . . . . . . . . . . . . . . . . . . . . . . . 28 10.3.3 Generic macros . . . . . . . . . . . . . . . . . . . . . 31 10.3.4 Hook into L^{A}TEX’s font selection . . . . . . . . . . . 38

10.4 Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . 40 10.4.1 Font Sets . . . . . . . . . . . . . . . . . . . . . . . . 40 10.4.2 Declarations . . . . . . . . . . . . . . . . . . . . . . . 44 10.4.3 Fine Tuning . . . . . . . . . . . . . . . . . . . . . . . 45 10.4.4 Character Inheritance . . . . . . . . . . . . . . . . . 49 10.4.5 Permutation . . . . . . . . . . . . . . . . . . . . . . 51

10.5 User Command . . . . . . . . . . . . . . . . . . . . . . . . . 53 10.6 Package Options . . . . . . . . . . . . . . . . . . . . . . . . 55

11 Configuration Files 61 11.1 Character Inheritance . . . . . . . . . . . . . . . . . . . . . 61 11.2 Font Expansion . . . . . . . . . . . . . . . . . . . . . . . . . 63 11.3 Character Protrusion . . . . . . . . . . . . . . . . . . . . . . 64

11.3.1 Default . . . . . . . . . . . . . . . . . . . . . . . . . 65 11.3.2 Italics . . . . . . . . . . . . . . . . . . . . . . . . . . 69 11.3.3 Small caps . . . . . . . . . . . . . . . . . . . . . . . 75 11.3.4 textcomp . . . . . . . . . . . . . . . . . . . . . . . . 79 11.3.5 Math . . . . . . . . . . . . . . . . . . . . . . . . . . 83

12 Auxiliary file for micro-fine tuning 89

A Change History 92

B Index 95

List of Tables

1 Predefined font sets . . . . . . . . . . . . . . . . . . . . . . . . . 8 2 Order for matching font attributes . . . . . . . . . . . . . . . . . 10 3 Fonts with tailored protrusion settings . . . . . . . . . . . . . . . 13

1 Micro-Typography with pdfTEX

pdfTEX, the TEX extension written by Hàn Thế Thành, introduces two features that make it the tool of choice not only for the creation of electronic documents but also of works of outstanding time-honoured typography: character protrusion (also known as margin kerning) and font expansion. Quoting Hàn Thế Thành’s thesis:

‘Margin kerning is the adjustments of the characters at the margins of a typeset text. A simplified employment of margin kerning is hanging punctuation. Margin kerning is needed for optical alignment of the margins of a typeset text, because mechanical justification of the margins makes them look rather ragged. Some characters can make a line appear shorter to the human eye than others. Shifting such characters by an appropriate amount into the margins would greatly improve the appearance of a typeset text. Composing with font expansion is the method to use a wider or narrower variant of a font to make interword spacing more even. A font in a loose line can be substituted by a wider variant so the interword spaces are stretched by a smaller amount. Similarly, a font in a tight line can be replaced by a narrower variant to reduce the amount that the interword spaces are shrunk by. There is certainly a potential danger of font distortion when using such manipulations, thus they must be used with extreme care. The potentiality to adjust a line width by font expansion can be taken into consideration while a paragraph is being broken into lines, in order to choose better breakpoints.’ [Thành 2000, 323]

Both these features have been lacking a simple L^{A}TEX user interface for quite some time. Then, the pdfcprot package was published [pdfcprot], which allowed L^{A}TEX users to employ character protrusion without having to mess much with the internals.

Font expansion, however, was still most difficult to utilize, since it required that the font metrics be available in all levels of expansion. Therefore, anybody who wanted to use this feature had to create multiple instances of the fonts in advance. Shell scripts to somewhat relieve the user from this burden were available – however, it remained a cumbersome task. Furthermore, all fonts were still being physically created, thus wasting compilation time and disk space.

In the summer of 2004, Hàn Thế Thành implemented a feature that can be expected to prove as a major facilitation for TEX and L^{A}TEX users: Font expansion can now take place automatically. That is, pdfTEX no longer needs the expanded font metrics but will calculate them at compile-time, and completely in memory.

This package provides a simple interface to both font expansion and character protrusion.^{2} All micro-typographic aspects may be customized to your taste and needs in a straightforward manner. The next chapters will present a survey of all options and customization possibilities.

2 Invoking the Package

There is nothing surprising in loading this package:

\usepackage{microtype}

This will be sufficient in most cases, and if you are not interested in fine-tuning the micro-typographic appearance of your document (which would seem unlikely, since using this package is proof of your interest in typographic issues), you may actually skip the rest of this document.

2.1 General Options

Like many other L^{A}TEX packages, the microtype package accepts options in the well known key=value syntax. In the following, you’ll find a description of all keys and their possible values (the \underline{underlined} value may be omitted in the options list; some values are ⟨placeholders⟩; multiple values, where allowed, must be enclosed in braces).

protrusion  \underline{true}, false, compatibility, \underline{nocompatibility}, ⟨font set name⟩

expansion These are the main options to control the level of micro-typography that should be applied to the fonts in your document. By default, the package is moderately greedy: Character protrusion will be enabled, font expansion will only be disabled in circumstances where pdfTEX cannot expand the fonts automatically, that is, if it is either too old (versions before 1.20) or if the output mode is DVI (see next option).

Protrusion and expansion may be enabled or disabled independently from each other by setting the respective key to true resp. false. The

activate  activate option is a shortcut for setting both expansion and protrusion

at the same time. So, the following lines all have the same effect (when creating PDF files with a new pdfTEX):

\usepackage[protrusion=true,expansion=true]{microtype}
\usepackage[protrusion,expansion]{microtype}
\usepackage[activate={true,nocompatibility}]{microtype}
\usepackage{microtype}

2 Therefore, it is an alternative, not a supplement, to the pdfcprot package.

When pdfTEX employs font expansion and character protrusion, line breaks (and consequently, page breaks) may turn out differently. If that is not desired, you may pass the value compatibility to the protrusion and/or expansion options. Typographically, however, the results may be suboptimal.

Finally, you may also specify the name of a font set to which character protrusion and/or font expansion should be restricted. See chapter 4.1 for a detailed discussion.

DVIoutput  \underline{true}, false

pdfTEX is not only able to generate PDF output but can also spit out DVI files.^{3} The latter can be ordered with the option DVIoutput, which will set

\pdfoutput to zero.

Note that this might confuse packages that depend on the value of \pdfoutput, if they were loaded earlier, as they had been made believe that they were called to generate PDF output where they actually weren’t. These packages are, among others: graphics, color, hyperref, pstricks and, of course, ifpdf. Either load these packages after microtype or else issue the command \pdfoutput=0 earlier – in the latter case, the DVIoutput option is redundant.

When generating DVI files, font expansion has to be enabled explicitly. Automatic font expansion will not work because dvips (resp. the DVI viewer) is not able to generate the expanded fonts on the fly.

draft  \underline{true}, false

final If the draft option is passed to the package, font expansion and character protrusion will be turned off. The draft and final may options may also be inherited from the class options; of course, you can override them in the package options.

verbose  \underline{true}, false

Information on each font being set up will be written into the log file if you enable the verbose option, which is disabled by default.

2.2 Option for Character Protrusion

factor ⟨number⟩ (\underline{1000})

Using this option, you can globally increase or decrease the amount that characters will be protruded. While a value of 1000 means that the full protrusion as specified in the configuration (see section 4.2) will be used, a value of 500 would result in halving all protrusion factors of the configuration. This might be useful if you are happy with the settings but prefer the margin kerning to be less or more visible (e. g., if you are so proud of being able to use this feature that you want everybody to see it, or – to mention a motivation more in compliance with typographical correctness – if you are using a large font that calls for more modest protrusion).

3 TEX systems are beginning to switch to pdfTEX as the default engine even for DVI

output.

2.3 Options for Font Expansion

auto  \underline{true}, false

As noted in chapter 1, font expansion may take place automatically. This option is true by default provided that pdfTEX’s version is found to be 1.20 or higher and output mode is PDF; otherwise, it will be disabled. If auto is set to false, the fonts for all expansion steps must exist.

stretch ⟨number⟩ (\underline{20})

shrink You may specify the stretchability and shrinkability of a font, i. e. the maximum amount that a font may stretch or shrink. The numbers will be divided by 1000, so that a stretch factor of 10 means that the font may be expanded by up to 1%.

The default stretch factor is 20. The shrink factor will by default be the same as the stretch factor. Therefore, the following lines are equivalent:

\usepackage[stretch=20,shrink=20]{microtype}
\usepackage[stretch=20]{microtype}
\usepackage{microtype}

step ⟨number⟩ (\underline{min(stretch,shrink)/5}) Font expansion will be applied in discrete steps. For example, if step is set to 4 (which it is by default), pdfTEX may use up to eleven different expansion levels of a font (from −20 to 20). If you set stretch or shrink to something other than their default values but do not specify step, it will be set to 1/5th of the smaller value of the two.

selected  \underline{true}, false

When applying font expansion, some characters may be expanded by a lesser amount than others if they are more sensitive to deformation (e. g., the ‘O’, in contrast to the ‘I’). This is called selected expansion, and its usage allows to increase the stretch and shrink limits (to, say, 30 instead of 20); however, the gain is limited since at the same time the average stretch variance will be decreased.

Beginning with version 1.5, where this option was introduced, it is by default set to false, so that all characters will be expanded by the same amount. See section 4.2.2 for a more detailed discussion.

3 User Command

\microtypesetup {⟨key = value list⟩} This command may be used anywhere in the document to change the general settings of the micro-typographic extensions. It accepts the keys: expansion, protrusion and activate, which in turn may receive the val-

ues true, false, compatibility or nocompatibility (but not the name

of a font set). Thus, you could temporarily disable font expansion by saying:

\microtypesetup{expansion=false}

4 Configuration

4.1 Declaring Font Sets

By default, all text fonts that are being used in the document will be subjected to protrusion and a basic set of fonts to expansion. You may want to customize the set of fonts which should get the benefit of microtypographic treatment. This can be achieved by specifying attributes of the font that have to be matched for them to be taken into account.

\DeclareMicroTypeSet  [protrusion|expansion] {⟨set name⟩} {⟨set of fonts⟩}

\DeclareMicroTypeSet* This macro declares a new set of fonts to which font expansion or character protrusion (or, if no optional argument is given, both) should be applied. This set can then be activated by calling:

\UseMicroTypeSet[protrusion|expansion]{⟨set name⟩}

The starred version of the command declares and activates the font set at the same time.

The set of fonts is specified by assigning values to the NFSS font attributes: encoding, family, series, shape, and size (cf. [L^{A}TEX 2ε font selection]). Let’s start with an example. This package defines a font set called ‘basictext’ in the configuration file as follows:

\DeclareMicroTypeSet{basictext}
   { encoding = {T1,OT1,LY1},
     family   = {rm*,sf*},
     series   = {m},
     shape    = {},
     size     = {normalsize,footnotesize,small,large}
   }

If you now call

\UseMicroTypeSet[expansion]{basictext}

          all     alltext (allmath)  basictext (basicmath)  normalfont

encoding –

T1, OT1, LY1, TS1 (OML, OMS)

T1, OT1, LY1 (OML, OMS)

                                                   \encodingdefault

family  –  –  \rmdefault, \sfdefault   \familydefault
series  –  –  m  \seriesdefault
shape  –  –  –  \shapedefault

size – –

                                    \normalsize,
                                    \footnotesize,
                                    \small, \large

                                                   \normalsize

Table 1: Predefined font sets

in the document’s preamble, only fonts in the text encodings T1, OT1 or LY1, roman or sans serif families, normal (or ‘medium’) series, and in sizes called

by \normalsize, \footnotesize, \small or \large, will be expanded.

Math fonts, on the other hand, will not, since they are in a different encoding. Neither will fonts in bold face, or huge fonts. Etc. (This font set will be activated for font expansion unless you choose a different one.)

If an attribute list is left empty – be it by saying something like ‘shape={}’, as in the above example, or by not specifying it at all –, it does not constitute a restriction. In other words, this is equivalent to specifying all possible values for that attribute.

Therefore, the predefined set ‘alltext’, declared like this:

\DeclareMicroTypeSet{alltext}
   { encoding = {T1,OT1,LY1,TS1} }

is far less restrictive. Here, the only condition is the encoding. (This is the default font set for character protrusion.)

If a value is followed by an asterisk (like ‘rm*’ and ‘sf*’ in the example above), it does not designate a NFSS code, but will expand to the current \⟨value⟩default, e. g. \rmdefault.^{4} For example, if you want to include the bold font, too, you should say ‘bf*’ instead of ‘b’ (\bfdefault for Computer Modern is ‘bx’, while for other fonts, it might be ‘b’ or even ‘sb’). A single asterisk means \⟨characteristic⟩default, e. g. \encodingdefault, respectively \normalsize for the size axis. Sizes may be either specified as a dimension (10 or 10pt), or as a size selection command without the backslash.

Table 1 shows an overview of all predefined font sets. You may also activate these by passing their name to the expansion resp. protrusion option when loading the package, for example:

\usepackage[protrusion=allmath,expansion=basicmath]{microtype}

4 Note that this expansion will take place immediately, so you should make all relevant

changes before loading this package.

\UseMicroTypeSet  [protrusion|expansion] {⟨set name⟩}

This macro activates a font set previously defined by \DeclareMicroTypeSet. Using the optional argument, you can limit the application of the set to protrusion or expansion only.

The commands \DeclareMicroTypeSet and \UseMicroTypeSet may only

be used in the preamble or in the main configuration file (cf. chapter 4.4).

4.2 Micro Fine Tuning

For typographic reasons, not all characters should be protruded by the same amount. It may also be desirable to restrict expansion of certain characters. Therefore, you can specify this amount for each character. Furthermore, since every font looks different, you will want to be able to do this for each font or set of fonts separately.

4.2.1 Character Protrusion

\SetProtrusion [⟨options⟩] {⟨set of fonts⟩} {⟨character list⟩} Using this macro, you can set the protrusion factors for each character of a font or a set of fonts.

A very incomplete example would be the following:

\SetProtrusion
   { encoding = T1,
     family   = cmr }
   {  A             = {50,50},
     \textquoteleft = {700, }  }

which would result in the character ‘A’ being protruded by 5% of its width on both sides, and the left quote character by 70% into the left margin. This would apply to all font shapes, series and sizes of the Computer Modern Roman family in encoding T1.

The character list may contain a number of ⟨character⟩ = ⟨protrusion factors⟩ pairs. Characters can be specified either as a single character (‘A’), as a command that has been defined by \DeclareTextSymbol (‘\textquoteleft’), or as a slot number: three digits for decimal notation, prefixed with " for hexadecimal, with ' for octal (e. g.: 092, "5C, '134). 8-bit characters may be entered directly or in the L^{A}TEX 7-bit way of defining them: both Ä and \"A are valid, provided the character is actually included in the encoding. You also have the possibility to declare sets of characters which should inherit protrusion or expansion factors (see section 4.3).

The numbers designate the amount that a character should be protruded into the left margin (first value) respectively into the right margin

1. 2. 3. 4. 5. 6. 7. 8.
encoding • • • • • • • •
family  • • • • • – – –
series  • • • – – • – –
shape  • • – • – – • –
size  • – – – – – – –

Table 2: Order for matching font attributes

(second value), where 1000 means that the character should be kerned fully into the margin, while, for example, a value of 50 means that it should be protruded by 5% of its width. Negative values are admitted, as well as numbers larger than 1000 (but effectively not more than 1em of the font). You can omit either number if the character should not be protruded on that side, but must not drop the separating comma.

The set of fonts should be declared using the same syntax of ⟨font axis⟩ = ⟨value list⟩ pairs as in the command \DeclareMicroTypeSet.

To determine whether a given font matches the specified set, the package will test all combinations of font family, series and shape. The font size will only be taken into account if all other criteria match as well. The encoding must always match.

Table 2 shows the order in which the combinations of font characteristics will be tested.

Optional Options:

name You may assign a name to the protrusion settings, so that you are able to load it by another set.

load You can load another list (provided, you previously assigned a name to it), before the current list will be loaded, so that the fonts will inherit the values from the loaded list.

factor This option can be used to influence all protrusion factors of the font or font set, overriding any global factor setting (see section 2.2).

The name and load options provide a way to simplify the configuration considerably. You can for instance create a default list for a font; settings for other shapes or series can then load these settings, and extend or overwrite them (since the value that comes last will take precedence). Font settings will be loaded recursively.

4.2.2 Font Expansion

\SetExpansion [⟨options⟩] {⟨set of fonts⟩} {⟨character list⟩} By default, all characters of a font are allowed to be stretched or shrunk by the same amount. However, it is also possible to limit the expansion of certain characters if they are more sensitive to deformation. This is the purpose of the \SetExpansion macro. Note that it will only have an effect if the package has been loaded with the selected option.

The character list contains a number of ⟨character⟩ = ⟨expansion factor⟩ pairs. You may specify one number for each character, which determines the amount that a character may be expanded. The numbers denominate thousandth of the full expansion. For example, if you set the expansion factor for the character ‘O’ to 500, it will only be expanded or shrunk by one half of the amount that the rest of the characters will be expanded or shrunk. While the default value for character protrusion is 0 – that is, if you didn’t specify any characters, none would be protruded –, the default value for expansion is 1000, which means that all characters would be expanded by the same amount.

The font set is specified in the same way as in \SetProtrusion.

Options: Additionally to name, load and factor, the optional first argument accepts the following options: stretch, shrink, step, auto.

Using these, you may override the global settings specified in the package options. If you don’t specify either one of stretch, shrink and step, their respective global value will be used (that is, no calculation will take place). You could for instance take advantage of these options in the following way:

\SetExpansion
   [ load     = T1-default,
     stretch  = 10 ]
   { series   = bf*,
     encoding = T1  }
   { }

This would use the settings for the characters as defined in the list T1-default, but expand the bold font by a smaller value (compared to the default stretch factor of 20).

However, since pdfTEX does not allow different expansion limits or steps within one paragraph, a different method is also provided with the factor option, using which you can influence the expansion factors of all characters (in contrast to the overall stretchability) of the font. The factor option can only be used to decrease the stretchability of the characters, that is, it may only receive values smaller than 1000. Also, it can only be used on a per-font basis, since setting it globally in the package options wouldn’t make much sense – for that, you use the stretch etc. options.

These options in the first argument will even be taken into account if the package has not been loaded with the selected option.

If the selected option has been passed to the package (cf. section 2.3), and settings for a font don’t exist, font expansion will not be applied to this font at all. Should the extraordinary situation arise that you want to employ selected expansion in general but that all characters of a particular font (set) should be expanded or shrunk by the same amount, you have to declare an empty list for these fonts, e. g.:

\SetExpansion
   { encoding = T1,
     family = {pkpx,pkpj} }
   { }

4.3 Character Inheritance

\DeclareCharacterInheritance[protrusion|expansion] {⟨font set⟩} {⟨inheritance list⟩}

In most cases, accented characters should inherit the protrusion resp. expansion factors from the respective base character. For example, all of the characters À, Á, Â, Ã, Ä, Å and Ă should probably be protruded by the same amount as the character A. Using the command \DeclareCharacterInheritance, you may declare such lists of characters, so that you then only have to set up the base characters. With the optional argument you may confine the scope of the list to protrusion resp. expansion. The font set can be declared in the usual way, with the only exception that you must specify exactly one encoding. The inheritance lists are to be declared as pairs of ⟨base character⟩ = ⟨list of inheriting characters⟩. Unless you are using a different encoding, there should be no need to change the default character inheritance settings.

See the configuration file microtype.cfg and the other font-specific files for examples of all these commands.

4.4 Configuration Files

The default configuration will be loaded from the file microtype.cfg. You may extend this file with custom settings.

If you are embarking on creating new expansion and protrusion settings for a different font family, you should put them into a separate file, whose name must be: ‘mt-⟨font family⟩.cfg’ (e. g. ‘mt-pad.cfg’), and may contain the commands \SetProtrusion, \SetExpansion and

Font family (NFSS code)  Series Shapes  TS1 Math
Generic  m  n, (it, sl, sc)^{a} (•)^{a}
Computer Modern Roman (cmr)^{b}  m  n, it (sl)^{c}, sc  •  •
Bitstream Charter (bch)  m  n, it (sl)^{c}, sc  •
Adobe Garamond (pad, padx, padj) m  n, it (sl)^{c}, sc  •

Adobe Minion (pmnx, pmnj) m n, it (sl)^{c}, sc, si

•

Palatino (ppl, pplx, pplj)  m  n, it (sl)^{c}, sc  (•)^{a}
Times (ptm, ptmx, ptmj)  m  n, it (sl)^{c}, sc  (•)^{a}

a Incomplete b Also used for: Latin Modern (lmr), ae (aer), zefonts (zer), eco (cmor), hfoldsty (hfor) c Settings taken from italic shape

Table 3: Fonts with tailored protrusion settings

\DeclareCharacterInheritance. These files will only be loaded if you are actually using the respective fonts. If the font name consists of four characters, the package will also try to find the file for the base font family by removing the suffix denoting the sub-family, so that you may put settings for the fonts padx (expert set), padj (oldstyle numerals) and pad (normal) into one and the same file.

This package ships with configuration files for the fonts Computer Modern Roman, Palatino, the inescapable Times, for Adobe Garamond and Minion^{5} and for Bitstream Charter. Table 3 lists them all. Remember that when settings for a font family cannot be found, the best matching generic settings will be used (see table 2).

If you have created a file for another font and you are willing to share, don’t hesitate to send it to me so that it can be included in future releases of this package.

\DeclareMicroTypeAlias {⟨font name⟩} {⟨alias font⟩} You may use this command for fonts that are very similar, or actually the same (for instance if you did not stick to the Berry naming scheme when installing the font). An example would be the Latin Modern fonts which are clones of the Computer Modern fonts, so that you probably don’t want to create new settings for them – you could say:

\DeclareMicroTypeAlias{lmr}{cmr}

which would make the package, whenever it encounters the font lmr and does not find settings for it, also try the font cmr. In fact, you will find this very line in the default configuration file, along with others for the virtual fonts provided by the packages ae, zefonts, eco and hfoldsty.

5 By courtesy of Harald Harders (h.harders@tu-bs.de).

5 Caveats

Use settings that match your font. Although the default settings should give reasonable results for most fonts, the particular font you happen to be using may have different character shapes that necessitate more or less protrusion or expansion. In particular italic letter shapes may differ wildly in different fonts, hence I have decided against providing default protrusion settings for them.

The file test-microtype.tex might be of some help when adjusting the protrusion settings for a font.

Don’t use too large a value for expansion. Font expansion is a feature that is supposed to enhance the typographic quality of your document by producing a more uniform greyness of the text block (and potentially reducing the number of necessary hyphenations). When expanding or shrinking a font too much, the effect will be turned into its opposite. Expanding the font by more than 2%, i. e. setting a stretch factor of more than 20, should be justified by a typographically trained eye. If you are so lucky as to be in the possession of multiple instances of a Multiple Master font, you may set expansion limits to up to 4%.

Don’t use font expansion for web documents. Because each instance of the font will be embedded in the PDF file, the file size may increase by quite a large factor (depending on expansion limits and step). Therefore, courtesy and thriftiness of bandwidth command it not to enable font expansion when creating files to be distributed electronically.

6 Contributions

I would be glad to include configuration files for more fonts. Preparing such configurations is quite a time-consuming task and requires a lot of patience. To alleviate this process, this package also includes a test file that can be used to check at least the protrusion settings (test-microtype.tex).

If you have created a configuration file for another font, or if you have any suggestions for enhancements in the default configuration files, I would gratefully accept them: w.m.l@gmx.net.^{6}

6 Should you have lots of pdfcprot configuration files lying around, I can also provide

you with a TEX conversion script. Just ask me.

7 Acknowledgments

This package would be pointless if Hàn Thế Thành hadn’t created the pdfTEX program in the first place, which introduced the micro-typographic extensions and made them available to the TEX world. Furthermore, I thank him for helping me to improve this package.

Harald Harders (h.harders@tu-bs.de) has contributed protrusion settings for Adobe Minion. I would also like to thank him for a number of bug reports and suggestions he had to make.

8 References

Hàn Thế Thành, Micro-typographic extensions to the TEX typesetting system, Diss. Masaryk University Brno 2000, in: TUGBoat, vol. 21(2000),

no. 4, pp. 317–434. (Online at http://www.tug.org/TUGboat/Articles/
tb21-4/tb69thanh.pdf)

Hàn Thế Thành, Margin Kerning and Font Expansion with pdfTEX, in: TUGBoat, vol. 22(2001), no. 3 – Proceedings of the 2001 Annual Meet-

ing, pp. 146–148. (Online at http://www.tug.org/TUGboat/Articles/
tb22-3/tb72thanh.pdf)

L^{A}TEX3 Project Team, L^{A}TEX 2ε font selection, 10 February 2004. (Available

from CTAN at /macros/latex/doc/fntguide.pdf)

Carsten Schurig, The pdfcprot.sty package, 14 August 2002. (Available

from CTAN in /macros/latex/contrib/pdfcprot/)

9 Short History

The comprehensive list of changes can be found in appendix A. The following is a list of all changes relevant in the user land; bug fixes are swept under the rug.

1.6a (2. 2. 2005)

Compatibility with the frenchpro package

1.6 (24. 1. 2005)

New option ‘factor’ to influence protrusion resp. expansion of all characters of a font or font set (see sections 2.2 and 4.2) When pdfTEX is too old to expand fonts automatically, font expansion has to be enabled explicitly, automatic expansion will be disabled (see section 2.1)

Protrusion settings of digits improved Use e-TEX extensions, if available 1.5 (15. 12. 2004)

When output mode is DVI, font expansion has to be enabled explicitly,

automatic expansion will be disabled (see section 2.1) New option ‘selected’ to enable selected expansion (see sections 2.3

and 4.2.2); default is: false New default for expansion option ‘step’: 4 (min(stretch,shrink)/5)

(see section 2.3) Protrusion settings for Bitstream Charter Compatibility with turkish babel

1.4b (26. 11. 2004)

\UseMicroTypeSet requires the set to be declared (see section 4.1) Internal optimization

1.4 (12. 11. 2004)

Set up fonts independently from L^{A}TEX font loading (therefore, no risk of overlooking fonts anymore, and the package may be loaded at any time)

\microtypesetup now sets the correct level of character protrusion

(see chapter 3) New option: ‘final’

1.3 (27. 10. 2004)

Compatibility with the german and ngerman packages

1.2 (3. 10. 2004)

New font sets: ‘allmath’ and ‘basicmath’ (see section 4.1 and table 1) Protrusion settings for Computer Modern Roman math symbols Protrusion settings for TS1 encoding completed for Computer Modern

Roman and Adobe Garamond If an alias font name is specified, it will be used as an alternative, not

as a replacement (see section 4.4) More tests for sanity of settings and whether all fonts will be set up More robust parsing of sizes in font sets

1.1 (21. 9. 2004)

Protrusion settings for Adobe Minion, contributed by Harald Harders

New macro: \DeclareCharacterInheritance (see section 4.3)

Characters may also be specified as octal or hexadecimal numbers

(see section 4.2) Configuration file names in lowercase (see section 4.4)

1.0 (11. 9. 2004)

First CTAN release

10 Implementation

The docstrip modules in this file are:

driver: The documentation driver (only visible in the dtx file).

package: The code for the microtype package.

debug: Code for additional output in the log file. Used for – surprise! – debugging purposes.

config: Surrounds all configuration modules.

m-t: The main configuration file (microtype.cfg).

bch: Settings for Bitstream Charter (mt-bch.cfg).

cmr: Settings for Computer Modern Roman (mt-cmr.cfg).

pad: Settings for Adobe Garamond (mt-pad.cfg).

ppl: Settings for Palatino (mt-ppl.cfg).

ptm: Settings for Times (mt-ptm.cfg).

pmn: Settings for Adobe Minion (mt-pmn.cfg).

Contributed by Harald Harders.

test: A helper file that may be used to create and test protrusion settings

    (test-microtype.tex).

And now for something completely different.

1 ⟨∗package⟩

 2 \RequirePackage{keyval}[1997/11/10]
\MT@info \MT@info@nl \MT@vinfo \MT@warning \MT@warning@nl \MT@error Save some typing.
 3 \def\MT@info{\PackageInfo{microtype}}
 4 \def\MT@info@nl#1{\MT@info{#1\@gobble}}
 5 ⟨!debug⟩\let\MT@vinfo\@gobble
 6 ⟨debug⟩\let\MT@vinfo\MT@info@nl
 7 \def\MT@warning{\PackageWarning{microtype}}
 8 \def\MT@warning@nl#1{\MT@warning{#1\@gobble}}
 9 \def\MT@error{\PackageError{microtype}}

These are all commands for the outside world. We define them here as dummy commands, so that they won’t generate an error if we are not running pdfTEX.

 10 \newcommand{\DeclareMicroTypeSet}[3][]{}
 11 \newcommand{\UseMicroTypeSet}[2][]{}
 12 \newcommand{\DeclareMicroTypeAlias}[2]{}
 13 \newcommand{\SetProtrusion}[3][]{}
 14 \newcommand{\SetExpansion}[3][]{}
 15 \newcommand{\DeclareCharacterInheritance}[3][]{}
 16 \newcommand{\microtypesetup}[1]{}

This command also has a starred version.

17 \def\DeclareMicroTypeSet{%
18 \@ifstar
19  {\@ifnextchar[\MT@DeclareSet{\MT@DeclareSet[]}}%
20  {\@ifnextchar[\MT@DeclareSet{\MT@DeclareSet[]}}%

21 }

22 \def\MT@DeclareSet[#1]#2#3{}

Set declarations are only allowed in the preamble (resp. the main configuration file). \SetExpansion and \SetProtrusion, on the other hand, must be allowed in the document, too, since they may be loaded from font configuration files.

23 \@onlypreamble{\DeclareMicroTypeSet}
24 \@onlypreamble{\UseMicroTypeSet}
25 \@onlypreamble{\DeclareMicroTypeAlias}

10.1 Requirements

\MT@pdftex@no Test which pdfTEX we’re using, if any.

26 \let\MT@pdftex@no\z@
Cases for \MT@pdftex@no are:

0: not running pdfTEX

1: pdftex (<0.14f)

2: + micro-typographic extensions (0.14f – 0.14g)

3: + protrusion relative to 1em (0.14h – <1.20)

4: + automatic font expansion (>= 1.20a)

At first check whether we are using pdfTEX.

27 \ifx\pdftexversion\@undefined \else
28 \ifx\pdftexversion\relax \else
29 ⟨debug⟩  \MT@info@nl{running pdftex \the\pdftexversion(\pdftexrevision)}
30  \def\MT@pdftex@no{4}

The autoexpand feature only works since pdfTEX 1.20.

31  \ifnum\pdftexversion < 120
32  \let\MT@pdftex@no\thr@@
33  \ifnum\pdftexversion = 14

Only pdfTEX versions 0.14f and 0.14g do not need adjustment of protrusion factors.

34  \ifnum \expandafter`\pdftexrevision < `h
35  \let\MT@pdftex@no\tw@
36  \fi
37  \ifnum \expandafter`\pdftexrevision < `f
38  \let\MT@pdftex@no\@ne
39  \fi
40  \else
41  \ifnum\pdftexversion < 14

42  \let\MT@pdftex@no\@ne
43  \fi
44  \fi
45  \fi
46 \fi
47 \fi
48 ⟨debug⟩\MT@info@nl{pdftex no: \number\MT@pdftex@no}

\MT@exitornot If we are not using pdfTEX or in case it is too old, we disable everything and exit here.

49 \let\MT@exitornot\relax
50 \ifnum\MT@pdftex@no<\tw@
51 \def\MT@exitornot{%
52  \AtEndOfPackage{\let\@unprocessedoptions\relax}%
53  \let\CurrentOption\@empty
54  \endinput

55 }

56 \MT@warning@nl{%
57  \ifcase\MT@pdftex@no
58  You don't seem to be using pdftex.\MessageBreak
59  \or
60  You are using a pdftex version older than 0.14f.\MessageBreak
61  microtype doesn't support such antiquated versions.\MessageBreak
62  Please install a newer version of pdftex.\MessageBreak
63  \fi
64  All micro-typographic features will be disabled%

65 }

66 \fi
67 \MT@exitornot

Still there? Then we can begin:

\MT@catcodes We have to make sure that the category codes of some characters are correct (the german package, for instance, makes " active). Probably overly cautious. Ceterum censeo: It should be forbidden for packages to change catcodes within the preamble.

68 \def\MT@catcodes{%
69 \@makeother\-%
70 \@makeother\,%
71 \@makeother\/%
72 \@makeother\`%
73 \@makeother\'%
74 \@makeother\"%
75 \catcode`\^7\relax

76 }

\MT@restore@catcodes Polite as we are, we’ll restore them afterwards.

77 \def\MT@restore@catcodes#1{%
78 \ifx\relax#1\else
79  \noexpand\catcode`\noexpand#1\the\catcode`#1\relax
80  \expandafter\MT@restore@catcodes
81 \fi

 83 \edef\MT@restore@catcodes{%
 84 \MT@restore@catcodes\-\,\/\`\'\"\^\relax

85 }

 86 \MT@catcodes
 87 \AtEndOfPackage{\MT@restore@catcodes}

Our competitor, the pdfcprot package, must not be tolerated!

 88 \AtBeginDocument{%
 89 \@ifpackageloaded{pdfcprot}{%
 90  \MT@error{%
 91  Detected the `pdfcprot' package!\MessageBreak
 92  `microtype' and `pdfcprot' may not be used together}%
 93  {The `pdfcprot' package provides an interface to
 94  character protrusion.\MessageBreak
 95  So does the `microtype' package.
 96  Using both packages at the same\MessageBreak
 97  time will almost certainly lead to undesired results.
 98  Have your choice!}%
 99 }{}%

The ledmac package puts each line of a paragraph into a \hbox before actually typesetting them by \unhboxing. This will (at least with current pdfTEX) destroy character protrusion. (Interestingly, there aren’t any problems with the lineno package.) We issue a warning, so that nobody can say they didn’t know. This is fixed in pdfTEX 1.20c, so we no longer warn.

100 }

We need a font (the minimal class doesn’t load one).

101 \expandafter\ifx\the\font\nullfont\normalfont\fi
\ifMT@DVIoutput \ifMT@draft \ifMT@protrusion \ifMT@expansion \ifMT@auto \ifMT@selected \MT@expansionlevel \MT@protrusionlevel \MT@stretch \MT@shrink \MT@step \MT@prot@factor These are the global switches and settings.
102 \newif\ifMT@DVIoutput
103 \newif\ifMT@draft
104 \newif\ifMT@protrusion
105 \newif\ifMT@expansion
106 \newif\ifMT@auto
107 \newif\ifMT@selected
108 \def\MT@expansionlevel{2}
109 \def\MT@protrusionlevel{2}
110 \let\MT@stretch\m@ne
111 \let\MT@shrink\m@ne
112 \let\MT@step\m@ne
113 \let\MT@prot@factor\@m

10.2 Auxiliary macros

\MT@def@n This is \@namedef.
114 \def\MT@def@n#1{\expandafter\def\csname #1\endcsname}

\MT@edef@n Its expanding version.

115 \def\MT@edef@n#1{\expandafter\edef\csname #1\endcsname}

\MT@let@nc \let a csname to a command.

116 \def\MT@let@nc#1{\expandafter\let\csname #1\endcsname}

\MT@let@cn \let a command to a csname.

117 \def\MT@let@cn#1#2{\expandafter\let\expandafter#1\csname #2\endcsname}

\MT@hop@else@fi We need this a couple of lines down to mask \ifcsname … \fi and

\ifdefined . . . \fi, if \ifcsname and \ifdefined aren’t defined.
118 \def\MT@hop@else@fi#1\else#2\fi{\fi#1}

\MT@ifdefined@c \MT@ifdefined@n Wrapper for testing whether command or \csname sequence is defined.

119 \ifx\ifdefined\@undefined\MT@hop@else@fi
120 ⟨debug⟩ \MT@info@nl{not using etex}%
121 \def\MT@ifdefined@c#1{%
122  \ifx#1\@undefined
123  \expandafter\@secondoftwo
124  \else
125  \expandafter\@firstoftwo
126  \fi

127 }

128 \def\MT@ifdefined@n#1{%
129  \expandafter\ifx\csname#1\endcsname\relax
130  \expandafter\@secondoftwo
131  \else
132  \expandafter\@firstoftwo
133  \fi

134 }

135 \else

If we are running e-TEX, we will use its new primitives \ifdefined and \ifcsname, which decreases memory use substantially.

136 ⟨debug⟩ \MT@info@nl{using etex}%
137 \def\MT@ifdefined@c#1{%
138  \ifdefined#1%
139  \expandafter\@firstoftwo
140  \else
141  \expandafter\@secondoftwo
142  \fi

143 }

144 \def\MT@ifdefined@n#1{%
145  \ifcsname#1\endcsname
146  \expandafter\@firstoftwo
147  \else
148  \expandafter\@secondoftwo
149  \fi

150 }

151 \fi

\MT@ifempty Test whether argument is empty.

152 \begingroup
153 \catcode`\%=12\relax
154 \catcode`\&=14\relax
155 \gdef\MT@ifempty#1{&
156 \if %#1%&

157  \expandafter\@firstoftwo
158 \else
159  \expandafter\@secondoftwo
160 \fi}
161 \endgroup

\MT@ifnumber Test whether argument is a number [0-9] (using an old trick by Mr. Arseneau).

162 \def\MT@ifnumber#1{%
163 \if!\ifnum9<1#1!\else_\fi
164  \expandafter\@firstoftwo
165 \else
166  \expandafter\@secondoftwo
167 \fi

168 }

\MT@xadd Add item to a list. (Yes, definitions must be global.)

169 \def\MT@xadd#1#2{%
170 \expandafter\ifx#1\relax
171  \xdef#1{#2}%
172 \else
173  \begingroup
174  \edef\x{#2}%
175  \toks@=\expandafter\expandafter\expandafter{\expandafter#1\x}%
176  \xdef#1{\the\toks@}%
177  \endgroup
178 \fi

179 }

\MT@in@list Test whether item is in list (separated by \MT@lt; allows to operate on the list items).

180 \newif\ifMT@inlist@
181 \def\MT@in@list#1#2{%
182 \MT@inlist@false
183 \def\MT@given{#1}%
184 \def\MT@lt##1{%
185  \def\MT@next{##1}\ifx\MT@next\MT@given\MT@inlist@true\fi}#2%

186 }

187 \let\MT@lt\@empty

\MT@in@llist Test whether item is in list (separated by a comma; faster for long lists, since the command only has to be executed once).

188 \def\MT@in@llist#1#2{%
189 \MT@inlist@false
190 \def\MT@in@l##1#1,##2\@nil{%
191  \ifx\\##2\\\else
192  \MT@inlist@true
193  \fi}%
194 \expandafter\MT@in@l#2,#1,\@nil

195 }

\MT@loop \MT@repeat This is the same as L^{A}TEX’s \loop, which we mustn’t use, since this could confuse an outer \loop in the document.

196 \def\MT@loop#1\MT@repeat{%

197 \def\MT@iterate{#1\relax\expandafter\MT@iterate\fi}%
198 \MT@iterate \let\MT@iterate\relax}
199 \let\MT@repeat\fi

\MT@count \MT@increment Increment macro ⟨#1 ⟩ by one. Saves using up too many counters.

200 \newcount\MT@count
201 \def\MT@increment#1{%
202 \MT@count#1\relax
203 \advance\MT@count \@ne
204 \edef#1{\number\MT@count}%

205 }

\MT@remove@spaces Remove spaces around ⟨#1 ⟩ (\KV@@sp@def is from keyval).

206 \def\MT@remove@spaces#1{\expandafter\KV@@sp@def\expandafter#1\expandafter{#1}}

10.3 Setting up a font

\MT@setupfont Setting up a font entails checking whether protrusion/expansion is desired for the current font (\font@name), and if so, adjusting \lpcode and \rpcode (protrusion) and \efcode (expansion) for each character.

207 \def\MT@setupfont{%
208 \ifx\MT@vinfo\MT@info@nl
209  \MT@info{Setting up font `\expandafter\string\font@name'}\fi

The font properties must be extracted from \font@name, since the current value of \f@encoding and friends may be wrong!

210 \expandafter\expandafter\expandafter
211  \MT@split@name\expandafter\string\font@name\@nil

Try to find a configuration file for the current font family.

212 \MT@find@file{\MT@family}%
213 \ifx\MT@familyalias\@empty\else\MT@find@file{\MT@familyalias}\fi

We have to make sure that \cf@encoding expands to the correct value, which isn’t the case when \selectfont chooses a new encoding (this would be done one second later, anyway).

214 \ifx\f@encoding\cf@encoding\else\@@enc@update\fi

Protrusion has to be set up first, says Thành!

215 \MT@checkfor{protrusion}%
216 \ifMT@font@protrusion
217  \MT@set@prot@codes
218 \else
219  \MT@vinfo{... No protrusion}%
220 \fi
221 \MT@checkfor{expansion}%
222 \ifMT@font@expansion
223  \MT@set@exp@codes
224 \else
225  \MT@vinfo{... No expansion}%
226 \fi

\ifMT@font@protrusion \ifMT@font@expansion \MT@checkfor We check all features of the current font against the lists defined by the

expansion resp. protrusion option, and set \MT@font@expansion resp.
\MT@font@protrusion accordingly.
228 \newif\ifMT@font@protrusion
229 \newif\ifMT@font@expansion
230 \def\MT@checkfor#1{%

(but only if protrusion/expansion isn’t globally set to false)

231 \csname ifMT@#1\endcsname

Begin with setting micro-typography to true for this font. The \MT@checklist test will set it to false, if the property is not in the list.

232  \csname MT@font@#1true\endcsname
233  \MT@checklist{#1}{encoding}%

family is special, since there may also be an alias name.

234  \MT@checklist@family{#1}%
235  \MT@checklist{#1}{series}%
236  \MT@checklist{#1}{shape}%
237  \MT@checklist{#1}{size}%
238 \fi

239 }

\MT@checklist If we’ve already found that a property is not in the list, we don’t have to bother any more.

240 \def\MT@checklist#1#2{%
241 \csname ifMT@font@#1\endcsname\MT@checklist@{#1}{#2}\fi

242 }

\MT@checklist@
243 \def\MT@checklist@#1#2{%
244 \edef\@tempa{\csname MT@#1@setname\endcsname}%
245 \MT@ifdefined@n{MT@#1list@#2@\@tempa}{%

Begin a \expandafter orgy to test whether the font characteristic is in the list.

246  \def\MT@listname{\csname MT@#1list@#2@\@tempa\endcsname}%
247  \expandafter\expandafter\expandafter\MT@in@list
248  \expandafter\expandafter\expandafter
249  {\csname MT@#2\endcsname}\MT@listname
250  \ifMT@inlist@
251 ⟨debug⟩  \MT@info@nl{#1: #2 `\csname MT@#2\endcsname' in list}%
252  \else
253  \csname MT@font@#1false\endcsname
254 ⟨debug⟩  \MT@info@nl{#1: #2 `\csname MT@#2\endcsname' not in list}%
255  \fi
256 }{%

If no limitations have been specified, i.e. the list for a font characteristic has not been defined at all, the font should be expanded resp. protruded.

257 ⟨debug⟩  \MT@info@nl{#1: #2 list empty}%

258 }%

\MT@checklist@family Also test for the alias font.

260 \def\MT@checklist@family#1{%
261 \csname ifMT@font@#1\endcsname\MT@checklist@family@{#1}\fi

262 }

\MT@checklist@family@
263 \def\MT@checklist@family@#1{%
264 \MT@checklist@{#1}{family}%

Only try if the original font is not in the list.

265 \csname ifMT@font@#1\endcsname\else
266  \ifx\MT@familyalias\@empty\else
267  \edef\@tempa{\csname MT@#1@setname\endcsname}%
268  \def\MT@listname{\csname MT@#1list@family@\@tempa\endcsname}%
269  \expandafter\expandafter\expandafter\MT@in@list
270  \expandafter
271  {\MT@familyalias}\MT@listname
272  \ifMT@inlist@
273  \csname MT@font@#1true\endcsname
274 ⟨debug⟩  \MT@info@nl{#1: alias `\MT@familyalias' in list}%
275 ⟨debug⟩  \else\MT@info@nl{#1: alias `\MT@familyalias' not in list}%
276  \fi
277  \fi
278 \fi

279 }

\MT@split@name Split up the font name (definitions must be global, since this will be called from inside a group).

280 \def\MT@split@name#1/#2/#3/#4/#5\@nil{%
281 \gdef\MT@encoding{#1}%
282 \gdef\MT@family{#2}%
283 \gdef\MT@series{#3}%
284 \gdef\MT@shape{#4}%
285 \gdef\MT@size{#5}%

Alias family?

286 \global\let\MT@familyalias\@empty
287 \MT@ifdefined@n{MT@\MT@family @alias}{%
288  \MT@escapechar{\csname MT@\MT@family @alias\endcsname}%
289  \global\let\MT@familyalias\MT@val
290 }{}%

291 }

10.3.1 Protrusion

\MT@set@prot@codes This macro is called by \MT@setupfont, and does all the work for setting up a font for protrusion.

292 \def\MT@set@prot@codes{%

Check which list should be applied to the current font.

293 \MT@get@codes@list{prot}%

We might not have found a list.

294 \MT@ifdefined@n{MT@protcodes@\MT@protcodes@name}{%
295  \MT@get@factor

Get the name of the inheritance list and parse it.

296  \MT@get@inh@list{protrusion}%
297  \MT@ifdefined@c\MT@protrusioninh@name{%
298  \MT@let@cn\@tempc{MT@protrusioninh@\MT@protrusioninh@name}%
299 %         \MT@ifdefined@c\@tempc{% this can't happen?
300  \ifx\@tempc\@empty\else
301  \let\MT@inh@name\MT@protrusioninh@name
302  \expandafter\MT@inhdo\@tempc,\relax,%
303  \fi
304 %         }{}%

Set to \@empty, so that we only parse the list once.

305  \global\MT@let@nc{MT@protrusioninh@\MT@protrusioninh@name}\@empty
306  }{}%

Load additional lists?

307  \MT@load@list{prot}{\MT@protcodes@name}%

Load the main list.

308  \MT@let@cn\@tempc{MT@protcodes@\MT@protcodes@name}%
309  \expandafter\MT@protdo\@tempc,\relax,%
310 }{}%

311 }

\MT@protdo Split up the values and set \lpcode and \rpcode.

312 \def\MT@protdo#1,{%
313 \ifx\relax#1\@empty\else
314  \MT@protsplit #1==\relax
315  \expandafter\MT@protdo\fi

316 }

\MT@protsplit
317 \def\MT@protsplit#1=#2=#3\relax{%
318 \KV@@sp@def\@tempa{#1}%
319 \ifx\@tempa\@empty\else
320  \MT@get@slot
321  \ifnum\MT@char > \m@ne
322  \KV@@sp@def\@tempb{#2}%
323  \expandafter\MT@protsplit@val\@tempb\relax
324  \fi
325 \fi

326 }

\MT@protsplit@val
327 \def\MT@protsplit@val#1,#2\relax{%
328 \KV@@sp@def\@tempb{#1}%
329 \MT@ifempty{\@tempb}{}{%
330  \MT@adjustprotcode
331  \lpcode\font@name\MT@char=\@tempcntb

332 }%

333 \KV@@sp@def\@tempb{#2}%
334 \MT@ifempty{\@tempb}{}{%

335  \MT@adjustprotcode
336  \rpcode\font@name\MT@char=\@tempcntb

337 }%

Now we can set the values for the inheriting characters. Their slot numbers are saved in the macro \MT@inh@⟨list name⟩@⟨slot number⟩@.

338 \MT@ifdefined@c\MT@protrusioninh@name{%
339  \MT@ifdefined@n{MT@inh@\MT@protrusioninh@name @\MT@char @}{%
340  \MT@set@prot@children
341  }{}%
342 }{}%

343 }

\MT@adjustprotcode Since pdfTEX version 0.14h, we have to adjust the protrusion factors (i. e., convert numbers from thousandth of character width to thousandth of an em of the font). We have to do this before setting the inheriting characters, so that they inherit the absolute value not the relative one if they have a differing width (e. g. the ‘ff’ ligature). We do not calculate with \lpcode resp. \rpcode, since this would disallow protrusion factors larger than the character width (since \[lr]pcode’s limit is 1000). Now, the maximum protrusion is 1em of the font.

344 \ifnum\MT@pdftex@no>\tw@
345 \def\MT@adjustprotcode{%
346  \MT@get@charwd
347  \multiply\@tempcntb \@tempb
348  \ifnum\@tempcntb=\z@ \else
349  \divide\@tempcntb \fontdimen6 \font@name
350  \MT@adjustprotcode@
351  \fi

352 }

\MT@get@charwd When using e-TEX, we can employ \fontcharwd.

353 \MT@ifdefined@c\fontcharwd{%
354  \def\MT@get@charwd{%
355  \@tempcntb=\number\fontcharwd\font@name\MT@char}%
356 }{%
357  \def\MT@get@charwd{%
358  \setbox\z@=\hbox{\font@name \char\MT@char}%
359  \@tempcntb=\wd\z@}%

360 }

No adjustment here.

361 \else
362 \def\MT@adjustprotcode{%
363  \@tempcntb=\@tempb
364  \ifnum\@tempcntb=\z@ \else
365  \MT@adjustprotcode@
366  \fi

367 }

368 \fi
\MT@adjustprotcode@ The rest, we can share.
369 \def\MT@adjustprotcode@{%

370 \multiply\@tempcntb \MT@prot@factor@
371 \divide\@tempcntb \@m
372 \ifnum\@tempcntb > \@m
373  \MT@warning@nl{Protrusion factor \@tempb\space for character
374  `\@tempa'\MessageBreak too large (= \the\@tempcntb) in
375  protrusion list `\MT@protcodes@name'}%
376 \else
377  \ifnum\@tempcntb < -\@m
378  \MT@warning@nl{Protrusion factor \@tempb\space for character
379  `\@tempa'\MessageBreak too small (= \the\@tempcntb) in
380  protrusion list `\MT@protcodes@name'}%
381  \fi
382 \fi

383 }

\MT@set@prot@children
384 \def\MT@set@prot@children{%
385 \def\MT@lt##1{%
386 ⟨debug⟩  \MT@info@nl{-- heir of \MT@char: ##1}%
387  \lpcode\font@name##1=\lpcode\font@name\MT@char
388  \rpcode\font@name##1=\rpcode\font@name\MT@char

389 }%

390 \csname MT@inh@\MT@protrusioninh@name @\MT@char @\endcsname

391 }

\MT@get@factor
392 \def\MT@get@factor{%
393 \MT@ifdefined@n{MT@protcodes@\MT@protcodes@name @factor}{%
394  \MT@let@cn\MT@prot@factor@{MT@protcodes@\MT@protcodes@name @factor}%
395  \MT@vinfo{... ... Multiplying protrusion factors by \MT@prot@factor@/1000}%
396 }{%
397  \let\MT@prot@factor@\MT@prot@factor

398 }% 399 }

10.3.2 Expansion

\MT@set@exp@codes Setting up font expansion is a bit different because of the selected option.

400 \newif\ifMT@selected@exp
401 \def\MT@set@exp@codes{%

If selected=true, we only apply font expansion to fonts for which a list has been declared (i. e., like for protrusion).

402 \ifMT@selected
403  \MT@get@codes@list{exp}%
404  \MT@ifdefined@n{MT@expcodes@\MT@expcodes@name}{%
405  \MT@get@extraopt
406  \MT@resetefcode
407  \MT@get@inh@list{expansion}%
408  \MT@ifdefined@c\MT@expansioninh@name{%
409  \MT@let@cn\@tempc{MT@expansioninh@\MT@expansioninh@name}%
410 %            \MT@ifdefined@c\@tempc{%
411  \ifx\@tempc\@empty\else

412  \let\MT@inh@name\MT@expansioninh@name
413  \expandafter\MT@inhdo\@tempc,\relax,%
414  \fi
415 %            }{}%
416  \global\MT@let@nc{MT@expansioninh@\MT@expansioninh@name}\@empty
417  }{}%
418  \MT@load@list{exp}{\MT@expcodes@name}%
419  \MT@let@cn\@tempc{MT@expcodes@\MT@expcodes@name}%
420  \expandafter\MT@expdo\@tempc,\relax,%
421  \pdffontexpand\font@name \MT@stretch@ \MT@shrink@ \MT@step@ \MT@auto@
422  }{}%

If, on the other hand, all characters should be expanded by the same amount, we only care about the first optional argument to the \SetExpansion declarations.

423 \else

We need this boolean in \MT@get@codes@list, so that no warning will be issued.

424  \MT@selected@exptrue
425  \MT@get@codes@list{exp}%
426  \MT@ifdefined@n{MT@expcodes@\MT@expcodes@name}{%
427  \MT@get@extraopt
428  }{%
429  \let\MT@exp@factor@\@m
430  \let\MT@stretch@\MT@stretch
431  \let\MT@shrink@\MT@shrink
432  \let\MT@step@\MT@step
433  \let\MT@auto@\MT@auto

434 }%

435  \MT@resetefcode
436  \pdffontexpand\font@name \MT@stretch@ \MT@shrink@ \MT@step@ \MT@auto@
437 \fi

438 }

\MT@resetefcode@ At first, all expansion factors for the characters will be set to 1000.

439 \def\MT@resetefcode@{%
440 \@tempcnta\z@
441 \MT@loop
442  \efcode\font@name\@tempcnta=\MT@exp@factor@
443  \advance\@tempcnta \@ne
444  \ifnum\@tempcnta < \@cclvi \MT@repeat

445 }

\MT@resetefcode This is only necessary for versions prior to 1.20a.

446 \ifnum\MT@pdftex@no<4
447 \let\MT@resetefcode\MT@resetefcode@
448 \else
449 \def\MT@resetefcode{%
450  \ifnum\MT@exp@factor@=\@m \else
451  \MT@resetefcode@
452  \fi

453 }

454 \fi

\MT@expdo There’s only one number per character.

455 \def\MT@expdo#1,{%
456 \ifx\relax#1\@empty\else
457  \MT@expsplit #1==\relax
458  \expandafter\MT@expdo\fi

459 }

\MT@expsplit
460 \def\MT@expsplit#1=#2=#3\relax{%
461 \KV@@sp@def\@tempa{#1}%
462 \ifx\@tempa\@empty\else
463  \MT@get@slot
464  \ifnum\MT@char > \m@ne
465  \KV@@sp@def\@tempb{#2}%
466  \@tempcnta=\@tempb

Take the optional factor into account.

467  \multiply\@tempcnta \MT@exp@factor@
468  \divide\@tempcnta \@m
469  \efcode\font@name\MT@char=\@tempcnta

Heirs, heirs, I love thy heirs.

470  \MT@ifdefined@c\MT@expansioninh@name{%
471  \MT@ifdefined@n{MT@inh@\MT@expansioninh@name @\MT@char @}%
472  {\MT@set@exp@children}{}%
473  }{}%
474  \fi
475 \fi

476 }

\MT@set@exp@children
477 \def\MT@set@exp@children{%
478 \def\MT@lt##1{%
479 ⟨debug⟩  \MT@info@nl{-- heir of \MT@char: ##1}%
480  \efcode\font@name##1=\efcode\font@name\MT@char

481 }%

482 \csname MT@inh@\MT@expansioninh@name @\MT@char @\endcsname

483 }

\MT@get@extraopt Apply different values to this font?

484 \def\MT@get@extraopt{%
485 \MT@ifdefined@n{MT@expcodes@\MT@expcodes@name @factor}{%
486  \MT@let@cn\MT@exp@factor@{MT@expcodes@\MT@expcodes@name @factor}%
487  \MT@vinfo{... ... Multiplying expansion factors by \MT@exp@factor@/1000}%
488 }{%
489  \let\MT@exp@factor@\@m

490 }%

491 \MT@ifdefined@n{MT@expcodes@\MT@expcodes@name @stretch}{%
492  \MT@let@cn\MT@stretch@{MT@expcodes@\MT@expcodes@name @stretch}%
493  \MT@vinfo{... ... Setting stretch factor to \MT@stretch@}%
494 }{%
495  \let\MT@stretch@\MT@stretch

496 }%

497 \MT@ifdefined@n{MT@expcodes@\MT@expcodes@name @shrink}{%

498  \MT@let@cn\MT@shrink@{MT@expcodes@\MT@expcodes@name @shrink}%
499  \MT@vinfo{... ... Setting shrink factor to \MT@shrink@}%
500 }{%
501  \let\MT@shrink@\MT@shrink

502 }%

503 \MT@ifdefined@n{MT@expcodes@\MT@expcodes@name @step}{%
504  \MT@let@cn\MT@step@{MT@expcodes@\MT@expcodes@name @step}%
505  \MT@vinfo{... ... Setting step factor to \MT@step@}%
506 }{%
507  \let\MT@step@\MT@step

508 }%

509 \MT@ifdefined@n{MT@expcodes@\MT@expcodes@name @auto}{%
510  \MT@let@cn\MT@auto@{MT@expcodes@\MT@expcodes@name @auto}%
511  \MT@vinfo{... ... Setting automatic expansion to \MT@auto@}%
512 }{%
513  \let\MT@auto@\MT@auto

514 }% 515 }

10.3.3 Generic macros

\MT@load@list Recurse through the lists to be loaded.

516 \def\MT@load@list#1#2{%
517 \edef\@tempa{#2}%
518 \MT@let@cn\@tempb{MT@#1codes@\@tempa load}%
519 \ifx\@tempa\@tempb
520  \MT@warning{#1. list `\@tempa' cannot load itself}%
521 \else
522  \ifx\@tempb\relax\else
523  \MT@ifdefined@n{MT@#1codes@\@tempb}{%
524  \MT@vinfo{... ... Additionally loading #1. list `\@tempb'}%
525  \begingroup
526  \MT@load@list{#1}{\@tempb}%
527  \endgroup
528  \MT@let@cn\@tempc{MT@#1codes@\@tempb}%
529  \expandafter\csname MT@#1do\expandafter\endcsname\@tempc,\relax,%
530  }{%
531  \MT@warning{%
532  #1. list `\@tempb' undefined. Cannot load it\MessageBreak
533  from list `\@tempa'}%

534 }%

535  \fi
536 \fi

537 }

\MT@find@file Micro-typographic settings may be written into a file mt-⟨font family⟩.cfg:

538 \let\MT@file@list\@empty
539 \def\MT@find@file#1{%

Check for existence of the file only once.

540 \expandafter\MT@in@llist\expandafter
541  {\csname MT@file@#1\endcsname}\MT@file@list
542 \ifMT@inlist@\else

Don’t forget that because reading the files takes place inside a group, all commands that may be used there have to be defined globally.

543  \begingroup
544  \MT@file@catcodes
545  \InputIfFileExists{mt-#1.cfg}{%
546  \MT@xadd\MT@file@list{\csname MT@file@#1\endcsname,}%
547  \MT@vinfo{... Loading font settings from mt-#1.cfg}%
548  }{%
549  \expandafter\MT@get@basefamily#1\relax\relax\relax
550  \expandafter\MT@in@llist\expandafter
551  {\csname MT@file@\@tempa\endcsname}\MT@file@list
552  \ifMT@inlist@\else
553  \InputIfFileExists{mt-\@tempa.cfg}{%
554  \MT@xadd\MT@file@list{\csname MT@file@\@tempa\endcsname,}%
555  \MT@vinfo{... Loading font settings from mt-\@tempa.cfg}%
556  }{%
557  \MT@xadd\MT@file@list{\csname MT@file@#1\endcsname,}%
558  \MT@vinfo{... No file mt-#1.cfg}%

559 }%

560  \fi

561 }%

562  \endgroup
563 \fi

564 }

\MT@file@catcodes We have to make sure that all characters have the correct category code. Especially, new lines and spaces should be ignored, since files might be loaded in the middle of the document. This is basically \nfss@catcodes (from the L^{A}TEX kernel). I’ve added: & (in tabulars), ;, ,, !, ?, and $, _, ~, and = (turkish).

565 \def\MT@file@catcodes{%
566  \makeatletter
567  \catcode`\ 9%
568  \catcode`\^7%
569  \catcode`\^^I9%
570  \catcode`\^^M9%
571  \catcode`\\\z@
572  \catcode`\{\@ne
573  \catcode`\}\tw@
574  \catcode`\#6%
575  \catcode`\%14%
576 \@makeother\<%
577 \@makeother\>%
578 \@makeother\*%
579 \@makeother\.%
580 \@makeother\-%
581 \@makeother\/%
582 \@makeother\[%
583 \@makeother\]%
584 \@makeother\`%
585 \@makeother\'%
586 \@makeother\"%

587 \@makeother\&%
588 \@makeother\;%
589 \@makeother\,%
590 \@makeother\!%
591 \@makeother\?%
592 \@makeother\$%
593 \@makeother\_%
594 \@makeother\~%
595 \@makeother\=%

596 }

\MT@get@basefamily The family name might have a suffix for expert or old style number font set or for swash capitals (x, j or w). We mustn’t simply remove the last letter, as this would make for instance cms out of cmss and cmsy (OK, cmex will still become cme …).

597 \def\MT@get@basefamily#1#2#3#4\relax{%
598 \ifx\relax#2\relax\def\@tempa{#1}\else
599  \ifx\relax#3\relax\def\@tempa{#1#2}\else
600  \def\@tempa{#1#2#3}%
601  \ifx\relax#4\relax\else
602  \edef\@tempc{\string#4}%
603  \edef\@tempb{\string x}%
604  \ifx\@tempc\@tempb\else
605  \edef\@tempb{\string j}%
606  \ifx\@tempc\@tempb\else
607  \edef\@tempb{\string w}%
608  \ifx\@tempc\@tempb\else
609  \def\@tempa{#1#2#3#4}%
610  \fi
611  \fi
612  \fi
613  \fi
614  \fi
615 \fi

616 }

\MT@get@listname Try all combinations of font family, series and shape to get a list for the current font.

617 \def\MT@get@listname#1{%
618 ⟨debug⟩ \MT@info@nl{trying to find #1. list for font \font@name}%
619 \def\@tempb{#1}%
620 \MT@next@listname1111\relax
621 \MT@ifdefined@n{MT@\@tempb @\@tempa}{}{%
622  \MT@next@listname1110\relax

623 }%

624 \MT@ifdefined@n{MT@\@tempb @\@tempa}{}{%
625  \MT@next@listname1100\relax

626 }%

627 \MT@ifdefined@n{MT@\@tempb @\@tempa}{}{%
628  \MT@next@listname1010\relax

629 }%

630 \MT@ifdefined@n{MT@\@tempb @\@tempa}{}{%
631  \MT@next@listname1000\relax

632 }%

633 \MT@ifdefined@n{MT@\@tempb @\@tempa}{}{%
634  \MT@next@listname0100\relax

635 }%

636 \MT@ifdefined@n{MT@\@tempb @\@tempa}{}{%
637  \MT@next@listname0010\relax

638 }%

639 \MT@ifdefined@n{MT@\@tempb @\@tempa}{}{%
640  \MT@next@listname0000\relax

641 }% 642 }

\MT@next@listname
643 \def\MT@next@listname#1#2#3#4{%
644 \edef\@tempa{\MT@encoding/%
645  \ifnum#1=\@ne \MT@family\fi/%
646  \ifnum#2=\@ne \MT@series\fi/%
647  \ifnum#3=\@ne \MT@shape\fi/%
648  \ifnum#4=\@ne \MT@size\fi}%
649 ⟨debug⟩ \MT@info@nl{trying \@tempa}%
650 \MT@ifdefined@n{MT@\@tempb @\@tempa}{}{%
651  \ifnum#1=\@ne
652  \ifx\MT@familyalias\@empty\else
653  \edef\@tempa{\MT@encoding/%
654  \MT@familyalias/%
655  \ifnum#2=\@ne \MT@series\fi/%
656  \ifnum#3=\@ne \MT@shape\fi/%
657  \ifnum#4=\@ne \MT@size\fi}%
658 ⟨debug⟩  \MT@info@nl{(alias) \@tempa}%
659  \fi
660  \fi

661 }% 662 }

\MT@get@codes@list
\MT@get@inh@list 663 \def\MT@get@codes@list#1{%
664 \MT@get@listname{#1codes}%
665 \MT@ifdefined@n{MT@#1codes@\@tempa}{%
666  \global\MT@edef@n{MT@#1codes@name}{\csname MT@#1codes@\@tempa\endcsname}%
667  \ifMT@selected@exp
668  \MT@vinfo{... Applying non-selected expansion (list `\MT@expcodes@name')}%
669  \else
670  \MT@vinfo{... Using #1. list `\csname MT@#1codes@name\endcsname'}%
671  \fi
672 }{%
673  \global\MT@let@nc{MT@#1codes@\csname MT@#1codes@name\endcsname}\@undefined
Don’t warn if selected=false.
674  \ifMT@selected@exp
675  \MT@vinfo{... Applying non-selected expansion}%
676  \else
677  \MT@warning{I cannot find a #1. list for
678  `\expandafter\string\font@name'.\MessageBreak
679  Switching off #1. for this font}%

680  \fi

681 }% 682 }

683 \def\MT@get@inh@list#1{%
684 \MT@get@listname{#1inh}%
685 \MT@ifdefined@n{MT@#1inh@\@tempa}{%
686  \MT@edef@n{MT@#1inh@name}{\csname MT@#1inh@\@tempa\endcsname}%
687 ⟨debug⟩  \MT@info@nl{... Using #1 inheritance list
688 ⟨debug⟩  `\csname MT@#1inh@name\endcsname'}%
689 }{%
690  \MT@let@nc{MT@#1inh@name}\@undefined

691 }% 692 }

Get the slot number of the character in the current encoding.

First we define some helper macros which inspect the \meaning of their arguments. No upper case T in macro names!

693 \begingroup
694 \catcode`\/=0
695 /catcode`/\=12
696 /catcode`/"=12
697 /catcode`/A=12
698 /catcode`/C=12
699 /catcode`/E=12
700 /catcode`/H=12
701 /catcode`/L=12
702 /catcode`/R=12
703 /catcode`/T=12
704 /lowercase{%
705  /def/x{%

\MT@isaletter \MT@letterstring Test whether argument expands to a letter.

706  /def/Mt@letterstring{THE LETTER}%
707  /def/Mt@isaletter ##1THE LETTER##2##3/relax{%
708  /@tempswafalse
709  /ifx/relax##1/relax
710  /@tempswatrue
711  /edef/Mt@char{/number`##2}%
712  /Mt@testrest{/Mt@letterstring}{##3}%
713  /fi

714 }%

\MT@isacharacter \MT@characterstring Argument expands to a character (anything with catcode 12, also a number).

715  /def/Mt@characterstring{THE CHARACTER}%
716  /def/Mt@isacharacter ##1THE CHARACTER##2##3/relax{%
717  /@tempswafalse
718  /ifx/relax##1/relax
719  /@tempswatrue
720  /edef/Mt@char{/number`##2}%
721  /Mt@testrest{/Mt@characterstring}{##3}%
722  /fi

723 }%

\MT@isachar \MT@charstring Everything that has been defined with \DeclareTextSymbol in the encod-

ing definition files.

724  /def/Mt@charstring{\CHAR"}%
725  /def/Mt@isachar##1\CHAR"##2##3##4/relax{%
726  /@tempswafalse
727  /ifx/relax##1/relax
728  /@tempswatrue
729  /if##3\/relax
730  /edef/Mt@char{/number"##2}%
731  /Mt@testrest{/Mt@charstring}{##3##4}%
732  /else
733  /edef/Mt@char{/number"##2##3}%
734  /Mt@testrest{/Mt@charstring}{##4}%
735  /fi
736  /fi

737 }% 738 }% 739 }

740 /expandafter/endgroup/x

\Mt@testrest Test whether all of the string has been used up.

741 \def\Mt@testrest#1#2{%
742 \edef\x{#1}%
743 \edef\y{#2}%
744 \ifx\x\y\else
745  \def\Mt@rest{#2}%
746 \fi

747 }

\MT@get@slot There are lots of possibilities how a character is defined in the configuration, which makes translating them into slot numbers hard. Let’s begin with the simplest cases:

748 \def\MT@get@slot{%
749 \MT@count=\escapechar
750 \escapechar=`\\
751 \let\Mt@rest\@empty
752 \let\Mt@char\m@ne
753 \edef\MT@char{\expandafter\meaning\@tempa}%

• It’s either a single letter.

754  \expandafter\expandafter\expandafter\Mt@isaletter
755  \expandafter\MT@char\Mt@letterstring \relax\relax
756  \ifnum\Mt@char < \z@

• A number or a ‘other’ character (catcode 12).

757  \expandafter\expandafter\expandafter\Mt@isacharacter
758  \expandafter\MT@char\Mt@characterstring \relax\relax
759  \if@tempswa
760  \expandafter\MT@get@number\@tempa\relax\relax
761  \fi
762  \ifnum\Mt@char < \z@

• Well then, maybe a backslash?

763  \expandafter\ifx\expandafter\ \@tempa\relax
764  \edef\Mt@char{\number`\\}%
765  \else

• OK, so it must be a macro. Now comes the hairy part.

Fortunately, we can assume that the command actually exists in the current encoding. Therefore, we can simply call \⟨encoding⟩\⟨command⟩ (that’s one command) instead of \⟨command⟩ itself, which might expand to funny stuff, depending on context.

766  \edef\MT@char{\expandafter\csname\expandafter\MT@encoding
767  \expandafter\string\@tempa\endcsname}%
768  \edef\MT@char{\expandafter\meaning\MT@char}%
769  \expandafter\expandafter\expandafter\Mt@isachar
770  \expandafter\MT@char\Mt@charstring \relax\relax\relax
771  \if@tempswa \else

Not all symbols have been defined by \DeclareTextSymbol, in which case they don’t expand to \char"⟨hex number⟩ (e. g. \i, when using frenchpro). Therefore, we also test whether it’s a letter.

772  \expandafter\expandafter\expandafter\Mt@isaletter
773  \expandafter\MT@char\Mt@letterstring \relax\relax
774  \fi
775  \fi
776  \ifnum\Mt@char < \z@

• Now, we’ll catch the rest, which will in most cases consist of two tokens (e. g. \"A). Errors will most likely occur here. How could I make this more robust?

777  \expandafter\MT@two@tokens\@tempa\relax\relax
778  \edef\MT@char{\expandafter\meaning\@tempa}%
779  \expandafter\expandafter\expandafter\Mt@isaletter
780  \expandafter\MT@char\Mt@letterstring \relax\relax
781  \if@tempswa \else
782  \MT@warning{Unknown slot number of `\@tempa' in\MessageBreak
783  encoding `\MT@encoding'. Ignoring it}%
784  \fi
785  \fi
786  \fi
787  \fi

If the user has specified something like ‘ab’, or he wanted to define a number but forgot to use three digits, we’ll have something left of the string. In this case, we issue a warning and forget the complete string.

788 \ifx\Mt@rest\@empty\else
789  \MT@warning{Unknown slot number of `\@tempa' in\MessageBreak
790  encoding `\MT@encoding'.
791  Make sure it's a single character\MessageBreak

792  (or a number). Ignoring it}%
793  \let\Mt@char\m@ne
794 \fi
795 \let\MT@char\Mt@char
796 \escapechar=\MT@count

797 }

\MT@two@tokens If we find two tokens, expand them to get the actual character (or so we hope).

798 \def\MT@two@tokens#1#2\relax{%
799 \MT@ifempty{#2}{}%
800  {\edef\@tempa{\@tempa}}%

801 }

\MT@get@number Numbers may be specified as a three-digit decimal number (092), as a hexadecimal number (prefixed with ": "5C) or as a octal number (prefixed with ': '134). They must consist of at least three letters (including the prefix), that is, "F is not permitted.

802 \def\MT@get@number#1#2#3\relax{%
803 \ifx\relax#3\relax\else
804  \ifx\relax#2\relax\else
805  \if#1"\relax
806  \def\@tempc{\uppercase{\edef\Mt@char{\number#1#2#3}}}%
807  \@tempc
808  \else
809  \if#1'\relax
810  \def\Mt@char{\number#1#2#3}%
811  \else
812  \MT@ifnumber{#1#2#3}{%
813  \def\Mt@char{\number#1#2#3}%
814  }{}%
815  \fi
816  \fi
817  \ifnum\Mt@char > \@cclv
818  \MT@warning{%
819  Number \noexpand#1\noexpand#2\noexpand#3 in encoding
820  `\MT@encoding' too large!\MessageBreak Ignoring it}%
821  \let\Mt@char\m@ne
822  \fi
823  \let\Mt@rest\@empty
824  \fi
825 \fi

826 }

10.3.4 Hook into L^{A}TEX’s font selection

We append \MT@setupfont to \pickup@font, which is called by L^{A}TEX every time a font is selected. We then check whether we’ve already seen this font, and if not, set it up for micro-typography. This ensures that we will catch all fonts, and that we will not set up fonts more than once. The whole package really hangs on this command.

In contrast to the pdfcprot package, there is no need to declare the fonts in advance that should be subjected to micro-typography. Also, only those fonts that are actually being used will be set up for expansion and protrusion.

For my reference:

   • \pickup@font calls \define@newfont.
   • \define@newfont may call
       – \wrong@fontshape, which in turn will call \pickup@font, and
         thus \define@newfont again, or
       – \extract@font.
   • \pickup@font is called by \wrong@fontshape, \selectfont, or
     \getanddefine@fonts (for math).

Up to version 1.3 of this package, we were using \define@newfont as the hook, which is only called for new fonts. This meant that we had to take special care to catch all fonts: We additionally had to set up the default font, the error font (if it wasn’t the default font), we had to check for some packages that might have been loaded before microtype and were loading fonts, e.g. jurabib, ledmac, pifont (loaded by hyperref), tipa, and probably many more. Furthermore, we had to include a hack for the IEEEtran class which loads all fonts in the class file itself (to fine tune inter-word spacing). Then I discovered that even my favorite class, the memoir class, loads fonts. To cut this short: It seemed to get out of hand, and I decided that it would be better to use \pickup@font and decide for ourselves whether we’ve already seen that font. I hope the overhead isn’t too large. (We use a comma-separated list.)

827 \let\MT@font@list\@empty
828 \g@addto@macro\pickup@font{%
829 \begingroup \escapechar\m@ne
830 \expandafter\MT@in@llist\expandafter
831  {\font@name}\MT@font@list
832 \ifMT@inlist@\else
833  \MT@setupfont
834  \xdef\MT@font@list{\MT@font@list\font@name,}%
835 \fi
836 \endgroup

837 }

\MT@pickupfont Test whether our definition has survived (at least CJK redefines \pickup@font)^{7}.

838 \let\MT@pickupfont\pickup@font
839 \AtBeginDocument{%
840 \ifx\MT@pickupfont\pickup@font\else

7 Can anybody say something about how microtype and CJK work together?

841  \MT@warning@nl{%
842  Another package has overwritten the definition\MessageBreak
843  of \string\pickup@font. I might not be able to\MessageBreak
844  apply any micro-typography. Please find the\MessageBreak
845  culprit, and load it before the microtype package}%
846 \fi

847 }

10.4 Configuration

10.4.1 Font Sets

\DeclareMicroTypeSet \DeclareMicroTypeSet* Calling this macro will create a list for every font characteristic of the form: \MT⟨expansion|protrusion ⟩list@⟨characteristic⟩@⟨set name⟩. If the optional argument is empty, lists for both expansion and protrusion will be created.

The third argument must be a list of key=value pairs. If a font characteristic is not specified, we define the corresponding list to \relax, so that it does not constitute a constraint.

The internal list will be of the form \MT@lt{⟨var1 ⟩} \MT@lt{⟨var2 ⟩} …, where \MT@lt acts as the delimiter between the list entries.

848 \def\DeclareMicroTypeSet{%
849 \@ifstar
850  {\@ifnextchar[%]
851  \MT@DeclareSetAndUseIt
852  {\MT@DeclareSetAndUseIt[]}}%
853  {\@ifnextchar[%]
854  \MT@DeclareSet
855  {\MT@DeclareSet[]}}%

856 }

\MT@DeclareSet
857 \def\MT@DeclareSet[#1]#2#3{%
858 \MT@DeclareSet@{#1}{#2}{#3}%

859 }

\MT@DeclareSetAndUseIt
860 \def\MT@DeclareSetAndUseIt[#1]#2#3{%
861 \MT@DeclareSet@{#1}{#2}{#3}%
862 \UseMicroTypeSet[#1]{#2}%

863 }

\MT@DeclareSet@
864 \def\MT@DeclareSet@#1#2#3{%
865 \KV@@sp@def\@tempa{#1}%
866 \MT@ifempty{\@tempa}{%
867  \MT@declare@sets{protrusion}{#2}{#3}%
868  \MT@declare@sets{expansion} {#2}{#3}%
869 }{%
870  \expandafter\MT@declare@sets\expandafter{\@tempa}{#2}{#3}%

871 }%

\MT@tmp@setname We need to remember the name of the set currently being declared.

873 \let\MT@tmp@setname\@empty

\MT@declare@sets Define the current set name and parse the keys.

874 \def\MT@declare@sets#1#2#3{%
875 \KV@@sp@def\MT@tmp@setname{#2}%
876 \global\MT@let@nc{MT@#1list@@\MT@tmp@setname}\@empty
877 ⟨debug⟩ \MT@info{declaring #1 set `\MT@tmp@setname'}%
878 \setkeys{MT#1@set}{#3}%

879 }

\MT@define@set@keys Define the keyval keys for expansion and protrusion sets.

880 \def\MT@define@set@keys#1{%
881 \MT@define@set@key{#1}{encoding}%
882 \MT@define@set@key{#1}{family}%
883 \MT@define@set@key{#1}{series}%
884 \MT@define@set@key{#1}{shape}%
885 \MT@define@set@key@size{#1}%

886 }

\MT@define@set@key ⟨#1 ⟩ = [expansion|protrusion], ⟨#2 ⟩ = font axis,
887 \def\MT@define@set@key#1#2{%
888 \define@key{MT#1@set}{#2}[]{%
889  \@for\MT@val:=##1\do{%

Get rid of spaces.

890  \MT@remove@spaces{\MT@val}%
891  \MT@get@highlevel{#2}%
892  \MT@escapechar{\MT@val}%
893  \MT@addto@list{#1}{#2}{\MT@val}%

894 }%

895 ⟨debug⟩  \MT@info@nl{-- #2: \csname MT@#1list@#2@\MT@tmp@setname\endcsname}%

896 }% 897 }

\MT@get@highlevel Saying, for instance, family={rm*} or shape={bf*} will lead to \rmdefault

resp. \bfdefault being expanded/protruded.

898 \def\MT@get@highlevel#1{%
899 \MT@getlast{\MT@val}%
900 \if*\@tempb
And family = * will become \familydefault.
901  \MT@ifempty{\@tempa}{\def\@tempa{#1}}{}%
902  \def\MT@val{\csname \@tempa default\endcsname}%

Beware that \rmdefault etc. might change after this package has been loaded! Therefore, we check (once for each characteristic/list) at the beginning of the document.

903  \ifx\@nodocument\relax\else
904  \expandafter\ifx
905  \csname MT@check@\MT@tmp@setname @\@tempa\endcsname\@empty
906  \else
907  \global\MT@edef@n{MT@\MT@tmp@setname @\@tempa @default}{\MT@val}%
908  \edef\x{{\MT@tmp@setname}{\@tempa}}%

909  \expandafter\AtBeginDocument\expandafter{%
910  \expandafter\MT@check@default\x

911 }%

912  \global\MT@let@nc{MT@check@\MT@tmp@setname @\@tempa}\@empty
913  \fi
914  \fi
915 \fi

916 }

\MT@check@default
917 \def\MT@check@default#1#2{%
918 \MT@let@cn\@tempa{MT@#1@#2@default}%
919 \edef\@tempb{\csname #2default\endcsname}%
920 \ifx\@tempa\@tempb\else
921  \MT@warning@nl{\expandafter\noexpand\csname #2default\endcsname
922  has changed (`\@tempa' <> `\@tempb')!\MessageBreak
923  This might affect the `#1' font set.\MessageBreak
924  Please make all relevant font changes *before*\MessageBreak
925  loading the `microtype' package}%
926 \fi

927 }

\MT@getlast
928 \def\MT@getlast#1{\def\@tempa{}\def\@tempb{}%
929 \expandafter\MT@getlast@#1\@nil}
\MT@getlast@
930 \def\MT@getlast@#1{\ifx#1\@nil \let\next=\relax
931 \else \edef\@tempa{\@tempa\@tempb}\def\@tempb{#1}%
932  \let\next=\MT@getlast@\fi \next}

\MT@escapechar Make sure that the escape char is set to -1, and catcodes are the same as in the original font name, so that the comparison doesn’t fail.

933 \def\MT@escapechar#1{%
934 \begingroup
935 \escapechar\m@ne
936 \xdef\MT@val{\expandafter\string\csname #1\endcsname}%
937 \endgroup

938 }

\MT@define@set@key@size  size requires special treatment.
939 \def\MT@define@set@key@size#1{%
940 \define@key{MT#1@set}{size}[]{%
941  \@for\MT@val:=##1\do{%
942  \MT@remove@spaces{\MT@val}%
943  \MT@get@size
944  \MT@addto@list{#1}{size}{\MT@val}%

945 }%

946 ⟨debug⟩  \MT@info@nl{-- size: \csname MT@#1list@size@\MT@tmp@setname\endcsname}%

947 }% 948 }

\MT@get@size If it’s not specified as a dimension, we tackle the size selection command here.

949 \def\MT@get@size{%

950 \let\@tempa\relax

A single star means \sizedefault, which doesn’t exist, so we define it to

be \normalsize.
951 \if*\MT@val\relax
952  \def\@tempa{\normalsize}%
953 \else
954  \MT@let@cn\@tempa{\MT@val}%
955 \fi
956 \ifx\@tempa\relax\else

The relsize solution of parsing \@setfontsize does not work with the AMS classes, among others. I hope my hijacking doesn’t do any harm. We redefine \set@fontsize, and not \@setfontsize because some classes might define the size selection commands by simply using \fontsize (e. g. the a0poster class).

957  \begingroup
958  \def\set@fontsize##1##2##3##4\@nil{\gdef\MT@val{##2}}%
959  \@tempa\@nil
960  \endgroup
961 \fi

Test whether we finally got a number or dimension so that we can strip the

‘pt’ (\@defaultunits and \strip@pt are kernel macros).
962 \setbox\z@=\hbox{\MT@count=0\MT@val\relax
963  \ifnum\MT@count=\z@
964  \@tempswafalse
965  \else
966  \@tempswatrue
967  \fi\expandafter}%
968 \if@tempswa
969  \@defaultunits\@tempdima\MT@val pt\relax\@nnil
970  \edef\MT@val{\strip@pt\@tempdima}%
971 \else
972  \MT@warning{Could not parse font size `\MT@val'\MessageBreak
973  in font set `\MT@tmp@setname'}%
974 \fi

975 }

\MT@addto@list Append the value ⟨#3 ⟩ to the expansion or protrusion (= ⟨#1 ⟩) list for font axis ⟨#2 ⟩.

976 \def\MT@addto@list#1#2#3{%
977 \expandafter\MT@xadd\csname MT@#1list@#2@\MT@tmp@setname\endcsname
978  {\noexpand\MT@lt{#3}}%

979 }

We have finally assembled all pieces to define \DeclareMicroTypeSet’s keys.

980 \MT@define@set@keys{protrusion}
981 \MT@define@set@keys{expansion}
\UseMicroTypeSet To use a particular set we simply redefine MT@⟨expansion|protrusion ⟩@setname.

If the optional argument is empty, both \MT@expansion@setname and

 \MT@protrusion@setname will be redefined.
 982 \renewcommand{\UseMicroTypeSet}[2][]{%
 983 \KV@@sp@def\@tempa{#1}%
 984 \MT@ifempty{\@tempa}{%
 985  \MT@use@sets{protrusion}{#2}%
 986  \MT@use@sets{expansion} {#2}%
 987 }{%
 988  \expandafter\MT@use@sets\expandafter{\@tempa}{#2}%

989 }% 990 }

\MT@use@sets The set must be declared.

 991 \def\MT@use@sets#1#2{%
 992 \KV@@sp@def{\@tempa}{#2}%
 993 \MT@ifdefined@n{MT@#1list@@\@tempa}{%
 994  \global\MT@edef@n{MT@#1@setname}{\@tempa}%
 995  \MT@info{Using #1 set `\@tempa'}%
 996 }{%
 997  \MT@ifdefined@n{MT@#1@setname}{}{%
 998  \global\MT@def@n{MT@#1@setname}{alltext}%

999 }%

1000  \MT@warning{The #1 set `\@tempa' is undeclared.\MessageBreak
1001  Using set `\csname MT@#1@setname\endcsname' instead}%

1002 }% 1003 }

\DeclareMicroTypeAlias This can be used to set an alias name for a font, so that the file (and the settings) for the aliased font will be loaded.

1004 \renewcommand{\DeclareMicroTypeAlias}[2]{%
1005 \KV@@sp@def\@tempa{#1}%
1006 \KV@@sp@def\@tempb{#2}%
1007 \global\MT@edef@n{MT@\@tempa @alias}{\@tempb}%

1008 } 1009 ⟨/package⟩

10.4.2 Declarations

We now set up some default sets (in the main configuration file).

1010 ⟨∗config & m − t⟩

1011

1012 %%% ----------------------------------------------------------------------
1013 %%% FONT SETS

1014

1015 \DeclareMicroTypeSet{all}

1016 {}

1017

1018 \DeclareMicroTypeSet{allmath}
1019 { encoding = {T1,OT1,LY1,TS1,OML,OMS} }

1020

1021 \DeclareMicroTypeSet{alltext}
1022 { encoding = {T1,OT1,LY1,TS1} }

1023

1024 \DeclareMicroTypeSet{basicmath}

1025 { encoding = {T1,OT1,LY1,OML,OMS},
1026  family   = {rm*,sf*},
1027  series   = {m},
1028  size     = {normalsize,footnotesize,small,large}

1029 }

1030

1031 \DeclareMicroTypeSet{basictext}
1032 { encoding = {T1,OT1,LY1},
1033  family   = {rm*,sf*},
1034  series   = {m},
1035  size     = {normalsize,footnotesize,small,large}

1036 }

1037

1038 \DeclareMicroTypeSet{normalfont}
1039 { encoding = *,
1040  family   = *,
1041  series   = *,
1042  shape    = *,
1043  size     = *

1044 }

1045

The Latin Modern fonts, the virtual fonts from the ae and zefonts, and the eco and hfoldsty packages (oldstyle numerals) all inherit the (basic) settings from Computer Modern Roman.

1046 %%% ----------------------------------------------------------------------
1047 %%% FONT ALIASES

1048

1049 \DeclareMicroTypeAlias{lmr} {cmr}
1050 \DeclareMicroTypeAlias{aer} {cmr}
1051 \DeclareMicroTypeAlias{zer} {cmr}
1052 \DeclareMicroTypeAlias{cmor}{cmr}
1053 \DeclareMicroTypeAlias{hfor}{cmr}

1054 ⟨/config & m − t⟩

10.4.3 Fine Tuning

The macros \SetExpansion and \SetProtrusion provide a similar interface for setting the character protrusion resp. expansion factors for a set of fonts.

\SetProtrusion This macro accepts three arguments: [options,] set of font characteristics

and list of character protrusion factors.

A new macro called \MT@protcodes@⟨name⟩ will be defined to be ⟨#3 ⟩ (i.e. the list of characters, not expanded).

1055 ⟨∗package⟩

1056 \renewcommand{\SetProtrusion}[3][]{%
1057 \global\let\MT@protcodes@name\@undefined
1058 \let\MT@load\@undefined
1059 \let\MT@extra@factor\@undefined

Parse the first argument:

1060 \setkeys{MT@protcodes}{#1}%

If the user hasn’t specified a name, we will create one.

1061 \MT@get@codes@name{prot}%
1062 \MT@set@factor
1063 ⟨debug⟩ \MT@info{creating protrusion list `\MT@protcodes@name'}%

Now we can define the macro to be ⟨#3 ⟩. Here, as elsewhere, we have to make the definitions global, since they may occur inside a group.

1064 \global\MT@def@n{MT@protcodes@\MT@protcodes@name}{#3}%

The second argument: We define macros for all permutations of the font characteristics to point to this macro.

1065 \setkeys{MT@protcodes}{#2}%
1066 \def\MT@permutelist{protcodes}%
1067 \MT@permute

1068 }

\SetExpansion \SetExpansion only differs in that it allows some extra options (stretch,

 shrink, step, auto).
1069 \renewcommand{\SetExpansion}[3][]{%
1070 \global\let\MT@expcodes@name\@undefined
1071 \let\MT@extra@factor\@undefined
1072 \let\MT@extra@stretch\@undefined
1073 \let\MT@extra@shrink\@undefined
1074 \let\MT@extra@step\@undefined
1075 \let\MT@extra@auto\@undefined
1076 \let\MT@load\@undefined
1077 \setkeys{MT@expcodes}{#1}%
1078 \MT@get@codes@name{exp}%
1079 \MT@set@exp@opt
1080 ⟨debug⟩ \MT@info{creating expansion list `\MT@expcodes@name'}%
1081 \global\MT@def@n{MT@expcodes@\MT@expcodes@name}{#3}%
1082 \setkeys{MT@expcodes}{#2}%
1083 \def\MT@permutelist{expcodes}%
1084 \MT@permute

1085 }

\MT@get@codes@name Simply use a roman number as the list name if the user didn’t bother creating one.

1086 \def\MT@get@codes@name#1{%
1087 \MT@ifdefined@n{MT@#1codes@name}{%
1088  \MT@ifdefined@n{MT@#1codes@\csname MT@#1codes@name\endcsname}{%
1089  \MT@warning{Redefining list `\csname MT@#1codes@name\endcsname'}%
1090  }{}%

1091 }{%

1092  \@tempcnta=\@ne
1093  \MT@loop
1094  \MT@ifdefined@n{MT@#1codes@#1-\romannumeral\@tempcnta}{%
1095  \advance \@tempcnta \@ne

1096 }{%

1097  \global\MT@edef@n{MT@#1codes@name}{#1-\romannumeral\@tempcnta}%
1098  \@tempcnta=\z@

1099 }%

1100  \ifnum\@tempcnta > \z@ \MT@repeat

1101 }%

Now that we know the name, we can cater for any set to be loaded by this list.

1102 \MT@ifdefined@c\MT@load{%
1103  \global\MT@let@nc{MT@#1codes@\csname MT@#1codes@name\endcsname load}\MT@load
1104 }{}%

1105 }

\MT@set@factor
1106 \def\MT@set@factor{%
1107 \MT@ifdefined@c\MT@extra@factor{%
1108  \global\MT@let@nc{MT@protcodes@\MT@protcodes@name @factor}\MT@extra@factor
1109 }{}%

1110 }

\MT@set@exp@opt The extra options to \SetExpansion also have to be dealt with only after we know the name.

1111 \def\MT@set@exp@opt{%
1112 \MT@ifdefined@c\MT@extra@factor{%
1113  \global\MT@let@nc{MT@expcodes@\MT@expcodes@name @factor}\MT@extra@factor
1114 }{}%
1115 \MT@ifdefined@c\MT@extra@stretch{%
1116  \global\MT@let@nc{MT@expcodes@\MT@expcodes@name @stretch}\MT@extra@stretch
1117 }{}%
1118 \MT@ifdefined@c\MT@extra@shrink{%
1119  \global\MT@let@nc{MT@expcodes@\MT@expcodes@name @shrink}\MT@extra@shrink
1120 }{}%
1121 \MT@ifdefined@c\MT@extra@step{%
1122  \global\MT@let@nc{MT@expcodes@\MT@expcodes@name @step}\MT@extra@step
1123 }{}%
1124 \MT@ifdefined@c\MT@extra@auto{%
1125  \global\MT@let@nc{MT@expcodes@\MT@expcodes@name @auto}\MT@extra@auto
1126 }{}%

1127 }

\MT@define@code@key Define the keys for expansion and protrusion character code lists.

1128 \def\MT@define@code@key#1#2{%
1129 \define@key{MT@#1}{#2}[]{%
1130  \@tempcnta=\@ne
1131  \@for\MT@val:=##1\do{%
1132  \MT@remove@spaces{\MT@val}%

Here, too, we allow for something like ‘bf*’. It will expanded immediately.

1133  \MT@get@highlevel{#2}%
1134  \MT@edef@n{MT@temp#2\romannumeral\@tempcnta}{\MT@val}%
1135  \advance\@tempcnta \@ne

1136 }% 1137 }% 1138 }

\MT@define@code@key@size
1139 \def\MT@define@code@key@size#1{%
1140 \define@key{MT@#1}{size}[]{%

1141  \@tempcnta=\@ne
1142  \@for\MT@val:=##1\do{%
1143  \MT@remove@spaces{\MT@val}%
1144  \MT@get@size
1145  \MT@edef@n{MT@tempsize\romannumeral\@tempcnta}{\MT@val}%
1146  \advance\@tempcnta \@ne

1147 }% 1148 }% 1149 }

\MT@declare@codes
1150 \def\MT@declare@codes#1{%
1151 \define@key{MT@#1codes}{name}[]{%
1152  \MT@ifempty{##1}{}{%
1153  \global\MT@def@n{MT@#1codes@name}{##1}%

1154 }% 1155 }%

1156 \define@key{MT@#1codes}{load}[]{%
1157  \MT@ifempty{##1}{}{%
1158  \def\MT@load{##1}%

1159 }% 1160 }%

1161 \define@key{MT@#1codes}{factor}[]{%
1162  \MT@ifempty{##1}{}{%
1163  \def\MT@extra@factor{##1 }%

1164 }% 1165 }%

1166 \MT@define@code@key{#1codes}{encoding}%
1167 \MT@define@code@key{#1codes}{family}%
1168 \MT@define@code@key{#1codes}{series}%
1169 \MT@define@code@key{#1codes}{shape}%
1170 \MT@define@code@key@size{#1codes}%

1171 }

1172 \MT@declare@codes{prot}
1173 \MT@declare@codes{exp}

\MT@define@expcodes@key The first argument to \SetExpansion accepts some more options.

1174 \def\MT@define@expcodes@key#1{%
1175 \define@key{MT@expcodes}{#1}[]{%
1176  \MT@ifempty{##1}{}{%

A space terminates the number.

1177  \MT@def@n{MT@extra@#1}{##1 }%

1178 }% 1179 }% 1180 }

1181 \MT@define@expcodes@key{stretch}
1182 \MT@define@expcodes@key{shrink}
1183 \MT@define@expcodes@key{step}
1184 \define@key{MT@expcodes}{auto}[]{%
1185 \MT@ifempty{#1}{\def\@tempb{true}}{\def\@tempb{#1}}%
1186 \csname if\@tempb\endcsname
1187  \def\MT@extra@auto{autoexpand }%

1188 \else
1189  \let\MT@extra@auto\@empty

1190 \fi 1191 }

10.4.4 Character Inheritance

\DeclareCharacterInheritance This macro may be used in the configuration files to declare characters that should inherit protrusion resp. expansion values from other characters. Thus, there is no need to define all accented characters (e. g. \`a, \'a, \^a, \~a, \"a, \r{a}, \k{a}, \u{a}), which will make the configuration files look much nicer and easier to maintain. If a single character of an inheritance list should have a different value, one can simply override it.

1192 \renewcommand{\DeclareCharacterInheritance}[3][]{%
1193 \KV@@sp@def\@tempa{#1}%
1194 \MT@ifempty{\@tempa}{%
1195  \MT@declare@char@inh{protrusion}{#2}{#3}%
1196  \MT@declare@char@inh{expansion} {#2}{#3}%

1197 }{%

1198  \expandafter\MT@declare@char@inh\expandafter{\@tempa}{#2}{#3}%

1199 }% 1200 }

\MT@declare@char@inh The optional argument may be used to restrict the inheritance list to protrusion or expansion.

1201 \def\MT@declare@char@inh#1#2#3{%
1202 \MT@let@nc{MT@#1inh@name}\@undefined
1203 \MT@get@inh@name{#1}%
1204 ⟨debug⟩ \MT@info{creating inheritance list `\csname MT@#1inh@name\endcsname'}%
1205 \global\MT@def@n{MT@#1inh@\csname MT@#1inh@name\endcsname}{#3}%
1206 \setkeys{MT@#1inh}{#2}%
1207 \def\MT@permutelist{#1inh}%
1208 \MT@permute

1209 }

\MT@get@inh@name The inheritance lists cannot be named by the user.

1210 \def\MT@get@inh@name#1{%
1211 \@tempcnta=\@ne
1212 \MT@loop
1213  \MT@ifdefined@n{MT@#1inh@#1-inh-\romannumeral\@tempcnta}{%
1214  \advance \@tempcnta \@ne

1215 }{%

1216  \MT@edef@n{MT@#1inh@name}{#1-inh-\romannumeral\@tempcnta}%
1217  \@tempcnta=\z@

1218 }%

1219  \ifnum\@tempcnta > \z@ \MT@repeat

1220 }

\MT@define@inh@key@encoding Parse the first argument. \DeclareCharacterInheritance may also be set

up for various combinations.

1221 \def\MT@define@inh@key@encoding#1{%
1222 \define@key{MT@#1}{encoding}[]{%

1223  \KV@@sp@def\MT@val{##1}%
1224  \expandafter\MT@encoding@check\MT@val,\@nil
1225  \MT@get@highlevel{encoding}%
1226  \MT@edef@n{MT@tempencoding\romannumeral1}{\MT@val}%

1227 }% 1228 }

\MT@encoding@check But we only allow one encoding.

1229 \def\MT@encoding@check#1,#2\@nil{%
1230 \MT@ifempty{#2}{}{%
1231  \edef\MT@val{#1}%
1232  \MT@warning{You may only specify one encoding for character\MessageBreak
1233  inheritance lists. Ignoring encoding #2}%

1234 }% 1235 }

\MT@define@inh@keys
1236 \def\MT@define@inh@keys#1{%
1237 \MT@define@inh@key@encoding{#1inh}%

For the rest, we can reuse the key setup from \SetProtrusion resp.

 \SetExpansion.
1238 \MT@define@code@key{#1inh}{family}%
1239 \MT@define@code@key{#1inh}{series}%
1240 \MT@define@code@key{#1inh}{shape}%
1241 \MT@define@code@key@size{#1inh}%

1242 }

1243 \MT@define@inh@keys{protrusion}
1244 \MT@define@inh@keys{expansion}

\MT@inhdo Parse the second argument, the inheritance lists. We define the commands \MT@inh@⟨name⟩@⟨slot⟩@, containing the inheriting characters. They will also be translated to slot numbers here, to save some time. The following will be executed only once, namely the first time this inheritance list is

 encountered (in \MT@set@prot@codes resp. \MT@set@exp@codes).
1245 \def\MT@inhdo#1,{%
1246 \ifx\relax#1\@empty\else
1247  \MT@inhsplit #1==\relax
1248  \expandafter\MT@inhdo\fi

1249 }

\MT@inhsplit At the right time (viz. in MT@set@⟨exp|prot ⟩@children), \MT@lt will be

redefined to set the codes for the inheriting characters gathered here.

1250 \def\MT@inhsplit#1=#2=#3\relax{%
1251 \KV@@sp@def\@tempa{#1}%
1252 \ifx\@tempa\@empty\else
1253  \MT@get@slot
1254  \ifnum\MT@char > \m@ne
1255  \let\MT@val\MT@char
1256  \let\MT@lt\relax
1257  \KV@@sp@def\@tempb{#2}%
1258  \@for\@tempa:=\@tempb\do{%
1259  \MT@remove@spaces{\@tempa}%

1260  \ifx\@tempa\@empty\else
1261  \MT@get@slot
1262  \ifnum\MT@char > \m@ne
1263  \expandafter\MT@xadd\csname MT@inh@\MT@inh@name @\MT@val @\endcsname
1264  {\noexpand\MT@lt{\MT@char}}%

1265 \fi 1266 \fi 1267 }%

1268 ⟨debug⟩  \let\MT@lt\@empty
1269 ⟨debug⟩  \MT@info@nl{children of #1 (\MT@val):
1270 ⟨debug⟩  \csname MT@inh@\MT@inh@name @\MT@val @\endcsname}%

1271 \fi 1272 \fi 1273 }

10.4.5 Permutation

\MT@permute \MT@permute@ \MT@permute@@ \MT@permute@@@ \MT@permute@@@@ \MT@permute@@@@@ Calling \MT@permute will define commands for all permutations of speci-

fied font characteristics of the form \MT@⟨list type⟩@/⟨encoding⟩/⟨family⟩/ ⟨series⟩/⟨shape⟩/⟨size⟩ to be the expansion of \MT@⟨list type⟩@name, i. e. the name of the currently defined list. This permutation can certainly be done in a more elegant way.

1274 \def\MT@permute{%
1275 \let\MT@cnt@encoding\@ne
1276 \MT@permute@

Undefine commands for the next round.

1277 \MT@permute@reset

1278 }

1279 \def\MT@permute@{%
1280 \let\MT@cnt@family\@ne
1281 \MT@permute@@
1282 \MT@increment\MT@cnt@encoding
1283 \MT@ifdefined@n{MT@tempencoding\romannumeral\MT@cnt@encoding}%
1284  {\MT@permute@}{}%

1285 }

1286 \def\MT@permute@@{%
1287 \let\MT@cnt@series\@ne
1288 \MT@permute@@@
1289 \MT@increment\MT@cnt@family
1290 \MT@ifdefined@n{MT@tempfamily\romannumeral\MT@cnt@family}%
1291  {\MT@permute@@}{}%

1292 }

1293 \def\MT@permute@@@{%
1294 \let\MT@cnt@shape\@ne
1295 \MT@permute@@@@
1296 \MT@increment\MT@cnt@series
1297 \MT@ifdefined@n{MT@tempseries\romannumeral\MT@cnt@series}%
1298  {\MT@permute@@@}{}%

1299 }

1300 \def\MT@permute@@@@{%
1301 \let\MT@cnt@size\@ne

1302 \MT@permute@@@@@
1303 \MT@increment\MT@cnt@shape
1304 \MT@ifdefined@n{MT@tempshape\romannumeral\MT@cnt@shape}%
1305  {\MT@permute@@@@}{}%

1306 }

1307 \def\MT@permute@@@@@{%
1308 \MT@permute@define{encoding}%
1309 \MT@permute@define{family}%
1310 \MT@permute@define{series}%
1311 \MT@permute@define{shape}%
1312 \MT@permute@define{size}%
1313 \edef\@tempa{\MT@tempencoding/%
1314  \MT@tempfamily/%
1315  \MT@tempseries/%
1316  \MT@tempshape/%
1317  \MT@tempsize}%

Some sanity checks: only one list should apply to a given combination; an encoding must be specified (unless nothing else is); size may only be defined if all the rest is, too.

1318 \def\@tempb{////}%
1319 \ifx\@tempa\@tempb\else
1320  \ifx\MT@tempencoding\@empty
1321  \MT@warning{%
1322  You have to specify an encoding for \MT@permutelist. list\MessageBreak
1323  `\csname MT@\MT@permutelist @name\endcsname'. I will ignore it}%
1324  \else
1325  \MT@ifdefined@n{MT@\MT@permutelist @\@tempa}{%
1326  \MT@warning{\MT@permutelist. list
1327  `\csname MT@\MT@permutelist @name\endcsname' will override list\MessageBreak
1328  `\csname MT@\MT@permutelist @\@tempa\endcsname' for font `\@tempa'}%
1329  }{}%
1330  \ifx\MT@tempsize\@empty\else
1331  \expandafter\MT@size@check\@tempa//\@nil

1332 \fi

1333  \global\MT@edef@n{MT@\MT@permutelist @\@tempa}%
1334  {\csname MT@\MT@permutelist @name\endcsname}%
1335 ⟨debug⟩  \MT@info@nl{initializing: use list for font \@tempa}%

1336 \fi 1337 \fi

1338 \MT@increment\MT@cnt@size
1339 \MT@ifdefined@n{MT@tempsize\romannumeral\MT@cnt@size}%
1340  {\MT@permute@@@@@}{}%

1341 }

\MT@size@check Check whether all font characteristics are specified.

1342 \def\MT@size@check#1//#2\@nil{%
1343 \MT@ifempty{#2}{}{%
1344  \MT@let@nc{MT@tempsize\romannumeral\MT@cnt@size}\@undefined
1345  \edef\@tempa{\MT@tempencoding/\MT@tempfamily/\MT@tempseries/\MT@tempshape/}%
1346  \MT@warning{Size may only be specified if all other font\MessageBreak
1347  characteristics are specified, too. Ignoring size\MessageBreak
1348  in \MT@permutelist. list `\csname MT@\MT@permutelist @name\endcsname'}%

1349 }%

1350 }

\MT@permute@define Define and reset the commands.

1351 \def\MT@permute@define#1{%
1352 \expandafter\@tempcnta\csname MT@cnt@#1\endcsname
1353 \MT@ifdefined@n{MT@temp#1\romannumeral\@tempcnta}{%
1354  \MT@edef@n{MT@temp#1}{\csname MT@temp#1\romannumeral\@tempcnta\endcsname}%

1355 }{%

1356  \MT@let@nc{MT@temp#1}\@empty

1357 }% 1358 }

\MT@permute@reset
1359 \def\MT@permute@reset{%
1360 \MT@permute@reset@{encoding}%
1361 \MT@permute@reset@{family}%
1362 \MT@permute@reset@{series}%
1363 \MT@permute@reset@{shape}%
1364 \MT@permute@reset@{size}%

1365 }

\MT@permute@reset@
1366 \def\MT@permute@reset@#1{%
1367 \@tempcnta\@ne
1368 \MT@loop
1369  \MT@let@nc{MT@temp#1\romannumeral\@tempcnta}\@undefined
1370  \advance\@tempcnta\@ne
1371  \MT@ifdefined@n{MT@temp#1\romannumeral\@tempcnta}
1372  {\@tempswatrue}
1373  {\@tempswafalse}%
1374  \if@tempswa\MT@repeat

1375 } 1376 ⟨/package⟩

10.5 User Command

\microtypesetup \MT@define@optionX This command may be used anywhere in the document. It accepts the options: protrusion, expansion and activate. Specifying font sets is not allowed.

1377 ⟨∗package⟩

1378 \def\MT@capitalize#1#2\@nil{%
1379 \uppercase{\def\@tempb{#1}}%
1380 \edef\@tempb{\@tempb#2}}%
1381 \def\microtypesetup{\setkeys{MTX}}
1382 \def\MT@define@optionX#1{%
1383 \define@key{MTX}{#1}[true]{%
1384  \@for\MT@val:=##1\do{%
1385  \MT@capitalize#1\@nil
1386  \MT@remove@spaces{\MT@val}%
1387  \MT@ifempty{\MT@val}{}{%
1388  \@tempcnta\m@ne
1389  \def\@tempa{true}%
1390  \ifx\MT@val\@tempa

Enabling micro-typography in the middle of the document is not possibly if it has been disabled in the package options since fonts might already have been loaded and hence wouldn’t be set up. (A whole caboodle of \expandafters because we have to use \csnames which would confuse the \if … \fi grouping.)

1391  \expandafter\expandafter\expandafter\ifx\expandafter
1392  \csname ifMT@#1\expandafter\endcsname\csname iftrue\endcsname
1393  \expandafter\@tempcnta\csname MT@#1level\endcsname
1394  \MT@info{\@tempb\space enabled}%
1395  \else
1396  \MT@warning{You cannot enable #1 if it was disabled\MessageBreak
1397  in the package options,}%

1398 \fi

1399  \let\MT@val\relax

1400 \fi

1401  \def\@tempa{false}%
1402  \ifx\MT@val\@tempa
1403  \@tempcnta\z@
1404  \MT@info{\@tempb\space disabled}%
1405  \let\MT@val\relax

1406 \fi

1407  \def\@tempa{compatibility}%
1408  \ifx\MT@val\@tempa
1409  \@tempcnta\@ne
1410  \MT@let@nc{MT@#1level}\@ne
1411  \MT@info{\@tempb\space set to level 1}%
1412  \let\MT@val\relax

1413 \fi

1414  \def\@tempa{nocompatibility}%
1415  \ifx\MT@val\@tempa
1416  \@tempcnta\tw@
1417  \MT@let@nc{MT@#1level}\tw@
1418  \MT@info{\@tempb\space set to level 2}%
1419  \let\MT@val\relax

1420 \fi

1421  \ifx\MT@val\relax\else
1422  \MT@warning{Value `\MT@val' not recognized}%

1423 \fi

1424  \ifnum\@tempcnta>\m@ne
1425  \def\@tempa{Expansion}%
1426  \ifx\@tempa\@tempb
1427  \pdfadjustspacing\@tempcnta
1428  \else
1429  \pdfprotrudechars\@tempcnta

1430 \fi 1431 \fi 1432 }% 1433 }% 1434 }% 1435 }

1436 \MT@define@optionX{protrusion}
1437 \MT@define@optionX{expansion}

1438 \define@key{MTX}{activate}[]{%
1439 \setkeys{MTX}{protrusion={#1}}%
1440 \setkeys{MTX}{expansion={#1}}%

1441 }

Disable everything – may be used as a work-around in case setting up fonts doesn’t work in certain environments. (Undocumented.)

1442 \def\MT@gobblethree#1#2#3{}
1443 \let\MT@saved@setupfont\MT@setupfont
1444 \define@key{MTX}{disable}[]{%
1445 \MT@info{Inactivate microtype package}%
1446 \let\MT@setupfont\MT@gobblethree

1447 }

1448 \define@key{MTX}{enable}[]{%
1449 \MT@info{Reactivate microtype package}%
1450 \let\MT@setupfont\MT@saved@setupfont

1451 }

10.6 Package Options

\ifMT@opt@protrusion \ifMT@opt@expansion \ifMT@opt@auto Keep track of whether the user explicitly set these options.
1452 \newif\ifMT@opt@protrusion
1453 \newif\ifMT@opt@expansion
1454 \newif\ifMT@opt@auto
\MT@define@option  expansion and protrusion may be true, false, compatibility, nocompatibility

and/or a ⟨set name⟩.

1455 \def\MT@define@option#1{%
1456 \define@key{MT}{#1}[true]{%
1457  \csname MT@opt@#1true\endcsname
1458  \@for\MT@val:=##1\do{%
1459  \MT@remove@spaces{\MT@val}%
1460  \MT@ifempty{\MT@val}{}{%
1461  \def\@tempa{false}%
1462  \ifx\MT@val\@tempa
1463  \csname MT@#1false\endcsname
1464  \let\MT@val\relax

1465 \fi

1466  \def\@tempa{compatibility}%
1467  \ifx\MT@val\@tempa
1468  \MT@def@n{MT@#1level}{1}%
1469  \let\MT@val\relax

1470 \fi

1471  \def\@tempa{nocompatibility}%
1472  \ifx\MT@val\@tempa
1473  \MT@def@n{MT@#1level}{2}%
1474  \let\MT@val\relax

1475 \fi

1476  \ifx\MT@val\relax\else
1477  \csname MT@#1true\endcsname
1478  \def\@tempa{true}%
1479  \ifx\MT@val\@tempa
1480  \else

If everything failed, it must be a set name.

1481  \MT@ifdefined@n{MT@#1list@@\MT@val}{%
1482  \global\MT@edef@n{MT@#1@setname}{\MT@val}%
1483  \MT@info@nl{Using #1 set `\MT@val'}%

1484 }{%

1485  \global\MT@def@n{MT@#1@setname}{alltext}%
1486  \MT@warning@nl{%
1487  The #1 set `\MT@val' is undeclared.\MessageBreak
1488  Using set `\csname MT@#1@setname\endcsname' instead}%

1489 }% 1490 \fi 1491 \fi 1492 }% 1493 }% 1494 }% 1495 }

1496 \MT@define@option{protrusion}
1497 \MT@define@option{expansion}

activate is a shortcut.

1498 \define@key{MT}{activate}[]{%
1499 \setkeys{MT}{protrusion={#1}}%
1500 \setkeys{MT}{expansion={#1}}%

1501 }

1502 \define@key{MT}{DVIoutput}[true]{\csname MT@DVIoutput#1\endcsname}

draft may be inherited from the class options.

1503 \define@key{MT}{draft}[true]{\csname MT@draft#1\endcsname}

final is the opposite.

1504 \define@key{MT}{final}[true]{%
1505 \def\@tempa{#1}\def\@tempb{true}%
1506 \ifx\@tempa\@tempb
1507  \MT@draftfalse
1508 \else
1509  \MT@drafttrue
1510 \fi}

For verbose output, we simply redefine \MT@vinfo.

1511 \define@key{MT}{verbose}[true]{%
1512 \def\@tempa{#1}\def\@tempb{true}%
1513 \ifx\@tempa\@tempb
1514  \let\MT@vinfo\MT@info@nl
1515 \fi}
1516 \define@key{MT}{auto}[true]{\csname MT@auto#1\endcsname\MT@opt@autotrue}
1517 \define@key{MT}{selected}[true]{\csname MT@selected#1\endcsname}
1518 \define@key{MT}{factor}[1000]{\MT@define@number\MT@prot@factor{#1}{factor}}
1519 \define@key{MT}{stretch}[20]{\MT@define@number\MT@stretch{#1}{stretch}}
1520 \define@key{MT}{shrink}[20]{\MT@define@number\MT@shrink{#1}{shrink}}
1521 \define@key{MT}{step}[5]{\MT@define@number\MT@step{#1}{step}}
\MT@define@number No nonsense in \MT@prot@factor et al.?
1522 \def\MT@define@number#1#2#3{%

1523 \MT@ifnumber{#2}{%

A space terminates the number.

1524  \def#1{#2 }%

1525 }{%

1526  \MT@warning@nl{Value `#2' for option `#3' is not a number.\MessageBreak
1527  Using default value}%

1528 }% 1529 }

The package should just work if called without any options. Therefore, expansion will be switched off by default if output is DVI, since it isn’t likely that expanded fonts are available. (This grows more important as TEX systems are switching to the pdfTEX engine even for DVI output, so that the user might not even be aware of the fact that she’s running pdfTEX.)

1530 \MT@protrusiontrue
1531 \ifnum\pdfoutput=\z@\else

Also, we only enable expansion by default if pdfTEX can expand the fonts automatically.

1532 \ifnum\MT@pdftex@no=4\relax
1533  \MT@expansiontrue
1534  \MT@autotrue

1535 \fi 1536 \fi

Load the local configuration file before executing the package options.

1537 \MT@info@nl{Trying to load local config file `microtype.cfg' ..}
1538 \IfFileExists{microtype.cfg}{%
1539 \begingroup
1540 \MT@file@catcodes
1541 \input{microtype.cfg}%
1542 \endgroup
1543 \MT@info@nl{... local config file loaded successfully}%

1544 }{%

1545 \MT@warning@nl{... local config file not found! This will\MessageBreak
1546  almost certainly lead to undesired results}%

1547 }

\ProcessOptionsWithKV Parse options.
1548 \def\ProcessOptionsWithKV#1{%
1549 \let\@tempc\relax
1550 \let\KVo@tempa\@empty
1551 \@for\CurrentOption:=\@classoptionslist\do{%
1552  \@ifundefined{KV@#1@\CurrentOption}{}{%
1553  \edef\KVo@tempa{\KVo@tempa,\CurrentOption,}%
1554  \@expandtwoargs\@removeelement\CurrentOption
1555  \@unusedoptionlist\@unusedoptionlist

1556 }% 1557 }%

1558 \edef\KVo@tempa{%
1559  \noexpand\setkeys{#1}{%

1560  \KVo@tempa\@ptionlist{\@currname.\@currext}%

1561 }% 1562 }%

1563 \KVo@tempa
1564 \AtEndOfPackage{\let\@unprocessedoptions\relax}%
1565 \let\CurrentOption\@empty

1566 }

1567 \ProcessOptionsWithKV{MT}

Now we can process the options:

pdfTEX can create DVI output, too. However, both the DVI viewer and dvips need to find actual fonts. Therefore, expansion will only work if the fonts for different degrees of expansion are readily available.

Some packages depend on the value of \pdfoutput and will get confused if we change it after they have been loaded. These packages are, among others: color, graphics, hyperref, crop, contour, pstricks and of course ifpdf. Instead of testing for each package (that’s not our job), we issue a different message if \pdfoutput is actually changed by DVIoutput. That must be sufficient!

1568 \ifMT@DVIoutput
1569 \ifnum\pdfoutput=\z@
1570  \MT@info@nl{Generating DVI output}
1571 \else
1572  \MT@info@nl{Changing output mode to DVI}
1573  \pdfoutput\z@

For DVI output, the user must have explicitly passed the expansion option to the package.

1574  \ifMT@opt@expansion\else
1575  \MT@expansionfalse

1576 \fi 1577 \fi

1578 \else
1579 \MT@info@nl{Generating \ifnum\pdfoutput=\z@ DVI \else PDF \fi output}

1580 \fi

Tell the log file which options the user has chosen (in case it’s interested). We disable most of what we’ve just defined in the 1580 lines above if we are running in draft mode.

1581 \ifMT@draft
1582 \MT@info@nl{`draft' option active.\MessageBreak
1583  Disabling all micro-typographic features}
1584 \MT@protrusionfalse
1585 \MT@expansionfalse
1586 \let\MT@setupfont\relax
1587 \let\microtypesetup\@gobble
1588 \renewcommand{\UseMicroTypeSet}[2][]{}
1589 \renewcommand{\SetProtrusion}[3][]{}
1590 \renewcommand{\SetExpansion}[3][]{}
1591 \else
1592 \ifMT@protrusion

1593  \MT@info@nl{Character protrusion enabled (level \MT@protrusionlevel)%
1594  \ifnum\MT@prot@factor=\@m\else,\MessageBreak factor: \MT@prot@factor\fi}

We have to make sure that font sets are defined at the end of the package. If the user didn’t activate any, we use the ‘alltext’ set for protrusion and the ‘basictext’ set for expansion. They can be overridden later on, of course.

1595  \MT@ifdefined@n{MT@protrusion@setname}{}{%
1596  \global\def\MT@protrusion@setname{alltext}%
1597  \MT@info@nl{Using default protrusion set `alltext'}%

1598 }

1599 \else
1600  \MT@info@nl{No character protrusion}

1601 \fi

1602 \ifMT@expansion

Set up the values for font expansion: If stretch has not been specified, we take the default value of 20.

1603  \ifnum\MT@stretch=\m@ne
1604  \def\MT@stretch{20 }

1605 \fi

If shrink has not been specified, it will inherit the value from stretch.

1606  \ifnum\MT@shrink=\m@ne
1607  \ifnum\MT@stretch>\z@
1608  \let\MT@shrink\MT@stretch
1609  \else
1610  \def\MT@shrink{20 }

1611 \fi 1612 \fi

If step has not been specified, we will set it to min(stretch,shrink)/5, rounded off, minimum value 1.

1613  \ifnum\MT@step=\m@ne
1614  \ifnum\MT@stretch>\MT@shrink
1615  \ifnum\MT@shrink=\z@
1616  \@tempcnta=\MT@stretch
1617  \else
1618  \@tempcnta=\MT@shrink

1619 \fi

1620  \else
1621  \ifnum\MT@stretch=\z@
1622  \@tempcnta=\MT@shrink
1623  \else
1624  \@tempcnta=\MT@stretch

1625 \fi 1626 \fi

1627  \divide\@tempcnta by 5\relax
1628  \else
1629  \@tempcnta=\MT@step

1630 \fi

1631  \ifnum\@tempcnta=\z@ \@tempcnta=\@ne\fi
1632  \edef\MT@step{\number\@tempcnta\space}

\MT@auto Automatic expansion of the font? This new feature of pdfTEX 1.20 makes the hz-algorithm really usable. It must be either ‘autoexpand’ or empty (or ‘1000’ for older versions of pdfTEX).

1633  \let\MT@auto\@empty
1634  \ifMT@auto
1635  \ifnum\MT@pdftex@no=4\relax

We turn off automatic expansion if output mode is DVI.

1636  \ifnum\pdfoutput=\z@
1637  \ifMT@opt@auto
1638  \MT@warning@nl{%
1639  Automatic font expansion only works for PDF output.\MessageBreak
1640  However, you are creating a DVI file. I will switch\MessageBreak
1641  automatic font expansion off and hope that expanded\MessageBreak
1642  fonts are available}

1643 \fi

1644  \MT@autofalse
1645  \else
1646  \def\MT@auto{autoexpand}

1647 \fi

Also, if pdfTEX is too old.

1648  \else
1649  \ifMT@opt@auto
1650  \MT@warning@nl{%
1651  Your version of pdftex is too old for automatic\MessageBreak
1652  font expansion. I will switch it off and hope that\MessageBreak
1653  expanded fonts are available on your system.\MessageBreak
1654  Install pdftex version 1.20a or newer}

1655 \fi

1656  \MT@autofalse
1657  \def\MT@auto{1000 }

1658 \fi

No automatic expansion.

1659  \else
1660  \ifnum\MT@pdftex@no<4\relax
1661  \def\MT@auto{1000 }

1662 \fi 1663 \fi

Info.

1664  \MT@info@nl{\ifMT@auto Automatic f\else F\fi ont expansion enabled
1665  (level \MT@expansionlevel),\MessageBreak
1666  stretch: \MT@stretch/ shrink: \MT@shrink/ step: \MT@step/
1667  \ifMT@selected\else non-\fi selected}
1668  \MT@ifdefined@n{MT@expansion@setname}{}{%
1669  \global\def\MT@expansion@setname{basictext}%
1670  \MT@info@nl{Using default expansion set `basictext'}%

1671 }

1672 \else
1673  \MT@info@nl{No font expansion}

1674 \fi 1675 \fi

Finally, we enable the micro-typographic extensions, or we don’t.

1676 \ifMT@protrusion
1677 \pdfprotrudechars\MT@protrusionlevel

1678 \fi

1679 \ifMT@expansion
1680 \pdfadjustspacing\MT@expansionlevel

1681 \fi 1682 ⟨/package⟩

That was that.

11 Configuration Files

Let’s now write the font configuration files.

1683 ⟨∗config⟩

11.1 Character Inheritance

First the lists of inheriting characters. We only declare those characters that are the same on both sides, i. e. not Æ for A.

1684 ⟨∗m − t⟩

1685

1686 %%% ----------------------------------------------------------------------
1687 %%% CHARACTER INHERITANCE

1688

Other interesting glyphs that should possibly inherit settings on one side: 012 (‘fi’ ligature), 013 (‘fl’), 014 (‘ffi’), 015 (‘ffl’), Æ, æ, Œ, œ.

1689 \DeclareCharacterInheritance
1690 { encoding = OT1 }
1691 { f = {011}, % ff
1692  i = {\i},
1693  j = {\j},
1694  O = {\O},
1695  o = {\o},

1696 }

1697

Candidates here: 028 (‘fi’), 029 (‘fl’), 030 (‘ffi’), 031 (‘ffl’), 156 (‘IJ’ ligature), 188 (‘ij’), Æ, æ, Œ, œ.

1698 \DeclareCharacterInheritance
1699 { encoding = T1 }
1700 { A = {\`A,\'A,\^A,\~A,\"A,\r{A},\k{A},\u{A}},
1701  a = {\`a,\'a,\^a,\~a,\"a,\r{a},\k{a},\u{a}},
1702  C = {\'C,\c{C},\v{C}},
1703  c = {\'c,\c{c},\v{c}},
1704  D = {\v{D},\DH,\DJ},
1705  d = {\v{d},\dj},
1706  E = {\`E,\'E,\^E,\"E,\k{E},\v{E}},
1707  e = {\`e,\'e,\^e,\"e,\k{e},\v{e}},
1708  f = {027}, % ff

1709  G = {\u{G}},
1710  g = {\u{g}},
1711  I = {\`I,\'I,\^I,\"I,\.I},
1712  i = {\`i,\'i,\^i,\"i,\i},
1713  j = {\j},
1714  L = {\L,\'L,\v{L}},
1715  l = {\l,\'l,\v{l}},
1716  N = {\'N,\~N,\v{N}},
1717  n = {\'n,\~n,\v{n}},
1718  O = {\O,\`O,\'O,\^O,\~O,\"O,\H{O}},
1719  o = {\o,\`o,\'o,\^o,\~o,\"o,\H{o}},
1720  R = {\'R,\v{R}},
1721  r = {\'r,\v{r}},
1722  S = {\'S,\c{S},\v{S},\SS},
1723  s = {\'s,\c{s},\v{s}},
1724  T = {\c{T},\v{T}},
1725  t = {\c{t},\v{t}},
1726  U = {\`U,\'U,\^U,\"U,\H{U},\r{U}},
1727  u = {\`u,\'u,\^u,\"u,\H{u},\r{u}},
1728  Y = {\'Y,\"Y},
1729  y = {\'y,\"y},
1730  Z = {\'Z,\.Z,\v{Z}},
1731  z = {\'z,\.z,\v{z}},
1732  - = {127},

1733 }

1734

More characters: 008 (‘fl’), 012 (‘fi’), 014 (‘ffi’), 015 (‘ffl’), Æ, æ, Œ, œ.

1735 \DeclareCharacterInheritance
1736 { encoding = LY1 }
1737 { A = {\`A,\'A,\^A,\~A,\"A,\r{A}},
1738  a = {\`a,\'a,\^a,\~a,\"a,\r{a}},
1739  C = {\c{C}},
1740  c = {\c{c}},
1741  D = {\DH},
1742  E = {\`E,\'E,\^E,\"E},
1743  e = {\`e,\'e,\^e,\"e},
1744  f = {011}, % ff
1745  I = {\`I,\'I,\^I,\"I},
1746  i = {\`i,\'i,\^i,\"i,\i},
1747  L = {\L},
1748  l = {\l},
1749  N = {\~N},
1750  n = {\~n},
1751  O = {\`O,\'O,\^O,\~O,\"O,\O},
1752  o = {\`o,\'o,\^o,\~o,\"o,\o},
1753  S = {\v{S}},
1754  s = {\v{s}},
1755  U = {\`U,\'U,\^U,\"U},
1756  u = {\`u,\'u,\^u,\"u},
1757  Y = {\'Y,\"Y},
1758  y = {\'y,\"y},
1759  Z = {\v{Z}},
1760  z = {\v{z}},

1761 }

1762

1763 ⟨/m − t⟩

11.2 Font Expansion

These are the original expansion settings from Hàn Thế Thành. They are used for all fonts (until somebody shows mercy and creates font-specific settings).

1764 ⟨∗m − t⟩

1765 %%% ----------------------------------------------------------------------
1766 %%% EXPANSION SETTINGS

1767

1768 \SetExpansion
1769 ⟨m − t⟩ [ name     = default      ]
1770 ⟨bch⟩ [ name     = bch-default  ]
1771 ⟨cmr⟩ [ name     = cmr-default  ]
1772 ⟨pad⟩ [ name     = pad-default  ]
1773 ⟨pmn⟩ [ name     = pmn-default  ]
1774 ⟨ppl⟩ [ name     = ppl-default  ]
1775 ⟨ptm⟩ [ name     = ptm-default  ]
1776 ⟨m − t⟩ { encoding = {OT1,T1,LY1} }
1777 ⟨!m − t⟩ { encoding = {OT1,T1,LY1},
1778 ⟨bch⟩  family   = bch }
1779 ⟨cmr⟩  family   = cmr }
1780 ⟨pad⟩  family   = {pad,padx,padj} }
1781 ⟨pmn⟩  family   = {pmn,pmnx,pmnj} }
1782 ⟨ppl⟩  family   = {ppl,pplx,pplj} }
1783 ⟨ptm⟩  family   = {ptm,ptmx,ptmj} }

1784 {

1785  A = 500,     a = 700,
1786 \AE = 500,   \ae = 700,
1787  B = 700,     b = 700,
1788  C = 700,     c = 700,
1789  D = 500,     d = 700,
1790  E = 700,     e = 700,
1791  F = 700,
1792  G = 500,     g = 700,
1793  H = 700,     h = 700,
1794  K = 700,     k = 700,
1795  M = 700,     m = 700,
1796  N = 700,     n = 700,
1797  O = 500,     o = 700,
1798 \OE = 500,   \oe = 700,
1799  P = 700,     p = 700,
1800  Q = 500,     q = 700,
1801  R = 700,
1802  S = 700,     s = 700,
1803  U = 700,     u = 700,
1804  W = 700,     w = 700,
1805  Z = 700,     z = 700,
1806  2 = 700,

1807  3 = 700,
1808  6 = 700,
1809  8 = 700,
1810  9 = 700,

1811 } 1812 ⟨/m − t⟩

11.3 Character Protrusion

1813

1814 %%% ----------------------------------------------------------------------
1815 %%% PROTRUSION SETTINGS

1816

For future historians, the original settings from Hàn Thế Thành.

1817 %\SetProtrusion
1818 %   [ name     = thanh ]

1819 % { } 1820 % {

1821 %     A = {50,50},
1822 %     F = { 0,50},
1823 %     J = {50, 0},
1824 %     K = { 0,50},
1825 %     L = { 0,50},
1826 %     T = {50,50},
1827 %     V = {50,50},
1828 %     W = {50,50},
1829 %     X = {50,50},
1830 %     Y = {50,50},
1831 %     k = { 0,50},
1832 %     r = { 0,50},
1833 %     t = { 0,50},
1834 %     v = {50,50},
1835 %     w = {50,50},
1836 %     x = {50,50},
1837 %     y = {50,50},
1838 %     . = {0,700},    {,}= {0,700},
1839 %     : = {0,500},     ; = {0,500},
1840 %     ! = {0,200},     ? = {0,200},
1841 %     ( = {50, 0},     ) = { 0,50},
1842 %     - = {0,700},
1843 %     \textendash        = {0,300},     \textemdash        = {0,200},
1844 %     \textquoteleft     = {700,0},     \textquoteright    = {0,700},
1845 %     \textquotedblleft  = {500,0},     \textquotedblright = {0,500},

1846 % } 1847 %

We also create configuration files for the fonts Bitstream Charter (NFSS code bch), Computer Modern Roman (cmr), Palatino (ppl, pplx, pplj), Times (ptm, ptmx, ptmj), Adobe Garamond (pad, padx, padj) and Minion^{8}

 (pmnx, pmnj).

8 Contributed by Harald Harders (h.harders@tu-bs.de)

11.3.1 Default

The default settings always use the most moderate value.

1848 \SetProtrusion
1849 ⟨m − t⟩ [ name     = default ]
1850 ⟨bch⟩ [ name     = bch-default ]
1851 ⟨cmr⟩ [ name     = cmr-default ]
1852 ⟨pad⟩ [ name     = pad-default ]
1853 ⟨pmn⟩ [ name     = pmnj-default ]
1854 ⟨ppl⟩ [ name     = ppl-default ]
1855 ⟨ptm⟩ [ name     = ptm-default ]
1856 ⟨m − t⟩ { encoding = OT1     }
1857 ⟨!m − t⟩ { encoding = OT1,
1858 ⟨bch⟩  family   = bch }
1859 ⟨cmr⟩  family   = cmr }
1860 ⟨pad⟩  family   = {pad,padx,padj} }
1861 ⟨pmn⟩  family   = pmnj }
1862 ⟨ppl⟩  family   = {ppl,pplx,pplj} }
1863 ⟨ptm⟩  family   = {ptm,ptmx,ptmj} }

1864 {

1865  A = {50,50},

1866 ⟨m − t | cmr | pad | ptm⟩ \AE = {50, }, 1867 ⟨bch | pad | pmn⟩ C = {50, }, 1868 ⟨bch | pad | pmn⟩ D = { ,50}, 1869 ⟨m − t | bch | cmr | pad | pmn | ptm⟩ F = { ,50}, 1870 ⟨bch | pad | pmn⟩ G = {50, }, 1871 ⟨m − t | cmr | pad | pmn | ppl | ptm⟩ J = {50, },

1872 ⟨bch⟩  J = {100,  },
1873  K = {  ,50},

1874 ⟨m − t | bch | cmr | pad | pmn | ppl⟩ L = { ,50}, 1875 ⟨ptm⟩ L = { ,80}, 1876 ⟨bch | pad | pmn⟩ O = {50,50}, 1877 ⟨bch | pad | pmn⟩ \OE = {50, }, 1878 ⟨bch | pad | pmn⟩ Q = {50,70}, 1879 ⟨bch⟩ R = { ,50},

1880  T = {50,50},
1881  V = {50,50},
1882  W = {50,50},
1883  X = {50,50},

1884 ⟨m − t | bch | cmr | pad | pmn | ppl⟩ Y = {50,50},

1885 ⟨ptm⟩  Y = {80,80},
1886  k = {  ,50},
1887 ⟨pmn⟩  l = {  ,-50},

1888 ⟨pad | ppl⟩ p = {50,50}, 1889 ⟨pad | ppl⟩ q = {50, },

1890  r = {  ,50},

1891 ⟨cmr | pad | pmn⟩ t = { ,70}, 1892 ⟨bch⟩ t = { ,50},

1893  v = {50,50},
1894  w = {50,50},
1895  x = {50,50},

1896 ⟨m − t | bch | pad | pmn⟩ y = { ,50}, 1897 ⟨cmr | ppl | ptm⟩ y = {50,70}, 1898 ⟨cmr⟩ 0 = { ,50},

1899 ⟨m − t⟩  1 = {50,50},

1900 ⟨bch | pad | ptm⟩ 1 = {150,150},

1901 ⟨cmr⟩  1 = {100,200},

1902 ⟨pmn⟩ 1 = { ,50},

1903 ⟨ppl⟩  1 = {100,100},

1904 ⟨bch | cmr | pad⟩ 2 = {50,50}, 1905 ⟨cmr | pad⟩ 3 = {50,50}, 1906 ⟨bch | pmn⟩ 3 = {50, }, 1907 ⟨m − t | pad⟩ 4 = {50,50},

1908 ⟨bch⟩  4 = {100,50},
1909 ⟨cmr⟩  4 = {70,70},

1910 ⟨pmn⟩ 4 = {50, }, 1911 ⟨ptm⟩ 4 = {70, }, 1912 ⟨cmr⟩ 5 = { ,50},

1913 ⟨pad⟩  5 = {50,50},

1914 ⟨bch⟩ 6 = {50, }, 1915 ⟨cmr⟩ 6 = { ,50},

1916 ⟨pad⟩  6 = {50,50},
1917 ⟨m − t⟩  7 = {50,50},

1918 ⟨bch | pad | pmn⟩ 7 = {50,80}, 1919 ⟨cmr | ptm⟩ 7 = {50,100}, 1920 ⟨ppl⟩ 7 = { ,50}, 1921 ⟨cmr⟩ 8 = { ,50}, 1922 ⟨bch | pad⟩ 9 = {50,50}, 1923 ⟨cmr⟩ 9 = { ,50}, 1924 ⟨m − t | cmr | pad | pmn | ppl | ptm⟩ . = { ,700},

1925 ⟨bch⟩  . = { ,600},
1926  {,}= { ,500},

1927 ⟨m − t | cmr | pad | pmn | ppl | ptm⟩ : = { ,500},

1928 ⟨bch⟩  : = { ,400},

1929 ⟨m − t | bch | pad | pmn | ptm⟩ ; = { ,300}, 1930 ⟨cmr | ppl⟩ ; = { ,500},

1931  ! = { ,100},

1932 ⟨m − t | pad | pmn | ptm⟩ ? = { ,100}, 1933 ⟨bch | cmr | ppl⟩ ? = { ,200},

1934 ⟨pmn⟩  " = {300,300},

1935 ⟨m − t | bch | cmr | pad | pmn | ppl⟩ @ = {50,50},

1936 ⟨ptm⟩  @ = {100,100},
1937  ~ = {200,250},

1938 ⟨m − t | bch | pad | pmn | ppl | ptm⟩ _= {100,100},

1939 ⟨cmr⟩  _= {200,200},

1940 ⟨pad | ppl | ptm⟩ & = {50,100}, 1941 ⟨m − t | cmr | pad | pmn⟩ 037 = {50,50}, % \%

1942 ⟨bch⟩ 037 = {  ,50},  % \%
1943 ⟨ppl | ptm⟩ 037 = {100,100},  % \%

1944 ⟨m − t | ppl | ptm⟩ * = {200,200}, 1945 ⟨bch | pmn⟩ * = {200,300}, 1946 ⟨cmr | pad⟩ * = {300,300}, 1947 ⟨m − t | cmr | ppl | ptm⟩ + = {250,250},

1948 ⟨bch⟩  + = {150,250},
1949 ⟨pad⟩  + = {300,300},
1950 ⟨pmn⟩  + = {150,200},

1951 ⟨m − t | pad | pmn | ptm⟩ ( = {100, }, ) = { ,200},

1952 ⟨bch⟩  ( = {200,   },    ) = {   ,200},
1953 ⟨cmr | ppl⟩  ( = {100,   },    ) = {   ,300},
1954 ⟨bch | pmn⟩  [ = {100,   },    ] = {   ,100},
1955 ⟨m − t | pad | pmn | ptm⟩  \ = {100,200},    / = {100,200},
1956 ⟨bch⟩  \ = {150,200},    / = { ,200},
1957 ⟨cmr | ppl⟩  \ = {200,300},    / = {200,300},

1958 ⟨m − t | ptm⟩ - = {500,500}, 1959 ⟨bch | cmr | ppl⟩ - = {400,500},

1960 ⟨pad⟩  - = {300,500},
1961 ⟨pmn⟩  - = {200,400},
1962 ⟨m − t | pmn⟩  \textendash       = {200,200},   \textemdash        = {150,150},
1963 ⟨bch⟩  \textendash       = {200,300},   \textemdash        = {150,250},
1964 ⟨cmr⟩  \textendash       = {400,300},   \textemdash        = {300,200},
1965 ⟨pad | ppl | ptm⟩  \textendash       = {300,300},   \textemdash        = {200,200},

Why settings for left and right quotes? Because in some languages they might be used like that (see the csquotes package for examples).

1966 ⟨m − t | bch | pmn⟩  \textquoteleft    = {300,400},   \textquoteright    = {300,400},
1967 ⟨cmr⟩  \textquoteleft    = {500,700},   \textquoteright    = {500,600},
1968 ⟨pad | ppl⟩  \textquoteleft    = {500,700},   \textquoteright    = {500,700},
1969 ⟨ptm⟩  \textquoteleft    = {500,500},   \textquoteright    = {300,500},
1970 ⟨m − t | bch | pmn⟩  \textquotedblleft = {300,300},   \textquotedblright = {300,300},
1971 ⟨cmr⟩  \textquotedblleft = {500,300},   \textquotedblright = {200,600},
1972 ⟨pad | ppl | ptm⟩  \textquotedblleft = {300,400},   \textquotedblright = {300,400},

Greek uppercase letters (for math mode).

1973 ⟨∗cmr⟩

1974 "00 = {   ,150}, % \Gamma
1975 "01 = {100,100}, % \Delta
1976 "02 = { 50, 50}, % \Theta
1977 "03 = {100,100}, % \Lambda
1978 %  "04 = {   ,   }, % \Xi
1979 %  "05 = {   ,   }, % \Pi
1980 "06 = { 50, 50}, % \Sigma
1981 "07 = {100,100}, % \Upsilon
1982 "08 = { 50, 50}, % \Phi
1983 "09 = { 50, 50}, % \Psi
1984 %  "0A = {   ,   }, % \Omega

1985 ⟨/cmr⟩ 1986 }

1987

T1 and LY1 encodings contain some more characters. The default list will be loaded first.

We won’t bother about the extra characters of LY1. Whoever uses that encoding, should complain to me.

1988 \SetProtrusion
1989 ⟨m − t⟩ [ name     = T1-default,
1990 ⟨bch⟩ [ name     = bch-T1,
1991 ⟨cmr⟩ [ name     = cmr-T1,
1992 ⟨pad⟩ [ name     = pad-T1,
1993 ⟨pmn⟩ [ name     = pmnj-T1,
1994 ⟨ppl⟩ [ name     = ppl-T1,

1995 ⟨ptm⟩ [ name     = ptm-T1,
1996 ⟨m − t⟩  load     = default     ]
1997 ⟨bch⟩  load     = bch-default ]
1998 ⟨cmr⟩  load     = cmr-default ]
1999 ⟨pad⟩  load     = pad-default ]
2000 ⟨pmn⟩  load     = pmnj-default ]
2001 ⟨ppl⟩  load     = ppl-default ]
2002 ⟨ptm⟩  load     = ptm-default ]
2003 ⟨m − t⟩ { encoding = {T1,LY1}    }
2004 ⟨!m − t⟩ { encoding = {T1,LY1},
2005 ⟨bch⟩  family   = bch }
2006 ⟨cmr⟩  family   = cmr }
2007 ⟨pad⟩  family   = {pad,padx,padj} }
2008 ⟨pmn⟩  family   = pmnj }
2009 ⟨ppl⟩  family   = {ppl,pplx,pplj} }
2010 ⟨ptm⟩  family   = {ptm,ptmx,ptmj} }

2011 {

The EC fonts do something weird: They insert a kern between quote and boundary character. Therefore, we must override the settings from OT1.

2012 ⟨cmr⟩  \textquotedblleft = {200,600},
2013 ⟨pmn⟩  \TH = {  , 50},
2014 ⟨m − t | cmr | pad | ppl | ptm⟩  \quotesinglbase   = {400,400},   \quotedblbase      = {400,400},
2015 ⟨bch | pmn⟩  \quotesinglbase   = {400,400},   \quotedblbase      = {300,300},
2016 ⟨m − t | bch | pmn⟩  \guilsinglleft    = {400,300},   \guilsinglright    = {300,400},
2017 ⟨cmr | pad | ppl | ptm⟩  \guilsinglleft    = {400,400},   \guilsinglright    = {300,500},
2018 ⟨m − t⟩  \guillemotleft    = {200,200},   \guillemotright    = {200,200},
2019 ⟨cmr⟩  \guillemotleft    = {300,200},   \guillemotright    = {100,400},
2020 ⟨bch | pmn⟩  \guillemotleft    = {200,200},   \guillemotright    = {150,300},
2021 ⟨pad⟩  \guillemotleft    = {300,300},   \guillemotright    = {200,400},
2022 ⟨ppl | ptm⟩  \guillemotleft    = {300,300},   \guillemotright    = {200,400},
2023 ⟨m − t | bch | cmr | pad | pmn | ppl⟩  \textexclamdown   = {100,   },   \textquestiondown  = {100,   },
2024 ⟨ptm⟩  \textexclamdown   = {200,   },   \textquestiondown  = {200,   },
2025 ⟨m − t | cmr | pad | ppl | ptm⟩  \textbraceleft    = {400,200},   \textbraceright    = {200,400},
2026 ⟨bch | pmn⟩  \textbraceleft    = {200,   },   \textbraceright    = {   ,300},
2027 ⟨m − t | bch | cmr | pad | ppl | ptm⟩  \textless         = {200,100},   \textgreater       = {100,200},
2028 ⟨pmn⟩  \textless         = {100,   },   \textgreater       = {   ,100},
2029 ⟨pmn⟩  \textvisiblespace = {100,100},

2030 }

2031

The lmodern fonts, on the other hand, restore the original kerning from the OT1 fonts, and so do we. Silly, isn’t it?

2032 ⟨∗cmr⟩

2033 \SetProtrusion
2034 [ name     = lmr-T1,
2035  load     = cmr-T1   ]
2036 { encoding = {T1,LY1},
2037  family   = lmr      }

2038 {

2039  \textquotedblleft = {500,300},
2040  \quotedblbase     = {500,300},

2041 } 2043 ⟨/cmr⟩ 2044 ⟨∗pmn⟩

2045 \SetProtrusion
2046 [ name     = pmnx-OT1,
2047  load     = pmnj-default ]
2048 { encoding = OT1,
2049  family   = pmnx }

2050 {

2051  1 = {230,180},

2052 }

2053

2054 \SetProtrusion
2055 [ name     = pmnx-T1,
2056  load     = pmnj-T1  ]
2057 { encoding = {T1,LY1},
2058  family   = pmnx     }

2059 {

2060  1 = {230,180},

2061 }

2062

2063 ⟨/pmn⟩

11.3.2 Italics

To find default settings for italic is difficult, since the character shapes and their behaviour at the beginning or end of line may be wildly different for different fonts. Therefore, we leave the letters away, and only set up the punctuation characters.

2064 \SetProtrusion
2065 ⟨m − t⟩ [ name     = OT1-it   ]
2066 ⟨bch⟩ [ name     = bch-it   ]
2067 ⟨cmr⟩ [ name     = cmr-it   ]
2068 ⟨pad⟩ [ name     = pad-it   ]
2069 ⟨pmn⟩ [ name     = pmnj-it  ]
2070 ⟨ppl⟩ [ name     = ppl-it   ]
2071 ⟨ptm⟩ [ name     = ptm-it   ]
2072 { encoding = OT1,
2073 ⟨bch⟩  family   = bch,
2074 ⟨cmr⟩  family   = cmr,
2075 ⟨pad⟩  family   = {pad,padx,padj},
2076 ⟨pmn⟩  family   = pmnj,
2077 ⟨ppl⟩  family   = {ppl,pplx,pplj},
2078 ⟨ptm⟩  family   = {ptm,ptmx,ptmj},
2079  shape    = {it,sl}  }

2080 { 2081 ⟨cmr | ptm⟩ A = {100,50}, 2082 ⟨pad | pmn⟩ A = {50, },

2083 ⟨ppl⟩  A = {50,50},

2084 ⟨cmr | ptm⟩ \AE = {100, }, 2085 ⟨pad | ppl⟩ \AE = {50, },

2086 ⟨pmn⟩ \AE = {  ,-50},

2087 ⟨cmr | pad | ppl | ptm⟩ B = {50, },

2088 ⟨pmn⟩  B = {20,-50},

2089 ⟨bch | ppl | ptm⟩ C = {50, }, 2090 ⟨cmr | pad⟩ C = {100, },

2091 ⟨pmn⟩  C = {50,-50},

2092 ⟨cmr | pad | ppl | ptm⟩ D = {50,50}, 2093 ⟨pmn⟩ D = {20, }, 2094 ⟨cmr | pad | ppl | ptm⟩ E = {50, },

2095 ⟨pmn⟩  E = {20,-50},

2096 ⟨cmr | pad | ptm⟩ F = {100, }, 2097 ⟨pmn⟩ F = {10, }, 2098 ⟨ppl⟩ F = {50, }, 2099 ⟨bch | ppl | ptm⟩ G = {50, }, 2100 ⟨cmr | pad⟩ G = {100, },

2101 ⟨pmn⟩  G = {50,-50},

2102 ⟨cmr | pad | ppl | ptm⟩ H = {50, }, 2103 ⟨cmr | pad | ptm⟩ I = {50, },

2104 ⟨pmn⟩  I = {20,-50},

2105 ⟨cmr | ptm⟩ J = {100, }, 2106 ⟨pad⟩ J = {50, }, 2107 ⟨pmn⟩ J = {20, }, 2108 ⟨cmr | pad | ppl | ptm⟩ K = {50, }, 2109 ⟨pmn⟩ K = {20, }, 2110 ⟨cmr | pad | ppl | ptm⟩ L = {50, },

2111 ⟨pmn⟩  L = {20,50},

2112 ⟨cmr | ptm⟩ M = {50, },

2113 ⟨pmn⟩  M = {  ,-30},

2114 ⟨cmr | ptm⟩ N = {50, },

2115 ⟨pmn⟩  N = {  ,-30},

2116 ⟨bch | pmn | ppl | ptm⟩ O = {50, }, 2117 ⟨cmr | pad⟩ O = {100, }, 2118 ⟨bch | pmn | ppl | ptm⟩ \OE = {50, }, 2119 ⟨cmr | pad⟩ \OE = {100, }, 2120 ⟨cmr | pad | ppl | ptm⟩ P = {50, },

2121 ⟨pmn⟩  P = {20,-50},

2122 ⟨bch | pmn | ppl | ptm⟩ Q = {50, }, 2123 ⟨cmr | pad⟩ Q = {100, }, 2124 ⟨cmr | pad | ppl | ptm⟩ R = {50, }, 2125 ⟨pmn⟩ R = {20, }, 2126 ⟨bch | cmr | pad | ppl | ptm⟩ S = {50, },

2127 ⟨pmn⟩  S = {20,-30},

2128 ⟨bch | cmr | pad | ppl | ptm⟩ � = {50, },

2129 ⟨pmn⟩  � = {20,-30},

2130 ⟨bch | pmn⟩ T = {70, }, 2131 ⟨cmr | pad | ppl | ptm⟩ T = {100, }, 2132 ⟨cmr | pad | ppl | ptm⟩ U = {50, },

2133 ⟨pmn⟩  U = {50,-50},

2134 ⟨cmr | pad | pmn⟩ V = {100, }, 2135 ⟨ppl | ptm⟩ V = {100,50}, 2136 ⟨cmr | pad | pmn⟩ W = {100, }, 2137 ⟨ppl⟩ W = {50, },

2138 ⟨ptm⟩  W = {100,50},

2139 ⟨cmr | ppl | ptm⟩ X = {50, }, 2140 ⟨cmr | ptm⟩ Y = {100, }, 2141 ⟨pmn⟩ Y = {50, },

2142 ⟨ppl⟩  Y = {100,50},
2143 ⟨pmn⟩  Z = {  ,-50},
2144 ⟨pmn⟩  d = {  ,-50},

2145 ⟨pad | pmn⟩ f = { ,-100},

2146 ⟨pmn⟩  i = {  ,-30},
2147 ⟨pmn⟩  j = {  ,-30},
2148 ⟨pmn⟩  l = {  ,-100},
2149 ⟨bch⟩  o = {50,50},

2150 ⟨bch⟩ p = { ,50},

2151 ⟨pmn⟩  p = {-50,  },

2152 ⟨bch⟩ q = {50, }, 2153 ⟨pmn⟩ r = { ,50}, 2154 ⟨bch⟩ t = { ,50}, 2155 ⟨pmn⟩ v = {50, }, 2156 ⟨bch⟩ w = { ,50}, 2157 ⟨pmn⟩ w = {50, }, 2158 ⟨bch⟩ y = { ,50},

2159 ⟨cmr⟩  0 = {100, },

2160 ⟨bch | ptm⟩ 1 = {150,100},

2161 ⟨cmr⟩  1 = {200,50},
2162 ⟨pad⟩  1 = {150, },

2163 ⟨pmn⟩ 1 = {50, },

2164 ⟨ppl⟩  1 = {100, },
2165 ⟨cmr⟩  2 = {100,-100},

2166 ⟨pad | ppl | ptm⟩ 2 = {50, },

2167 ⟨pmn⟩  2 = {-50,  },

2168 ⟨bch⟩ 3 = {50, },

2169 ⟨cmr⟩  3 = {100,-100},
2170 ⟨pmn⟩  3 = {-100, },
2171 ⟨ptm⟩  3 = {100,50},
2172 ⟨bch⟩  4 = {100, },

2173 ⟨cmr | pad⟩ 4 = {150, }, 2174 ⟨ppl | ptm⟩ 4 = {50, },

2175 ⟨cmr⟩  5 = {100, },

2176 ⟨ptm⟩ 5 = {50, }, 2177 ⟨bch⟩ 6 = {50, },

2178 ⟨cmr⟩  6 = {100, },

2179 ⟨bch | pad | ptm⟩ 7 = {100, },

2180 ⟨cmr⟩  7 = {200,-150},

2181 ⟨pmn⟩ 7 = {20, }, 2182 ⟨ppl⟩ 7 = {50, },

2183 ⟨cmr⟩  8 = {50,-50},
2184 ⟨cmr⟩  9 = {100,-100},

2185 ⟨m − t | cmr | pad | pmn | ppl⟩ . = { ,500}, 2186 ⟨bch | ptm⟩ . = { ,700}, 2187 ⟨m − t | cmr | pad | pmn | ppl⟩ {,}= { ,500},

2188 ⟨bch⟩  {,}= { ,600},
2189 ⟨ptm⟩  {,}= { ,700},

2190 ⟨m − t | cmr | pad | ppl⟩ : = { ,300},

2191 ⟨bch⟩  : = { ,400},
2192 ⟨pmn⟩  : = { ,200},
2193 ⟨ptm⟩  : = { ,500},

2194 ⟨m − t | cmr | pad | ppl⟩ ; = { ,300},

2195 ⟨bch⟩  ; = { ,400},

2196 ⟨pmn⟩  ; = { ,200},
2197 ⟨ptm⟩  ; = { ,500},
2198 ⟨ptm⟩  ! = { ,100},
2199 ⟨bch⟩  ? = { ,200},
2200 ⟨ptm⟩  ? = { ,100},
2201 ⟨ppl⟩  ? = { ,300},
2202 ⟨pmn⟩  " = {400,200},

2203 ⟨m − t | bch | pmn⟩ _= { ,100},

2204 ⟨cmr⟩  _= {100,200},

2205 ⟨pad | ppl | ptm⟩ _= {100,100}, 2206 ⟨m − t | pad | pmn | ppl | ptm⟩ & = {50,50}, 2207 ⟨bch⟩ & = { ,80},

2208 ⟨cmr⟩  & = {100,50},

2209 ⟨m − t | cmr | pad | pmn⟩ 037 = {100, },

2210 ⟨bch⟩ 037 = {50,50},
2211 ⟨ppl | ptm⟩ 037 = {100,100},

2212 ⟨m − t | pmn | ppl⟩ * = {200,200},

2213 ⟨bch⟩  * = {300,200},
2214 ⟨cmr⟩  * = {400,100},
2215 ⟨pad⟩  * = {500,100},
2216 ⟨ptm⟩  * = {400,200},

2217 ⟨m − t | cmr | pmn | ppl⟩ + = {150,200},

2218 ⟨bch⟩  + = {250,250},

2219 ⟨pad | ptm⟩ + = {250,200}, 2220 ⟨m − t | pad | pmn | ppl⟩ @ = {50,50},

2221 ⟨bch⟩  @ = {80,50},
2222 ⟨cmr⟩  @ = {200,50},
2223 ⟨ptm⟩  @ = {150,150},

2224 ⟨m − t | bch⟩ ~ = {150,150}, 2225 ⟨cmr | pad | pmn | ppl | ptm⟩ ~ = {200,150},

2226  ( = {200, },     ) = {   ,200},

2227 ⟨m − t | cmr | pad | ppl | ptm⟩ \ = {100,200}, / = {100,200},

2228 ⟨bch⟩  \ = {150,150},   / = {  ,150},
2229 ⟨pmn⟩  \ = {100,150},   / = {100,150},
2230 ⟨m − t⟩  - = {300,300},

2231 ⟨bch | pad⟩ - = {300,400},

2232 ⟨pmn⟩  - = {200,300},
2233 ⟨cmr⟩  - = {500,300},
2234 ⟨ppl⟩  - = {300,500},
2235 ⟨ptm⟩  - = {500,500},
2236 ⟨m − t | pmn⟩  \textendash       = {200,200},   \textemdash        = {150,150},
2237 ⟨bch⟩  \textendash       = {200,300},   \textemdash        = {150,200},
2238 ⟨cmr | pad | ppl | ptm⟩  \textendash       = {300,300},   \textemdash        = {200,200},
2239 ⟨m − t | bch | pmn⟩  \textquoteleft    = {400,200},   \textquoteright    = {400,200},
2240 ⟨cmr | pad⟩  \textquoteleft    = {800,200},   \textquoteright    = {800,200},
2241 ⟨ppl⟩  \textquoteleft    = {700,400},   \textquoteright    = {700,400},
2242 ⟨ptm⟩  \textquoteleft    = {800,500},   \textquoteright    = {800,500},
2243 ⟨m − t | bch | pmn⟩  \textquotedblleft = {400,200},   \textquotedblright = {400,200},
2244 ⟨cmr⟩  \textquotedblleft = {700,100},   \textquotedblright = {500,300},
2245 ⟨pad⟩  \textquotedblleft = {700,200},   \textquotedblright = {700,200},
2246 ⟨ppl⟩  \textquotedblleft = {500,300},   \textquotedblright = {500,300},
2247 ⟨ptm⟩  \textquotedblleft = {700,400},   \textquotedblright = {700,400},

2248 ⟨∗cmr⟩

2249 "00 = {200,150}, % \Gamma

2250 "01 = {150,100}, % \Delta
2251 "02 = {150, 50}, % \Theta
2252 "03 = {150, 50}, % \Lambda
2253 "04 = {100,100}, % \Xi
2254 "05 = {100,100}, % \Pi
2255 "06 = {100, 50}, % \Sigma
2256 "07 = {200,150}, % \Upsilon
2257 "08 = {150, 50}, % \Phi
2258 "09 = {150,100}, % \Psi
2259 "0A = { 50, 50}, % \Omega

2260 ⟨/cmr⟩ 2261 }

2262

2263 \SetProtrusion
2264 ⟨m − t⟩ [ name     = T1-it-default,
2265 ⟨bch⟩ [ name     = bch-it-T1,
2266 ⟨cmr⟩ [ name     = cmr-it-T1,
2267 ⟨pad⟩ [ name     = pad-it-T1,
2268 ⟨pmn⟩ [ name     = pmnj-it-T1,
2269 ⟨ppl⟩ [ name     = ppl-it-T1,
2270 ⟨ptm⟩ [ name     = ptm-it-T1,
2271 ⟨m − t⟩  load     = OT1-it   ]
2272 ⟨bch⟩  load     = bch-it   ]
2273 ⟨cmr⟩  load     = cmr-it   ]
2274 ⟨pmn⟩  load     = pmnj-it  ]
2275 ⟨pad⟩  load     = pad-it   ]
2276 ⟨ppl⟩  load     = ppl-it   ]
2277 ⟨ptm⟩  load     = ptm-it   ]
2278 { encoding = {T1,LY1},
2279 ⟨bch⟩  family   = bch,
2280 ⟨cmr⟩  family   = cmr,
2281 ⟨pmn⟩  family   = pmnj,
2282 ⟨pad⟩  family   = {pad,padx,padj},
2283 ⟨ppl⟩  family   = {ppl,pplx,pplj},
2284 ⟨ptm⟩  family   = {ptm,ptmx,ptmj},
2285  shape    = {it,sl}  }

2286 {

2287 ⟨cmr⟩  \textquotedblleft = {500,300},
2288 ⟨pmn⟩  188 = {  ,-30}, % ij
2289 ⟨pmn⟩  031 = { ,-100}, % ffl
2290 ⟨cmr | ptm⟩  156 = {100, },  % IJ
2291 ⟨pad⟩  156 = {50,  },  % IJ
2292 ⟨pmn⟩  156 = {20,  },  % IJ
2293 ⟨pmn⟩ \v{t} = { ,100},
2294 ⟨m − t | ptm⟩  \quotesinglbase   = {300,700},   \quotedblbase      = {400,500},
2295 ⟨cmr⟩  \quotesinglbase   = {300,700},   \quotedblbase      = {200,600},
2296 ⟨bch | pmn⟩  \quotesinglbase   = {200,500},   \quotedblbase      = {150,500},
2297 ⟨pad | ppl⟩  \quotesinglbase   = {500,500},   \quotedblbase      = {400,400},
2298 ⟨m − t | ppl | ptm⟩  \guilsinglleft    = {400,400},   \guilsinglright    = {300,500},
2299 ⟨bch | pmn⟩  \guilsinglleft    = {300,400},   \guilsinglright    = {200,500},
2300 ⟨cmr⟩  \guilsinglleft    = {500,300},   \guilsinglright    = {400,400},
2301 ⟨pad⟩  \guilsinglleft    = {500,400},   \guilsinglright    = {300,500},
2302 ⟨m − t | ppl⟩  \guillemotleft    = {300,300},   \guillemotright    = {300,300},
2303 ⟨bch | pmn⟩  \guillemotleft    = {200,300},   \guillemotright    = {150,400},

2304 ⟨cmr⟩  \guillemotleft    = {400,100},   \guillemotright    = {200,300},
2305 ⟨pad⟩  \guillemotleft    = {300,300},   \guillemotright    = {200,400},
2306 ⟨ptm⟩  \guillemotleft    = {300,400},   \guillemotright    = {200,400},
2307 ⟨m − t | pad | ppl⟩  \textexclamdown   = {100,   },   \textquestiondown  = {200,   },
2308 ⟨cmr | ptm⟩  \textexclamdown   = {200,   },   \textquestiondown  = {200,   },
2309 ⟨pmn⟩  \textexclamdown   = {-50,   },   \textquestiondown  = {-50,   },
2310 ⟨m − t | ppl⟩  \textbraceleft    = {200,100},   \textbraceright    = {200,200},
2311 ⟨bch | pmn⟩  \textbraceleft    = {200,   },   \textbraceright    = {   ,200},
2312 ⟨cmr | pad | ptm⟩  \textbraceleft    = {400,100},   \textbraceright    = {200,200},
2313 ⟨bch | pmn⟩  \textless         = {100,   },   \textgreater       = {   ,100},
2314 ⟨cmr | pad | ppl | ptm⟩  \textless         = {300,100},   \textgreater       = {200,100},
2315 ⟨pmn⟩  \textvisiblespace = {100,100},

2316 }

2317

2318 ⟨∗cmr⟩

2319 \SetProtrusion
2320 [ name     = lmr-it-T1,
2321  load     = cmr-it-T1 ]
2322 { encoding = {T1,LY1},
2323  family   = lmr,
2324  shape    = {it,sl} }

2325 {

2326  \textquotedblleft = {700,100},
2327  \quotedblbase     = {600,300},

2328 }

2329

Oldstyle numerals are slightly different.

2330 \SetProtrusion
2331 [ name = cmr(oldstyle)-it,
2332  load = cmr-it-T1 ]
2333 { encoding = T1,
2334  family   = {hfor,cmor},
2335  shape    = {it,sl}  }

2336 {

2337  1 = {250, 50},
2338  2 = {150,-100},
2339  3 = {100,-50},
2340  4 = {150,150},
2341  6 = {200,   },
2342  7 = {200, 50},
2343  8 = {150,-50},
2344  9 = {100, 50},

2345 }

2346

2347 ⟨/cmr⟩ 2348 ⟨∗pmn⟩

2349 \SetProtrusion
2350 [ name     = pmnx-it,
2351  load     = pmnj-it ]
2352 { encoding = OT1,
2353  family   = pmnx,
2354  shape    = {it,sl} }

2356  1 = {100,150},

2357 }

2358

2359 \SetProtrusion
2360 [ name     = pmnx-it-T1,
2361  load     = pmnj-it-T1 ]
2362 { encoding = {T1,LY1},
2363  family   = pmnx,
2364  shape    = {it,sl} }

2365 {

2366  1 = {100,150},

2367 }

2368

2369 ⟨/pmn⟩

11.3.3 Small caps

Small caps should inherit the values from their big brothers. Since values are relative to character width, we don’t need to adjust them any further.

2370 \SetProtrusion
2371 ⟨m − t⟩ [ name     = OT1-sc,
2372 ⟨bch⟩ [ name     = bch-sc,
2373 ⟨cmr⟩ [ name     = cmr-sc,
2374 ⟨pad⟩ [ name     = pad-sc,
2375 ⟨pmn⟩ [ name     = pmnj-sc,
2376 ⟨ppl⟩ [ name     = ppl-sc,
2377 ⟨ptm⟩ [ name     = ptm-sc,
2378 ⟨m − t⟩  load     = default ]
2379 ⟨bch⟩  load     = bch-default ]
2380 ⟨cmr⟩  load     = cmr-default ]
2381 ⟨pad⟩  load     = pad-default ]
2382 ⟨pmn⟩  load     = pmnj-default ]
2383 ⟨ppl⟩  load     = ppl-default ]
2384 ⟨ptm⟩  load     = ptm-default ]
2385 { encoding = OT1,
2386 ⟨bch⟩  family   = bch,
2387 ⟨cmr⟩  family   = cmr,
2388 ⟨pad⟩  family   = {pad,padx,padj},
2389 ⟨pmn⟩  family   = pmnj,
2390 ⟨ppl⟩  family   = {ppl,pplx,pplj},
2391 ⟨ptm⟩  family   = {ptm,ptmx,ptmj},
2392  shape    = sc }

2393 {

2394  a = {50,50},

2395 ⟨cmr | pad | ppl | ptm⟩ \ae = {50, }, 2396 ⟨bch | pmn⟩ c = {50, }, 2397 ⟨bch | pad | pmn⟩ d = { ,50}, 2398 ⟨m − t | bch | cmr | pad | pmn | ptm⟩ f = { ,50}, 2399 ⟨bch | pad | pmn⟩ g = {50, }, 2400 ⟨m − t | cmr | pad | pmn | ppl | ptm⟩ j = {50, },

2401 ⟨bch⟩  j = {100,  },

2402 ⟨m − t | bch | cmr | pad | pmn | ppl⟩ l = { ,50}, 2403 ⟨ptm⟩ l = { ,80}, 2404 ⟨m − t | bch | cmr | pad | pmn | ppl⟩ 013 = { 0,50}, % fl

2405 ⟨ptm⟩ 013 = { 0,80}, % fl

2406 ⟨bch | pad | pmn⟩ o = {50,50}, 2407 ⟨bch | pad | pmn⟩ \oe = {50, }, 2408 ⟨ppl⟩ p = { 0, 0}, 2409 ⟨bch | pad | pmn⟩ q = {50,70}, 2410 ⟨ppl⟩ q = { 0, }, 2411 ⟨m − t | cmr | pad | pmn | ppl | ptm⟩ r = { , 0},

2412  t = {50,50},

2413 ⟨m − t | bch | cmr | pad | pmn | ppl⟩ y = {50,50},

2414 ⟨ptm⟩  y = {80,80},

2415 }

2416

2417 \SetProtrusion
2418 ⟨m − t⟩ [ name     = T1-sc,
2419 ⟨bch⟩ [ name     = bch-sc-T1,
2420 ⟨cmr⟩ [ name     = cmr-sc-T1,
2421 ⟨pad⟩ [ name     = pad-sc-T1,
2422 ⟨pmn⟩ [ name     = pmnj-sc-T1,
2423 ⟨ppl⟩ [ name     = ppl-sc-T1,
2424 ⟨ptm⟩ [ name     = ptm-sc-T1,
2425 ⟨m − t⟩  load     = T1-default ]
2426 ⟨bch⟩  load     = bch-T1     ]
2427 ⟨cmr⟩  load     = cmr-T1     ]
2428 ⟨pad⟩  load     = pad-T1     ]
2429 ⟨pmn⟩  load     = pmnj-T1    ]
2430 ⟨ppl⟩  load     = ppl-T1     ]
2431 ⟨ptm⟩  load     = ptm-T1     ]
2432 { encoding = {T1,LY1},
2433 ⟨bch⟩  family   = bch,
2434 ⟨cmr⟩  family   = cmr,
2435 ⟨pad⟩  family   = {pad,padx,padj},
2436 ⟨pmn⟩  family   = pmnj,
2437 ⟨ppl⟩  family   = {ppl,pplx,pplj},
2438 ⟨ptm⟩  family   = {ptm,ptmx,ptmj},
2439  shape    = sc }

2440 {

2441  a = {50,50},

2442 ⟨cmr | pad | ppl | ptm⟩ \ae = {50, }, 2443 ⟨bch | pmn⟩ c = {50, }, 2444 ⟨bch | pad | pmn⟩ d = { ,50}, 2445 ⟨m − t | bch | cmr | pad | pmn | ptm⟩ f = { ,50}, 2446 ⟨bch | pad | pmn⟩ g = {50, }, 2447 ⟨m − t | cmr | pad | pmn | ppl | ptm⟩ j = {50, },

2448 ⟨bch⟩  j = {100,  },

2449 ⟨m − t | bch | cmr | pad | pmn | ppl⟩ l = { ,50}, 2450 ⟨ptm⟩ l = { ,80}, 2451 ⟨m − t | bch | cmr | pad | pmn | ppl⟩ 029 = { ,50}, % fl

2452 ⟨ptm⟩ 029 = {  ,80}, % fl

2453 ⟨bch | pad | pmn⟩ o = {50,50}, 2454 ⟨bch | pad | pmn⟩ \oe = {50, }, 2455 ⟨ppl⟩ p = { 0, 0}, 2456 ⟨bch | pad | pmn⟩ q = {50,70}, 2457 ⟨ppl⟩ q = { 0, }, 2458 ⟨m − t | cmr | pad | pmn | ppl | ptm⟩ r = { , 0},

2459  t = {50,50},

2460 ⟨m − t | bch | cmr | pad | pmn | ppl⟩ y = {50,50},

2461 ⟨ptm⟩  y = {80,80},

2462 }

2463

2464 ⟨∗pmn⟩

2465 \SetProtrusion
2466 [ name     = pmnx-sc,
2467  load     = pmnj-sc ]
2468 { encoding = OT1,
2469  family   = pmnx,
2470  shape    = sc }

2471 {

2472  1 = {230,180},

2473 }

2474

2475 \SetProtrusion
2476 [ name     = pmnx-sc-T1,
2477  load     = pmnj-sc-T1 ]
2478 { encoding = {T1,LY1},
2479  family   = pmnx,
2480  shape    = sc }

2481 {

2482  1 = {230,180},

2483 }

2484

Minion provides real small caps in italics.

2485 \SetProtrusion
2486 [ name     = pmnj-scit,
2487  load     = pmnj-it   ]
2488 { encoding = OT1,
2489  family   = pmnj,
2490  shape    = {scit,si} }

2491 {

2492  a = {50,  },
2493 \ae = {  ,-50},
2494  b = {20,-50},
2495  c = {50,-50},
2496  d = {20, 0},
2497  e = {20,-50},
2498  f = {10, 0},
2499 012 = {10,-50}, % fi
2500 013 = {10,-50}, % fl
2501 014 = {10,-50}, % ffi
2502 015 = {10,-50}, % ffl
2503  g = {50,-50},
2504  i = {20,-50},
2505  j = {20, 0},
2506  k = {20,  },
2507  l = {20,50},
2508  m = {  ,-30},
2509  n = {  ,-30},

2510  o = {50,  },
2511 \oe = {50,-50},
2512  p = {20,-50},
2513  q = {50,  },
2514  r = {20, 0},
2515  s = {20,-30},
2516  t = {70,  },
2517  u = {50,-50},
2518  v = {100,  },
2519  w = {100,  },
2520  y = {50,  },
2521  z = {  ,-50},

2522 }

2523

2524 \SetProtrusion
2525 [ name     = pmnj-scit-T1,
2526  load     = pmnj-it-T1   ]
2527 { encoding = {T1,LY1},
2528  family   = pmnj,
2529  shape    = {scit,si}    }

2530 {

2531  a = {50,  },
2532 \ae = {  ,-50},
2533  b = {20,-50},
2534  c = {50,-50},
2535  d = {20, 0},
2536  e = {20,-50},
2537  f = {10, 0},
2538 028 = {10,-50}, % fi
2539 029 = {10,-50}, % fl
2540 030 = {10,-50}, % ffi
2541 031 = {10,-50}, % ffl
2542  g = {50,-50},
2543  i = {20,-50},
2544 188 = {20, 0},  % ij
2545  j = {20, 0},
2546  k = {20,  },
2547  l = {20,50},
2548  m = {  ,-30},
2549  n = {  ,-30},
2550  o = {50,  },
2551 \oe = {50,-50},
2552  p = {20,-50},
2553  q = {50,  },
2554  r = {20, 0},
2555  s = {20,-30},
2556  t = {70,  },
2557  u = {50,-50},
2558  v = {100,  },
2559  w = {100,  },
2560  y = {50,  },
2561  z = {  ,-50},

2562 }

2564 \SetProtrusion
2565 [ name     = pmnx-scit,
2566  load     = pmnj-scit ]
2567 { encoding = OT1,
2568  family   = pmnx,
2569  shape    = {scit,si} }

2570 {

2571  1 = {100,150},

2572 }

2573

2574 \SetProtrusion
2575 [ name     = pmnx-scit-T1,
2576  load     = pmnj-scit-T1 ]
2577 { encoding = {T1,LY1},
2578  family   = pmnx,
2579  shape    = {scit,si}    }

2580 {

2581  1 = {100,150},

2582 }

2583

2584 ⟨/pmn⟩

 11.3.4 textcomp

Finally the TS1 encoding. Still very incomplete for Times and Palatino.

2585 \SetProtrusion
2586 ⟨m − t⟩ [ name     = textcomp ]
2587 ⟨bch⟩ [ name     = bch-textcomp ]
2588 ⟨cmr⟩ [ name     = cmr-textcomp ]
2589 ⟨pad⟩ [ name     = pad-textcomp ]
2590 ⟨pmn⟩ [ name     = pmn-textcomp ]
2591 ⟨ppl⟩ [ name     = ppl-textcomp ]
2592 ⟨ptm⟩ [ name     = ptm-textcomp ]
2593 ⟨m − t⟩ { encoding = TS1      }
2594 ⟨!m − t⟩ { encoding = TS1,
2595 ⟨bch⟩  family   = bch }
2596 ⟨cmr⟩  family   = cmr }
2597 ⟨pad⟩  family   = {pad,padx,padj} }
2598 ⟨pmn⟩  family   = {pmnx,pmnj} }
2599 ⟨ppl⟩  family   = {ppl,pplx,pplj} }
2600 ⟨ptm⟩  family   = {ptm,ptmx,ptmj} }

2601 {

2602 ⟨cmr⟩  \textquotestraightbase = {300,300},
2603 ⟨pad | pmn⟩  \textquotestraightbase = {400,400},
2604 ⟨cmr | pmn⟩  \textquotestraightdblbase = {300,300},
2605 ⟨pad⟩  \textquotestraightdblbase = {400,400},
2606 ⟨bch | cmr | pad | pmn⟩  \texttwelveudash = {200,200},
2607 ⟨bch | cmr | pad | pmn⟩  \textthreequartersemdash = {150,150},
2608 ⟨cmr | pmn⟩  \textquotesingle = {300,400},
2609 ⟨pad⟩  \textquotesingle = {400,500},
2610 ⟨bch | cmr | pmn⟩  \textasteriskcentered = {200,300},
2611 ⟨pad⟩  \textasteriskcentered = {300,300},
2612 ⟨pmn⟩  \textfractionsolidus = {-200,-200},

2613 ⟨cmr⟩  \textoneoldstyle = {100,100},
2614 ⟨pmn⟩  \textoneoldstyle = {  ,50},
2615 ⟨cmr⟩  \textthreeoldstyle = {  ,50},
2616 ⟨pad | pmn⟩  \textthreeoldstyle = {50,  },
2617 ⟨cmr⟩  \textfouroldstyle = {50,50},
2618 ⟨pad | pmn⟩  \textfouroldstyle = {50,  },
2619 ⟨cmr | pad | pmn⟩  \textsevenoldstyle = {50,80},
2620 ⟨cmr⟩  \textlangle     = {400,   },
2621 ⟨cmr⟩  \textrangle     = {   ,400},
2622 ⟨m − t | bch | pmn | ptm⟩  \textminus      = {200,200},
2623 ⟨cmr | pad | ppl⟩  \textminus      = {300,300},
2624 ⟨bch | pad | pmn⟩  \textlbrackdbl = {100,  },
2625 ⟨bch | pad | pmn⟩  \textrbrackdbl = {  ,100},
2626 ⟨pmn⟩  \textasciigrave = {200,500},
2627 ⟨bch | cmr | pad | pmn⟩  \texttildelow = {200,250},
2628 ⟨pmn⟩  \textasciibreve = {300,400},
2629 ⟨pmn⟩  \textasciicaron = {300,400},
2630 ⟨pmn⟩  \textacutedbl = {200,300},
2631 ⟨pmn⟩  \textgravedbl = {150,300},
2632 ⟨bch | pmn⟩  \textdagger = {80,80},
2633 ⟨cmr | pad⟩  \textdagger = {100,100},
2634 ⟨cmr | pad | pmn⟩  \textdaggerdbl = {80,80},
2635 ⟨bch⟩  \textbardbl = {100,100},
2636 ⟨bch⟩  \textbullet = {200,200},
2637 ⟨cmr | pad | pmn⟩  \textbullet = {  ,100},
2638 ⟨bch | cmr | pmn⟩  \textcelsius = {50,  },
2639 ⟨pad⟩  \textcelsius = {80,  },
2640 ⟨bch⟩  \textflorin = {50,50},
2641 ⟨pad⟩  \textflorin = { ,100},
2642 ⟨pmn⟩  \textflorin = {50,100},
2643 ⟨cmr⟩  \textcolonmonetary = {  ,50},
2644 ⟨pad | pmn⟩  \textcolonmonetary = {50,  },
2645 ⟨pmn⟩  \textinterrobang = {  ,100},
2646 ⟨pmn⟩  \textinterrobangdown = {100,  },
2647 ⟨m − t | pad | ptm⟩  \texttrademark  = {100,100},
2648 ⟨bch⟩  \texttrademark  = {150,150},
2649 ⟨cmr | ppl⟩  \texttrademark  = {200,200},
2650 ⟨pmn⟩  \texttrademark  = {50,50},
2651 ⟨bch⟩  \textcent = {50, },
2652 ⟨bch⟩  \textsterling = {50,  },
2653 ⟨bch⟩  \textbrokenbar = {200,200},
2654 ⟨pmn⟩  \textasciidieresis = {300,400},
2655 ⟨m − t | bch | cmr | pad | ptm⟩  \textcopyright  = {100,100},
2656 ⟨pmn⟩  \textcopyright  = {100,150},
2657 ⟨ppl⟩  \textcopyright  = {200,200},
2658 ⟨bch | cmr⟩  \textordfeminine = {100,200},
2659 ⟨pad | pmn⟩  \textordfeminine = {200,200},

2660 ⟨bch | cmr | pad | pmn⟩ \textlnot = {200, },

2661 ⟨m − t | bch | cmr | pad | ptm⟩  \textregistered = {100,100},
2662 ⟨pmn⟩  \textregistered = {50,150},
2663 ⟨ppl⟩  \textregistered = {200,200},
2664 ⟨pmn⟩  \textasciimacron = {150,200},
2665 ⟨m − t | ppl | ptm⟩  \textdegree     = {300,300},
2666 ⟨bch⟩  \textdegree     = {150,200},

2667 ⟨cmr | pad⟩  \textdegree     = {400,400},
2668 ⟨pmn⟩  \textdegree     = {150,400},

2669 ⟨bch | cmr | pad | pmn⟩ \textpm = {150,200},

2670 ⟨bch⟩  \texttwosuperior = {100,200},
2671 ⟨cmr⟩  \texttwosuperior = {50,100},
2672 ⟨pad | pmn⟩  \texttwosuperior = {200,200},
2673 ⟨bch⟩  \textthreesuperior = {100,200},
2674 ⟨cmr⟩  \textthreesuperior = {50,100},
2675 ⟨pad | pmn⟩  \textthreesuperior = {200,200},
2676 ⟨pmn⟩  \textasciiacute = {300,400},
2677 ⟨bch⟩  \textmu = { ,100},
2678 ⟨bch | pad | pmn⟩  \textparagraph = {  ,100},
2679 ⟨bch | cmr | pad | pmn⟩  \textperiodcentered = {300,400},
2680 ⟨bch⟩  \textonesuperior = {200,300},
2681 ⟨cmr | pad | pmn⟩  \textonesuperior = {200,200},
2682 ⟨bch | pad | pmn⟩  \textordmasculine = {200,200},
2683 ⟨cmr⟩  \textordmasculine = {100,200},
2684 ⟨bch | cmr | pmn⟩  \texteuro = {100,  },
2685 ⟨pad⟩  \texteuro = {50,100},
2686 ⟨bch⟩  \texttimes = {100,100},
2687 ⟨cmr⟩  \texttimes = {150,250},
2688 ⟨pad⟩  \texttimes = {100,150},
2689 ⟨pmn⟩  \texttimes = {70,100},
2690 ⟨bch | pad | pmn⟩  \textdiv = {150,200},
2691 ⟨cmr⟩  \textdiv = {150,250},

2692 }

2693

2694 ⟨∗cmr | pad | pmn⟩

2695 \SetProtrusion
2696 ⟨cmr⟩ [ name     = cmr-textcomp-it ]
2697 ⟨pad⟩ [ name     = pad-textcomp-it ]
2698 ⟨pmn⟩ [ name     = pmn-textcomp-it ]
2699 { encoding = TS1,
2700 ⟨cmr⟩  family   = cmr,
2701 ⟨pad⟩  family   = {pad,padx,padj},
2702 ⟨pmn⟩  family   = {pmnx,pmnj},
2703  shape    = {it,sl} }

2704 {

2705 ⟨cmr⟩  \textquotestraightbase = {300,600},
2706 ⟨pad | pmn⟩  \textquotestraightbase = {400,400},
2707 ⟨cmr⟩  \textquotestraightdblbase = {300,600},
2708 ⟨pad⟩  \textquotestraightdblbase = {300,400},
2709 ⟨pmn⟩  \textquotestraightdblbase = {300,300},
2710  \texttwelveudash = {200,200},
2711  \textthreequartersemdash = {150,150},
2712 ⟨cmr⟩  \textquotesingle = {600,300},
2713 ⟨pad⟩  \textquotesingle = {800,100},
2714 ⟨pmn⟩  \textquotesingle = {300,200},
2715 ⟨cmr⟩  \textasteriskcentered = {300,200},
2716 ⟨pad⟩  \textasteriskcentered = {500,100},
2717 ⟨pmn⟩  \textasteriskcentered = {200,300},
2718 ⟨pmn⟩  \textfractionsolidus = {-200,-200},
2719 ⟨cmr⟩  \textoneoldstyle = {100,50},
2720 ⟨pad⟩  \textoneoldstyle = {100,  },

2721 ⟨pmn⟩  \textoneoldstyle = {50,  },
2722 ⟨pad⟩  \texttwooldstyle = {50,  },
2723 ⟨pmn⟩  \texttwooldstyle = {-50,  },
2724 ⟨cmr⟩  \textthreeoldstyle = {100,50},
2725 ⟨pmn⟩  \textthreeoldstyle = {-100,  },
2726 ⟨cmr⟩  \textfouroldstyle = {50,50},
2727 ⟨pad⟩  \textfouroldstyle = {50,100},
2728 ⟨cmr⟩  \textsevenoldstyle = {50,80},
2729 ⟨pad⟩  \textsevenoldstyle = {50,  },
2730 ⟨pmn⟩  \textsevenoldstyle = {20,  },
2731 ⟨cmr⟩  \textlangle     = {400,   },
2732 ⟨cmr⟩  \textrangle     = {   ,400},
2733 ⟨cmr | pad⟩  \textminus      = {300,300},
2734 ⟨pmn⟩  \textminus = {200,200},
2735 ⟨pad | pmn⟩  \textlbrackdbl = {100,  },
2736 ⟨pad | pmn⟩  \textrbrackdbl = {  ,100},
2737 ⟨pmn⟩  \textasciigrave = {300,300},
2738  \texttildelow = {200,250},
2739 ⟨pmn⟩  \textasciibreve = {300,300},
2740 ⟨pmn⟩  \textasciicaron = {300,300},
2741 ⟨pmn⟩  \textacutedbl = {200,300},
2742 ⟨pmn⟩  \textgravedbl = {150,300},
2743 ⟨cmr⟩  \textdagger = {100,100},
2744 ⟨pad⟩  \textdagger = {200,100},
2745 ⟨pmn⟩  \textdagger = {80,50},
2746 ⟨cmr | pad⟩  \textdaggerdbl = {80,80},
2747 ⟨pmn⟩  \textdaggerdbl = {80,50},
2748 ⟨cmr⟩  \textbullet = {200,100},
2749 ⟨pad⟩  \textbullet = {300, },
2750 ⟨pmn⟩  \textbullet = {30,70},
2751 ⟨cmr⟩  \textcelsius = {100,  },
2752 ⟨pad⟩  \textcelsius = {200,  },
2753 ⟨pmn⟩  \textcelsius = {50,-50},
2754 ⟨pad⟩  \textflorin = {100, },
2755 ⟨pmn⟩  \textflorin = {50,100},
2756 ⟨cmr⟩  \textcolonmonetary = {150, },
2757 ⟨pad⟩  \textcolonmonetary = {100,  },
2758 ⟨pmn⟩  \textcolonmonetary = {50,-50},
2759 ⟨cmr | pad⟩  \texttrademark  = {200, },
2760 ⟨pmn⟩  \texttrademark  = {50,100},
2761 ⟨pmn⟩  \textasciidieresis = {300,200},
2762 ⟨cmr⟩  \textcopyright  = {100, },
2763 ⟨pad⟩  \textcopyright  = {200,100},
2764 ⟨pmn⟩  \textcopyright  = {100,150},
2765 ⟨cmr⟩  \textordfeminine = {100,100},
2766 ⟨pmn⟩  \textordfeminine = {200,200},
2767 ⟨cmr | pad⟩  \textlnot = {300,  },
2768 ⟨pmn⟩  \textlnot = {200,  },
2769 ⟨cmr⟩  \textregistered = {100, },
2770 ⟨pad⟩  \textregistered = {200,100},
2771 ⟨pmn⟩  \textregistered = {50,150},
2772 ⟨pmn⟩  \textasciimacron = {150,200},
2773 ⟨cmr | pad⟩  \textdegree     = {500,100},
2774 ⟨pmn⟩  \textdegree     = {150,150},

2775 ⟨cmr⟩  \textpm = {150,100},
2776 ⟨pad⟩  \textpm = {200,150},
2777 ⟨pmn⟩  \textpm = {150,200},
2778 ⟨cmr⟩  \textonesuperior = {400, },
2779 ⟨pad⟩  \textonesuperior = {300,100},
2780 ⟨pmn⟩  \textonesuperior = {200,100},
2781 ⟨cmr⟩  \texttwosuperior = {400, },
2782 ⟨pad⟩  \texttwosuperior = {300, },
2783 ⟨pmn⟩  \texttwosuperior = {200,100},
2784 ⟨cmr⟩  \textthreesuperior = {400, },
2785 ⟨pad⟩  \textthreesuperior = {300, },
2786 ⟨pmn⟩  \textthreesuperior = {200,100},
2787 ⟨pmn⟩  \textasciiacute = {300,200},
2788 ⟨cmr⟩  \textparagraph = {200,},
2789 ⟨pmn⟩  \textparagraph = {  ,100},
2790 ⟨cmr⟩  \textperiodcentered = {500,500},
2791 ⟨pad | pmn⟩  \textperiodcentered = {300,400},
2792 ⟨cmr⟩  \textordmasculine = {100,100},
2793 ⟨pmn⟩  \textordmasculine = {200,200},
2794 ⟨cmr⟩  \texteuro = {200, },
2795 ⟨pad⟩  \texteuro = {100, },
2796 ⟨pmn⟩  \texteuro = {100,-50},
2797 ⟨cmr⟩  \texttimes = {200,200},
2798 ⟨pad⟩  \texttimes = {200,100},
2799 ⟨pmn⟩  \texttimes = {70,100},
2800 ⟨cmr | pad⟩  \textdiv = {200,200},
2801 ⟨pmn⟩  \textdiv = {150,200},

2802 }

2803

2804 ⟨/cmr | pad | pmn⟩

11.3.5 Math

Now to the math symbols for Computer Modern Roman. Definitions have been extracted from fontmath.ltx. Not all characters will be protruded on both sides (probably because of some restrictions in pdfTEX (currently 1.20b)). I did not spend too much time fiddling with these settings, so they can surely be improved.

The math font operators uses OT1/cmr/m/n, which we’ve already set up above. It’s declared as:

 \DeclareSymbolFont{operators}   {OT1}{cmr} {m}{n}
 \SetSymbolFont{operators}{bold}{OT1}{cmr} {bx}{n}
 \DeclareSymbolFontAlphabet{\mathrm}    {operators}

The following alphabets are already set up, too:

 \DeclareMathAlphabet      {\mathbf}{OT1}{cmr}{bx}{n}
 \DeclareMathAlphabet      {\mathit}{OT1}{cmr}{m}{it}

while these aren’t (and won’t be, for now):

 \DeclareMathAlphabet      {\mathsf}{OT1}{cmss}{m}{n}
 \DeclareMathAlphabet      {\mathtt}{OT1}{cmtt}{m}{n}

Math font letters is declared as:

 \DeclareSymbolFont{letters}     {OML}{cmm} {m}{it}
 \SetSymbolFont{letters}  {bold}{OML}{cmm} {b}{it}
 \DeclareSymbolFontAlphabet{\mathnormal}{letters}

Since it may also be loaded under the name of OML/cmr/bx/sc, or whatever, we leave series and shape empty.

2805 ⟨∗cmr⟩

2806 \SetProtrusion
2807 [ name     = cmr-math-letters ]
2808 { encoding = OML,
2809  family   = {cmm,cmr} }

2810 {

2811  A = {100, 50}, % \mathnormal
2812  B = { 50,   },
2813  C = { 50,   },
2814  D = { 50, 50},
2815  E = { 50,   },
2816  F = {100, 50},
2817  G = { 50, 50},
2818  H = { 50, 50},
2819  I = { 50, 50},
2820  J = {150, 50},
2821  K = { 50,100},
2822  L = { 50, 50},
2823  M = { 50,   },
2824  N = { 50,   },
2825  O = { 50,   },
2826  P = { 50,   },
2827  Q = { 50, 50},
2828  R = { 50,   },
2829  S = { 50,   },
2830  T = { 50,100},
2831  U = { 50, 50},
2832  V = {100,100},
2833  W = { 50,100},
2834  X = { 50,100},
2835  Y = {100,100},
2836  f = {100,100},
2837  h = {   ,100},
2838  i = {   , 50},
2839  j = {   , 50},
2840  k = {   , 50},
2841  r = {   , 50},
2842  v = {   , 50},
2843  w = {   , 50},
2844  x = {   , 50},
2845 "0B = { 50,   }, % \alpha
2846 "0C = { 50,   }, % \beta
2847 "0D = {200,   }, % \gamma
2848 "0E = { 50,   }, % \delta
2849 "0F = { 50,   }, % \epsilon
2850 "10 = {100,   }, % \zeta

2851 %  "11 = {   ,   }, % \eta
2852 "12 = { 50,   }, % \theta
2853 %  "13 = {   ,   }, % \iota
2854 %  "14 = {   ,   }, % \kappa
2855 "15 = {100,   }, % \lambda
2856 %  "16 = {   ,   }, % \mu
2857 "17 = { 50,   }, % \nu
2858 %  "18 = {   ,   }, % \xi
2859 "19 = { 50,   }, % \pi
2860 "1A = { 50,   }, % \rho
2861 "1B = { 50,   }, % \sigma
2862 "1C = { 50,   }, % \tau
2863 "1D = { 50,   }, % \upsilon
2864 "1E = { 50,   }, % \phi
2865 "1F = { 50,   }, % \chi
2866 "20 = { 50,   }, % \psi
2867 %  "21 = {   ,   }, % \omega
2868 %  "22 = {   ,   }, % \varepsilon
2869 %  "23 = {   ,   }, % \vartheta
2870 %  "24 = {   ,   }, % \varpi
2871 "25 = {100,   }, % \varrho
2872 "26 = {100,   }, % \varsigma
2873 "27 = { 50,   }, % \varphi
2874 "28 = {100,100}, % \leftharpoonup
2875 "29 = {100,100}, % \leftharpoondown
2876 "2A = {100,100}, % \rightharpoonup
2877 "2B = {100,100}, % \rightharpoondown
2878 "2C = {300,200}, % \lhook
2879 "2D = {200,300}, % \rhook
2880 "2E = {   ,100}, % \triangleright
2881 "2F = {100,   }, % \triangleleft
2882 % 0 - 9
2883 "3A = {   ,500}, % ., \ldotp
2884 "3B = {   ,500}, % ,
2885 "3C = {200,100}, % <
2886 "3D = {300,400}, % /
2887 "3E = {100,200}, % >
2888 "3F = {200,200}, % \star
2889 %  "40 = {   ,   }, % \partial
2890 "5B = {   ,100}, % \flat
2891 %  "5C = {   ,   }, % \natural
2892 %  "5D = {   ,   }, % \sharp
2893 "5E = {200,200}, % \smile
2894 "5F = {200,200}, % \frown
2895 %  "60 = {   ,   }, % \ell
2896 %  "7B = {   ,   }, % \imath
2897 "7C = {100,   }, % \jmath
2898 "7D = {   ,100}, % \wp

2899 }

2900

Math font symbols is declared as:

 \DeclareSymbolFont{symbols}     {OMS}{cmsy}{m}{n}
 \SetSymbolFont{symbols}  {bold}{OMS}{cmsy}{b}{n}

 \DeclareSymbolFontAlphabet{\mathcal}   {symbols}
2901 \SetProtrusion
2902 [ name     = cmr-math-symbols ]
2903 { encoding = OMS,
2904  family   = {cmsy,cmr} }

2905 {

2906  A = {150, 50}, % \mathcal
2907  C = {   ,100},
2908  D = {   , 50},
2909  F = { 50,100},
2910  J = {100,100},
2911  K = {   ,100},
2912  L = {100,   },
2913  M = { 50,   },
2914  N = { 50, 50},
2915  P = {   , 50},
2916  Q = { 50,   },
2917  T = { 50,100},
2918  X = {100,100},
2919  Y = {100,   },
2920  Z = {100,100},
2921 "00 = {300,300}, % -
2922 "01 = {   ,700}, % \cdot, \cdotp
2923 "02 = {150,250}, % \times
2924 "03 = {150,250}, % *, \ast
2925 "04 = {200,300}, % \div
2926 "05 = {150,250}, % \diamond
2927 "06 = {200,200}, % \pm
2928 "07 = {200,200}, % \mp
2929 "08 = {100,100}, % \oplus
2930 "09 = {100,100}, % \ominus
2931 "0A = {100,100}, % \otimes
2932 "0B = {100,100}, % \oslash
2933 "0C = {100,100}, % \odot
2934 "0D = {100,100}, % \bigcirc
2935 "0E = {100,100}, % \circ
2936 "0F = {100,100}, % \bullet
2937 "10 = {100,100}, % \asymp
2938 "11 = {100,100}, % \equiv
2939 "12 = {200,100}, % \subseteq
2940 "13 = {100,200}, % \supseteq
2941 "14 = {200,100}, % \leq
2942 "15 = {100,200}, % \geq
2943 "16 = {200,100}, % \preceq
2944 "17 = {100,200}, % \succeq
2945 "18 = {200,200}, % \sim
2946 "19 = {150,150}, % \approx
2947 "1A = {200,100}, % \subset
2948 "1B = {100,200}, % \supset
2949 "1C = {200,100}, % \ll
2950 "1D = {100,200}, % \gg
2951 "1E = {300,100}, % \prec
2952 "1F = {100,300}, % \succ

2953 "20 = {100,200}, % \leftarrow
2954 "21 = {200,100}, % \rightarrow
2955 "22 = {100,100}, % \uparrow
2956 "23 = {100,100}, % \downarrow
2957 "24 = {100,100}, % \leftrightarrow
2958 "25 = {100,100}, % \nearrow
2959 "26 = {100,100}, % \searrow
2960 "27 = {100,100}, % \simeq
2961 "28 = {100,100}, % \Leftarrow
2962 "29 = {100,100}, % \Rightarrow
2963 "2A = {100,100}, % \Uparrow
2964 "2B = {100,100}, % \Downarrow
2965 "2C = {100,100}, % \Leftrightarrow
2966 "2D = {100,100}, % \nwarrow
2967 "2E = {100,100}, % \swarrow
2968 "2F = {   ,100}, % \propto
2969 "30 = {   ,100}, % \prime
2970 "31 = {100,100}, % \infty
2971 "32 = {150,100}, % \in
2972 "33 = {100,150}, % \ni
2973 "34 = {100,100}, % \triangle, \bigtriangleup
2974 "35 = {100,100}, % \bigtriangledown
2975 %  "36 = {   ,   }, % \not
2976 %  "37 = {   ,   }, % \mapstochar
2977 "38 = {   ,100}, % \forall
2978 "39 = {100,   }, % \exists
2979 "3A = {200,   }, % \neg
2980 %  "3B = {   ,   }, % \emptyset
2981 %  "3C = {   ,   }, % \Re
2982 %  "3D = {   ,   }, % \Im
2983 "3E = {200,200}, % \top
2984 "3F = {200,200}, % \bot, \perp
2985 %  "40 = {   ,   }, % \aleph
2986 %  "5B = {   ,   }, % \cup
2987 %  "5C = {   ,   }, % \cap
2988 %  "5D = {   ,   }, % \uplus
2989 "5E = {100,200}, % \wedge
2990 "5F = {100,200}, % \vee
2991 "60 = {   ,300}, % \vdash
2992 "61 = {300,   }, % \dashv
2993 "62 = {100,100}, % \lfloor
2994 "63 = {100,100}, % \rfloor
2995 "64 = {100,100}, % \lceil
2996 "65 = {100,100}, % \rceil
2997 "66 = {150,   }, % \lbrace
2998 "67 = {   ,150}, % \rbrace
2999 "68 = {200,   }, % \langle
3000 "69 = {   ,200}, % \rangle
3001 %  "6A = {   ,   }, % \arrowvert, \mid, \vert, |
3002 %  "6B = {   ,   }, % \Arrowvert, \parallel, \Vert
3003 "6C = {100,100}, % \updownarrow
3004 "6D = {100,100}, % \Updownarrow
3005 "6E = {100,300}, % \, \backslash, \setminus
3006 %  "6F = {   ,   }, % \wr

3007 %  "70 = {   ,   }, % \sqrtsign
3008 %  "71 = {   ,   }, % \amalg
3009 "72 = {100,100}, % \nabla
3010 %  "73 = {   ,   }, % \smallint
3011 %  "74 = {   ,   }, % \sqcup
3012 %  "75 = {   ,   }, % \sqcap
3013 %  "76 = {   ,   }, % \sqsubseteq
3014 %  "77 = {   ,   }, % \sqsupseteq
3015 %  "78 = {   ,   }, % \mathsection
3016 "79 = {200,200}, % \dagger
3017 "7A = {100,100}, % \ddagger
3018 "7B = {100,   }, % \mathparagraph
3019 "7C = {100,100}, % \clubsuit
3020 "7D = {100,100}, % \diamondsuit
3021 "7E = {100,100}, % \heartsuit
3022 "7F = {100,100}, % \spadesuit

3023 }

3024

We don’t bother about largesymbols, since it will only be used in display math, where protrusion doesn’t work anyway. It’s declared as:

 \DeclareSymbolFont{largesymbols}{OMX}{cmex}{m}{n}
3025 %\SetProtrusion
3026 %   [ name     = cmr-math-largesymbols ]
3027 %   { encoding = OMX,
3028 %     family   = {cmex,cmr} }

3029 % {

3030 %     "00 % (
3031 %     "01 % )
3032 %     "02 % [
3033 %     "03 % ]
3034 %     "04 % \lfloor
3035 %     "05 % \rfloor
3036 %     "06 % \lceil
3037 %     "07 % \rceil
3038 %     "08 % \lbrace
3039 %     "09 % \rbrace
3040 %     "0A % <, \langle
3041 %     "0B % >, \rangle
3042 %     "0C % \vert, |
3043 %     "0D % \Vert
3044 %     "0E % /
3045 %     "0F % \backslash
3046 %     "3A % \lgroup
3047 %     "3B % \rgroup
3048 %     "3C % \arrowvert
3049 %     "3D % \Arrowvert
3050 %     "3E % \bracevert
3051 %     "3F % \updownarrow
3052 %     "40 % \lmoustache
3053 %     "41 % \rmoustache
3054 %     "46 % \bigsqcup
3055 %     "48 % \ointop

3056 %     "4A % \bigodot
3057 %     "4C % \bigoplus
3058 %     "4E % \bigotimes
3059 %     "50 % \sum
3060 %     "51 % \prod
3061 %     "52 % \intop
3062 %     "53 % \bigcup
3063 %     "54 % \bigcap
3064 %     "55 % \biguplus
3065 %     "56 % \bigwedge
3066 %     "57 % \bigvee
3067 %     "60 % \coprod
3068 %     "70 % \sqrtsign
3069 %     "77 % \Updownarrow
3070 %     "78 % \uparrow
3071 %     "79 % \downarrow
3072 %     "7A % \braceld, \lmoustache
3073 %     "7B % \bracerd, \rmoustache
3074 %     "7C % \bracelu
3075 %     "7D % \braceru
3076 %     "7E % \Uparrow
3077 %     "7F % \Downarrow

3078 % } 3079 ⟨/cmr⟩ 3080 ⟨/config⟩

12 Auxiliary file for micro-fine tuning

This file can be used to test protrusion and expansion settings.

3081 ⟨∗test⟩

3082 \documentclass{article}

3083

3084 %% Here you can set the font you want to test, using
3085 %% the commands \fontfamily, \fontseries, and \fontshape.
3086 %% Make sure to end all lines with a comment character!
3087 \newcommand{\TestFont}{%
3088 \fontfamily{ppl}%
3089 %%   \fontseries{b}%
3090 %%   \fontshape{it}% sc, sl

3091 }

3092

3093 \usepackage{ifthen}
3094 \usepackage[T1]{fontenc}
3095 %%\usepackage[latin1]{inputenc}
3096 \usepackage[verbose,expansion=alltext,stretch=50]{microtype}

3097

3098 \pagestyle{empty}
3099 \setlength{\parindent}{0pt}
3100 \newcommand{\crulefill}{\cleaders\hbox{$\mkern-2mu\smash-\mkern-2mu$}\hfill}
3101 \newcommand{\testprotrusion}[2][]{%
3102 \ifthenelse{\equal{#1}{r}}{}{#2}%
3103 lorem ipsum dolor sit amet,

3104  \ifthenelse{\equal{#1}{r}}{\crulefill}{\leftarrowfill} #2
3105  \ifthenelse{\equal{#1}{l}}{\crulefill}{\rightarrowfill}
3106 you know the rest%
3107 \ifthenelse{\equal{#1}{l}}{}{#2}%
3108 \linebreak
3109 {\fontencoding{\encodingdefault}%
3110 \fontseries{\seriesdefault}%
3111 \fontshape{\shapedefault}%
3112 \selectfont
3113 Here is the beginning of a line, \dotfill and here is its end}\linebreak

3114 }

3115 \newcommand{\showTestFont}{\expandafter\stripprefix\meaning\TestFont}
3116 \def\stripprefix#1>{}
3117 \newcount\charcount
3118 \begin{document}
3119 \microtypesetup{expansion=false}

3120

3121 {\centering The font in this document is called by:\\
3122 \texttt{\showTestFont}\par}\bigskip

3123

3124 \TestFont\selectfont
3125 This line intentionally left empty\linebreak
3126 %% A -- Z
3127 \charcount=65
3128 \loop
3129 \testprotrusion{\char\charcount}
3130 \advance\charcount 1
3131 \ifnum\charcount < 91 \repeat
3132 %% a -- z
3133 \charcount=97
3134 \loop
3135 \testprotrusion{\char\charcount}
3136 \advance\charcount 1
3137 \ifnum\charcount < 123 \repeat
3138 %% 0 -- 9
3139 \charcount=48
3140 \loop
3141 \testprotrusion{\char\charcount}
3142 \advance\charcount 1
3143 \ifnum\charcount < 58 \repeat

3144 %%

3145 \testprotrusion[r]{,}
3146 \testprotrusion[r]{.}
3147 \testprotrusion[r]{;}
3148 \testprotrusion[r]{:}
3149 \testprotrusion[r]{?}
3150 \testprotrusion[r]{!}
3151 \testprotrusion[l]{\textexclamdown}
3152 \testprotrusion[l]{\textquestiondown}
3153 \testprotrusion[r]{)}
3154 \testprotrusion[l]{(}
3155 \testprotrusion{/}
3156 \testprotrusion{\char`\\}
3157 \testprotrusion{-}

3158 \testprotrusion{\textendash}
3159 \testprotrusion{\textemdash}
3160 \testprotrusion{\textquoteleft}
3161 \testprotrusion{\textquoteright}
3162 \testprotrusion{\textquotedblleft}
3163 \testprotrusion{\textquotedblright}
3164 \testprotrusion{\quotesinglbase}
3165 \testprotrusion{\quotedblbase}
3166 \testprotrusion{\guilsinglleft}
3167 \testprotrusion{\guilsinglright}
3168 \testprotrusion{\guillemotleft}
3169 \testprotrusion{\guillemotright}

3170

3171 \bigskip
3172 The following displays the current font stretched by 5\%,
3173 normal, and shrunk by 5\%:

3174

3175 \microtypesetup{expansion=true}

3176

3177 \bigskip
3178 \newlength{\MTln}
3179 \newcommand{\teststring}
3180 {ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789}
3181 \settowidth{\MTln}{\teststring}

3182

3183 \parbox{1.05\MTln}{\teststring\linebreak\\
3184  \teststring}\par\bigskip
3185 \parbox{0.95\MTln}{\teststring}
3186 \end{document}

3187 ⟨/test⟩

Needless to say that things may always be improved. For suggestions,

 mail to w.m.l@gmx.net.

A Change History

Version 1.0 (11. 9. 2004)

General: Initial version . . . . . . . . . 1

Version 1.1 (21. 9. 2004)

General: bug fix concerning version check (reported by Harald Harders) . . . . . . . . . . . . . . . . . 17

configuration file names in lowercase (suggested by Harald Harders) . . . . . . . . . . . . . . . . . 30

issue an error instead of a warning, when pdfTEX version is too old for autoexpand …. 59

protrusion: added factors for

some more characters . . . . . 63 protrusion: settings for Adobe

Minion (contributed by Harald Harders) . . . . . . . . . . . . . . . 63

removed 8-bit characters from the configuration files (suggested by Harald Harders) . . 60

\DeclareCharacterInheritance:

new macro: possibility to specify character inheritance … 48

\MT@declare@sets: remove spaces

around set name . . . . . . . . . 40

\MT@DeclareSet@: remove spaces

around first argument . . . . . 39 \MT@find@file: bug fix: also check

whether the file for the base font family has already been loaded . . . . . . . . . . . . . . . . 30

                              \MT@get@basefamily: only remove

suffix, if it is ‘x’ or ‘j’ . . . . . 32

                              \MT@get@listname: don’t check for

empty characteristics list … 32 \MT@get@number: numbers may also

be specified in hexadecimal or octal (suggested by Harald Harders). . . . . . . . . . . . . . . 37

\MT@ifempty: bug fix: use category code 12 for the percent character (reported by Tom Kink) . 20

\MT@permute: don’t use sets for

empty encoding . . . . . . . . . 50 \MT@protsplit: bug fix: allow zero

and negative values . . . . . . . 25 \MT@use@sets: remove spaces

around set name . . . . . . . . . 43

                              \UseMicroTypeSet: remove spaces

around first argument . . . . . 43

Version 1.2 (3. 10. 2004)

General: added protrusion factors for Adobe Garamond and Computer Modern Roman in TS1 encoding . . . . . . . . . . . 78

added protrusion factors for Computer Modern Roman math symbols . . . . . . . . . . . 82

check for packages that might

load fonts . . . . . . . . . . . . . . 38 declare cmr as an alias for cmor 44 new font sets: allmath and

basicmath . . . . . . . . . . . . . 43

                              \MT@check@default: new macro . 41

\MT@checkfor: also check for alias

font name . . . . . . . . . . . . . . 23

                              \MT@define@inh@key@encoding:

check whether only one encoding specified . . . . . . . . . . . . 48

                              \MT@get@basefamily: also remove

‘w’ (swash capitals) . . . . . . . 32

                              \MT@get@highlevel: check whether

defaults have changed . . . . . 40

                              \MT@get@listname: alternatively

check for alias font name … 32 \MT@get@size: additional magic to

catch some errors . . . . . . . . 42 hijack \set@fontsize instead of

\@setfontsize . . . . . . . . . . 42

\MT@get@slot: bug fix: group must

also include \MT@two@tokens 35

\MT@loop: bug fix: new macro, used

instead of \loop . . . . . . . . . 21

\MT@permute@@@@@: more sanity
checks for \SetProtrusion
and \SetExpansion . . . . . . 51

\MT@set@prot@codes: bug fix: set

inheritance list \globally to \@empty . . . . . . . . . . . . . . . 25

\MT@setupfont: also search for alias

font file . . . . . . . . . . . . . . . 22

bug fix: call \@@enc@update if

necessary . . . . . . . . . . . . . . 22 \MT@split@name: define alias font

name as an alternative, not as a replacement . . . . . . . . . . . 24

Version 1.3 (27. 10. 2004)

General: declare cmr as an alias for

aer, zer and hfor . . . . . . . 44 \MT@catcodes: check some category

codes (compatibility with german) . . . . . . . . . . . . . . . . . 18

\MT@get@codes@name: bug fix: spec-

ifying load option does no longer require to give a name, too . . . . . . . . . . . . . . . . . . . 46

\MT@load@list: check whether list

exists . . . . . . . . . . . . . . . . . 30 \MT@size@check: check only once 51

Version 1.4 (26. 11. 2004)

General: check for pdfcprot . . . . . 19

don’t use scratch registers in

global definitions . . . . . . . . . 34 new message if \pdfoutput is

changed . . . . . . . . . . . . . . . 57 new option: final . . . . . . . . . 55 no need to check for packages

that might load fonts anymore 38 optimization: use less \csnames

and \expandafters . . . . . . . 19 protrusion: harmonize dashes in

upshape and italic (cmr, pad, ppl) . . . . . . . . . . . . . . . . . . 63

protrusion: slanted like italics . 68 protrusion: tweak quote charac-

ters for cmr variants (OT1, T1, lmr) . . . . . . . . . . . . . . . . . . 67

set catcodes before reading global configuration file (reported by Christoph Bier) . . 56

use \pickup@font instead of
\define@newfont as the hook
for \MT@setupfont . . . . . . . 38

use one instead of five counters 22

\microtypesetup: bug fix: set the

correct levels, and remember them; warning when enabling an option disabled in package options . . . . . . . . . . . . . . . . 52

\MT@checklist@family@: bug fix:

don’t try alias family name if encoding failed . . . . . . . . . . 24

\MT@find@file: bug fix: reset some more catcodes when reading files (reported by Michael Hoppe) . . . . . . . . . . . . . . . . 31

\MT@get@basefamily: bug fix: failed

for font names of the form abczz (reported by Georg Verweyen) . . . . . . . . . . . . . . . . 32

\MT@get@size: don’t set \MT@count

globally (save stack problem) 42

\MT@get@slot:  don’t  define

\MT@char globally (save stack problem) . . . . . . . . . . . . . . 35

\MT@in@llist: bug fix: compare with \\ instead of \relax (reported by Herb Schulz) …. 21

\MT@set@exp@opt: bug fix: speci-

fying extra options does no longer require to give a name, too . . . . . . . . . . . . . . . . . . . 46

\MT@set@prot@children: remove

group . . . . . . . . . . . . . . . . . 27 \MT@use@sets: don’t use undeclared

font sets . . . . . . . . . . . . . . . 43

Version 1.5 (15. 12. 2004)

General: defaults: step: 4 . . . . . . 55

defaults: calculate step as

min(stretch,shrink)/5 . . . 58

defaults: turn off expansion for

DVI output . . . . . . . . . . . . 57 disable automatic expansion for

DVI output . . . . . . . . . . . . 59 new option: selected, by default

false . . . . . . . . . . . . . . . . . . 55 new: short history . . . . . . . . . 14 protrusion: settings for Bit-

stream Charter . . . . . . . . . . 63 remove \ss from character inher-

itance list, add \DJ . . . . . . . 60

\DeclareMicroTypeAlias: remove

spaces around arguments … 43

\MT@adjustprotcode: don’t use

\lpcode and \rpcode for the

calculation . . . . . . . . . . . . . 26 warning for protrusion factors

greater than 1000 . . . . . . . . 26 \MT@catcodes: reset catcode of ‘^’

(compatibility with chemsym) 18

\MT@file@catcodes: reset catcode

of ‘=’ (compatibility with turkish babel) . . . . . . . . . . . . . . 31

\MT@get@highlevel: don’t test de-

faults if called after begin document . . . . . . . . . . . . . . . . 40

\MT@set@exp@codes: allow non-

selected font expansion …. 27

\MT@set@prot@codes: adjust pro-

trusion factors before setting the inheriting characters … 24

Version 1.6 (2. 2. 2005)

General: defaults: turn off expansion

for old pdfTEX versions …. 56 disable automatic expansion for

old pdfTEX versions . . . . . . 59 load a font, if none is active . . 19 new option: factor, by default

1000 . . . . . . . . . . . . . . . . . . 55 protrusion: add italic uppercase

Greek letters . . . . . . . . . . . . 68 protrusion: improve settings for

numbers (pointed out by Peter Muthesius) . . . . . . . . . . . . . 64

protrusion: tune CMR math let-

ters (OML encoding) . . . . . . 83 restructure dtx file . . . . . . . . . 60 test whether \pickup@font has

changed . . . . . . . . . . . . . . . 38 use e-TEX, if available . . . . . . 20

\MT@define@number: test whether

numeric options received a

number . . . . . . . . . . . . . . . 55

\MT@get@charwd: use e-TEX’s

\fontcharwd, if available . . 26

\MT@get@inh@list: correct message

if selected is false . . . . . . . 33 \MT@get@slot: completely redone,

hopefully more robust (compatible with frenchpro) …. 35

\MT@pdftex@no: new macro . . . . . 17

\MT@resetefcode: only reset

\efcodes for older pdfTEX versions . . . . . . . . . . . . . . . . . 28

\MT@set@exp@codes:  introduce

factor option . . . . . . . . . . . 27

\MT@set@prot@codes: introduce

factor option . . . . . . . . . . . 24 \MT@use@sets: keep current set if

new set is undeclared . . . . . 43 \MT@vinfo: new macro instead of

\ifMT@verbose . . . . . . . . . . 16

\underline{INDEX 95}

B Index

Numbers written in italic refer to the page where the corresponding entry is described; numbers underlined refer to the code line of the definition; numbers in roman refer to the code lines where the entry is used.

Symbols

User Commands:

\DeclareCharacterInheritance

. . . . . . . . . . . . . . . . . . . . . 11

\DeclareMicroTypeAlias . . . 12
\DeclareMicroTypeSet . . . . . . 6
\DeclareMicroTypeSet* . . . . . 6
\microtypesetup . . . . . . . . . . 6
\SetExpansion . . . . . . . . . . . 10
\SetProtrusion . . . . . . . . . . . 8
\UseMicroTypeSet . . . . . . . . . 8

User Options:

DVIoutput . . . . . . . . . . . . . . . . 4 activate . . . . . . . . . . . . . . . . 3 auto . . . . . . . . . . . . . . . . . . . . 5 draft . . . . . . . . . . . . . . . . . . . 4 expansion . . . . . . . . . . . . . . . . 3 factor . . . . . . . . . . . . . . . . . . 4 final . . . . . . . . . . . . . . . . . . . 4 protrusion . . . . . . . . . . . . . . . 3 selected . . . . . . . . . . . . . . . . 5 shrink . . . . . . . . . . . . . . . . . . 5 step . . . . . . . . . . . . . . . . . . . . 5 stretch . . . . . . . . . . . . . . . . . 5 verbose . . . . . . . . . . . . . . . . . 4

A

a0poster (package) . . . . . . . . . . 42 activate (option) . . . . . . . . . . . . 3 ae (package) . . . . . . . . . . . 12, 13, 44 AMS (package) . . . . . . . . . . . . . . . 42 auto (option) . . . . . . . . . . . . . . . . 5

B

babel (package) . . . . . . . . . . . . . 15

C

CJK (package) . . . . . . . . . . . . . . . 38 color (package) . . . . . . . . . . . 4, 57 contour (package) . . . . . . . . . . . 57 crop (package) . . . . . . . . . . . . . . 57 csquotes (package) . . . . . . . . . . 66

D

\DeclareCharacterInheritance

. . . . . . . . . . . . . . . . . 11, \underline{1192}

\DeclareMicroTypeAlias . . 12, \underline{1004}
\DeclareMicroTypeSet . . . . 6, \underline{848}
\DeclareMicroTypeSet* . . . . 6, \underline{848}

docstrip (package) . . . . . . . . . . 16 draft (option) . . . . . . . . . . . . . . . 4 DVIoutput (option) . . . . . . . . . . . . 4

E

eco (package) . . . . . . . . . . 12, 13, 44 expansion (option) . . . . . . . . . . . . 3

F

factor (option) . . . . . . . . . . . . . . 4 final (option) . . . . . . . . . . . . . . . 4 frenchpro (package) . . . . . . . 14, 36

G

german (package) . . . . . . . . . 15, 18 graphics (package) . . . . . . . . 4, 57

H

hfoldsty (package) . . . . . 12, 13, 44 hyperref (package) . . . . . . 4, 38, 57

I

IEEEtran (package) . . . . . . . . . . 38 \ifMT@auto . . . . . . . . . . . . . . . \underline{102} \ifMT@draft . . . . . . . . . . . . . . \underline{102}

\ifMT@DVIoutput . . . . . . . . . . . \underline{102}
\ifMT@expansion . . . . . . . . . . . \underline{102}
\ifMT@font@expansion . . . . . . \underline{228}
\ifMT@font@protrusion . . . . . . \underline{228}

\ifMT@opt@auto . . . . . . . . . . . \underline{1452}

\ifMT@opt@expansion . . . . . . \underline{1452}
\ifMT@opt@protrusion . . . . . \underline{1452}
\ifMT@protrusion . . . . . . . . . . \underline{102}

\ifMT@selected . . . . . . . . . . . . \underline{102} ifpdf (package) . . . . . . . . . . . 4, 57

J

jurabib (package) . . . . . . . . . . . 38

K

keyval (package) . . . . . . . . . 22, 40

L

ledmac (package) . . . . . . . . . 19, 38 lineno (package) . . . . . . . . . . . . 19 lmodern (package) . . . . . . . . . . . 67

M

memoir (package) . . . . . . . . . . . . 38 microtype (package) . . 1, 3, 4, 16, 38

\microtypesetup . . . . . . . . 6, \underline{1377}

minimal (package) . . . . . . . . . . . 19 \MT@addto@list . . . . . . . . . . . . \underline{976}

\MT@adjustprotcode . . . . . . . . \underline{344}
\MT@adjustprotcode@ . . . . . . . \underline{369}

\MT@auto . . . . . . . . . . . . . . . . \underline{1633} \MT@catcodes . . . . . . . . . . . . . . \underline{68}

\MT@characterstring . . . . . . . \underline{715}

\MT@charstring . . . . . . . . . . . . \underline{724}

\MT@check@default . . . . . . . . . \underline{917}

\MT@checkfor . . . . . . . . . . . . . \underline{228} \MT@checklist . . . . . . . . . . . . . \underline{240} \MT@checklist@ . . . . . . . . . . . . \underline{243}

\MT@checklist@family . . . . . . \underline{260}
\MT@checklist@family@ . . . . . . \underline{263}

\MT@count . . . . . . . . . . . . . . . . \underline{200}

\MT@declare@char@inh . . . . . \underline{1201}
\MT@declare@codes . . . . . . . . \underline{1150}
\MT@declare@sets . . . . . . . . . . \underline{874}

\MT@DeclareSet . . . . . . . . . . . . \underline{857}

\MT@DeclareSet@ . . . . . . . . . . . \underline{864}
\MT@DeclareSetAndUseIt . . . . . \underline{860}

\MT@def@n . . . . . . . . . . . . . . . . \underline{114}

\MT@define@code@key . . . . . . \underline{1128}
\MT@define@code@key@size . . \underline{1139}
\MT@define@expcodes@key . . . \underline{1174}
\MT@define@inh@key@encoding  \underline{1221}
\MT@define@inh@keys . . . . . . \underline{1236}
\MT@define@number . . . . . . . . \underline{1522}
\MT@define@option . . . . . . . . \underline{1455}
\MT@define@optionX . . . . . . . \underline{1377}
\MT@define@set@key . . . . . . . . \underline{887}
\MT@define@set@key@size . . . . \underline{939}
\MT@define@set@keys . . . . . . . \underline{880}

\MT@edef@n . . . . . . . . . . . . . . . \underline{115}

\MT@encoding@check . . . . . . . \underline{1229}

\MT@error . . . . . . . . . . . . . . . . . . \underline{3} \MT@escapechar . . . . . . . . . . . . \underline{933} \MT@exitornot . . . . . . . . . . . . . . \underline{49}

\MT@expansionlevel . . . . . . . . \underline{102}

\MT@expdo . . . . . . . . . . . . . . . . \underline{455} \MT@expsplit . . . . . . . . . . . . . \underline{460}

\MT@file@catcodes . . . . . . . . . \underline{565}

\MT@find@file . . . . . . . . . . . . . \underline{538}

\MT@get@basefamily . . . . . . . . \underline{597}

\MT@get@charwd . . . . . . . . . . . . \underline{353}

\MT@get@codes@list . . . . . . . . \underline{663}
\MT@get@codes@name . . . . . . . \underline{1086}
\MT@get@extraopt . . . . . . . . . . \underline{484}

\MT@get@factor . . . . . . . . . . . . \underline{392}

\MT@get@highlevel . . . . . . . . . \underline{898}
\MT@get@inh@list . . . . . . . . . . \underline{663}
\MT@get@inh@name . . . . . . . . . \underline{1210}
\MT@get@listname . . . . . . . . . . \underline{617}

\MT@get@number . . . . . . . . . . . . \underline{802} \MT@get@size . . . . . . . . . . . . . \underline{949} \MT@get@slot . . . . . . . . . . . . . \underline{748} \MT@getlast . . . . . . . . . . . . . . \underline{928} \MT@getlast@ . . . . . . . . . . . . . \underline{930}

\MT@hop@else@fi . . . . . . . . . . . \underline{118}
\MT@ifdefined@c . . . . . . . . . . . \underline{119}
\MT@ifdefined@n . . . . . . . . . . . \underline{119}

\MT@ifempty . . . . . . . . . . . . . . \underline{152} \MT@ifnumber . . . . . . . . . . . . . \underline{162} \MT@in@list . . . . . . . . . . . . . . \underline{180} \MT@in@llist . . . . . . . . . . . . . \underline{188} \MT@increment . . . . . . . . . . . . . \underline{200} \MT@info . . . . . . . . . . . . . . . . . . . \underline{3} \MT@info@nl . . . . . . . . . . . . . . . . \underline{3} \MT@inhdo . . . . . . . . . . . . . . . \underline{1245} \MT@inhsplit . . . . . . . . . . . . \underline{1250} \MT@isachar . . . . . . . . . . . . . . \underline{724}

\MT@isacharacter . . . . . . . . . . \underline{715}

\MT@isaletter . . . . . . . . . . . . . \underline{706} \MT@let@cn . . . . . . . . . . . . . . . \underline{117} \MT@let@nc . . . . . . . . . . . . . . . \underline{116}

\MT@letterstring . . . . . . . . . . \underline{706}

\MT@load@list . . . . . . . . . . . . . \underline{516} \MT@loop . . . . . . . . . . . . . . . . . \underline{196}

\MT@next@listname . . . . . . . . . \underline{643}

\MT@pdftex@no . . . . . . . . . . . . . . \underline{26} \MT@permute . . . . . . . . . . . . . \underline{1274} \MT@permute@ . . . . . . . . . . . . \underline{1274} \MT@permute@@ . . . . . . . . . . . . \underline{1274} \MT@permute@@@ . . . . . . . . . . . \underline{1274}

\MT@permute@@@@ . . . . . . . . . . \underline{1274}
\MT@permute@@@@@ . . . . . . . . . \underline{1274}
\MT@permute@define . . . . . . . \underline{1351}

\MT@permute@reset . . . . . . . . \underline{1359}
\MT@permute@reset@ . . . . . . . \underline{1366}

\MT@pickupfont . . . . . . . . . . . . \underline{838}

\MT@prot@factor . . . . . . . . . . . \underline{102}

\MT@protdo . . . . . . . . . . . . . . . \underline{312}

\MT@protrusionlevel . . . . . . . \underline{102}

\MT@protsplit . . . . . . . . . . . . . \underline{317}

\MT@protsplit@val . . . . . . . . . \underline{327}
\MT@remove@spaces . . . . . . . . . \underline{206}

\MT@repeat . . . . . . . . . . . . . . . \underline{196}

\MT@resetefcode . . . . . . . . . . . \underline{446}
\MT@resetefcode@ . . . . . . . . . . \underline{439}
\MT@restore@catcodes . . . . . . . \underline{77}
\MT@set@exp@children . . . . . . \underline{477}
\MT@set@exp@codes . . . . . . . . . \underline{400}
\MT@set@exp@opt . . . . . . . . . . \underline{1111}

\MT@set@factor . . . . . . . . . . . \underline{1106}

\MT@set@prot@children . . . . . . \underline{384}
\MT@set@prot@codes . . . . . . . . \underline{292}

\MT@setupfont . . . . . . . . . . . . . \underline{207} \MT@shrink . . . . . . . . . . . . . . . \underline{102} \MT@size@check . . . . . . . . . . . \underline{1342} \MT@split@name . . . . . . . . . . . . \underline{280} \MT@step . . . . . . . . . . . . . . . . . \underline{102} \MT@stretch . . . . . . . . . . . . . . \underline{102} \Mt@testrest . . . . . . . . . . . . . \underline{741}

\MT@tmp@setname . . . . . . . . . . . \underline{873}

\MT@two@tokens . . . . . . . . . . . . \underline{798} \MT@use@sets . . . . . . . . . . . . . \underline{991} \MT@vinfo . . . . . . . . . . . . . . . . . . \underline{3} \MT@warning . . . . . . . . . . . . . . . . \underline{3} \MT@warning@nl . . . . . . . . . . . . . . \underline{3} \MT@xadd . . . . . . . . . . . . . . . . . \underline{169}

N ngerman (package) . . . . . . . . . . . 15

P pdfcprot (package) . 2, 3, 13, 19, 38 pifont (package) . . . . . . . . . . . . 38

                                   \ProcessOptionsWithKV . . . . . \underline{1548}

protrusion (option) . . . . . . . . . . . 3 pstricks (package) . . . . . . . . 4, 57

R relsize (package) . . . . . . . . . . . 42

S selected (option) . . . . . . . . . . . . 5 \SetExpansion . . . . . . . . . . 10, \underline{1069} \SetProtrusion . . . . . . . . . 8, \underline{1055} shrink (option) . . . . . . . . . . . . . . 5 step (option) . . . . . . . . . . . . . . . . 5 stretch (option) . . . . . . . . . . . . . 5

T tipa (package) . . . . . . . . . . . . . . 38

U

                                   \UseMicroTypeSet . . . . . . . . 8, \underline{982}

V verbose (option) . . . . . . . . . . . . . 4

Z zefonts (package) . . . . . . 12, 13, 44