The microtype package

The microtype package
An interface to the micro-typographic extensions of pdfTEX
R Schlicht
[email protected]
v1.7 — 2005/03/23
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
2.1 General Options . . . . . . . . . . . . . . . . . . . . . . . .
2.2 Option for Character Protrusion . . . . . . . . . . . . . . . .
2.3 Options for Font Expansion . . . . . . . . . . . . . . . . . .
4
4
6
6
3 User Command
7
4 Configuration
4.1 Declaring Font Sets . . . . . . . . . . . . . . . . . . . . . . .
4.2 Micro Fine Tuning . . . . . . . . . . . . . . . . . . . . . . .
7
7
9
[Character Protrusion – 9]
[Font Expansion – 11]
4.3 Character Inheritance . . . . . . . . . . . . . . . . . . . . .
4.4 Configuration Files . . . . . . . . . . . . . . . . . . . . . . .
12
13
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.
1
5 Caveats
14
6 Contributions
15
7 Acknowledgments
15
8 References
16
9 Short History
16
10 Implementation
10.1 Requirements . . . . . . . . . . . . . . . . . . . . . . . . . .
10.2 Auxiliary macros . . . . . . . . . . . . . . . . . . . . . . . .
10.3 Setting up a font . . . . . . . . . . . . . . . . . . . . . . . .
18
19
23
27
[Protrusion – 30] [Expansion – 33] [Generic macros – 36]
[Hook into LATEX’s font selection – 45]
10.4 Configuration . . . . . . . . . . . . . . . . . . . . . . . . . .
47
[Font Sets – 47] [Declarations – 53] [Fine Tuning – 54]
[Character Inheritance – 58] [Permutation – 60]
10.5 User Command . . . . . . . . . . . . . . . . . . . . . . . . .
10.6 Package Options . . . . . . . . . . . . . . . . . . . . . . . .
64
66
11 Configuration Files
11.1 Character Inheritance . . . . . . . . . . . . . . . . . . . . .
11.2 Font Expansion . . . . . . . . . . . . . . . . . . . . . . . . .
11.3 Character Protrusion . . . . . . . . . . . . . . . . . . . . . .
73
74
75
77
[Default – 77] [Italics – 82] [Small caps – 88] [textcomp – 92]
[Math – 96]
12 Auxiliary File for Micro Fine Tuning
102
A Change History
104
B Index
108
List of Tables
1 Predefined font sets . . . . . . . . . . . . . . . . . . . . . . . . .
2 Fonts with tailored protrusion settings . . . . . . . . . . . . . . .
3 Order for matching font attributes . . . . . . . . . . . . . . . . .
9
13
39
MICRO-TYPOGRAPHY WITH PDFTEX
1
3
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 LATEX user interface for
quite some time. Then, the pdfcprot package was published [pdfcprot],
which allowed LATEX 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 LATEX users:
Font expansion can now take place automatically. That is, pdfTEX no longer
needs the expanded font metrics but will calculate them at run-time, and
completely in memory.
INVOKING THE PACKAGE
4
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 LATEX 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 underlined value may be omitted
in the options list; some values are hplaceholdersi; multiple values, where
allowed, must be enclosed in braces).
protrusion true, false, compatibility, nocompatibility, hfont set namei
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.
INVOKING THE PACKAGE: General Options
5
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 section 4.1 for
a detailed discussion.
DVIoutput 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 will 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 true, false
final If the draft option is passed to the package, font expansion and character
protrusion will be disabled. The draft and final options may also be inherited from the class options; of course, you can override them in the package
options.
verbose true, false, errors
Information on the settings used for each font will be written into the log
file if you enable the verbose option, which is disabled by default.
When microtype encounters a problem that is not fatal (e. g., an unknown character in the settings, or non-existent settings), it will by default only issue a warning and try to continue. Loading the package with
verbose=errors will turn all warnings into errors, so that you can be sure
that no problem will go unnoticed.
3 TEX systems are beginning to switch to pdfTEX as the default engine even for DVI output.
INVOKING THE PACKAGE: Option for Character Protrusion
2.2
6
Option for Character Protrusion
factor hnumberi (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 generally satisfied 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).
2.3
Options for Font Expansion
auto true, false
As noted in chapter 1, the expanded versions of the fonts may be calculated
automatically. This option is true by default provided that pdfTEX’s version
is found to be 1.20 or higher and the output mode is PDF; otherwise, it will
be disabled. If auto is set to false, the fonts for all expansion steps must
exist.
stretch hnumberi (20)
shrink You may specify the stretchability and shrinkability of a font, i. e. the maxi-
mum amount that a font may be stretched or shrunk. 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.
step hnumberi (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.
Therefore, the following lines are all equivalent:
\usepackage[stretch=20,shrink=20]{microtype}
\usepackage[stretch=20,step=4]{microtype}
\usepackage{microtype}
CONFIGURATION
7
selected true, false
When applying font expansion, it is possible to restrict the expansion of
some characters if they are more sensitive to deformation than others (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 {hkey = value listi}
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 values 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
4.1
Configuration
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 that should get the benefit of micro-typographic
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] {hset namei} {hset of fontsi}
\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]{hset namei}
The starred version of the command declares and activates the font set
at the same time.
CONFIGURATION: Declaring Font Sets
8
The set of fonts is specified by assigning values to the NFSS font attributes: encoding, family, series, shape, and size (cf. [LATEX 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}
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 another encoding.
Neither will fonts in bold face, or huge fonts. Etc. (The ‘basictext’ 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. The only condition for this set is that the encoding
must match. (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
\hvalueidefault, 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 \hcharacteristicidefault, 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. You may also specify ranges (e. g.,
small-large); while the lower boundary is included in the range, the upper boundary is not. Thus, 12-16 would match 12, 13.5, and 15.999 pt,
e. g., but not 16 pt. You are allowed to omit the lower or upper bound (-10,
large-).
4 Note that this expansion will take place immediately, so you should make all relevant
changes before loading this package.
9
CONFIGURATION: Micro Fine Tuning
normalfont
basictext
(basicmath)
alltext
(allmath)
all
encoding
\encodingdefault
T1, OT1, LY1
(OML, OMS)
T1, OT1, LY1, TS1
(OML, OMS)
–
family
\familydefault
–
–
series
shape
size
\seriesdefault
\shapedefault
\normalsize
\rmdefault,
\sfdefault
m
–
\normalsize,
\footnotesize,
\small, \large
–
–
–
–
–
–
Table 1: Predefined font sets
Table 1 lists all predefined font sets. They may also be activated by
passing their name to the expansion resp. protrusion option when loading
the package, for example:
\usepackage[protrusion=allmath,expansion=basicmath]{microtype}
\UseMicroTypeSet [protrusion|expansion] {hset namei}
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. section 4.4).
4.2
Micro Fine Tuning
Every character asks for a particular amount of protrusion. It may also be
desirable to restrict the maximum expansion of certain characters. Furthermore, since every font looks different, settings have to be specific to a font
or set of fonts. This package offers flexible and straight-forward methods
of customizing these finer aspects of micro-typography.
4.2.1
Character Protrusion
\SetProtrusion [hoptionsi] {hset of fontsi} {hprotrusion settingsi}
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,
} }
CONFIGURATION: Micro Fine Tuning
10
which would result in the character ‘A’ being protruded by 5% of its width
on both sides, and the left quote character by 70% of its width into the
left margin. This would apply to all font shapes, series and sizes of the
Computer Modern Roman family in encoding T1.
The protrusion settings consist of hcharacteri = hprotrusion factorsi pairs.
The hcharactersi may be specified either as a single character (‘A’), as a
text symbol command (‘\textquoteleft’), or as a slot number: three digits for decimal notation, prefixed with " for hexadecimal, with ’ for octal
(e. g., the ‘fl’ ligature in T1 encoding: 029, "1D, ’35). 8-bit characters may be
entered directly or in the LATEX 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 hprotrusion factorsi designate the amount that a character should
be protruded into the left margin (first value) respectively into the right
margin (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 to which the settings should apply are declared using the same syntax of hfont axisi = hvalue listi pairs as in the command
\DeclareMicroTypeSet.
To find the matching settings for a given font the package will try all
combinations of font encoding, family, series, shape and size, with decreasing significance in this order. For instance, if both settings for the current family (say, OT1/cmr///) and settings for italic fonts in normal weight
(OT1//m/it/) exist, those for the Computer Modern Roman font would be
applied.5 The encoding must always match.
Optional Options:
name You may assign a name to the protrusion settings, so that you are able
to load it by another list.
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).
5 For the interested, table 3 on page 39 presents the exact order.
CONFIGURATION: Micro Fine Tuning
11
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 [hoptionsi] {hset of fontsi} {hexpansion settingsi}
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. Otherwise, settings
in \SetExpansion will be ignored.
The expansion settings consist of hcharacteri = hexpansion factori 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 set of fonts
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
stretch
{ series
encoding
{ }
=
=
=
=
T1-default,
10 ]
bf*,
T1 }
CONFIGURATION: Character Inheritance
12
The bold font would thus inherit the settings defined in the list ‘T1-default’,
but would only be allowed to be expanded by a maximum amount of 1%.
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 for
single fonts or font sets; setting it globally in the package options wouldn’t
make much sense – for that, you use the stretch etc. options.
These options in the optional 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] {hfont seti} {hinheritance listi}
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 hbase characteri = hlist of inheriting charactersi. Unless
you are using a different encoding or a very peculiarly shaped font, there
should be no need to change the default character inheritance settings.
In the main configuration file microtype.cfg and the other font-specific
configuration files, you can find examples of all these commands.
13
CONFIGURATION: Configuration Files
Font family (NFSS code)
Series
Shapes
TS1
Generic
Computer Modern Roman (cmr)b
Bitstream Charter (bch)
Adobe Garamond (pad, padx, padj)
Adobe Minion (pmnx, pmnj)
Palatino (ppl, pplx, pplj)
Times (ptm, ptmx, ptmj)
m
m
m
m
m
m
m
n, (it, sl, sc)a
n, it (sl)c , sc
n, it (sl)c , sc
n, it (sl)c , sc
n, it (sl)c , sc, si
n, it (sl)c , sc
n, it (sl)c , sc
(•)a
•
•
•
•
(•)a
(•)a
Math
•
a Incomplete
b Also used for: Latin Modern (lmr), ae (aer), zefonts (zer), eco (cmor), hfoldsty (hfor)
c Settings taken from italic shape
Table 2: Fonts with tailored protrusion settings
4.4
Configuration Files
The default configuration, consisting of inheritance settings for OT1, LY1
and T1 encoding, declarations of font sets and alias fonts, and generic protrusion and expansion settings, 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 font family, you should put them into a separate file, whose name must
be: ‘mt-hfont familyi.cfg’ (e. g. ‘mt-pad.cfg’), and may contain the commands \SetProtrusion, \SetExpansion and \DeclareCharacterInheritance.
These files will be loaded automatically 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, Adobe Garamond and Minion6
and for Bitstream Charter. Table 2 lists them all.
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 {hfont namei} {halias fonti}
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
6 By courtesy of Harald Harders ([email protected]).
CAVEATS
14
clones of the Computer Modern fonts, so that it is not necessary 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.
\LoadMicroTypeFile {hfont namei}
In rare cases, it might be necessary to load a configuration file manually,
for instance, from within another configuration file, or to be able to extend
settings defined in a file that would otherwise not be loaded automatically,
or would be loaded too late.7
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 expanded
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.
7 Font package authors might also want to have a look at the hook \MicroType@Hook,
described in the implementation section.
ACKNOWLEDGMENTS
15
Compatibility. The package should work happily together with all other
LATEX packages (except pdfcprot). However, life isn’t perfect, so problems
are to be expected. Currently, I am only aware of the following issues concerning the loading order of packages:
• All packages that change the default fonts and encodings (e. g.
mathpazo, fontenc) should be loaded before microtype, so that variables used in the configuration file (e. g. ‘rm*’ for \rmdefault) don’t
expand to a different value than in the body of the document (as
explained in section 4.1).
• The CJK package must be loaded before microtype.8
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: [email protected]
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 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.
Andreas Bühmann has suggested the possibility to specify ranges of
font sizes, and resourcefully assisted in implementing this. He also came
up with some good ideas for the management of complex configurations.
The following people have reported bugs or helped otherwise (in
chronological order): Ulrich Dirr, Tom Kink, Herb Schulz, Michael Hoppe,
Gary L. Gray, Georg Verweyen, Christoph Bier, Peter Muthesius, and Bernard Gaulle.
8 And it might still not work. I simply don’t know, since I know nothing of CJK. Feedback
on the interaction of both packages – positive or negative – would be appreciated.
9 Should you have lots of pdfcprot configuration files lying around, I can also provide
you with a TEX conversion script. Just ask me.
SHORT HISTORY
8
16
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 Meeting,
pp. 146–148. (Online at http://www.tug.org/TUGboat/Articles/tb22-3/
tb72thanh.pdf)
LATEX3 Project Team, LATEX 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 at /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.7 (23. 3. 2005)
Possibility to specify ranges of font sizes in the set declarations and
protrusion and expansion settings (see sections 4.1 and 4.2)
Always take font size into account when trying to find protrusion resp.
expansion settings for a given font (see section 4.2)
New command \LoadMicroTypeFile to load a font configuration file
(see section 4.4)
New option ‘verbose=errors’ to turn all warnings into errors
Compatibility with the chemsym and statex packages
Disable expansion inside \showhyphens
Warning when running in draft mode
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
SHORT HISTORY
17
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 LATEX 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
IMPLEMENTATION
10
18
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 h*packagei
2 \RequirePackage{keyval}[1997/11/10]
\MT@error
\MT@warning
\MT@warning@nl
\MT@warn@err
\MT@info
\MT@info@nl
\MT@vinfo
Communicate.
3 \def\MT@error{\PackageError{microtype}}
4 \def\MT@warning{\PackageWarning{microtype}}
5 \def\MT@warning@nl#1{\MT@warning{#1\@gobble}}
6 \def\MT@warn@err#1{\MT@error{#1}{%
7
This error message appears because you loaded the package\MessageBreak
8
with ‘verbose=errors’.}}
9 \def\MT@info{\PackageInfo{microtype}}
10 \def\MT@info@nl#1{\MT@info{#1\@gobble}}
11 h!debugi\let\MT@vinfo\@gobble
12 hdebugi\let\MT@vinfo\MT@info@nl
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.
13 \newcommand{\DeclareMicroTypeSet}[3][]{}
14 \newcommand{\UseMicroTypeSet}[2][]{}
15 \newcommand{\DeclareMicroTypeAlias}[2]{}
16 \newcommand{\SetProtrusion}[3][]{}
17 \newcommand{\SetExpansion}[3][]{}
18 \newcommand{\DeclareCharacterInheritance}[3][]{}
19 \newcommand{\LoadMicroTypeFile}[1]{}
IMPLEMENTATION: Requirements
19
20 \newcommand{\microtypesetup}[1]{}
This command also has a starred version.
21 \def\DeclareMicroTypeSet{%
22
\@ifstar
23
{\@ifnextchar[\MT@DeclareSet{\MT@DeclareSet[]}}%
24
{\@ifnextchar[\MT@DeclareSet{\MT@DeclareSet[]}}%
25 }
26 \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.
27 \@onlypreamble{\DeclareMicroTypeSet}
28 \@onlypreamble{\UseMicroTypeSet}
Debug. Cases for \tracingmicrotype:
0: almost none
1: + configuration
2: + heirs
3: + slots
4: + factors
29 h*debugi
30 \newcount\tracingmicrotype
31 \tracingmicrotype=2
32 \def\MT@dinfo#1#2{\ifnum\tracingmicrotype>#1\relax\MT@info{#2}\fi}
33 \def\MT@dinfo@nl#1#2{\ifnum\tracingmicrotype>#1\relax\MT@info@nl{#2}\fi}
34 h/debugi
10.1
\MT@pdftex@no
Requirements
pdfTEX’s features for which we provide an interface here haven’t always
been available, and some specifics have changed over time. Therefore, we
have to test which pdfTEX we’re using, if any. \MT@pdftex@no will be used
throughout the package to respectively do the right thing.
Currently, there are five cases:
0: not running pdfTEX
1: pdftex (<0.14f)
2: + micro-typographic extensions (0.14f, 0.14g)
3: + protrusion relative to 1em (>0.14h)
4: + automatic font expansion; default \efcode = 1000 (>= 1.20a)
35 \let\MT@pdftex@no\z@
IMPLEMENTATION: Requirements
20
Old packages might have defined \pdftexversion to \relax.
36 \ifx\pdftexversion\@undefined \else
37
\ifx\pdftexversion\relax \else
38 hdebugi\MT@dinfo@nl{-1}{running pdftex \the\pdftexversion(\pdftexrevision)}
39
\def\MT@pdftex@no{4}
40
\ifnum\pdftexversion < 120
41
\let\MT@pdftex@no\thr@@
42
\ifnum\pdftexversion = 14
43
\ifnum \expandafter‘\pdftexrevision < ‘h
44
\let\MT@pdftex@no\tw@
45
\fi
46
\ifnum \expandafter‘\pdftexrevision < ‘f
47
\let\MT@pdftex@no\@ne
48
\fi
49
\else
50
\ifnum\pdftexversion < 14
51
\let\MT@pdftex@no\@ne
52
\fi
53
\fi
54
\fi
55
\fi
56 \fi
57 hdebugi\MT@dinfo@nl{-1}{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.
58 \let\MT@exitornot\relax
59 \ifnum\MT@pdftex@no<\tw@
60
\def\MT@exitornot{%
61
\AtEndOfPackage{\let\@unprocessedoptions\relax}%
62
\let\CurrentOption\@empty
63
\endinput
64
}
65
\MT@warning@nl{%
66
\ifcase\MT@pdftex@no
67
You don’t seem to be using pdftex.\MessageBreak
68
\or
69
You are using a pdftex version older than 0.14f.\MessageBreak
70
microtype won’t work with such antiquated versions.\MessageBreak
71
Please install a newer version of pdftex.\MessageBreak
72
\fi
73
All micro-typographic features will be disabled%
74
}
75 \fi
76 \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.
77 \def\MT@catcodes{%
IMPLEMENTATION: Requirements
78
79
80
81
82
83
84
85 }
\MT@restore@catcodes
21
\@makeother\-%
\@makeother\,%
\@makeother\/%
\@makeother\‘%
\@makeother\’%
\@makeother\"%
\catcode‘\^7\relax
Polite as we are, we’ll restore them afterwards.
86 \def\MT@restore@catcodes#1{%
87
\ifx\relax#1\else
88
\noexpand\catcode‘\noexpand#1\the\catcode‘#1\relax
89
\expandafter\MT@restore@catcodes
90
\fi
91 }
92 \edef\MT@restore@catcodes{%
93
\MT@restore@catcodes\-\,\/\‘\’\"\^\relax
94 }
95 \MT@catcodes
96 \AtEndOfPackage{\MT@restore@catcodes}
\MT@pdfcprot@error
Our competitor, the pdfcprot package, must not be tolerated!
97 \def\MT@pdfcprot@error{%
98
\MT@error{%
99
Detected the ‘pdfcprot’ package!\MessageBreak
100
‘microtype’ and ‘pdfcprot’ may not be used together}%
101
{The ‘pdfcprot’ package provides an interface to
102
character protrusion.\MessageBreak
103
So does the ‘microtype’ package.
104
Using both packages at the same\MessageBreak
105
time will almost certainly lead to undesired results.
106
Have your choice!}%
107 }
108 \@ifpackageloaded{pdfcprot}\MT@pdfcprot@error\relax
\MT@setupfont@hook
A hook for compatibility with other packages. Inside the preamble, we
check for the packages each time a font is set up. Thus, it will work regardless when the packages are loaded.
109 \def\MT@setupfont@hook{%
The chemsym package redefines, among other commands, the Hungarian
umlaut \H in a way that cannot be parsed by microtype. As a work-around,
we restore the usual definition of \H before setting up the font (which will
be done inside a group).
110
111
112
\@ifpackageloaded{chemsym}{%
\let\H\h
}\relax
Same for statex.
113
114
115
\@ifpackageloaded{statex}{%
\let\H\STATEXH
\let\c\STATEXc
IMPLEMENTATION: Requirements
116
117
118
119
120
121 }
22
\let\^\STATEXhat
\let\~\STATEXtilde
\let\’\STATEXsinglequote
\let\.\STATEXdot
}\relax
Check again at the beginning of the document.
122 \AtBeginDocument{%
123
\@ifpackageloaded{pdfcprot}\MT@pdfcprot@errror\relax
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.21, so we no longer warn.
We can clean up \MT@setupfont@hook now.
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140 }
\let\MT@setupfont@hook\@empty
\@ifpackageloaded{chemsym}{%
\g@addto@macro\MT@setupfont@hook{%
\let\H\h
}%
}\relax
\@ifpackageloaded{statex}{%
\g@addto@macro\MT@setupfont@hook{%
\let\H\STATEXH
\let\^\STATEXhat
\let\~\STATEXtilde
\let\’\STATEXsinglequote
\let\c\STATEXc
\let\.\STATEXdot
}%
}\relax
We need a font (the minimal class doesn’t load one).
141 \expandafter\ifx\the\font\nullfont\normalfont\fi
\ifMT@DVIoutput
\ifMT@draft
\ifMT@protrusion
\ifMT@expansion
\ifMT@auto
\ifMT@selected
These are the global switches . . .
142 \newif\ifMT@DVIoutput
143 \newif\ifMT@draft
144 \newif\ifMT@protrusion
145 \newif\ifMT@expansion
146 \newif\ifMT@auto
147 \newif\ifMT@selected
\MT@ex@level
. . . and numbers.
\MT@pr@level
148 \let\MT@ex@level\tw@
149 \let\MT@pr@level\tw@
150 \let\MT@factor\@m
151 \let\MT@stretch\m@ne
152 \let\MT@shrink\m@ne
153 \let\MT@step\m@ne
\MT@factor
\MT@stretch
\MT@shrink
\MT@step
IMPLEMENTATION: Auxiliary macros
\MT@factor@default
\MT@stretch@default
\MT@shrink@default
\MT@step@default
Default values.
154 \def\MT@factor@default{1000 }
155 \def\MT@stretch@default{20 }
156 \def\MT@shrink@default{20 }
157 \def\MT@step@default{4 }
10.2
\MT@etex@no
23
Auxiliary macros
Test whether we are using e-TEX. Cases:
0: not running e-TEX
1: running e-TEX
158 \let\MT@etex@no\z@
159 \ifx\eTeXversion\@undefined \else
160 \ifx\eTeXversion\relax \else
161
\ifnum\eTeXversion>\z@
162
\let\MT@etex@no\@ne
163
\fi
164 \fi
165 \fi
\MT@def@n
This is \@namedef.
166 \def\MT@def@n#1{\expandafter\def\csname #1\endcsname}
\MT@edef@n
Its expanding version.
167 \def\MT@edef@n#1{\expandafter\edef\csname #1\endcsname}
\MT@let@nc
\let a \csname sequence to a command.
168 \def\MT@let@nc#1{\expandafter\let\csname #1\endcsname}
\MT@let@cn
\let a command to a \csname sequence.
169 \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.
170 \def\MT@hop@else@fi#1\else#2\fi{\fi#1}
\MT@ifdefined@c
Wrapper for testing whether command resp. \csname sequence is defined.
\MT@ifdefined@n
171 \ifcase\MT@etex@no \MT@hop@else@fi
172 hdebugi\MT@dinfo@nl{-1}{not using etex}%
173
\def\MT@ifdefined@c#1{%
174
\ifx#1\@undefined
175
\expandafter\@secondoftwo
176
\else
177
\expandafter\@firstoftwo
178
\fi
179
}
180
\def\MT@ifdefined@n#1{%
181
\expandafter\ifx\csname#1\endcsname\relax
182
\expandafter\@secondoftwo
183
\else
184
\expandafter\@firstoftwo
IMPLEMENTATION: Auxiliary macros
24
185
\fi
186
}
187 \else
If we are running e-TEX, we will use its primitives \ifdefined and
\ifcsname, which decreases memory use substantially.
188 hdebugi\MT@dinfo@nl{-1}{using etex}%
189
\def\MT@ifdefined@c#1{%
190
\ifdefined#1%
191
\expandafter\@firstoftwo
192
\else
193
\expandafter\@secondoftwo
194
\fi
195
}
196
\def\MT@ifdefined@n#1{%
197
\ifcsname#1\endcsname
198
\expandafter\@firstoftwo
199
\else
200
\expandafter\@secondoftwo
201
\fi
202
}
203 \fi
\MT@ifempty
Test whether argument is empty.
204 \begingroup
205 \catcode‘\%=12\relax
206 \catcode‘\&=14\relax
207 \gdef\MT@ifempty#1{&
208 \if %#1%&
209
\expandafter\@firstoftwo
210 \else
211
\expandafter\@secondoftwo
212 \fi
213 }
214 \endgroup
\MT@ifnumber
Test whether argument is a number [0-9] (using an old trick by Mr. Arseneau).
215 \def\MT@ifnumber#1{%
216
\if!\ifnum9<1#1!\else_\fi
217
\expandafter\@firstoftwo
218
\else
219
\expandafter\@secondoftwo
220
\fi
221 }
\MT@xadd
Add item to a list. (Yes, definitions must be global.)
222 \def\MT@xadd#1#2{%
223
\expandafter\ifx#1\relax
224
\xdef#1{#2}%
225
\else
226
\begingroup
227
\edef\x{#2}%
228
\toks@=\expandafter\expandafter\expandafter{\expandafter#1\x}%
IMPLEMENTATION: Auxiliary macros
229
230
231
232 }
\ifMT@inlist@
\MT@lt
\MT@in@list
\MT@in@llist
\xdef#1{\the\toks@}%
\endgroup
\fi
Test whether item is in list (separated by \MT@lt; allows to operate on the
list items).
233 \newif\ifMT@inlist@
234 \let\MT@lt\@empty
235 \def\MT@in@list#1#2{%
236
\MT@inlist@false
237
\def\MT@given{#1}%
238
\def\MT@lt##1{%
239
\def\MT@next{##1}%
240
\ifx\MT@next\MT@given
241
\MT@inlist@true
242
\fi
243
}#2%
244 }
Test whether item is in list (separated by a comma; faster for long lists,
since the command has to be executed once only).
245 \def\MT@in@llist#1#2{%
246
\MT@inlist@false
247
\def\MT@in@l##1#1,##2\@nil{%
248
\ifx\\##2\\\else
249
\MT@inlist@true
250
\fi
251
}%
252
\expandafter\MT@in@l#2,#1,\@nil
253 }
\MT@in@rlist
Test whether a size is in the list of ranges.
254 \def\MT@in@rlist#1#2{%
255
\MT@inlist@false
256
\def\MT@range##1##2##3{%
257
\MT@ifeq{##2}\m@ne{%
258
\ifdim #1pt = ##1pt
259
\MT@inlist@true
260
\def\MT@size@name{##3}%
261
\fi
262
}{%
263
\ifdim#1pt < ##1pt \else \ifdim#1pt < ##2pt
264
\MT@inlist@true
265
\def\MT@size@name{##3}%
266
\fi\fi
267
}%
268
}%
269
#2%
270 }
\MT@ifgt
Test whether dimensions are smaller, larger resp. equal.
\MT@iflt
271 \def\MT@ifgt#1#2{%
272
\ifdim #1pt > #2pt
\MT@ifeq
25
IMPLEMENTATION: Auxiliary macros
26
273
\expandafter\@firstoftwo
274
\else
275
\expandafter\@secondoftwo
276
\fi
277 }
278 \def\MT@iflt#1#2{%
279
\ifdim #1pt < #2pt
280
\expandafter\@firstoftwo
281
\else
282
\expandafter\@secondoftwo
283
\fi
284 }
285 \def\MT@ifeq#1#2{%
286
\ifdim #1pt = #2pt
287
\expandafter\@firstoftwo
288
\else
289
\expandafter\@secondoftwo
290
\fi
291 }
This is the same as LATEX’s \loop, which we mustn’t use, since this could
\MT@repeat confuse an outer \loop in the document.
\MT@loop
292 \def\MT@loop#1\MT@repeat{%
293
\def\MT@iterate{#1\relax\expandafter\MT@iterate\fi}%
294
\MT@iterate
295
\let\MT@iterate\relax
296 }
297 \let\MT@repeat\fi
\MT@count
\MT@increment
Increment macro h#1i by one. Saves using up too many counters.
298 \newcount\MT@count
299 \ifcase\MT@etex@no
300
\def\MT@increment#1{%
301
\MT@count=#1
302
\advance\MT@count \@ne
303
\edef#1{\number\MT@count}%
304
}
305 \else
The e-TEX way is slightly faster.
306
\def\MT@increment#1{%
307
\edef#1{\number\numexpr #1 + 1 \relax}%
308
}
309 \fi
\MT@scale
Multiply and divide a counter. If we are using e-TEX, we will use its \numexpr
primitive. This has the advantage that it is less likely to run into arithmetic
overflow. The result of the division will be rounded instead of truncated.
Therefore, we’ll get a different result in about half of the cases.
310 \ifcase\MT@etex@no
311
\def\MT@scale#1#2#3{%
312
\multiply #1 #2 \relax
313
\ifnum #3 = \z@ \else
IMPLEMENTATION: Setting up a font
27
314
\divide #1 #3 \relax
315
\fi
316
}
317 \else
318
\def\MT@scale#1#2#3{%
319
\ifnum #3 = \z@
320
#1=\numexpr #1 * #2 \relax
321
\else
322
#1=\numexpr #1 * #2 / #3 \relax
323
\fi
324
}
325 \fi
\MT@remove@spaces
Remove spaces around h#1i (\KV@@sp@def is from keyval).
326 \def\MT@remove@spaces#1{\expandafter\KV@@sp@def\expandafter#1\expandafter{#1}}
Some abbreviations. Thus, we can have short command names but fulllength log output.
327 \def\MT@abbr@pr{protrusion}
328 \def\MT@abbr@ex{expansion}
329 \def\MT@abbrx@protrusion{pr}
330 \def\MT@abbrx@expansion{ex}
331 \def\MT@abbr@pr@c{protrusion codes}
332 \def\MT@abbr@ex@c{expansion codes}
333 \def\MT@abbr@pr@inh{protrusion inheritance}
334 \def\MT@abbr@ex@inh{expansion inheritance}
10.3
\MT@setupfont
Setting up a font
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.
335 \def\MT@setupfont{%
336
\ifx\MT@vinfo\MT@info@nl
337
\MT@info{Setting up font ‘\expandafter\string\font@name’}\fi
We might have to disable stuff when used together with adventurous packages (currently, chemsym and statex).
338
\MT@setupfont@hook
The font properties must be extracted from \font@name, since the current
value of \f@encoding and friends may be wrong!
339
340
\expandafter\expandafter\expandafter
\MT@split@name\expandafter\string\font@name\@nil
Try to find a configuration file for the current font family.
341
342
\MT@find@file{\MT@family}%
\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 a second later in \selectfont, anyway – three lines, to be exact).
IMPLEMENTATION: Setting up a font
343
28
\ifx\f@encoding\cf@encoding\else\@@enc@update\fi
Protrusion has to be set up first, says Thành!
344
345
346
347
348
349
350
351
352
353
354
355
356 }
\MT@checkfor{pr}%
\ifMT@font@pr
\MT@set@prot@codes
\else
\MT@vinfo{... No protrusion}%
\fi
\MT@checkfor{ex}%
\ifMT@font@ex
\MT@set@exp@codes
\else
\MT@vinfo{... No expansion}%
\fi
We check all features of the current font against the lists of the currently
\ifMT@font@ex active font set, and set \MT@font@ex resp. \MT@font@pr accordingly.
\ifMT@font@pr
\MT@checkfor
357 \newif\ifMT@font@pr
358 \newif\ifMT@font@ex
359 \def\MT@checkfor#1{%
(but only if protrusion/expansion isn’t globally set to false)
360
\expandafter\csname ifMT@\csname MT@abbr@#1\endcsname\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.
\csname MT@font@#1true\endcsname
\MT@checklist{#1}{encoding}%
361
362
family is special, since there may also be an alias name.
\MT@checklist@family{#1}%
\MT@checklist{#1}{series}%
\MT@checklist{#1}{shape}%
363
364
365
size is special since it may contain ranges.
366
367
368 }
\MT@checklist
\MT@checklist@size{#1}%
\fi
If we’ve already found that a property is not in the list, we don’t have to
bother any more.
369 \def\MT@checklist#1#2{%
370
\csname ifMT@font@#1\endcsname\MT@checklist@{#1}{#2}\fi
371 }
\MT@checklist@
372 \def\MT@checklist@#1#2{%
373
\edef\@tempa{\csname MT@#1@setname\endcsname}%
374
\MT@ifdefined@n{MT@#1list@#2@\@tempa}{%
Begin a \expandafter orgy to test whether the font characteristic is in the
list.
375
\def\@tempb{\csname MT@#1list@#2@\@tempa\endcsname}%
IMPLEMENTATION: Setting up a font
29
376
\expandafter\expandafter\expandafter\MT@in@list
377
\expandafter\expandafter\expandafter
378
{\csname MT@#2\endcsname}\@tempb
379
\ifMT@inlist@
380 hdebugi\MT@dinfo@nl{0}{\@nameuse{MT@abbr@#1}: #2 ‘\@nameuse{MT@#2}’ in list}%
381
\else
382
\csname MT@font@#1false\endcsname
383 hdebugi\MT@dinfo@nl{0}{\@nameuse{MT@abbr@#1}: #2 ‘\@nameuse{MT@#2}’ not in list}%
384
\fi
385
}{%
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.
386 hdebugi\MT@dinfo@nl{0}{\@nameuse{MT@abbr@#1}: #2 list empty}%
387
}%
388 }
\MT@checklist@family
Also test for the alias font.
389 \def\MT@checklist@family#1{%
390
\csname ifMT@font@#1\endcsname\MT@checklist@family@{#1}\fi
391 }
\MT@checklist@family@
392 \def\MT@checklist@family@#1{%
393
\MT@checklist@{#1}{family}%
Only try if the original font is not in the list.
394
\csname ifMT@font@#1\endcsname\else
395
\ifx\MT@familyalias\@empty\else
396
\edef\@tempa{\csname MT@#1@setname\endcsname}%
397
\def\@tempb{\csname MT@#1list@family@\@tempa\endcsname}%
398
\expandafter\expandafter\expandafter\MT@in@list
399
\expandafter{\MT@familyalias}\@tempb
400
\ifMT@inlist@
401
\csname MT@font@#1true\endcsname
402 hdebugi\MT@dinfo@nl{0}{\@nameuse{MT@abbr@#1}: alias ‘\MT@familyalias’ in list}%
403 hdebugi\else\MT@dinfo@nl{0}{\@nameuse{MT@abbr@#1}: alias ‘\MT@familyalias’ not in list}%
404
\fi
405
\fi
406
\fi
407 }
\MT@checklist@size
Test whether font size is in list of size ranges.
408 \def\MT@checklist@size#1{%
409
\csname ifMT@font@#1\endcsname\MT@checklist@size@{#1}\fi
410 }
\MT@checklist@size@
411 \def\MT@checklist@size@#1{%
412
\edef\@tempa{\csname MT@#1@setname\endcsname}%
413
\MT@ifdefined@n{MT@#1list@size@\@tempa}{%
414
\def\MT@listname{\csname MT@#1list@size@\@tempa\endcsname}%
415
\expandafter\MT@in@rlist\expandafter
416
{\MT@size}\MT@listname
417
\ifMT@inlist@
IMPLEMENTATION: Setting up a font
30
418 hdebugi\MT@dinfo@nl{0}{\@nameuse{MT@abbr@#1}: size ‘\MT@size’ in list}%
419
\else
420
\csname MT@font@#1false\endcsname
421 hdebugi\MT@dinfo@nl{0}{\@nameuse{MT@abbr@#1}: size ‘\MT@size’ not in list}%
422
\fi
423
}{%
424 hdebugi\MT@dinfo@nl{0}{\@nameuse{MT@abbr@#1}: size list empty}%
425
}%
426 }
\MT@split@name
\MT@encoding
\MT@family
\MT@series
\MT@shape
\MT@size
\MT@familyalias
Split up the font name.
427 \def\MT@split@name#1/#2/#3/#4/#5\@nil{%
428
\def\MT@encoding{#1}%
429
\def\MT@family{#2}%
430
\def\MT@series{#3}%
431
\def\MT@shape{#4}%
432
\def\MT@size{#5}%
Alias family?
433
434
435
436
437 }
\let\MT@familyalias\@empty
\MT@ifdefined@n{MT@\MT@family @alias}{%
\MT@let@cn\MT@familyalias{MT@\MT@family @alias}%
}\relax
10.3.1
\MT@set@prot@codes
Protrusion
This macro is called by \MT@setupfont, and does all the work for setting up
a font for protrusion.
438 \def\MT@set@prot@codes{%
Check which list should be applied to the current font.
439
\MT@get@codes@list{pr}%
We might not have found a list.
440
441
\MT@ifdefined@n{MT@pr@c@\MT@pr@c@name}{%
\MT@get@prot@opt
Get the name of the inheritance list and parse it.
442
\MT@get@inh@list{pr}%
443
\MT@ifdefined@c\MT@pr@inh@name{%
444
\MT@let@cn\@tempc{MT@pr@inh@\MT@pr@inh@name}%
445
\ifx\@tempc\@empty\else
446 hdebugi\MT@dinfo@nl{0}{parsing ...}%
447
\let\MT@inh@name\MT@pr@inh@name
448
\expandafter\MT@inh@do\@tempc,\relax,%
Set to \@empty, so that we only parse the list once.
449
450
451
\global\MT@let@nc{MT@pr@inh@\MT@pr@inh@name}\@empty
\fi
}\relax
Redefine \MT@lt to set the inheriting characters, later.
452
\def\MT@lt##1{%
IMPLEMENTATION: Setting up a font
31
453 hdebugi\MT@dinfo@nl{1}{-- heir of \MT@char: ##1}%
454 hdebugi\MT@dinfo@nl{3}{; ; lp/rp (##1): \number\lpcode\font@name\MT@char/%
455 hdebugi
\number\rpcode\font@name\MT@char}%
456
\lpcode\font@name##1=\lpcode\font@name\MT@char
457
\rpcode\font@name##1=\rpcode\font@name\MT@char
458
}%
Load additional lists?
459
\MT@load@list{pr}{\MT@pr@c@name}%
Load the main list.
460
461
462
463 }
\MT@pr@do
\MT@let@cn\@tempc{MT@pr@c@\MT@pr@c@name}%
\expandafter\MT@pr@do\@tempc,\relax,%
}\relax
Split up the values and set \lpcode and \rpcode.
464 \def\MT@pr@do#1,{%
465
\ifx\relax#1\@empty\else
466
\MT@pr@split #1==\relax
467
\expandafter\MT@pr@do\fi
468 }
\MT@pr@split
The keyval package would remove spaces here, which we don’t need since
\SetProtrusion ignores spaces in the protrusion list anyway.
469 \def\MT@pr@split#1=#2=#3\relax{%
470
\def\@tempa{#1}%
471
\ifx\@tempa\@empty\else
472
\MT@get@slot
473
\ifnum\MT@char > \m@ne
474
\def\@tempb{#2}%
475
\expandafter\MT@pr@split@val\@tempb\relax
476
\fi
477
\fi
478 }
\MT@pr@split@val
479 \def\MT@pr@split@val#1,#2\relax{%
480
\def\@tempb{#1}%
481
\MT@ifempty\@tempb\relax{%
482
\MT@adjustprotcode
483 hdebugi\MT@dinfo@nl{3}{; ; lp (\MT@char): \number\@tempcntb}%
484
\lpcode\font@name\MT@char=\@tempcntb
485
}%
486
\def\@tempb{#2}%
487
\MT@ifempty\@tempb\relax{%
488
\MT@adjustprotcode
489 hdebugi\MT@dinfo@nl{3}{; ; rp (\MT@char): \number\@tempcntb}%
490
\rpcode\font@name\MT@char=\@tempcntb
491
}%
Now we can set the values for the inheriting characters. Their slot numbers
are saved in the macro \MT@inh@hlist namei@hslot numberi@.
492
493
\MT@ifdefined@c\MT@pr@inh@name{%
\MT@ifdefined@n{MT@inh@\MT@pr@inh@name @\MT@char @}{%
IMPLEMENTATION: Setting up a font
494
495
496
497 }
\MT@adjustprotcode
32
\@nameuse{MT@inh@\MT@pr@inh@name @\MT@char @}%
}\relax
}\relax
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 the latter 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.
498 \ifnum\MT@pdftex@no>\tw@
499
\def\MT@adjustprotcode{%
500
\MT@get@charwd
For really huge fonts (100pt or so), an arithmetic overflow could occur with
vanilla TEX. Using e-TEX, this can’t happen, since the intermediate value is
64 bit, which could only be reached with a character width larger than
\maxdimen.
501
502
503
504
505
\MT@get@charwd
\MT@scale\@tempcntb \@tempb {\fontdimen6 \font@name}%
\ifnum\@tempcntb=\z@ \else
\MT@adjustprotcode@
\fi
}
When using e-TEX, we can employ \fontcharwd instead of building scratch
boxes. Could save some time.
506
\ifcase\MT@etex@no
507
\def\MT@get@charwd{%
508
\setbox\z@=\hbox{\font@name \char\MT@char}%
509
\@tempcntb=\wd\z@
510
}
511
\else
512
\def\MT@get@charwd{%
513
\@tempcntb=\number\fontcharwd\font@name\MT@char
514
}
515
\fi
516 \else
No adjustment with versions 0.14f and 0.14g.
517
518
519
520
521
522
\def\MT@adjustprotcode{%
\@tempcntb=\@tempb
\ifnum\@tempcntb=\z@ \else
\MT@adjustprotcode@
\fi
}
We need this in \MT@prot@too@large (neutralized).
523
\def\MT@get@charwd{\@tempcntb=\fontdimen6 \font@name}
524 \fi
IMPLEMENTATION: Setting up a font
\MT@adjustprotcode@
33
Furthermore, we might have to multiply with a factor.
525 \def\MT@adjustprotcode@{%
526
\ifnum\MT@pr@factor@=\@m \else
527
\MT@scale\@tempcntb \MT@pr@factor@ \@m
528
\fi
529
\ifnum\@tempcntb > \@m
530
\@tempcnta=\@m
531
\MT@prot@too@large
532
\else
533
\ifnum\@tempcntb < -\@m
534
\@tempcnta=-\@m
535
\MT@prot@too@large
536
\fi
537
\fi
538 }
\MT@prot@too@large
Type out a warning if a chosen protrusion factor is too large after the conversion. As a special service, we also type out the maximum amount that
may be specified in the configuration file.
539 \def\MT@prot@too@large{%
540
\ifnum\MT@pr@factor@=\@m \else
541
\MT@scale\@tempcnta \@m \MT@pr@factor@
542
\fi
543
\MT@get@charwd
544
\MT@scale\@tempcnta {\fontdimen6 \font@name}\@tempcntb
545
\MT@warning@nl{%
546
Protrusion factor \@tempb\space too large for character\MessageBreak
547
‘\@tempa’ in protrusion list ‘\MT@pr@c@name’.\MessageBreak
548
Setting it to the maximum of \the\@tempcnta}%
549
\@tempcntb=\@tempcnta
550 }
\MT@get@prot@opt
\MT@pr@factor@
The first optional argument to \SetProtrusion.
551 \def\MT@get@prot@opt{%
552
\MT@ifdefined@n{MT@pr@c@\MT@pr@c@name @factor}{%
553
\MT@let@cn\MT@pr@factor@{MT@pr@c@\MT@pr@c@name @factor}%
554
\MT@vinfo{... : Multiplying protrusion factors by
555
\number\MT@pr@factor@/1000}%
556
}{%
557
\let\MT@pr@factor@\MT@factor
558
}%
559 }
10.3.2
\MT@set@exp@codes@s
Expansion
Setting up font expansion is a bit different because of the selected option.
There are two versions of this macro.
If selected=true, we only apply font expansion to those fonts for which
a list has been declared (i. e., like for protrusion).
560 \def\MT@set@exp@codes@s{%
561
\MT@get@codes@list{ex}%
562
\MT@ifdefined@n{MT@ex@c@\MT@ex@c@name}{%
IMPLEMENTATION: Setting up a font
34
563
\MT@get@exp@opt
564
\MT@resetefcode
565
\MT@get@inh@list{ex}%
566
\MT@ifdefined@c\MT@ex@inh@name{%
567
\MT@let@cn\@tempc{MT@ex@inh@\MT@ex@inh@name}%
568
\ifx\@tempc\@empty\else
569 hdebugi\MT@dinfo@nl{0}{parsing ...}%
570
\let\MT@inh@name\MT@ex@inh@name
571
\expandafter\MT@inh@do\@tempc,\relax,%
572
\global\MT@let@nc{MT@ex@inh@\MT@ex@inh@name}\@empty
573
\fi
574
}\relax
575
\def\MT@lt##1{%
576 hdebugi\MT@dinfo@nl{1}{-- heir of \MT@char: ##1}%
577 hdebugi\MT@dinfo@nl{3}{: : ef (##1) \number\efcode\font@name\MT@char}%
578
\efcode\font@name##1=\efcode\font@name\MT@char
579
}%
580
\MT@load@list{ex}{\MT@ex@c@name}%
581
\MT@let@cn\@tempc{MT@ex@c@\MT@ex@c@name}%
582
\expandafter\MT@ex@do\@tempc,\relax,%
583
\pdffontexpand\font@name \MT@stretch@ \MT@shrink@ \MT@step@ \MT@auto@
584
}\relax
585 }
If, on the other hand, all characters should be expanded by the same
amount, we only take the first optional argument to \SetExpansion into
account.
\ifMT@nonselected We need this boolean in \MT@get@codes@list so that no warning for missing lists will be issued.
\MT@set@exp@codes@n
586 \newif\ifMT@nonselected
587 \def\MT@set@exp@codes@n{%
588
\MT@nonselectedtrue
589
\MT@get@codes@list{ex}%
590
\MT@ifdefined@n{MT@ex@c@\MT@ex@c@name}%
591
\MT@get@exp@opt
592
{%
593
\let\MT@ex@factor@\@m
594
\let\MT@stretch@\MT@stretch
595
\let\MT@shrink@\MT@shrink
596
\let\MT@step@\MT@step
597
\let\MT@auto@\MT@auto
598
}%
599
\MT@resetefcode
600
\pdffontexpand\font@name \MT@stretch@ \MT@shrink@ \MT@step@ \MT@auto@
601 }
\MT@set@exp@codes
Default is non-selected. It can be changed in the package options.
602 \let\MT@set@exp@codes\MT@set@exp@codes@n
\MT@resetefcode@
At first, all expansion factors for the characters will be set to 1000 (respectively the factor of this font).
603 \def\MT@resetefcode@{%
IMPLEMENTATION: Setting up a font
35
604
\@tempcnta=\z@
605
\MT@loop
606 hdebugi\MT@dinfo@nl{3}{: : ef (\number\@tempcnta): \number\MT@ex@factor@}%
607
\efcode\font@name\@tempcnta=\MT@ex@factor@
608
\advance\@tempcnta \@ne
609
\ifnum\@tempcnta < \@cclvi \MT@repeat
610 }
\MT@resetefcode
However, this is only necessary for versions prior to 1.20.
611 \ifnum\MT@pdftex@no<4
612
\let\MT@resetefcode\MT@resetefcode@
613 \else
614
\def\MT@resetefcode{%
615
\ifnum\MT@ex@factor@=\@m \else
616
\MT@resetefcode@
617
\fi
618
}
619 \fi
\MT@ex@do
There’s only one number per character.
620 \def\MT@ex@do#1,{%
621
\ifx\relax#1\@empty\else
622
\MT@ex@split #1==\relax
623
\expandafter\MT@ex@do\fi
624 }
\MT@ex@split
625 \def\MT@ex@split#1=#2=#3\relax{%
626
\def\@tempa{#1}%
627
\ifx\@tempa\@empty\else
628
\MT@get@slot
629
\ifnum\MT@char > \m@ne
630
\@tempcnta=#2 \relax
Take an optional factor into account.
631
\ifnum\MT@ex@factor@=\@m \else
632
\MT@scale\@tempcnta \MT@ex@factor@ \@m
633
\fi
634 hdebugi\MT@dinfo@nl{3}{: : ef (\MT@char): \number\@tempcnta}%
635
\efcode\font@name\MT@char=\@tempcnta
Heirs, heirs, I love thy heirs.
636
637
638
639
640
641
642
643 }
\MT@get@exp@opt
\MT@ex@factor@
\MT@stretch@
\MT@shrink@
\MT@step@
\MT@auto@
\MT@ifdefined@c\MT@ex@inh@name{%
\MT@ifdefined@n{MT@inh@\MT@ex@inh@name @\MT@char @}{%
\@nameuse{MT@inh@\MT@ex@inh@name @\MT@char @}%
}\relax
}\relax
\fi
\fi
Apply different values to this font?
644 \def\MT@get@exp@opt{%
645
\MT@ifdefined@n{MT@ex@c@\MT@ex@c@name @factor}{%
646
\MT@let@cn\MT@ex@factor@{MT@ex@c@\MT@ex@c@name @factor}%
IMPLEMENTATION: Setting up a font
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677 }
\MT@vinfo{... : Multiplying expansion factors by \number\MT@ex@factor@/1000}%
}{%
\let\MT@ex@factor@\@m
}%
\MT@ifdefined@n{MT@ex@c@\MT@ex@c@name @stretch}{%
\MT@let@cn\MT@stretch@{MT@ex@c@\MT@ex@c@name @stretch}%
\MT@vinfo{... : Setting stretch factor to \number\MT@stretch@}%
}{%
\let\MT@stretch@\MT@stretch
}%
\MT@ifdefined@n{MT@ex@c@\MT@ex@c@name @shrink}{%
\MT@let@cn\MT@shrink@{MT@ex@c@\MT@ex@c@name @shrink}%
\MT@vinfo{... : Setting shrink factor to \number\MT@shrink@}%
}{%
\let\MT@shrink@\MT@shrink
}%
\MT@ifdefined@n{MT@ex@c@\MT@ex@c@name @step}{%
\MT@let@cn\MT@step@{MT@ex@c@\MT@ex@c@name @step}%
\MT@vinfo{... : Setting step factor to \number\MT@step@}%
}{%
\let\MT@step@\MT@step
}%
\MT@ifdefined@n{MT@ex@c@\MT@ex@c@name @auto}{%
\MT@let@cn\MT@auto@{MT@ex@c@\MT@ex@c@name @auto}%
\def\@tempa{autoexpand}%
\MT@vinfo{... : \ifx\@tempa\MT@auto@ En\else Dis\fi
abling automatic expansion}%
}{%
\let\MT@auto@\MT@auto
}%
10.3.3
\MT@load@list
36
Generic macros
Recurse through the lists to be loaded.
678 \def\MT@load@list#1#2{%
679
\edef\@tempa{#2}%
680
\MT@let@cn\@tempb{MT@#1@c@\@tempa load}%
681
\ifx\@tempa\@tempb
682
\MT@warning{\@nameuse{MT@abbr@#1} list ‘\@tempa’ cannot load itself}%
683
\else
684
\ifx\@tempb\relax\else
685
\MT@ifdefined@n{MT@#1@c@\@tempb}{%
686
\MT@vinfo{... : Additionally loading \@nameuse{MT@abbr@#1} list ‘\@tempb’}%
687
\begingroup
688
\MT@load@list{#1}{\@tempb}%
689
\endgroup
690
\MT@let@cn\@tempc{MT@#1@c@\@tempb}%
691
\expandafter\csname MT@#1@do\expandafter\endcsname\@tempc,\relax,%
692
}{%
693
\MT@warning{\@nameuse{MT@abbr@#1} list ‘\@tempb’ undefined.
694
Cannot load\MessageBreak it from list ‘\@tempa’}%
695
}%
IMPLEMENTATION: Setting up a font
696
697
698 }
37
\fi
\fi
\MT@file@list
Micro-typographic settings may be written into a file mt-hfont familyi.cfg:
\MT@find@file
699 \let\MT@file@list\@empty
700 \def\MT@find@file#1{%
Check for existence of the file only once.
701
702
703
\expandafter\MT@in@llist\expandafter
{\csname MT@file@#1\endcsname}\MT@file@list
\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.
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727 }
\MT@begin@catcodes
\MT@begin@catcodes
\let\MT@begin@catcodes\relax
\let\MT@end@catcodes\relax
\InputIfFileExists{mt-#1.cfg}{%
\MT@vinfo{... Loading font settings from mt-#1.cfg}%
\MT@xadd\MT@file@list{\csname MT@file@#1\endcsname,}%
}{%
\expandafter\MT@get@basefamily#1\relax\relax\relax
\expandafter\MT@in@llist\expandafter
{\csname MT@file@\@tempa\endcsname}\MT@file@list
\ifMT@inlist@\else
\InputIfFileExists{mt-\@tempa.cfg}{%
\MT@vinfo{... Loading font settings from mt-\@tempa.cfg}%
\MT@xadd\MT@file@list{\csname MT@file@\@tempa\endcsname,%
\csname MT@file@#1\endcsname,}%
}{%
\MT@vinfo{... No file mt-#1.cfg}%
\MT@xadd\MT@file@list{\csname MT@file@#1\endcsname,}%
}%
\fi
}%
\endgroup
\fi
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 LATEX kernel). I’ve added: & (in tabulars), !, ?, ;, : (french), ,,
$, _, ~, and = (Turkish babel).
We will use this before reading the files as well as in the configuration
commands \SetExpansion, \SetProtrusion and \DeclareCharacterInheritance,
so that the catcodes are also correct when these commands are used outside the configuration files.
728 \def\MT@begin@catcodes{%
729
\begingroup
730
\makeatletter
IMPLEMENTATION: Setting up a font
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761 }
\MT@end@catcodes
38
\catcode‘\ 9%
\catcode‘\^7%
\catcode‘\^^I9%
\catcode‘\^^M9%
\catcode‘\\\z@
\catcode‘\{\@ne
\catcode‘\}\tw@
\catcode‘\#6%
\catcode‘\%14%
\@makeother\<%
\@makeother\>%
\@makeother\*%
\@makeother\.%
\@makeother\-%
\@makeother\/%
\@makeother\[%
\@makeother\]%
\@makeother\‘%
\@makeother\’%
\@makeother\"%
\@makeother\&%
\@makeother\;%
\@makeother\:%
\@makeother\,%
\@makeother\!%
\@makeother\?%
\@makeother\$%
\@makeother\_%
\@makeother\~%
\@makeother\=%
End group if outside configuration file (otherwise relax).
762 \let\MT@end@catcodes\endgroup
\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 . . . ).
763 \def\MT@get@basefamily#1#2#3#4\relax{%
764
\ifx\relax#2\relax\def\@tempa{#1}\else
765
\ifx\relax#3\relax\def\@tempa{#1#2}\else
766
\def\@tempa{#1#2#3}%
767
\ifx\relax#4\relax\else
768
\edef\@tempc{\string#4}%
769
\edef\@tempb{\string x}%
770
\ifx\@tempc\@tempb\else
771
\edef\@tempb{\string j}%
772
\ifx\@tempc\@tempb\else
773
\edef\@tempb{\string w}%
774
\ifx\@tempc\@tempb\else
775
\def\@tempa{#1#2#3#4}%
776
\fi
39
IMPLEMENTATION: Setting up a font
encoding
family
series
shape
size
1.
2.
3.
4.
5.
6.
7.
8.
9. 10. 11. 12. 13. 14. 15. 16.
•
•
•
•
•
• • • • • • • • • • • • • • •
• • • • • • • - - - - - - - • • • - - - - • • • • - - - • - - • • - - • • - - • • - • - • - • - • - • - • - • Table 3: Order for matching font attributes
777
778
779
780
781
782 }
\MT@get@listname
\fi
\fi
\fi
\fi
\fi
Try all combinations of font family, series, shape and size to get a list for
the current font.
783 \def\MT@break@tfor#1\@@#2#3{\fi}
784 \def\MT@get@listname#1{%
785 hdebugi\MT@dinfo@nl{0}{trying to find \@nameuse{MT@abbr@#1} list for font \font@name}%
786
\def\@tempb{#1}%
787
\let\MT@listname\@undefined
788
\expandafter\@tfor\expandafter\MT@val\expandafter:\expandafter=\MT@try@order\do{%
789
\MT@ifdefined@c{\MT@listname}\MT@break@tfor{%
790
\expandafter\MT@next@listname\MT@val\relax
791
}%
792
}%
793 }
\MT@try@order
Beginning with version 1.7, we always check for the font size. Since the
matching order has become more logical now, it can be described in words,
so that we don’t need table 3 in the documentation part any longer and
can cast it off here.
794 \def\MT@try@order{%
795
{1111}{1110}{1101}{1100}{1011}{1010}{1001}{1000}%
796
{0111}{0110}{0101}{0100}{0011}{0010}{0001}{0000}%
797 }
\MT@next@listname
798 \def\MT@next@listname#1#2#3#4{%
799
\edef\@tempa{\MT@encoding/%
800
\ifnum#1=\@ne \MT@family\fi/%
801
\ifnum#2=\@ne \MT@series\fi/%
802
\ifnum#3=\@ne \MT@shape\fi/%
803
\ifnum#4=\@ne *\fi}%
804 hdebugi\MT@dinfo@nl{0}{trying \@tempa}%
805
\MT@ifdefined@n{MT@\@tempb @\@tempa}{%
806
\ifnum#4=\@ne
807
\expandafter\expandafter\expandafter\MT@in@rlist
808
\expandafter{\expandafter\MT@size\expandafter}%
IMPLEMENTATION: Setting up a font
809
810
811
812
813
814
815
816
40
\csname MT@\@tempb @\@tempa @sizes\endcsname
\ifMT@inlist@
\let\MT@listname\MT@size@name
\fi
\else
\MT@let@cn\MT@listname{MT@\@tempb @\@tempa}%
\fi
}{%
Also try with an alias family.
817
\ifnum#1=\@ne
818
\ifx\MT@familyalias\@empty\else
819
\edef\@tempa{\MT@encoding/%
820
\MT@familyalias/%
821
\ifnum#2=\@ne \MT@series\fi/%
822
\ifnum#3=\@ne \MT@shape\fi/%
823
\ifnum#4=\@ne *\fi}%
824 hdebugi\MT@dinfo@nl{0}{(alias) \@tempa}%
825
\MT@ifdefined@n{MT@\@tempb @\@tempa}{%
826
\ifnum#4=\@ne
827
\expandafter\expandafter\expandafter\MT@in@rlist
828
\expandafter{\expandafter\MT@size\expandafter}%
829
\csname MT@\@tempb @\@tempa @sizes\endcsname
830
\ifMT@inlist@
831
\let\MT@listname\MT@size@name
832
\fi
833
\else
834
\MT@let@cn\MT@listname{MT@\@tempb @\@tempa}%
835
\fi
836
}\relax
837
\fi
838
\fi
839
}%
840 }
\MT@get@codes@list
\MT@get@inh@list
841 \def\MT@get@codes@list#1{%
842
\MT@get@listname{#1@c}%
843
\MT@ifdefined@c\MT@listname{%
844
\MT@edef@n{MT@#1@c@name}{\MT@listname}%
845
\ifMT@nonselected
846
\MT@vinfo{... Applying non-selected expansion (list ‘\MT@ex@c@name’)}%
847
\else
848
\MT@vinfo{... Loading \@nameuse{MT@abbr@#1} list ‘\@nameuse{MT@#1@c@name}’}%
849
\fi
850
}{%
Since the name cannot be \@empty, this is a sound proof that no matching
list exists.
851
\MT@let@nc{MT@#1@c@name}\@empty
Don’t warn if selected=false.
852
853
\ifMT@nonselected
\MT@vinfo{... Applying non-selected expansion}%
IMPLEMENTATION: Setting up a font
41
854
\else
855
\MT@warning{%
856
I cannot find a \@nameuse{MT@abbr@#1} list for font\MessageBreak
857
‘\expandafter\string\font@name’. Switching off \@nameuse{MT@abbr@#1}%
858
\MessageBreak for this font}%
859
\fi
860
}%
861 }
862 \def\MT@get@inh@list#1{%
863
\MT@get@listname{#1@inh}%
864
\MT@ifdefined@c\MT@listname{%
865
\MT@edef@n{MT@#1@inh@name}{\MT@listname}%
866 hdebugi\MT@dinfo@nl{0}{... Using \@nameuse{MT@abbr@#1} inheritance list
867 hdebugi
‘\@nameuse{MT@#1@inh@name}’}%
868
}{%
869
\MT@let@nc{MT@#1@inh@name}\@undefined
870
}%
871 }
\Mt@char
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!
872 hdebugi\def\Mt@info{\MT@dinfo@nl{2}}
873 \begingroup
874
\catcode‘\/=0
875
/catcode‘/\=12
876
/catcode‘/"=12
877
/catcode‘/A=12
878
/catcode‘/C=12
879
/catcode‘/E=12
880
/catcode‘/H=12
881
/catcode‘/L=12
882
/catcode‘/R=12
883
/catcode‘/T=12
884
/lowercase{%
885
/def/x{%
\Mt@isaletter
\Mt@letterstring
Test whether argument expands to a letter.
886
/def/Mt@letterstring{THE LETTER}%
887
/def/Mt@isaletter ##1THE LETTER##2##3/relax{%
888
/@tempswafalse
889
/ifx/relax##1/relax
890
/@tempswatrue
891
/edef/Mt@char{/number‘##2}%
892 hdebugi/Mt@info{> ‘/the/toks@’ is a letter (/Mt@char)}%
893
/Mt@testrest{/Mt@letterstring}{##3}%
894
/fi
895
}%
Argument expands to a character (anything with catcode 12, also a num\Mt@characterstring ber).
\Mt@isacharacter
896
897
/def/Mt@characterstring{THE CHARACTER}%
/def/Mt@isacharacter ##1THE CHARACTER##2##3/relax{%
IMPLEMENTATION: Setting up a font
42
898
/@tempswafalse
899
/ifx/relax##1/relax
900
/@tempswatrue
901
/edef/Mt@char{/number‘##2}%
902 hdebugi/Mt@info{> ‘/the/toks@’ is a character (/Mt@char)}%
903
/Mt@testrest{/Mt@characterstring}{##3}%
904
/fi
905
}%
\Mt@isachar
\Mt@charstring
Everything that has been defined with \DeclareTextSymbol in the encoding
definition files.
906
/def/Mt@charstring{\CHAR"}%
907
/def/Mt@isachar##1\CHAR"##2##3##4/relax{%
908
/@tempswafalse
909
/ifx/relax##1/relax
910
/@tempswatrue
911
/if##3\/relax
912
/edef/Mt@char{/number"##2}%
913
/Mt@testrest{/Mt@charstring}{##3##4}%
914
/else
915
/edef/Mt@char{/number"##2##3}%
916
/Mt@testrest{/Mt@charstring}{##4}%
917
/fi
918 hdebugi/Mt@info{> ‘/the/toks@’ is a /string/char/space (/Mt@char)}%
919
/fi
920
}%
921
}%
922
}
923 /expandafter/endgroup/x
\Mt@testrest
\Mt@rest
\MT@get@slot
\MT@char
Test whether all of the string has been used up.
924 \def\Mt@testrest#1#2{%
925
\edef\x{#1}%
926
\edef\y{#2}%
927
\ifx\x\y\else
928
\def\Mt@rest{#2}%
929
\fi
930 }
There are lots of possibilities how a character is defined in the configuration, which makes translating them into slot numbers hard.
931 \def\MT@get@slot{%
932
\MT@count=\escapechar
933
\escapechar=‘\\
934
\let\Mt@char\m@ne
935
\let\Mt@rest\@empty
936
\edef\MT@char{\expandafter\meaning\@tempa}%
Save unexpanded string in case we need to issue a warning message.
937
\toks@=\expandafter{\@tempa}%
• It’s either a letter
938
939
\expandafter\expandafter\expandafter\Mt@isaletter
\expandafter\MT@char\Mt@letterstring \relax\relax
IMPLEMENTATION: Setting up a font
940
43
\ifnum\Mt@char < \z@
• An‘other’ character (catcode 12)
\expandafter\expandafter\expandafter\Mt@isacharacter
\expandafter\MT@char\Mt@characterstring \relax\relax
941
942
• A number?
\if@tempswa
\expandafter\MT@get@number\@tempa\relax\relax
\fi
\ifnum\Mt@char < \z@
943
944
945
946
• OK, so it must be a macro. We do not allow random commands but
only those defined in LATEX’s idiosyncratic font encoding scheme:
If \hencodingi\hcommandi (that’s one command) is defined, we try to
extract the slot number.
\MT@ifdefined@n{\MT@encoding\expandafter\string\@tempa}%
\MT@get@symbol
{%
947
948
949
• Now, we’ll catch the rest, which hopefully is an accented character
(e. g. \"a).
\expandafter\MT@get@composite\@tempa\relax\relax
}%
\ifnum\Mt@char < \z@
950
951
952
• It could also be a \chardefed command (e. g. the percent character)
\expandafter\expandafter\expandafter\Mt@isachar
\expandafter\MT@char\Mt@charstring \relax\relax\relax
953
954
We give up.
955
956
957
958
959
960
961
\if@tempswa \else
\MT@warning{Unknown slot number of ‘\the\toks@’
in encoding\MessageBreak‘\MT@encoding’}%
\fi
\fi
\fi
\fi
A final test: If the user has specified something like ‘ab’, or 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.
962
963
964
965
966
967
\ifx\Mt@rest\@empty
\let\MT@char\Mt@char
\else
\MT@warning{%
Unknown slot number of ‘\the\toks@’ in encoding\MessageBreak
‘\MT@encoding’. Make sure it’s a single character\MessageBreak
IMPLEMENTATION: Setting up a font
968
969
970
971
972 }
\MT@get@number
44
(or a number)}%
\let\MT@char\m@ne
\fi
\escapechar=\MT@count
Numbers may be specified as a three-digit decimal number (029), as a
hexadecimal number (prefixed with ": "1D) or as a octal number (prefixed
with ’: ’35). They must consist of at least three characters (including the
prefix), that is, "F is not permitted.
973 \def\MT@get@number#1#2#3\relax{%
974
\ifx\relax#3\relax\else
975
\ifx\relax#2\relax\else
976
\if#1"\relax
977
\def\@tempc{\uppercase{\edef\Mt@char{\number#1#2#3}}}%
978
\@tempc
979 hdebugi\MT@dinfo@nl{2}{> ... a hexadecimal number: \Mt@char}%
980
\else
981
\if#1’\relax
982
\def\Mt@char{\number#1#2#3}%
983 hdebugi\MT@dinfo@nl{2}{> ... an octal number: \Mt@char}%
984
\else
985
\MT@ifnumber{#1#2#3}{%
986
\def\Mt@char{\number#1#2#3}%
987 hdebugi\MT@dinfo@nl{2}{> ... a decimal number: \Mt@char}%
988
}\relax
989
\fi
990
\fi
991
\ifnum\Mt@char > \@cclv
992
\MT@warning{%
993
Number \noexpand#1\noexpand#2\noexpand#3 in encoding
994
‘\MT@encoding’ too large!\MessageBreak Ignoring it}%
995
\let\Mt@char\m@ne
996
\fi
997
\let\Mt@rest\@empty
998
\fi
999
\fi
1000 }
\MT@get@symbol
Fortunately, we can simply call \hencodingi\hcommandi instead of \hcommandi
itself, which might expand to funny stuff, depending on context.
1001 \def\MT@get@symbol{%
1002
\edef\@tempa{\expandafter\expandafter\expandafter\expandafter
1003
\expandafter\expandafter\expandafter
1004
\meaning\expandafter
1005
\csname\expandafter
1006
\MT@encoding\expandafter
1007
\string\@tempa
1008
\endcsname}%
1009
\expandafter\expandafter\expandafter\Mt@isachar
1010
\expandafter\@tempa\Mt@charstring \relax\relax\relax
1011
\if@tempswa \else
Not all symbols have been defined by \DeclareTextSymbol, in which case
IMPLEMENTATION: Setting up a font
45
they won’t expand to \char"hhex numberi but to a letter (e. g. \i, when
using frenchpro).
1012
1013
1014
1015 }
\MT@get@composite
\expandafter\expandafter\expandafter\Mt@isaletter
\expandafter\@tempa\Mt@letterstring \relax\relax
\fi
Here, we are dealing with accented characters, specified as two tokens.
1016 \def\MT@get@composite#1#2\relax{%
1017
\MT@ifempty{#2}\relax{%
We construct a control sequence of the form: \\hencodingi\haccenti-hcharacteri,
e. g. \\T1\"-a, which will expand to a letter if it has been defined by
\DeclareTextComposite. This should be robust, finally.
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029 }
\edef\@tempa{\expandafter\expandafter\expandafter\expandafter
\expandafter\expandafter\expandafter
\meaning\expandafter
\csname\expandafter
\string\csname\MT@encoding\endcsname
\string#1-%
\string#2%
\endcsname}%
\expandafter\expandafter\expandafter\Mt@isaletter
\expandafter\@tempa\Mt@letterstring \relax\relax
}%
10.3.4
Hook into LATEX’s font selection
We append \MT@setupfont to \pickup@font, which is called by LATEX 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).
IMPLEMENTATION: Setting up a font
46
Up to version 1.3 of this package, we were using \define@newfont as
the hook, which is only called for new fonts, and therefore seemed the
natural choice. However, 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.
\MT@font@list (We use a comma-separated list.)
1030 \let\MT@font@list\@empty
First we check whether \pickup@font is defined as expected. The warning
issued by \CheckCommand* would be a bit too generic.
1031 \def\MT@pickupfont{\expandafter\ifx\font@name\relax\define@newfont\fi}
1032 \ifx\pickup@font\MT@pickupfont \else
1033
\MT@warning@nl{%
1034
Command \string\pickup@font\space is not defined as expected.\MessageBreak
1035
Double-check whether micro-typography is indeed\MessageBreak
1036
applied to the document.\MessageBreak (Hint: Turn on ‘verbose’ mode)%
1037
}%
1038 \fi
Then we append our stuff.
1039 \g@addto@macro\pickup@font{%
1040
\begingroup
1041
\escapechar\m@ne
1042
\expandafter\MT@in@llist\expandafter
1043
{\font@name}\MT@font@list
1044
\ifMT@inlist@ \else
1045
\MT@setupfont
1046
\xdef\MT@font@list{\MT@font@list\font@name,}%
1047
\fi
1048
\endgroup
1049 }
\MT@pickupfont
We also test whether our definition has survived (at least CJK redefines
\pickup@font)10 .
1050 \let\MT@pickupfont\pickup@font
1051 \AtBeginDocument{%
1052
\ifx\MT@pickupfont\pickup@font \else
1053
\MT@error{%
1054
Another package has overwritten the definition\MessageBreak
1055
of \string\pickup@font. I might not be able to\MessageBreak
10 Can anybody say something about how microtype and CJK work together?
IMPLEMENTATION: Configuration
47
1056
apply any micro-typography. Please find the\MessageBreak
1057
culprit, and load it before the microtype package
1058
}{%
1059 The microtype package appends the micro-typographic setup to\MessageBreak
1060 \string\pickup@font. If the other package has simply overwritten this\MessageBreak
1061 command, nothing will work. If, on the other hand, it has changed\MessageBreak
1062 the command in a cautious way, everything may be fine.\MessageBreak
1063 In either case, please send a report to <[email protected]>.
1064
}%
1065
\fi
1066 }
10.4
10.4.1
\DeclareMicroTypeSet
\DeclareMicroTypeSet*
Configuration
Font Sets
Calling this macro will create a list for every font characteristic of the
form: \MThex|prilist@hcharacteristici@hset namei. 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{hvar1i} \MT@lt{hvar2i} . . . ,
where \MT@lt acts as the delimiter between the list entries.
1067 \def\DeclareMicroTypeSet{%
1068
\@ifstar
1069
{\@ifnextchar[%]
1070
\MT@DeclareSetAndUseIt
1071
{\MT@DeclareSetAndUseIt[]}}%
1072
{\@ifnextchar[%]
1073
\MT@DeclareSet
1074
{\MT@DeclareSet[]}}%
1075 }
\MT@DeclareSet
1076 \def\MT@DeclareSet[#1]#2#3{%
1077
\MT@DeclareSet@{#1}{#2}{#3}%
1078 }
\MT@DeclareSetAndUseIt
1079 \def\MT@DeclareSetAndUseIt[#1]#2#3{%
1080
\MT@DeclareSet@{#1}{#2}{#3}%
1081
\UseMicroTypeSet[#1]{#2}%
1082 }
\MT@DeclareSet@
1083 \def\MT@DeclareSet@#1#2#3{%
1084
\KV@@sp@def\@tempa{#1}%
1085
\MT@ifempty\@tempa{%
1086
\MT@declare@sets{pr}{#2}{#3}%
1087
\MT@declare@sets{ex}{#2}{#3}%
1088
}{%
IMPLEMENTATION: Configuration
1089
1090
1091
1092 }
\MT@tmp@setname
48
\expandafter\MT@declare@sets\expandafter
{\csname MT@abbrx@\@tempa\endcsname}{#2}{#3}%
}%
We need to remember the name of the set currently being declared.
1093 \let\MT@tmp@setname\@empty
\MT@declare@sets
Define the current set name and parse the keys.
1094 \def\MT@declare@sets#1#2#3{%
1095
\KV@@sp@def\MT@tmp@setname{#2}%
1096
\global\MT@let@nc{MT@#1list@@\MT@tmp@setname}\@empty
1097 hdebugi\MT@dinfo{0}{declaring \@nameuse{MT@abbr@#1} set ‘\MT@tmp@setname’}%
1098
\setkeys{MT#1@set}{#3}%
1099 }
\MT@define@set@keys
Define the keyval keys for expansion and protrusion sets.
1100 \def\MT@define@set@keys#1{%
1101
\MT@define@set@key{#1}{encoding}%
1102
\MT@define@set@key{#1}{family}%
1103
\MT@define@set@key{#1}{series}%
1104
\MT@define@set@key{#1}{shape}%
1105
\MT@define@set@key@size{#1}%
1106 }
\MT@define@set@key
h#1i = [ex|pr], h#2i = font axis,
1107 \def\MT@define@set@key#1#2{%
1108
\define@key{MT#1@set}{#2}[]{%
1109
\@for\MT@val:=##1\do{%
Get rid of spaces.
1110
\MT@remove@spaces{\MT@val}%
1111
\MT@get@highlevel{#2}%
1112
\MT@escapechar{\MT@val}%
1113
\MT@addto@list{#1}{#2}{\MT@val}%
1114
}%
1115 hdebugi\MT@dinfo@nl{0}{-- #2: \@nameuse{MT@#1list@#2@\MT@tmp@setname}}%
1116
}%
1117 }
\MT@escapechar
Make sure that the escape char is set to -1, and characters have category
code 12, as in the original font name, so that the comparison doesn’t fail.
1118 \def\MT@escapechar#1{%
1119
\begingroup
1120
\escapechar\m@ne
1121
\xdef\MT@val{\expandafter\string\csname #1\endcsname}%
1122
\endgroup
1123 }
\MT@addto@list
Append the value h#3i to the expansion or protrusion (= h#1i) list for font
axis h#2i.
1124 \def\MT@addto@list#1#2#3{%
1125
\expandafter\MT@xadd\csname MT@#1list@#2@\MT@tmp@setname\endcsname
1126
{\noexpand\MT@lt{#3}}%
1127 }
IMPLEMENTATION: Configuration
\MT@get@highlevel
49
Saying, for instance, ‘family=rm*’ or ‘shape=bf*’ will lead to \rmdefault
resp. \bfdefault being expanded/protruded.
1128 \def\MT@get@highlevel#1{%
1129
\expandafter\MT@test@ast\MT@val*\@nil
1130
\if@tempswa
And ‘family = *’ will become \familydefault.
\MT@ifempty\@tempa{\def\@tempa{#1}}\relax
\def\MT@val{\csname \@tempa default\endcsname}%
1131
1132
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.
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146 }
\MT@test@ast
\ifx\@nodocument\relax \else
\expandafter\ifx
\csname MT@check@\MT@tmp@setname @\@tempa\endcsname\@empty
\else
\global\MT@edef@n{MT@\MT@tmp@setname @\@tempa @default}{\MT@val}%
\edef\x{{\MT@tmp@setname}{\@tempa}}%
\expandafter\AtBeginDocument\expandafter{%
\expandafter\MT@check@default\x
}%
\global\MT@let@nc{MT@check@\MT@tmp@setname @\@tempa}\@empty
\fi
\fi
\fi
Test whether last character is an asterisk.
1147 \def\MT@test@ast#1*#2\@nil{%
1148
\def\@tempa{#1}%
1149
\MT@ifempty{#2}%
1150
\@tempswafalse
1151
\@tempswatrue
1152 }
\MT@check@default
1153 \def\MT@check@default#1#2{%
1154
\MT@let@cn\@tempa{MT@#1@#2@default}%
1155
\edef\@tempb{\csname #2default\endcsname}%
1156
\ifx\@tempa\@tempb\else
1157
\MT@warning@nl{\expandafter\noexpand\csname #2default\endcsname
1158
has changed (‘\@tempa’ <> ‘\@tempb’)!\MessageBreak
1159
This might affect the ‘#1’ font set.\MessageBreak
1160
Please make all relevant font changes *before*\MessageBreak
1161
loading the ‘microtype’ package}%
1162
\fi
1163 }
\MT@define@set@key@size
size requires special treatment.
1164 \def\MT@define@set@key@size#1{%
1165
\define@key{MT#1@set}{size}[]{%
1166
\@for\MT@val:=##1\do{%
1167
\MT@remove@spaces{\MT@val}%
IMPLEMENTATION: Configuration
50
1168
\expandafter\MT@get@range\MT@val--\@nil
1169
\ifx\MT@val\relax \else
1170
\expandafter\MT@xadd\csname MT@#1list@size@\MT@tmp@setname\endcsname
1171
{\noexpand\MT@range{\MT@lower}{\MT@upper}\relax}%
1172
\fi
1173
}%
1174 hdebugi\MT@dinfo@nl{0}{-- size: \@nameuse{MT@#1list@size@\MT@tmp@setname}}%
1175
}%
1176 }
Font sizes may also be specified as ranges. This has been requested by Andreas Bühmann, who has also offered valuable help in implementing this.
Now, one may for instance set up different lists for fonts with optical sizes.
(The MinionPro project is trying this for the OpenType version of Adobe’s
Minion. See http://developer.berlios.de/projects/minionpro/.)
Ranges are stored as \MT@range{hlower boundi}{hupper boundi}{hlist namei}.
\MT@get@range For simple sizes, the upper boundary is -1.
\MT@range
1177 \let\MT@range\relax
1178 \def\MT@get@range#1-#2-#3\@nil{%
1179
\MT@ifempty{#1}{%
1180
\MT@ifempty{#2}{%
1181
\let\MT@val\relax
1182
}{%
1183
\def\MT@lower{0}%
1184
\def\MT@val{#2}%
1185
\MT@get@size
1186
\edef\MT@upper{\MT@val}%
1187
}%
1188
}{%
1189
\def\MT@val{#1}%
1190
\MT@get@size
1191
\ifx\MT@val\relax \else
1192
\edef\MT@lower{\MT@val}%
1193
\MT@ifempty{#2}{%
1194
\MT@ifempty{#3}{%
1195
\def\MT@upper{-1}%
1196
}{%
1197
\def\MT@upper{2048}%
1198
}%
1199
}{%
1200
\def\MT@val{#2}%
1201
\MT@get@size
1202
\MT@ifgt\MT@lower\MT@val{%
1203
\MT@warning@nl{%
1204
Invalid size range (\MT@lower\space > \MT@val) in font set
1205
‘\MT@tmp@setname’.\MessageBreak Swapping sizes}%
1206
\edef\MT@upper{\MT@lower}%
1207
\edef\MT@lower{\MT@val}%
1208
}{%
1209
\edef\MT@upper{\MT@val}%
1210
}%
1211
\MT@ifeq\MT@lower\MT@upper{%
IMPLEMENTATION: Configuration
1212
1213
1214
1215
1216
1217 }
\MT@get@size
51
\def\MT@upper{-1}%
}\relax
}%
\fi
}%
If it’s not specified as a dimension, we tackle the size selection command
here.
1218 \def\MT@get@size{%
1219
\let\@tempa\relax
A single star means \sizedefault, which doesn’t exist, so we define it to
be \normalsize.
1220
1221
1222
1223
1224
1225
\if*\MT@val\relax
\def\@tempa{\normalsize}%
\else
\MT@let@cn\@tempa{\MT@val}%
\fi
\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).
1226
1227
1228
1229
1230
\begingroup
\def\set@fontsize##1##2##3##4\@nil{\gdef\MT@val{##2}}%
\@tempa\@nil
\endgroup
\fi
Test whether we finally got a number or dimension so that we can strip the
‘pt’ (\@defaultunits and \strip@pt are kernel macros).
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245 }
\setbox\z@=\hbox{\MT@count=1\MT@val\relax
\ifnum\MT@count=\@ne
\@tempswafalse
\else
\@tempswatrue
\fi\expandafter}%
\if@tempswa
\@defaultunits\@tempdima\MT@val pt\relax\@nnil
\edef\MT@val{\strip@pt\@tempdima}%
\else
\MT@warning{Could not parse font size ‘\MT@val’\MessageBreak
in font set ‘\MT@tmp@setname’}%
\let\MT@val\relax
\fi
We have finally assembled all pieces to define \DeclareMicroTypeSet’s
keys.
1246 \MT@define@set@keys{pr}
IMPLEMENTATION: Configuration
52
1247 \MT@define@set@keys{ex}
\UseMicroTypeSet
To use a particular set we simply redefine MT@hex|pri@setname. If the optional argument is empty, both \MT@ex@setname and \MT@pr@setname will
be redefined.
1248 \renewcommand{\UseMicroTypeSet}[2][]{%
1249
\KV@@sp@def\@tempa{#1}%
1250
\MT@ifempty\@tempa{%
1251
\MT@use@set{pr}{#2}%
1252
\MT@use@set{ex}{#2}%
1253
}{%
1254
\expandafter\MT@use@set\expandafter
1255
{\csname MT@abbrx@\@tempa\endcsname}{#2}%
1256
}%
1257 }
\MT@use@set
Only use sets that have been declared.
1258 \def\MT@use@set#1#2{%
1259
\KV@@sp@def{\@tempa}{#2}%
1260
\MT@ifdefined@n{MT@#1list@@\@tempa}{%
1261
\global\MT@edef@n{MT@#1@setname}{\@tempa}%
1262
\MT@info{Using \@nameuse{MT@abbr@#1} set ‘\@tempa’}%
1263
}{%
1264
\MT@ifdefined@n{MT@#1@setname}\relax{%
1265
\global\MT@def@n{MT@#1@setname}{alltext}%
1266
}%
1267
\MT@warning{%
1268
The \@nameuse{MT@abbr@#1} set ‘\@tempa’ is undeclared.\MessageBreak
1269
Using set ‘\@nameuse{MT@#1@setname}’ instead}%
1270
}%
1271 }
\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.
1272 \renewcommand{\DeclareMicroTypeAlias}[2]{%
1273
\KV@@sp@def\@tempa{#1}%
1274
\KV@@sp@def\@tempb{#2}%
1275
\global\MT@edef@n{MT@\@tempa @alias}{\@tempb}%
If we encounter this command while a font is being set up, we also set
the alias for the current font so that if \DeclareMicroTypeAlias has been
issued in a configuration file, the configuration file for the alias font will be
loaded, too.
1276
1277
1278
1279 }
\LoadMicroTypeFile
\MT@ifdefined@c\MT@family{%
\global\let\MT@familyalias\@tempb
}\relax
May be used to load a configuration file manually.
1280 \def\LoadMicroTypeFile#1{%
1281
\expandafter\MT@in@llist\expandafter
1282
{\csname MT@file@#1\endcsname}\MT@file@list
1283
\ifMT@inlist@
IMPLEMENTATION: Configuration
53
1284
\MT@vinfo{... Configuration file mt-#1.cfg already loaded}%
1285
\else
1286
\MT@begin@catcodes
1287
\MT@xadd\MT@file@list{\csname MT@file@#1\endcsname,}%
1288
\InputIfFileExists{mt-#1.cfg}{%
1289
\MT@vinfo{... Loading configuration file mt-#1.cfg}%
1290
}{%
1291
\MT@warning{... Configuration file mt-#1.cfg\MessageBreak
1292
does not exist}%
1293
}%
1294
\MT@end@catcodes
1295
\fi
1296 }
1297 h/packagei
10.4.2
Declarations
We now set up some default sets (in the main configuration file).
1298 h*config&m-ti
1299
1300 %%% ---------------------------------------------------------------------1301 %%% FONT SETS
1302
1303 \DeclareMicroTypeSet{all}
1304
{}
1305
1306 \DeclareMicroTypeSet{allmath}
1307
{ encoding = {T1,OT1,LY1,TS1,OML,OMS} }
1308
1309 \DeclareMicroTypeSet{alltext}
1310
{ encoding = {T1,OT1,LY1,TS1} }
1311
1312 \DeclareMicroTypeSet{basicmath}
1313
{ encoding = {T1,OT1,LY1,OML,OMS},
1314
family
= {rm*,sf*},
1315
series
= {m},
1316
size
= {normalsize,footnotesize,small,large}
1317
}
1318
1319 \DeclareMicroTypeSet{basictext}
1320
{ encoding = {T1,OT1,LY1},
1321
family
= {rm*,sf*},
1322
series
= {m},
1323
size
= {normalsize,footnotesize,small,large}
1324
}
1325
1326 \DeclareMicroTypeSet{normalfont}
1327
{ encoding = *,
1328
family
= *,
1329
series
= *,
1330
shape
= *,
1331
size
= *
1332
}
IMPLEMENTATION: Configuration
54
1333
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.
1334 %%% ---------------------------------------------------------------------1335 %%% FONT ALIASES
1336
1337 \DeclareMicroTypeAlias{lmr} {cmr}
1338 \DeclareMicroTypeAlias{aer} {cmr}
1339 \DeclareMicroTypeAlias{zer} {cmr}
1340 \DeclareMicroTypeAlias{cmor}{cmr}
1341 \DeclareMicroTypeAlias{hfor}{cmr}
1342 h/config&m-ti
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@pr@c@hnamei will be defined to be h#3i (i.e.
the list of characters, not expanded).
1343 h*packagei
1344 \renewcommand{\SetProtrusion}[2][]{%
1345
\let\MT@pr@c@name\@undefined
1346
\let\MT@load\@undefined
1347
\let\MT@extra@factor\@undefined
Parse the optional first argument:
1348
\setkeys{MT@pr@c}{#1}%
If the user hasn’t specified a name, we will create one.
1349
\MT@get@codes@name{pr}%
1350
\MT@set@prot@opt
1351 hdebugi\MT@dinfo{0}{creating protrusion list ‘\MT@pr@c@name’}%
1352
\setkeys{MT@pr@c}{#2}%
\MT@permutelist
We have parsed the second argument, and can now define macros for all
permutations of the font characteristics to point to \MT@pr@c@hnamei, . . .
1353
1354
\def\MT@permutelist{pr@c}%
\MT@permute
. . . which we can now define to be h#3i. We want the catcodes to be correct
even if this is called in the preamble.
1355
1356
1357 }
\MT@set@prot@list
\MT@begin@catcodes
\MT@set@prot@list
Here, as elsewhere, we have to make the definitions global, since they will
occur inside a group.
IMPLEMENTATION: Configuration
55
1358 \def\MT@set@prot@list#1{%
1359
\global\MT@def@n{MT@pr@c@\MT@pr@c@name}{#1}%
1360
\MT@end@catcodes
1361 }
\SetExpansion
\SetExpansion only differs in that it allows some extra options (stretch,
shrink, step, auto).
1362 \renewcommand{\SetExpansion}[2][]{%
1363
\let\MT@ex@c@name\@undefined
1364
\let\MT@load\@undefined
1365
\let\MT@extra@factor\@undefined
1366
\let\MT@extra@stretch\@undefined
1367
\let\MT@extra@shrink\@undefined
1368
\let\MT@extra@step\@undefined
1369
\let\MT@extra@auto\@undefined
1370
\setkeys{MT@ex@c}{#1}%
1371
\MT@get@codes@name{ex}%
1372
\MT@set@exp@opt
1373 hdebugi\MT@dinfo{0}{creating expansion list ‘\MT@ex@c@name’}%
1374
\setkeys{MT@ex@c}{#2}%
1375
\def\MT@permutelist{ex@c}%
1376
\MT@permute
1377
\MT@begin@catcodes
1378
\MT@set@exp@list
1379 }
\MT@set@exp@list
Same story.
1380 \def\MT@set@exp@list#1{%
1381
\global\MT@def@n{MT@ex@c@\MT@ex@c@name}{#1}%
1382
\MT@end@catcodes
1383 }
\MT@get@codes@name
Simply use a roman number as the list name if the user didn’t bother creating one.
1384 \def\MT@get@codes@name#1{%
1385
\MT@ifdefined@n{MT@#1@c@name}{%
1386
\MT@ifdefined@n{MT@#1@c@\csname MT@#1@c@name\endcsname}{%
1387
\MT@warning{Redefining list ‘\@nameuse{MT@#1@c@name}’}%
1388
}\relax
1389
}{%
1390
\@tempcnta=\@ne
1391
\MT@loop
1392
\MT@ifdefined@n{MT@#1@c@#1-\romannumeral\@tempcnta}{%
1393
\advance \@tempcnta \@ne
1394
}{%
1395
\MT@edef@n{MT@#1@c@name}{#1-\romannumeral\@tempcnta}%
1396
\@tempcnta=\z@
1397
}%
1398
\ifnum\@tempcnta > \z@ \MT@repeat
1399
}%
1400
\MT@let@cn\MT@tmp@setname{MT@#1@c@name}%
Now that we know the name, we can cater for any set to be loaded by this
list.
56
IMPLEMENTATION: Configuration
1401
1402
1403
1404 }
\MT@set@prot@opt
\MT@ifdefined@c\MT@load{%
\global\MT@let@nc{MT@#1@c@\MT@tmp@setname load}\MT@load
}\relax
Only one extra option for protrusion: factor.
1405 \def\MT@set@prot@opt{%
1406
\MT@ifdefined@c\MT@extra@factor{%
1407
\global\MT@let@nc{MT@pr@c@\MT@pr@c@name @factor}\MT@extra@factor
1408
}\relax
1409 }
\MT@set@exp@opt
The extra options to \SetExpansion also have to be dealt with only after
we know the name.
1410 \def\MT@set@exp@opt{%
1411
\MT@ifdefined@c\MT@extra@factor{%
1412
\global\MT@let@nc{MT@ex@c@\MT@ex@c@name
1413
}\relax
1414
\MT@ifdefined@c\MT@extra@stretch{%
1415
\global\MT@let@nc{MT@ex@c@\MT@ex@c@name
1416
}\relax
1417
\MT@ifdefined@c\MT@extra@shrink{%
1418
\global\MT@let@nc{MT@ex@c@\MT@ex@c@name
1419
}\relax
1420
\MT@ifdefined@c\MT@extra@step{%
1421
\global\MT@let@nc{MT@ex@c@\MT@ex@c@name
1422
}\relax
1423
\MT@ifdefined@c\MT@extra@auto{%
1424
\global\MT@let@nc{MT@ex@c@\MT@ex@c@name
1425
}\relax
1426 }
\MT@define@code@key
@factor}\MT@extra@factor
@stretch}\MT@extra@stretch
@shrink}\MT@extra@shrink
@step}\MT@extra@step
@auto}\MT@extra@auto
Define the keys for expansion and protrusion character code lists.
1427 \def\MT@define@code@key#1#2{%
1428
\define@key{MT@#1}{#2}[]{%
1429
\@tempcnta=\@ne
1430
\@for\MT@val:=##1\do{%
1431
\MT@remove@spaces{\MT@val}%
Here, too, we allow for something like ‘bf*’. It will be expanded immediately.
1432
1433
1434
1435
1436
1437 }
\MT@get@highlevel{#2}%
\MT@edef@n{MT@temp#2\romannumeral\@tempcnta}{\MT@val}%
\advance\@tempcnta \@ne
}%
}%
\MT@define@code@key@size
1438 \def\MT@define@code@key@size#1{%
1439
\define@key{MT@#1}{size}[]{%
1440
\@for\MT@val:=##1\do{%
1441
\MT@remove@spaces{\MT@val}%
1442
\expandafter\MT@get@range\MT@val--\@nil
IMPLEMENTATION: Configuration
1443
1444
1445
1446
1447
1448
1449
1450
1451 }
\ifx\MT@val\relax \else
\expandafter\MT@xadd
\csname MT@tempsize\endcsname
{\noexpand\MT@range{\MT@lower}{\MT@upper}%
{\csname MT@#1@name\endcsname}}%
\fi
}%
}%
\MT@declare@codes
1452 \def\MT@declare@codes#1{%
1453
\define@key{MT@#1@c}{name}[]{%
1454
\MT@ifempty{##1}\relax{%
1455
\MT@def@n{MT@#1@c@name}{##1}%
1456
}%
1457
}%
1458
\define@key{MT@#1@c}{load}[]{%
1459
\MT@ifempty{##1}\relax{%
1460
\def\MT@load{##1}%
1461
}%
1462
}%
1463
\define@key{MT@#1@c}{factor}[]{%
1464
\MT@ifempty{##1}\relax{%
1465
\def\MT@extra@factor{##1 }%
1466
}%
1467
}%
1468
\MT@define@code@key{#1@c}{encoding}%
1469
\MT@define@code@key{#1@c}{family}%
1470
\MT@define@code@key{#1@c}{series}%
1471
\MT@define@code@key{#1@c}{shape}%
1472
\MT@define@code@key@size{#1@c}%
1473 }
1474 \MT@declare@codes{pr}
1475 \MT@declare@codes{ex}
\MT@define@expcodes@key
The first argument to \SetExpansion accepts some more options.
1476 \def\MT@define@expcodes@key#1{%
1477
\define@key{MT@ex@c}{#1}[]{%
1478
\MT@ifempty{##1}\relax{%
A space terminates the number.
1479
1480
1481
1482 }
\MT@def@n{MT@extra@#1}{##1 }%
}%
}%
1483 \MT@define@expcodes@key{stretch}
1484 \MT@define@expcodes@key{shrink}
1485 \MT@define@expcodes@key{step}
1486 \define@key{MT@ex@c}{auto}[]{%
1487
\MT@ifempty{#1}%
1488
{\def\@tempb{true}}%
1489
{\KV@@sp@def\@tempb{#1}}%
57
IMPLEMENTATION: Configuration
1490
58
\csname if\@tempb\endcsname
Don’t alter \MT@extra@auto for pdfTEX version older than 1.20.
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503 }
\ifnum\MT@pdftex@no=4\relax
\def\MT@extra@auto{autoexpand}%
\else
\MT@warning{%
pdfTeX too old for automatic font expansion. Cannot\MessageBreak
enable it in font set ‘\MT@ex@c@name’}%
\fi
\else
\ifnum\MT@pdftex@no=4\relax
\let\MT@extra@auto\@empty
\fi
\fi
10.4.4
\DeclareCharacterInheritance
Character Inheritance
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.
1504 \renewcommand{\DeclareCharacterInheritance}[2][]{%
1505
\MT@begin@catcodes
1506
\MT@set@inh@list{#1}{#2}%
1507 }
\MT@set@inh@list
Safe category codes in the third argument.
1508 \def\MT@set@inh@list#1#2#3{%
1509
\KV@@sp@def\@tempa{#1}%
1510
\MT@ifempty\@tempa{%
1511
\MT@declare@char@inh{pr}{#2}{#3}%
1512
\MT@declare@char@inh{ex}{#2}{#3}%
1513
}{%
1514
\expandafter\MT@declare@char@inh\expandafter
1515
{\csname MT@abbrx@\@tempa\endcsname}{#2}{#3}%
1516
}%
1517
\MT@end@catcodes
1518 }
\MT@declare@char@inh
The optional argument may be used to restrict the inheritance list to protrusion or expansion.
1519 \def\MT@declare@char@inh#1#2#3{%
1520
\MT@let@nc{MT@#1@inh@name}\@undefined
1521
\MT@get@inh@name{#1}%
1522 hdebugi\MT@dinfo{0}{creating inheritance list ‘\@nameuse{MT@#1@inh@name}’}%
1523
\global\MT@def@n{MT@#1@inh@\csname MT@#1@inh@name\endcsname}{#3}%
1524
\setkeys{MT@#1@inh}{#2}%
1525
\def\MT@permutelist{#1@inh}%
IMPLEMENTATION: Configuration
1526
1527 }
\MT@get@inh@name
59
\MT@permute
The inheritance lists cannot be named by the user.
1528 \def\MT@get@inh@name#1{%
1529
\@tempcnta=\@ne
1530
\MT@loop
1531
\MT@ifdefined@n{MT@#1@inh@#1-inh-\romannumeral\@tempcnta}{%
1532
\advance \@tempcnta \@ne
1533
}{%
1534
\MT@edef@n{MT@#1@inh@name}{#1-inh-\romannumeral\@tempcnta}%
1535
\@tempcnta=\z@
1536
}%
1537
\ifnum\@tempcnta > \z@ \MT@repeat
1538 }
\MT@define@inh@key@encoding
Parse the first argument. \DeclareCharacterInheritance may also be set
up for various combinations.
1539 \def\MT@define@inh@key@encoding#1{%
1540
\define@key{MT@#1}{encoding}[]{%
1541
\def\MT@val{##1}%
1542
\expandafter\MT@encoding@check\MT@val,\@nil
1543
\MT@get@highlevel{encoding}%
1544
\MT@edef@n{MT@tempencoding\romannumeral1}{\MT@val}%
1545
}%
1546 }
\MT@encoding@check
But we only allow one encoding.
1547 \def\MT@encoding@check#1,#2\@nil{%
1548
\MT@ifempty{#2}\relax{%
1549
\edef\MT@val{#1}%
1550
\MT@warning{You may only specify one encoding for character\MessageBreak
1551
inheritance lists. Ignoring encoding #2}%
1552
}%
1553 }
\MT@define@inh@keys
1554 \def\MT@define@inh@keys#1{%
1555
\MT@define@inh@key@encoding{#1@inh}%
For the rest, we can reuse the key setup from \SetProtrusion resp.
\SetExpansion.
1556
\MT@define@code@key{#1@inh}{family}%
1557
\MT@define@code@key{#1@inh}{series}%
1558
\MT@define@code@key{#1@inh}{shape}%
1559
\MT@define@code@key@size{#1@inh}%
1560 }
1561 \MT@define@inh@keys{pr}
1562 \MT@define@inh@keys{ex}
\MT@inh@do
Parse the second argument, the inheritance lists. We define the commands
\MT@inh@hnamei@hsloti@, 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
IMPLEMENTATION: Configuration
60
encountered (in \MT@set@prot@codes resp. \MT@set@exp@codes).
1563 \def\MT@inh@do#1,{%
1564
\ifx\relax#1\@empty\else
1565
\MT@inh@split #1==\relax
1566
\expandafter\MT@inh@do\fi
1567 }
\MT@inh@split
At the right time (viz. in MT@set@hexp|proti@codes), \MT@lt will be redefined to set the codes for the inheriting characters gathered here.
1568 \def\MT@inh@split#1=#2=#3\relax{%
1569
\def\@tempa{#1}%
1570
\ifx\@tempa\@empty\else
1571
\MT@get@slot
1572
\ifnum\MT@char > \m@ne
1573
\let\MT@val\MT@char
1574
\def\@tempb{#2}%
1575
\@for\@tempa:=\@tempb\do{%
1576
\ifx\@tempa\@empty\else
1577
\MT@get@slot
1578
\ifnum\MT@char > \m@ne
1579
\expandafter\MT@xadd
1580
\csname MT@inh@\MT@inh@name @\MT@val @\endcsname
1581
{\noexpand\MT@lt{\MT@char}}%
1582
\fi
1583
\fi
1584
}%
1585 hdebugi\let\MT@lt\@empty
1586 hdebugi\MT@dinfo@nl{1}{children of #1 (\MT@val):
1587 hdebugi
\@nameuse{MT@inh@\MT@inh@name @\MT@val @}}%
1588
\fi
1589
\fi
1590 }
10.4.5
\MT@permute
\MT@permute@
\MT@permute@@
\MT@permute@@@
\MT@permute@@@@
\MT@permute@@@@@
Permutation
Calling \MT@permute will define commands for all permutations of specified font characteristics of the form \MT@hlist typei@/hencodingi/hfamilyi/
hseriesi/hshapei/h|*i to be the expansion of \MT@hlist typei@name, i. e. the
name of the currently defined list. Size ranges are held in a separate macro
called \MT@hlist typei@/hfont axesi@sizes, which in turn contains the respective hlist nameis attached to the ranges.
1591 \def\MT@permute{%
1592
\let\MT@cnt@encoding\@ne
1593
\MT@permute@
Undefine commands for the next round.
1594
\MT@permute@reset
1595 }
1596 \def\MT@permute@{%
1597
\let\MT@cnt@family\@ne
1598
\MT@permute@@
IMPLEMENTATION: Configuration
61
1599
\MT@increment\MT@cnt@encoding
1600
\MT@ifdefined@n{MT@tempencoding\romannumeral\MT@cnt@encoding}%
1601
\MT@permute@
1602
\relax
1603 }
1604 \def\MT@permute@@{%
1605
\let\MT@cnt@series\@ne
1606
\MT@permute@@@
1607
\MT@increment\MT@cnt@family
1608
\MT@ifdefined@n{MT@tempfamily\romannumeral\MT@cnt@family}%
1609
\MT@permute@@
1610
\relax
1611 }
1612 \def\MT@permute@@@{%
1613
\let\MT@cnt@shape\@ne
1614
\MT@permute@@@@
1615
\MT@increment\MT@cnt@series
1616
\MT@ifdefined@n{MT@tempseries\romannumeral\MT@cnt@series}%
1617
\MT@permute@@@
1618
\relax
1619 }
1620 \def\MT@permute@@@@{%
1621
\MT@permute@@@@@
1622
\MT@increment\MT@cnt@shape
1623
\MT@ifdefined@n{MT@tempshape\romannumeral\MT@cnt@shape}%
1624
\MT@permute@@@@
1625
\relax
1626 }
1627 \def\MT@permute@@@@@{%
1628
\MT@permute@define{encoding}%
1629
\MT@permute@define{family}%
1630
\MT@permute@define{series}%
1631
\MT@permute@define{shape}%
1632
\edef\@tempa{\MT@tempencoding/%
1633
\MT@tempfamily/%
1634
\MT@tempseries/%
1635
\MT@tempshape/%
1636
\MT@ifdefined@c\MT@tempsize *\@empty}%
Some sanity checks: an encoding must be specified (unless nothing else is);
only one list should apply to a given combination.
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
\def\@tempb{////}%
\ifx\@tempa\@tempb\else
\ifx\MT@tempencoding\@empty
\MT@warning{You have to specify an encoding for
\@nameuse{MT@abbr@\MT@permutelist} list\MessageBreak
‘\@nameuse{MT@\MT@permutelist @name}’. Ignoring it}%
\else
\ifx\MT@tempsize\@undefined
\MT@ifdefined@n{MT@\MT@permutelist @\@tempa}{%
\MT@warning{\@nameuse{MT@abbr@\MT@permutelist} list
‘\@nameuse{MT@\MT@permutelist @name}’ will override list\MessageBreak
‘\@nameuse{MT@\MT@permutelist @\@tempa}’ for font ‘\@tempa’}%
}\relax
IMPLEMENTATION: Configuration
62
1650 hdebugi\MT@dinfo@nl{0}{initializing: use list for font \@tempa}%
1651
\else
Append the list of ranges to the current combination, after checking for any
conflicts.
1652
\expandafter\MT@check@rlist\expandafter
1653
{MT@\MT@permutelist @\@tempa @sizes}\MT@tempsize
1654
\expandafter\MT@xadd
1655
\csname MT@\MT@permutelist @\@tempa @sizes\endcsname
1656
\MT@tempsize
1657 hdebugi\MT@dinfo@nl{0}{initializing: use list for font \@tempa,\MessageBreak
1658 hdebugi
sizes: \csname MT@\MT@permutelist @\@tempa @sizes\endcsname}%
1659
\fi
1660
\global\MT@edef@n{MT@\MT@permutelist @\@tempa}%
1661
{\csname MT@\MT@permutelist @name\endcsname}%
1662
\fi
1663
\fi
1664 }
\MT@permute@define
Define and reset the commands.
1665 \def\MT@permute@define#1{%
1666
\expandafter\@tempcnta=\csname MT@cnt@#1\endcsname\relax
1667
\MT@ifdefined@n{MT@temp#1\romannumeral\@tempcnta}{%
1668
\MT@edef@n{MT@temp#1}{\csname MT@temp#1\romannumeral\@tempcnta\endcsname}%
1669
}{%
1670
\MT@let@nc{MT@temp#1}\@empty
1671
}%
1672 }
\MT@permute@reset
1673 \def\MT@permute@reset{%
1674
\MT@permute@reset@{encoding}%
1675
\MT@permute@reset@{family}%
1676
\MT@permute@reset@{series}%
1677
\MT@permute@reset@{shape}%
1678
\let\MT@tempsize\@undefined
1679 }
\MT@permute@reset@
1680 \def\MT@permute@reset@#1{%
1681
\@tempcnta=\@ne
1682
\MT@loop
1683
\MT@let@nc{MT@temp#1\romannumeral\@tempcnta}\@undefined
1684
\advance\@tempcnta\@ne
1685
\MT@ifdefined@n{MT@temp#1\romannumeral\@tempcnta}%
1686
\@tempswatrue
1687
\@tempswafalse
1688
\if@tempswa \MT@repeat
1689 }
\MT@check@rlist
For every range item in h#2i, test whether it overlaps with items in list
h#1i.
1690 \def\MT@check@rlist#1#2{%
1691
\MT@ifdefined@n{#1}{%
IMPLEMENTATION: Configuration
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701 }
\MT@check@range
63
\begingroup
\def\MT@range##1##2##3{%
\def\@tempb{##1}%
\def\@tempc{##2}%
\MT@check@range{#1}%
}%
#2%
\endgroup
}\relax
Recurse through the list of existing ranges.
1702 \def\MT@check@range#1{%
1703
\expandafter\expandafter\expandafter\MT@check@range@
1704
\csname #1\endcsname\relax\@nil
1705 }
\MT@check@range@
\@tempb and \@tempc are lower resp. upper bound of the new item, h#2i
and h#3i those of the existing item.
1706 \def\MT@check@range@#1#2#3#4#5\@nil{%
1707
\@tempswafalse
1708
\MT@ifeq{#3}\m@ne{%
1709
\MT@ifeq\@tempc\m@ne{%
Both items are simple sizes.
\MT@ifeq\@tempb{#2}\@tempswatrue\relax
1710
1711
}{%
Item in list is a simple size, new item is a range.
1712
1713
1714
1715
1716
1717
1718
1719
1720
\MT@ifgt\@tempb{#2}\relax{%
\MT@ifgt\@tempc{#2}{%
\@tempswatrue
\edef\@tempb{#2 (with range: \@tempb\space to \@tempc)}%
}\relax
}%
}%
}{%
\MT@ifeq\@tempc\m@ne{%
Item in list is a range, new item is a simple size.
1721
1722
1723
1724
\MT@iflt\@tempb{#3}{%
\MT@iflt\@tempb{#2}\relax\@tempswatrue
}\relax
}{%
Both items are ranges.
1725
1726
1727
1728
1729
1730
1731
1732
1733
\MT@iflt\@tempb{#3}{%
\MT@ifgt\@tempc{#2}{%
\@tempswatrue
\edef\@tempb{#2 to #3 (with range: \@tempb\space to \@tempc)}%
}\relax
}\relax
}%
}%
\if@tempswa
IMPLEMENTATION: User Command
1734
1735
1736
1737
64
\MT@warning{\@nameuse{MT@abbr@\MT@permutelist} list
‘\@nameuse{MT@\MT@permutelist @name}’ will override\MessageBreak
list ‘#4’ for font \@tempa,\MessageBreak size \@tempb}%
\else
If we’ve already found a conflict with this item, we can skip the rest of the
list, otherwise we call this macro again.
1738
1739
1740
1741
1742 }
10.5
\microtypesetup
\MT@define@optionX
\ifx#5\relax\else
\MT@check@range@#5\@nil
\fi
\fi
User Command
This command may be used anywhere in the document. It accepts the options: protrusion, expansion and activate. Specifying font sets is not allowed.
1743 \def\microtypesetup{\setkeys{MTX}}
1744 \def\MT@define@optionX#1{%
1745
\define@key{MTX}{#1}[true]{%
1746
\KV@@sp@def\@tempb{#1}%
1747
\@for\MT@val:=##1\do{%
1748
\MT@remove@spaces{\MT@val}%
1749
\edef\@tempb{\csname MT@abbrx@\@tempb\endcsname}%
1750
\MT@ifempty\MT@val\relax{%
1751
\@tempcnta=\m@ne
1752
\def\@tempa{false}%
1753
\ifx\MT@val\@tempa
1754
\@tempcnta=\z@
1755
\MT@info{Disabling #1}%
1756
\let\MT@val\relax
1757
\fi
Enabling micro-typography in the middle of the document is not allowed if
it has been disabled in the package options since fonts might already have
been loaded and hence wouldn’t be set up.
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
\def\@tempa{true}%
\ifx\MT@val\@tempa
\MT@checksetup{\@tempb}%
\if@tempswa
\expandafter\@tempcnta=\csname MT@\@tempb @level\endcsname\relax
\MT@info{Enabling #1\space (level
\number\csname MT@\@tempb @level\endcsname)}%
\let\MT@val\relax
\fi
\fi
\def\@tempa{compatibility}%
\ifx\MT@val\@tempa
\MT@checksetup{\@tempb}%
\if@tempswa
\@tempcnta=\@ne
IMPLEMENTATION: User Command
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805 }
65
\MT@let@nc{MT@\@tempb @level}\@ne
\MT@info{Setting #1\space to level 1}%
\let\MT@val\relax
\fi
\fi
\def\@tempa{nocompatibility}%
\ifx\MT@val\@tempa
\MT@checksetup{\@tempb}%
\if@tempswa
\@tempcnta=\tw@
\MT@let@nc{MT@\@tempb @level}\tw@
\MT@info{Setting #1\space to level 2}%
\let\MT@val\relax
\fi
\fi
\ifx\MT@val\relax\else
\MT@warning{%
Value ‘\MT@val’ for key ‘#1’ not recognized.\MessageBreak
Use any of ‘true’, ‘false’, ‘compatibility’ or\MessageBreak
‘nocompatibility’}%
\fi
\ifnum\@tempcnta>\m@ne
\def\@tempa{ex}%
\ifx\@tempa\@tempb
\pdfadjustspacing\@tempcnta
\else
\pdfprotrudechars\@tempcnta
\fi
\fi
}%
}%
}%
\MT@checksetup
1806 \def\MT@checksetup#1{%
1807
\expandafter\csname ifMT@\csname MT@abbr@#1\endcsname\endcsname
1808
\@tempswatrue
1809
\else
1810
\MT@warning{%
1811
You cannot enable \@nameuse{MT@abbr@#1} if it was disabled\MessageBreak
1812
in the package options,}%
1813
\let\MT@val\relax
1814
\@tempswafalse
1815
\fi
1816 }
1817 \MT@define@optionX{protrusion}
1818 \MT@define@optionX{expansion}
1819 \define@key{MTX}{activate}[]{%
1820
\setkeys{MTX}{protrusion={#1}}%
1821
\setkeys{MTX}{expansion={#1}}%
1822 }
IMPLEMENTATION: Package Options
66
Disable everything – may be used as a work-around in case setting up fonts
doesn’t work in certain environments. (Undocumented.)
1823 \def\MT@gobblethree#1#2#3{}
1824 \let\MT@saved@setupfont\MT@setupfont
1825 \define@key{MTX}{disable}[]{%
1826
\MT@info{Inactivate microtype package}%
1827
\let\MT@setupfont\MT@gobblethree
1828 }
1829 \define@key{MTX}{enable}[]{%
1830
\MT@info{Reactivate microtype package}%
1831
\let\MT@setupfont\MT@saved@setupfont
1832 }
10.6
\ifMT@opt@protrusion
Package Options
Keep track of whether the user explicitly set these options.
\ifMT@opt@expansion 1833 \newif\ifMT@opt@protrusion
\ifMT@opt@auto 1834 \newif\ifMT@opt@expansion
1835 \newif\ifMT@opt@auto
\MT@define@option
expansion and protrusion may be true, false, compatibility, nocompatibility
and/or a hset namei.
1836 \def\MT@define@option#1{%
1837
\define@key{MT}{#1}[true]{%
1838
\csname MT@opt@#1true\endcsname
1839
\@for\MT@val:=##1\do{%
1840
\MT@remove@spaces{\MT@val}%
1841
\edef\@tempb{\csname MT@abbrx@#1\endcsname}%
1842
\MT@ifempty\MT@val\relax{%
1843
\csname MT@#1true\endcsname
1844
\def\@tempa{false}%
1845
\ifx\MT@val\@tempa
1846
\csname MT@#1false\endcsname
1847
\let\MT@val\relax
1848
\fi
1849
\def\@tempa{compatibility}%
1850
\ifx\MT@val\@tempa
1851
\MT@let@nc{MT@\@tempb @level}\@ne
1852
\let\MT@val\relax
1853
\fi
1854
\def\@tempa{nocompatibility}%
1855
\ifx\MT@val\@tempa
1856
\MT@let@nc{MT@\@tempb @level}\tw@
1857
\let\MT@val\relax
1858
\fi
1859
\ifx\MT@val\relax\else
1860
\def\@tempa{true}%
1861
\ifx\MT@val\@tempa
1862
\else
If everything failed, it must be a set name.
1863
\MT@ifdefined@n{MT@\@tempb list@@\MT@val}{%
IMPLEMENTATION: Package Options
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877 }
67
\global\MT@edef@n{MT@\@tempb @setname}{\MT@val}%
\MT@info@nl{Using #1 set ‘\MT@val’}%
}{%
\global\MT@def@n{MT@\@tempb @setname}{alltext}%
\MT@warning@nl{%
The #1 set ‘\MT@val’ is undeclared.\MessageBreak
Using set ‘\@nameuse{MT@\@tempb @setname}’ instead}%
}%
\fi
\fi
}%
}%
}%
1878 \MT@define@option{protrusion}
1879 \MT@define@option{expansion}
activate is a shortcut.
1880 \define@key{MT}{activate}[]{%
1881
\setkeys{MT}{protrusion={#1}}%
1882
\setkeys{MT}{expansion={#1}}%
1883 }
\MT@def@bool@opt
The true/false options: DVIoutput, draft (may be inherited from the class
options), auto, selected.
1884 \def\MT@def@bool@opt#1{%
1885
\define@key{MT}{#1}[true]{%
1886
\def\@tempa{##1}%
1887
\def\@tempb{true}%
1888
\ifx\@tempa\@tempb \else
1889
\def\@tempb{false}%
1890
\ifx\@tempa\@tempb \else
1891
\MT@warning@nl{%
1892
Unrecognized value for option ‘#1’.\MessageBreak
1893
Assuming ‘false’}%
1894
\fi
1895
\fi
1896
\csname MT@#1\@tempb\endcsname
1897
}%
1898 }
1899 \@tfor\MT@val:={DVIoutput}{draft}{auto}{selected}\do{%
1900
\expandafter\MT@def@bool@opt\expandafter{\MT@val}
1901 }
final is the opposite to draft.
1902 \define@key{MT}{final}[true]{%
1903
\MT@draftfalse
1904
\def\@tempa{#1}%
1905
\def\@tempb{true}%
1906
\ifx\@tempa\@tempb
1907
\else
1908
\def\@tempb{false}%
IMPLEMENTATION: Package Options
1909
1910
1911
1912
1913
1914
1915
1916
1917 }
\ifx\@tempa\@tempb
\MT@drafttrue
\else
\MT@warning@nl{%
Unrecognized value for option ‘final’.\MessageBreak
Assuming ‘true’}%
\fi
\fi
For verbose output, we simply redefine \MT@vinfo.
1918 \define@key{MT}{verbose}[true]{%
1919
\let\MT@vinfo\MT@info@nl
1920
\def\@tempa{#1}%
1921
\def\@tempb{true}%
1922
\ifx\@tempa\@tempb
1923
\else
Take problems seriously.
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938 }
\MT@def@num@opt
\def\@tempb{errors}%
\ifx\@tempa\@tempb
\let\MT@warning\MT@warn@err
\let\MT@warning@nl\MT@warn@err
\else
\let\MT@vinfo\@gobble
\def\@tempb{false}%
\ifx\@tempa\@tempb \else
\MT@warning@nl{%
Unrecognized value for option ‘verbose’.\MessageBreak
Assuming ‘false’}%
\fi
\fi
\fi
Options with numerical keys: factor, stretch, shrink, step.
1939 \def\MT@def@num@opt#1{%
1940
\define@key{MT}{#1}[]{%
1941
\MT@ifempty{##1}%
1942
{\MT@let@cn\@tempa{MT@#1@default}}%
1943
{\def\@tempa{##1 }}%
No nonsense in \MT@factor et al.? A space terminates the number.
1944
1945
1946
1947
1948
1949
1950
1951
1952 }
\MT@ifnumber\@tempa{%
\MT@edef@n{MT@#1}{\@tempa}%
}{%
\MT@warning@nl{%
Value ‘##1’ for option ‘#1’ is not a number.\MessageBreak
Using default value of \number\@nameuse{MT@#1@default}}%
}%
}%
1953 \@tfor\MT@val:={factor}{stretch}{shrink}{step}\do{%
1954
\expandafter\MT@def@num@opt\expandafter{\MT@val}%
68
IMPLEMENTATION: Package Options
69
1955 }
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.)
1956 \MT@protrusiontrue
1957 \ifnum\pdfoutput=\z@\else
Also, we only enable expansion by default if pdfTEX can expand the fonts
automatically.
1958
\ifnum\MT@pdftex@no=4\relax
1959
\MT@expansiontrue
1960
\MT@autotrue
1961
\fi
1962 \fi
Load the local configuration file before processing the package options.
1963 \MT@info@nl{Trying to load main configuration file ...}
1964 \IfFileExists{microtype.cfg}{%
1965
\MT@begin@catcodes
1966
\let\MT@begin@catcodes\relax
1967
\let\MT@end@catcodes\relax
1968
\input{microtype.cfg}%
1969
\endgroup
1970
\MT@info@nl{... main configuration file loaded successfully}%
1971 }{%
1972
\MT@warning@nl{%
1973
Could not find configuration file ‘microtype.cfg’!\MessageBreak
1974
This will almost certainly cause undesired results.\MessageBreak
1975
Please fix your installation}%
1976 }
\MicroType@Hook
This hook may be used by font package authors, e. g. to declare alias fonts.
If it is defined, it will be executed here, i. e., after the main configuration
file has been loaded, and before the package options are evaluated.
This hook overcomes the situation that (1) the microtype package
should be loaded after all font defaults have been set up (hence, using
\@ifpackageloaded in the font package is not viable), and (2) checking
\AtBeginDocument might be too late, since fonts might already have been
loaded, and consequently set up, in the preamble.
Package authors should check whether the command is already defined
so that existing definitions by other packages aren’t overwritten. Example:
\def\MinionPro@MT@Hook
{\DeclareMicroTypeAlias{MinionPro-LF}{MinionPro}}
\@ifundefined{MicroType@Hook}
{\let\MicroType@Hook\MinionPro@MT@Hook}
{\g@addto@macro\MicroType@Hook{\MinionPro@MT@Hook}}
1977 \MT@ifdefined@c\MicroType@Hook\MicroType@Hook\relax
IMPLEMENTATION: Package Options
\ProcessOptionsWithKV
70
Parse options.
1978 \def\ProcessOptionsWithKV#1{%
1979
\let\@tempc\relax
1980
\let\KVo@tempa\@empty
1981
\@for\CurrentOption:=\@classoptionslist\do{%
1982
\MT@ifdefined@n{KV@#1@\CurrentOption}{%
1983
\edef\KVo@tempa{\KVo@tempa,\CurrentOption,}%
1984
\@expandtwoargs\@removeelement\CurrentOption
1985
\@unusedoptionlist\@unusedoptionlist
1986
}\relax
1987
}%
1988
\edef\KVo@tempa{%
1989
\noexpand\setkeys{#1}{%
1990
\KVo@tempa\@ptionlist{\@currname.\@currext}%
1991
}%
1992
}%
1993
\KVo@tempa
1994
\AtEndOfPackage{\let\@unprocessedoptions\relax}%
1995
\let\CurrentOption\@empty
1996 }
1997 \ProcessOptionsWithKV{MT}
Now we can take the appropriate actions:
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 it is changed 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!
1998 \ifMT@DVIoutput
1999
\ifnum\pdfoutput=\z@
2000
\MT@info@nl{Generating DVI output}
2001
\else
2002
\pdfoutput\z@
2003
\MT@info@nl{Changing output mode to DVI}
For DVI output, the user must have explicitly passed the expansion option
to the package.
2004
\ifMT@opt@expansion\else
2005
\MT@expansionfalse
2006
\fi
2007
\fi
2008 \else
2009
\MT@info@nl{Generating \ifnum\pdfoutput=\z@ DVI \else PDF \fi output}
2010 \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 2010 lines above if we
IMPLEMENTATION: Package Options
71
are running in draft mode.
2011 \ifMT@draft
2012
\MT@warning@nl{‘draft’ option active.\MessageBreak
2013
Disabling all micro-typographic features}
2014
\MT@protrusionfalse
2015
\MT@expansionfalse
2016
\let\MT@setupfont\relax
2017
\let\microtypesetup\@gobble
2018
\renewcommand{\UseMicroTypeSet}[2][]{}
2019
\renewcommand{\SetProtrusion}[3][]{}
2020
\renewcommand{\SetExpansion}[3][]{}
2021 \else
2022
\ifMT@protrusion
2023
\MT@info@nl{%
2024
Character protrusion enabled (level \number\MT@pr@level)%
2025
\ifnum\MT@factor=\@m\else,\MessageBreak factor: \number\MT@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.
2026
2027
2028
2029
2030
2031
2032
2033
\MT@ifdefined@n{MT@pr@setname}\relax{%
\MT@info@nl{Using default protrusion set ‘alltext’}%
\gdef\MT@pr@setname{alltext}%
}
\else
\MT@info@nl{No character protrusion}
\fi
\ifMT@expansion
Set up the values for font expansion: If stretch has not been specified, we
take the default value of 20.
2034
2035
2036
\ifnum\MT@stretch=\m@ne
\let\MT@stretch\MT@stretch@default
\fi
If shrink has not been specified, it will inherit the value from stretch.
2037
2038
2039
2040
2041
2042
2043
\ifnum\MT@shrink=\m@ne
\ifnum\MT@stretch>\z@
\let\MT@shrink\MT@stretch
\else
\let\MT@shrink\MT@shrink@default
\fi
\fi
If step has not been specified, we will set it to min(stretch,shrink)/5,
rounded off, minimum value 1.
2044
2045
2046
2047
2048
2049
2050
\ifnum\MT@step=\m@ne
\ifnum\MT@stretch>\MT@shrink
\ifnum\MT@shrink=\z@
\@tempcnta=\MT@stretch
\else
\@tempcnta=\MT@shrink
\fi
IMPLEMENTATION: Package Options
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
\MT@auto
72
\else
\ifnum\MT@stretch=\z@
\@tempcnta=\MT@shrink
\else
\@tempcnta=\MT@stretch
\fi
\fi
\divide\@tempcnta 5 \relax
\else
\@tempcnta=\MT@step
\fi
\ifnum\@tempcnta=\z@ \@tempcnta=\@ne \fi
\edef\MT@step{\number\@tempcnta\space}
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).
2064
2065
2066
\let\MT@auto\@empty
\ifMT@auto
\ifnum\MT@pdftex@no=4\relax
We turn off automatic expansion if output mode is DVI.
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
\ifnum\pdfoutput=\z@
\ifMT@opt@auto
\MT@warning@nl{%
Automatic font expansion only works for PDF output.\MessageBreak
However, you are creating a DVI file. I will switch\MessageBreak
automatic font expansion off and hope that expanded\MessageBreak
fonts are available}
\fi
\MT@autofalse
\else
\def\MT@auto{autoexpand}
\fi
Also, if pdfTEX is too old.
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
\else
\ifMT@opt@auto
\MT@warning@nl{%
The pdftex you are using is too old for automatic\MessageBreak
font expansion. I will switch it off and hope that\MessageBreak
expanded fonts are available on your system.\MessageBreak
Install pdftex version 1.20 or newer}
\fi
\MT@autofalse
\def\MT@auto{1000 }
\fi
No automatic expansion.
2090
2091
2092
2093
2094
\else
\ifnum\MT@pdftex@no<4\relax
\def\MT@auto{1000 }
\fi
\fi
CONFIGURATION FILES
73
Use the appropriate macro for selected expansion.
2095
2096
2097
2098
2099
\ifMT@selected
\let\MT@set@exp@codes\MT@set@exp@codes@s
\else
\let\MT@set@exp@codes\MT@set@exp@codes@n
\fi
Info.
2100
\MT@info@nl{\ifMT@auto Automatic f\else F\fi ont expansion enabled
2101
(level \number\MT@ex@level),\MessageBreak
2102
stretch: \number\MT@stretch, shrink: \number\MT@shrink,
2103
step: \number\MT@step, \ifMT@selected\else non-\fi selected}
2104
\MT@ifdefined@n{MT@ex@setname}\relax{%
2105
\MT@info@nl{Using default expansion set ‘basictext’}%
2106
\gdef\MT@ex@setname{basictext}%
2107
}
2108
\else
2109
\MT@info@nl{No font expansion}
2110
\fi
2111 \fi
Finally, we enable the micro-typographic extensions, or we don’t.
2112 \ifMT@protrusion
2113
\pdfprotrudechars\MT@pr@level
2114 \fi
2115 \ifMT@expansion
2116
\pdfadjustspacing\MT@ex@level
Inside \showhyphens, font expansion should be disabled.
2117
2118
2119
2120
\showhyphens
\CheckCommand*{\showhyphens}[1]{%
\setbox0\vbox{\color@begingroup\everypar{}\parfillskip\z@skip
\hsize\maxdimen\normalfont\pretolerance\m@ne\tolerance\m@ne
\hbadness\z@\showboxdepth\z@\ #1\color@endgroup}}
I wonder why it’s defined globally (in ltfssbas.dtx)?
2121
\gdef\showhyphens#1{%
2122
\setbox0\vbox{%
2123
\color@begingroup
2124
\pdfadjustspacing=\z@
2125
\everypar{}%
2126
\parfillskip\z@skip\hsize\maxdimen
2127
\normalfont
2128
\pretolerance\m@ne\tolerance\m@ne\hbadness\z@\showboxdepth\z@\ #1%
2129
\color@endgroup}}
2130 \fi
2131 h/packagei
That was that.
11
Configuration Files
Let’s now write the font configuration files.
2132 h*configi
CONFIGURATION FILES: Character Inheritance
74
The following characters must not appear verbatim: ‘\’ (use ‘\textbackslash’
instead); ‘{’, ‘}’ (‘\textbraceleft’, ‘\textbraceright’); ‘%’ (‘\%’); ‘,’, ‘=’
(‘{,}’, ‘{=}’). Of course, numerical identification is possible, too.
Ligatures and \mathchardefed symbols always have to be specified numerically.
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.
2133 h*m-ti
2134
2135 %%% ---------------------------------------------------------------------2136 %%% CHARACTER INHERITANCE
2137
Glyphs that should possibly inherit settings on one side only: 012 (‘fi’ ligature), 013 (‘fl’), 014 (‘ffi’), 015 (‘ffl’), Æ, æ, Œ, œ.
2138 \DeclareCharacterInheritance
2139
{ encoding = OT1 }
2140
{ f = {011}, % ff
2141
i = {\i},
2142
j = {\j},
2143
O = {\O},
2144
o = {\o},
2145
}
2146
Candidates here: 028 (‘fi’), 029 (‘fl’), 030 (‘ffi’), 031 (‘ffl’), 156 (‘IJ’ ligature),
188 (‘ij’), Æ, æ, Œ, œ.
2147 \DeclareCharacterInheritance
2148
{ encoding = T1 }
2149
{ A = {\‘A,\’A,\^A,\~A,\"A,\r{A},\k{A},\u{A}},
2150
a = {\‘a,\’a,\^a,\~a,\"a,\r{a},\k{a},\u{a}},
2151
C = {\’C,\c{C},\v{C}},
2152
c = {\’c,\c{c},\v{c}},
2153
D = {\v{D},\DH,\DJ},
2154
d = {\v{d},\dj},
2155
E = {\‘E,\’E,\^E,\"E,\k{E},\v{E}},
2156
e = {\‘e,\’e,\^e,\"e,\k{e},\v{e}},
2157
f = {027}, % ff
2158
G = {\u{G}},
2159
g = {\u{g}},
2160
I = {\‘I,\’I,\^I,\"I,\.I},
2161
i = {\‘i,\’i,\^i,\"i,\i},
2162
j = {\j},
2163
L = {\L,\’L,\v{L}},
2164
l = {\l,\’l,\v{l}},
2165
N = {\’N,\~N,\v{N}},
2166
n = {\’n,\~n,\v{n}},
2167
O = {\O,\‘O,\’O,\^O,\~O,\"O,\H{O}},
CONFIGURATION FILES: Font Expansion
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
o
R
r
S
s
T
t
U
u
Y
y
Z
z
-
=
=
=
=
=
=
=
=
=
=
=
=
=
=
75
{\o,\‘o,\’o,\^o,\~o,\"o,\H{o}},
{\’R,\v{R}},
{\’r,\v{r}},
{\’S,\c{S},\v{S},\SS},
{\’s,\c{s},\v{s}},
{\c{T},\v{T}},
{\c{t},\v{t}},
{\‘U,\’U,\^U,\"U,\H{U},\r{U}},
{\‘u,\’u,\^u,\"u,\H{u},\r{u}},
{\’Y,\"Y},
{\’y,\"y},
{\’Z,\.Z,\v{Z}},
{\’z,\.z,\v{z}},
{127},
}
More characters: 008 (‘fl’), 012 (‘fi’), 014 (‘ffi’), 015 (‘ffl’), Æ, æ, Œ, œ.
2184 \DeclareCharacterInheritance
2185
{ encoding = LY1 }
2186
{ A = {\‘A,\’A,\^A,\~A,\"A,\r{A}},
2187
a = {\‘a,\’a,\^a,\~a,\"a,\r{a}},
2188
C = {\c{C}},
2189
c = {\c{c}},
2190
D = {\DH},
2191
E = {\‘E,\’E,\^E,\"E},
2192
e = {\‘e,\’e,\^e,\"e},
2193
f = {011}, % ff
2194
I = {\‘I,\’I,\^I,\"I},
2195
i = {\‘i,\’i,\^i,\"i,\i},
2196
L = {\L},
2197
l = {\l},
2198
N = {\~N},
2199
n = {\~n},
2200
O = {\‘O,\’O,\^O,\~O,\"O,\O},
2201
o = {\‘o,\’o,\^o,\~o,\"o,\o},
2202
S = {\v{S}},
2203
s = {\v{s}},
2204
U = {\‘U,\’U,\^U,\"U},
2205
u = {\‘u,\’u,\^u,\"u},
2206
Y = {\’Y,\"Y},
2207
y = {\’y,\"y},
2208
Z = {\v{Z}},
2209
z = {\v{z}},
2210
}
2211
2212 h/m-ti
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
CONFIGURATION FILES: Font Expansion
76
settings).
2213 h*m-ti
2214 %%% ---------------------------------------------------------------------2215 %%% EXPANSION SETTINGS
2216
2217 \SetExpansion
2218 hm-ti
[ name
= default
]
2219 hbchi
[ name
= bch-default ]
2220 hcmri
[ name
= cmr-default ]
2221 hpadi
[ name
= pad-default ]
2222 hpmni
[ name
= pmn-default ]
2223 hppli
[ name
= ppl-default ]
2224 hptmi
[ name
= ptm-default ]
2225 hm-ti
{ encoding = {OT1,T1,LY1} }
2226 h!m-ti
{ encoding = {OT1,T1,LY1},
2227 hbchi
family
= bch }
2228 hcmri
family
= cmr }
2229 hpadi
family
= {pad,padx,padj} }
2230 hpmni
family
= {pmn,pmnx,pmnj} }
2231 hppli
family
= {ppl,pplx,pplj} }
2232 hptmi
family
= {ptm,ptmx,ptmj} }
2233
{
2234
A = 500,
a = 700,
2235
\AE = 500,
\ae = 700,
2236
B = 700,
b = 700,
2237
C = 700,
c = 700,
2238
D = 500,
d = 700,
2239
E = 700,
e = 700,
2240
F = 700,
2241
G = 500,
g = 700,
2242
H = 700,
h = 700,
2243
K = 700,
k = 700,
2244
M = 700,
m = 700,
2245
N = 700,
n = 700,
2246
O = 500,
o = 700,
2247
\OE = 500,
\oe = 700,
2248
P = 700,
p = 700,
2249
Q = 500,
q = 700,
2250
R = 700,
2251
S = 700,
s = 700,
2252
U = 700,
u = 700,
2253
W = 700,
w = 700,
2254
Z = 700,
z = 700,
2255
2 = 700,
2256
3 = 700,
2257
6 = 700,
2258
8 = 700,
2259
9 = 700,
2260
}
2261 h/m-ti
CONFIGURATION FILES: Character Protrusion
11.3
77
Character Protrusion
For future historians, the original settings from Hàn Thế Thành (from
protcode.tex, converted to microtype notation).
2262
2263 %%% ---------------------------------------------------------------------2264 %%% PROTRUSION SETTINGS
2265
2266 %\SetProtrusion
2267 %
[ name
= thanh ]
2268 %
{ encoding = OT1 }
2269 %
{
2270 %
A = {50,50},
2271 %
F = { ,50},
2272 %
J = {50, },
2273 %
K = { ,50},
2274 %
L = { ,50},
2275 %
T = {50,50},
2276 %
V = {50,50},
2277 %
W = {50,50},
2278 %
X = {50,50},
2279 %
Y = {50,50},
2280 %
k = { ,50},
2281 %
r = { ,50},
2282 %
t = { ,50},
2283 %
v = {50,50},
2284 %
w = {50,50},
2285 %
x = {50,50},
2286 %
y = {50,50},
2287 %
. = { ,700},
{,}= { ,700},
2288 %
: = { ,500},
; = { ,500},
2289 %
! = { ,200},
? = { ,200},
2290 %
( = {50, },
) = { ,50},
2291 %
- = { ,700},
2292 %
\textendash
= { ,300},
\textemdash
= { ,200},
2293 %
\textquoteleft
= {700, },
\textquoteright
= { ,700},
2294 %
\textquotedblleft = {500, },
\textquotedblright = { ,500},
2295 %
}
2296 %
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 Minion11
(pmnx, pmnj).
11.3.1
Default
The default settings always use the most moderate value.
2297 \SetProtrusion
2298 hm-ti
[ name
= default ]
11 Contributed by Harald Harders ([email protected])
CONFIGURATION FILES: Character Protrusion
2299 hbchi
[ name
= bch-default ]
2300 hcmri
[ name
= cmr-default ]
2301 hpadi
[ name
= pad-default ]
2302 hpmni
[ name
= pmnj-default ]
2303 hppli
[ name
= ppl-default ]
2304 hptmi
[ name
= ptm-default ]
2305 hm-ti
{ encoding = OT1
}
2306 h!m-ti
{ encoding = OT1,
2307 hbchi
family
= bch }
2308 hcmri
family
= cmr }
2309 hpadi
family
= {pad,padx,padj} }
2310 hpmni
family
= pmnj }
2311 hppli
family
= {ppl,pplx,pplj} }
2312 hptmi
family
= {ptm,ptmx,ptmj} }
2313
{
2314
A = {50,50},
2315 hm-t|cmr|pad|ptmi
\AE = {50, },
2316 hbch|pad|pmni
C = {50, },
2317 hbch|pad|pmni
D = { ,50},
2318 hm-t|bch|cmr|pad|pmn|ptmi
F = { ,50},
2319 hbch|pad|pmni
G = {50, },
2320 hm-t|cmr|pad|pmn|ppl|ptmi
J = {50, },
2321 hbchi
J = {100, },
2322
K = { ,50},
2323 hm-t|bch|cmr|pad|pmn|ppli
L = { ,50},
2324 hptmi
L = { ,80},
2325 hbch|pad|pmni
O = {50,50},
2326 hbch|pad|pmni
\OE = {50, },
2327 hbch|pad|pmni
Q = {50,70},
2328 hbchi
R = { ,50},
2329
T = {50,50},
2330
V = {50,50},
2331
W = {50,50},
2332
X = {50,50},
2333 hm-t|bch|cmr|pad|pmn|ppli
Y = {50,50},
2334 hptmi
Y = {80,80},
2335
k = { ,50},
2336 hpmni
l = { ,-50},
2337 hpad|ppli
p = {50,50},
2338 hpad|ppli
q = {50, },
2339
r = { ,50},
2340 hcmr|pad|pmni
t = { ,70},
2341 hbchi
t = { ,50},
2342
v = {50,50},
2343
w = {50,50},
2344
x = {50,50},
2345 hm-t|bch|pad|pmni
y = { ,50},
2346 hcmr|ppl|ptmi
y = {50,70},
2347 hcmri
0 = { ,50},
2348 hm-ti
1 = {50,50},
2349 hbch|pad|ptmi
1 = {150,150},
2350 hcmri
1 = {100,200},
2351 hpmni
1 = { ,50},
78
79
CONFIGURATION FILES: Character Protrusion
2352 hppli
1 = {100,100},
2353 hbch|cmr|padi
2 = {50,50},
2354 hcmr|padi
3 = {50,50},
2355 hbch|pmni
3 = {50, },
2356 hm-t|padi
4 = {50,50},
2357 hbchi
4 = {100,50},
2358 hcmri
4 = {70,70},
2359 hpmni
4 = {50, },
2360 hptmi
4 = {70, },
2361 hcmri
5 = { ,50},
2362 hpadi
5 = {50,50},
2363 hbchi
6 = {50, },
2364 hcmri
6 = { ,50},
2365 hpadi
6 = {50,50},
2366 hm-ti
7 = {50,50},
2367 hbch|pad|pmni
7 = {50,80},
2368 hcmr|ptmi
7 = {50,100},
2369 hppli
7 = { ,50},
2370 hcmri
8 = { ,50},
2371 hbch|padi
9 = {50,50},
2372 hcmri
9 = { ,50},
2373 hm-t|cmr|pad|pmn|ppl|ptmi
. = { ,700},
2374 hbchi
. = { ,600},
2375
{,}= { ,500},
2376 hm-t|cmr|pad|pmn|ppl|ptmi
: = { ,500},
2377 hbchi
: = { ,400},
2378 hm-t|bch|pad|pmn|ptmi
; = { ,300},
2379 hcmr|ppli
; = { ,500},
2380
! = { ,100},
2381 hm-t|pad|pmn|ptmi
? = { ,100},
2382 hbch|cmr|ppli
? = { ,200},
2383 hpmni
" = {300,300},
2384 hm-t|bch|cmr|pad|pmn|ppli
@ = {50,50},
2385 hptmi
@ = {100,100},
2386
~ = {200,250},
_ = {100,100},
2387 hm-t|bch|pad|pmn|ppl|ptmi
_ = {200,200},
2388 hcmri
2389 hpad|ppl|ptmi
& = {50,100},
2390 hm-t|cmr|pad|pmni
\% = {50,50},
2391 hbchi
\% = { ,50},
2392 hppl|ptmi
\% = {100,100},
2393 hm-t|ppl|ptmi
* = {200,200},
2394 hbch|pmni
* = {200,300},
2395 hcmr|padi
* = {300,300},
2396 hm-t|cmr|ppl|ptmi
+ = {250,250},
2397 hbchi
+ = {150,250},
2398 hpadi
+ = {300,300},
2399 hpmni
+ = {150,200},
2400 hm-t|pad|pmn|ptmi
( = {100,
},
) = {
2401 hbchi
( = {200,
},
) = {
,200},
2402 hcmr|ppli
( = {100,
},
) = {
,300},
2403 hbch|pmni
[ = {100,
},
] = {
,100},
2404 hm-t|pad|pmn|ptmi
/ = {100,200},
,200},
CONFIGURATION FILES: Character Protrusion
80
2405 hbchi
/ = { ,200},
2406 hcmr|ppli
/ = {200,300},
2407 hm-t|ptmi
- = {500,500},
2408 hbch|cmr|ppli
- = {400,500},
2409 hpadi
- = {300,500},
2410 hpmni
- = {200,400},
2411 hm-t|pmni
\textendash
= {200,200},
\textemdash
= {150,150},
2412 hbchi
\textendash
= {200,300},
\textemdash
= {150,250},
2413 hcmri
\textendash
= {400,300},
\textemdash
= {300,200},
2414 hpad|ppl|ptmi
\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).
2415 hm-t|bch|pmni
\textquoteleft
= {300,400},
\textquoteright
= {300,400},
2416 hcmri
\textquoteleft
= {500,700},
\textquoteright
= {500,600},
2417 hpad|ppli
\textquoteleft
= {500,700},
\textquoteright
= {500,700},
2418 hptmi
\textquoteleft
= {500,500},
\textquoteright
= {300,500},
2419 hm-t|bch|pmni
\textquotedblleft = {300,300},
\textquotedblright = {300,300},
2420 hcmri
\textquotedblleft = {500,300},
\textquotedblright = {200,600},
2421 hpad|ppl|ptmi
\textquotedblleft = {300,400},
\textquotedblright = {300,400},
Greek uppercase letters (for math mode).
2422 h*cmri
2423
"00
2424
"01
2425
"02
2426
"03
2427 % "04
2428 % "05
2429
"06
2430
"07
2431
"08
2432
"09
2433 % "0A
2434 h/cmri
2435
}
2436
=
=
=
=
=
=
=
=
=
=
=
{
,150},
{100,100},
{ 50, 50},
{100,100},
{
,
},
{
,
},
{ 50, 50},
{100,100},
{ 50, 50},
{ 50, 50},
{
,
},
%
%
%
%
%
%
%
%
%
%
%
\Gamma
\Delta
\Theta
\Lambda
\Xi
\Pi
\Sigma
\Upsilon
\Phi
\Psi
\Omega
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.
2437 \SetProtrusion
2438 hm-ti
[ name
2439 hbchi
[ name
2440 hcmri
[ name
2441 hpadi
[ name
2442 hpmni
[ name
2443 hppli
[ name
2444 hptmi
[ name
2445 hm-ti
load
2446 hbchi
load
2447 hcmri
load
= T1-default,
= bch-T1,
= cmr-T1,
= pad-T1,
= pmnj-T1,
= ppl-T1,
= ptm-T1,
= default
]
= bch-default ]
= cmr-default ]
CONFIGURATION FILES: Character Protrusion
2448 hpadi
2449 hpmni
2450 hppli
2451 hptmi
2452 hm-ti
2453 h!m-ti
2454 hbchi
2455 hcmri
2456 hpadi
2457 hpmni
2458 hppli
2459 hptmi
2460
{
81
load
= pad-default ]
load
= pmnj-default ]
load
= ppl-default ]
load
= ptm-default ]
{ encoding = {T1,LY1}
}
{ encoding = {T1,LY1},
family
= bch }
family
= cmr }
family
= {pad,padx,padj} }
family
= pmnj }
family
= {ppl,pplx,pplj} }
family
= {ptm,ptmx,ptmj} }
The EC fonts do something weird: They insert a kern between quote and
boundary character. Therefore, we must override the settings from OT1.
2461 hm-t|pad|pmn|ptmi
\textbackslash
= {100,200},
2462 hbchi
\textbackslash
= {150,200},
2463 hcmr|ppli
\textbackslash
= {200,300},
2464 hcmri
\textquotedblleft = {200,600},
2465 hpmni
\TH = { , 50},
2466 hm-t|cmr|pad|ppl|ptmi
\quotesinglbase
= {400,400},
\quotedblbase
= {400,400},
2467 hbch|pmni
\quotesinglbase
= {400,400},
\quotedblbase
= {300,300},
2468 hm-t|bch|pmni
\guilsinglleft
= {400,300},
\guilsinglright
= {300,400},
2469 hcmr|pad|ppl|ptmi
\guilsinglleft
= {400,400},
\guilsinglright
= {300,500},
2470 hm-ti
\guillemotleft
= {200,200},
\guillemotright
= {200,200},
2471 hcmri
\guillemotleft
= {300,200},
\guillemotright
= {100,400},
2472 hbch|pmni
\guillemotleft
= {200,200},
\guillemotright
= {150,300},
2473 hpadi
\guillemotleft
= {300,300},
\guillemotright
= {200,400},
2474 hppl|ptmi
\guillemotleft
= {300,300},
\guillemotright
= {200,400},
2475 hm-t|bch|cmr|pad|pmn|ppli
\textexclamdown
= {100,
},
\textquestiondown = {100,
},
2476 hptmi
\textexclamdown
= {200,
},
\textquestiondown = {200,
},
2477 hm-t|cmr|pad|ppl|ptmi
\textbraceleft
= {400,200},
\textbraceright
= {200,400},
2478 hbch|pmni
\textbraceleft
= {200,
},
\textbraceright
= {
,300},
2479 hm-t|bch|cmr|pad|ppl|ptmi
\textless
= {200,100},
\textgreater
= {100,200},
2480 hpmni
\textless
= {100,
},
\textgreater
= {
,100},
2481 hpmni
\textvisiblespace = {100,100},
2482
}
2483
The lmodern fonts, on the other hand, restore the original kerning from the
OT1 fonts, and so do we. Silly, isn’t it?
2484 h*cmri
2485 \SetProtrusion
2486
[ name
= lmr-T1,
2487
load
= cmr-T1
]
2488
{ encoding = {T1,LY1},
2489
family
= lmr
}
2490
{
2491
\textquotedblleft = {500,300},
2492
\quotedblbase
= {500,300},
2493
}
2494
2495 h/cmri
CONFIGURATION FILES: Character Protrusion
82
2496 h*pmni
2497 \SetProtrusion
2498
[ name
= pmnx-OT1,
2499
load
= pmnj-default ]
2500
{ encoding = OT1,
2501
family
= pmnx }
2502
{
2503
1 = {230,180},
2504
}
2505
2506 \SetProtrusion
2507
[ name
= pmnx-T1,
2508
load
= pmnj-T1 ]
2509
{ encoding = {T1,LY1},
2510
family
= pmnx
}
2511
{
2512
1 = {230,180},
2513
}
2514
2515 h/pmni
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.
2516 \SetProtrusion
2517 hm-ti
[ name
= OT1-it
]
2518 hbchi
[ name
= bch-it
]
2519 hcmri
[ name
= cmr-it
]
2520 hpadi
[ name
= pad-it
]
2521 hpmni
[ name
= pmnj-it ]
2522 hppli
[ name
= ppl-it
]
2523 hptmi
[ name
= ptm-it
]
2524
{ encoding = OT1,
2525 hbchi
family
= bch,
2526 hcmri
family
= cmr,
2527 hpadi
family
= {pad,padx,padj},
2528 hpmni
family
= pmnj,
2529 hppli
family
= {ppl,pplx,pplj},
2530 hptmi
family
= {ptm,ptmx,ptmj},
2531
shape
= {it,sl} }
2532
{
2533 hcmr|ptmi
A = {100,50},
2534 hpad|pmni
A = {50, },
2535 hppli
A = {50,50},
2536 hcmr|ptmi
\AE = {100, },
2537 hpad|ppli
\AE = {50, },
2538 hpmni
\AE = { ,-50},
2539 hcmr|pad|ppl|ptmi
B = {50, },
2540 hpmni
B = {20,-50},
CONFIGURATION FILES: Character Protrusion
2541 hbch|ppl|ptmi
C = {50, },
2542 hcmr|padi
C = {100, },
2543 hpmni
C = {50,-50},
2544 hcmr|pad|ppl|ptmi
D = {50,50},
2545 hpmni
D = {20, },
2546 hcmr|pad|ppl|ptmi
E = {50, },
2547 hpmni
E = {20,-50},
2548 hcmr|pad|ptmi
F = {100, },
2549 hpmni
F = {10, },
2550 hppli
F = {50, },
2551 hbch|ppl|ptmi
G = {50, },
2552 hcmr|padi
G = {100, },
2553 hpmni
G = {50,-50},
2554 hcmr|pad|ppl|ptmi
H = {50, },
2555 hcmr|pad|ptmi
I = {50, },
2556 hpmni
I = {20,-50},
2557 hcmr|ptmi
J = {100, },
2558 hpadi
J = {50, },
2559 hpmni
J = {20, },
2560 hcmr|pad|ppl|ptmi
K = {50, },
2561 hpmni
K = {20, },
2562 hcmr|pad|ppl|ptmi
L = {50, },
2563 hpmni
L = {20,50},
2564 hcmr|ptmi
M = {50, },
2565 hpmni
M = { ,-30},
2566 hcmr|ptmi
N = {50, },
2567 hpmni
N = { ,-30},
2568 hbch|pmn|ppl|ptmi
O = {50, },
2569 hcmr|padi
O = {100, },
2570 hbch|pmn|ppl|ptmi
\OE = {50, },
2571 hcmr|padi
\OE = {100, },
2572 hcmr|pad|ppl|ptmi
P = {50, },
2573 hpmni
P = {20,-50},
2574 hbch|pmn|ppl|ptmi
Q = {50, },
2575 hcmr|padi
Q = {100, },
2576 hcmr|pad|ppl|ptmi
R = {50, },
2577 hpmni
R = {20, },
2578 hbch|cmr|pad|ppl|ptmi
S = {50, },
2579 hpmni
S = {20,-30},
2580 hbch|cmr|pad|ppl|ptmi
$ = {50, },
2581 hpmni
$ = {20,-30},
2582 hbch|pmni
T = {70, },
2583 hcmr|pad|ppl|ptmi
T = {100, },
2584 hcmr|pad|ppl|ptmi
U = {50, },
2585 hpmni
U = {50,-50},
2586 hcmr|pad|pmni
V = {100, },
2587 hppl|ptmi
V = {100,50},
2588 hcmr|pad|pmni
W = {100, },
2589 hppli
W = {50, },
2590 hptmi
W = {100,50},
2591 hcmr|ppl|ptmi
X = {50, },
2592 hcmr|ptmi
Y = {100, },
2593 hpmni
Y = {50, },
2594 hppli
Y = {100,50},
83
CONFIGURATION FILES: Character Protrusion
2595 hpmni
Z = { ,-50},
2596 hpmni
d = { ,-50},
2597 hpad|pmni
f = { ,-100},
2598 hpmni
i = { ,-30},
2599 hpmni
j = { ,-30},
2600 hpmni
l = { ,-100},
2601 hbchi
o = {50,50},
2602 hbchi
p = { ,50},
2603 hpmni
p = {-50, },
2604 hbchi
q = {50, },
2605 hpmni
r = { ,50},
2606 hbchi
t = { ,50},
2607 hpmni
v = {50, },
2608 hbchi
w = { ,50},
2609 hpmni
w = {50, },
2610 hbchi
y = { ,50},
2611 hcmri
0 = {100, },
2612 hbch|ptmi
1 = {150,100},
2613 hcmri
1 = {200,50},
2614 hpadi
1 = {150, },
2615 hpmni
1 = {50, },
2616 hppli
1 = {100, },
2617 hcmri
2 = {100,-100},
2618 hpad|ppl|ptmi
2 = {50, },
2619 hpmni
2 = {-50, },
2620 hbchi
3 = {50, },
2621 hcmri
3 = {100,-100},
2622 hpmni
3 = {-100, },
2623 hptmi
3 = {100,50},
2624 hbchi
4 = {100, },
2625 hcmr|padi
4 = {150, },
2626 hppl|ptmi
4 = {50, },
2627 hcmri
5 = {100, },
2628 hptmi
5 = {50, },
2629 hbchi
6 = {50, },
2630 hcmri
6 = {100, },
2631 hbch|pad|ptmi
7 = {100, },
2632 hcmri
7 = {200,-150},
2633 hpmni
7 = {20, },
2634 hppli
7 = {50, },
2635 hcmri
8 = {50,-50},
2636 hcmri
9 = {100,-100},
2637 hm-t|cmr|pad|pmn|ppli
. = { ,500},
2638 hbch|ptmi
. = { ,700},
2639 hm-t|cmr|pad|pmn|ppli
{,}= { ,500},
2640 hbchi
{,}= { ,600},
2641 hptmi
{,}= { ,700},
2642 hm-t|cmr|pad|ppli
: = { ,300},
2643 hbchi
: = { ,400},
2644 hpmni
: = { ,200},
2645 hptmi
: = { ,500},
2646 hm-t|cmr|pad|ppli
; = { ,300},
2647 hbchi
; = { ,400},
2648 hpmni
; = { ,200},
84
CONFIGURATION FILES: Character Protrusion
85
2649 hptmi
; = { ,500},
2650 hptmi
! = { ,100},
2651 hbchi
? = { ,200},
2652 hptmi
? = { ,100},
2653 hppli
? = { ,300},
2654 hpmni
" = {400,200},
_ = { ,100},
2655 hm-t|bch|pmni
_
2656 hcmri
= {100,200},
_ = {100,100},
2657 hpad|ppl|ptmi
2658 hm-t|pad|pmn|ppl|ptmi
& = {50,50},
2659 hbchi
& = { ,80},
2660 hcmri
& = {100,50},
2661 hm-t|cmr|pad|pmni
\% = {100, },
2662 hbchi
\% = {50,50},
2663 hppl|ptmi
\% = {100,100},
2664 hm-t|pmn|ppli
* = {200,200},
2665 hbchi
* = {300,200},
2666 hcmri
* = {400,100},
2667 hpadi
* = {500,100},
2668 hptmi
* = {400,200},
2669 hm-t|cmr|pmn|ppli
+ = {150,200},
2670 hbchi
+ = {250,250},
2671 hpad|ptmi
+ = {250,200},
2672 hm-t|pad|pmn|ppli
@ = {50,50},
2673 hbchi
@ = {80,50},
2674 hcmri
@ = {200,50},
2675 hptmi
@ = {150,150},
2676 hm-t|bchi
~ = {150,150},
2677 hcmr|pad|pmn|ppl|ptmi
~ = {200,150},
2678
( = {200, },
) = {
,200},
2679 hm-t|cmr|pad|ppl|ptmi
/ = {100,200},
2680 hbchi
/ = { ,150},
2681 hpmni
/ = {100,150},
2682 hm-ti
- = {300,300},
2683 hbch|padi
- = {300,400},
2684 hpmni
- = {200,300},
2685 hcmri
- = {500,300},
2686 hppli
- = {300,500},
2687 hptmi
- = {500,500},
2688 hm-t|pmni
\textendash
= {200,200},
\textemdash
= {150,150},
2689 hbchi
\textendash
= {200,300},
\textemdash
= {150,200},
2690 hcmr|pad|ppl|ptmi
\textendash
= {300,300},
\textemdash
= {200,200},
2691 hm-t|bch|pmni
\textquoteleft
= {400,200},
\textquoteright
= {400,200},
2692 hcmr|padi
\textquoteleft
= {800,200},
\textquoteright
= {800,200},
2693 hppli
\textquoteleft
= {700,400},
\textquoteright
= {700,400},
2694 hptmi
\textquoteleft
= {800,500},
\textquoteright
= {800,500},
2695 hm-t|bch|pmni
\textquotedblleft = {400,200},
\textquotedblright = {400,200},
2696 hcmri
\textquotedblleft = {700,100},
\textquotedblright = {500,300},
2697 hpadi
\textquotedblleft = {700,200},
\textquotedblright = {700,200},
2698 hppli
\textquotedblleft = {500,300},
\textquotedblright = {500,300},
2699 hptmi
\textquotedblleft = {700,400},
\textquotedblright = {700,400},
2700 h*cmri
2701
"00 = {200,150}, % \Gamma
2702
"01 = {150,100}, % \Delta
CONFIGURATION FILES: Character Protrusion
86
2703
"02 = {150, 50}, % \Theta
2704
"03 = {150, 50}, % \Lambda
2705
"04 = {100,100}, % \Xi
2706
"05 = {100,100}, % \Pi
2707
"06 = {100, 50}, % \Sigma
2708
"07 = {200,150}, % \Upsilon
2709
"08 = {150, 50}, % \Phi
2710
"09 = {150,100}, % \Psi
2711
"0A = { 50, 50}, % \Omega
2712 h/cmri
2713
}
2714
2715 \SetProtrusion
2716 hm-ti
[ name
= T1-it-default,
2717 hbchi
[ name
= bch-it-T1,
2718 hcmri
[ name
= cmr-it-T1,
2719 hpadi
[ name
= pad-it-T1,
2720 hpmni
[ name
= pmnj-it-T1,
2721 hppli
[ name
= ppl-it-T1,
2722 hptmi
[ name
= ptm-it-T1,
2723 hm-ti
load
= OT1-it
]
2724 hbchi
load
= bch-it
]
2725 hcmri
load
= cmr-it
]
2726 hpmni
load
= pmnj-it ]
2727 hpadi
load
= pad-it
]
2728 hppli
load
= ppl-it
]
2729 hptmi
load
= ptm-it
]
2730
{ encoding = {T1,LY1},
2731 hbchi
family
= bch,
2732 hcmri
family
= cmr,
2733 hpmni
family
= pmnj,
2734 hpadi
family
= {pad,padx,padj},
2735 hppli
family
= {ppl,pplx,pplj},
2736 hptmi
family
= {ptm,ptmx,ptmj},
2737
shape
= {it,sl} }
2738
{
2739 hm-t|cmr|pad|ppl|ptmi
\textbackslash
= {100,200},
2740 hbchi
\textbackslash
= {150,150},
2741 hpmni
\textbackslash
= {100,150},
2742 hpmni
031 = { ,-100}, % ffl
2743 hcmr|ptmi
156 = {100, }, % IJ
2744 hpadi
156 = {50, }, % IJ
2745 hpmni
156 = {20, }, % IJ
2746 hpmni
188 = { ,-30}, % ij
2747 hpmni
\v{t} = { ,100},
2748 hcmri
\textquotedblleft = {500,300},
2749 hm-t|ptmi
\quotesinglbase
= {300,700},
\quotedblbase
= {400,500},
2750 hcmri
\quotesinglbase
= {300,700},
\quotedblbase
= {200,600},
2751 hbch|pmni
\quotesinglbase
= {200,500},
\quotedblbase
= {150,500},
2752 hpad|ppli
\quotesinglbase
= {500,500},
\quotedblbase
= {400,400},
2753 hm-t|ppl|ptmi
\guilsinglleft
= {400,400},
\guilsinglright
= {300,500},
2754 hbch|pmni
\guilsinglleft
= {300,400},
\guilsinglright
= {200,500},
2755 hcmri
\guilsinglleft
= {500,300},
\guilsinglright
= {400,400},
2756 hpadi
\guilsinglleft
= {500,400},
\guilsinglright
= {300,500},
CONFIGURATION FILES: Character Protrusion
87
2757 hm-t|ppli
\guillemotleft
= {300,300},
\guillemotright
= {300,300},
2758 hbch|pmni
\guillemotleft
= {200,300},
\guillemotright
= {150,400},
2759 hcmri
\guillemotleft
= {400,100},
\guillemotright
= {200,300},
2760 hpadi
\guillemotleft
= {300,300},
\guillemotright
= {200,400},
2761 hptmi
\guillemotleft
= {300,400},
\guillemotright
= {200,400},
2762 hm-t|pad|ppli
\textexclamdown
= {100,
},
\textquestiondown = {200,
},
2763 hcmr|ptmi
\textexclamdown
= {200,
},
\textquestiondown = {200,
},
2764 hpmni
\textexclamdown
= {-50,
},
\textquestiondown = {-50,
},
2765 hm-t|ppli
\textbraceleft
= {200,100},
\textbraceright
= {200,200},
2766 hbch|pmni
\textbraceleft
= {200,
},
\textbraceright
= {
,200},
2767 hcmr|pad|ptmi
\textbraceleft
= {400,100},
\textbraceright
= {200,200},
2768 hbch|pmni
\textless
= {100,
},
\textgreater
= {
,100},
2769 hcmr|pad|ppl|ptmi
\textless
= {300,100},
\textgreater
= {200,100},
2770 hpmni
\textvisiblespace = {100,100},
2771
}
2772
2773 h*cmri
2774 \SetProtrusion
2775
[ name
= lmr-it-T1,
2776
load
= cmr-it-T1 ]
2777
{ encoding = {T1,LY1},
2778
family
= lmr,
2779
shape
= {it,sl} }
2780
{
2781
\textquotedblleft = {700,100},
2782
\quotedblbase
= {600,300},
2783
}
2784
Oldstyle numerals are slightly different.
2785 \SetProtrusion
2786
[ name = cmr(oldstyle)-it,
2787
load = cmr-it-T1 ]
2788
{ encoding = T1,
2789
family
= {hfor,cmor},
2790
shape
= {it,sl} }
2791
{
2792
1 = {250, 50},
2793
2 = {150,-100},
2794
3 = {100,-50},
2795
4 = {150,150},
2796
6 = {200,
},
2797
7 = {200, 50},
2798
8 = {150,-50},
2799
9 = {100, 50},
2800
}
2801
2802 h/cmri
2803 h*pmni
2804 \SetProtrusion
2805
[ name
= pmnx-it,
2806
load
= pmnj-it ]
2807
{ encoding = OT1,
2808
family
= pmnx,
CONFIGURATION FILES: Character Protrusion
88
2809
shape
= {it,sl} }
2810
{
2811
1 = {100,150},
2812
}
2813
2814 \SetProtrusion
2815
[ name
= pmnx-it-T1,
2816
load
= pmnj-it-T1 ]
2817
{ encoding = {T1,LY1},
2818
family
= pmnx,
2819
shape
= {it,sl} }
2820
{
2821
1 = {100,150},
2822
}
2823
2824 h/pmni
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.
2825 \SetProtrusion
2826 hm-ti
[ name
= OT1-sc,
2827 hbchi
[ name
= bch-sc,
2828 hcmri
[ name
= cmr-sc,
2829 hpadi
[ name
= pad-sc,
2830 hpmni
[ name
= pmnj-sc,
2831 hppli
[ name
= ppl-sc,
2832 hptmi
[ name
= ptm-sc,
2833 hm-ti
load
= default ]
2834 hbchi
load
= bch-default ]
2835 hcmri
load
= cmr-default ]
2836 hpadi
load
= pad-default ]
2837 hpmni
load
= pmnj-default ]
2838 hppli
load
= ppl-default ]
2839 hptmi
load
= ptm-default ]
2840
{ encoding = OT1,
2841 hbchi
family
= bch,
2842 hcmri
family
= cmr,
2843 hpadi
family
= {pad,padx,padj},
2844 hpmni
family
= pmnj,
2845 hppli
family
= {ppl,pplx,pplj},
2846 hptmi
family
= {ptm,ptmx,ptmj},
2847
shape
= sc }
2848
{
2849
a = {50,50},
2850 hcmr|pad|ppl|ptmi
\ae = {50, },
2851 hbch|pmni
c = {50, },
2852 hbch|pad|pmni
d = { ,50},
2853 hm-t|bch|cmr|pad|pmn|ptmi
f = { ,50},
2854 hbch|pad|pmni
g = {50, },
2855 hm-t|cmr|pad|pmn|ppl|ptmi
j = {50, },
CONFIGURATION FILES: Character Protrusion
2856 hbchi
j = {100, },
2857 hm-t|bch|cmr|pad|pmn|ppli
l = { ,50},
2858 hptmi
l = { ,80},
2859 hm-t|bch|cmr|pad|pmn|ppli
013 = { ,50}, % fl
2860 hptmi
013 = { ,80}, % fl
2861 hbch|pad|pmni
o = {50,50},
2862 hbch|pad|pmni
\oe = {50, },
2863 hppli
p = { 0, 0},
2864 hbch|pad|pmni
q = {50,70},
2865 hppli
q = { 0, },
2866 hm-t|cmr|pad|pmn|ppl|ptmi
r = { , 0},
2867
t = {50,50},
2868 hm-t|bch|cmr|pad|pmn|ppli
y = {50,50},
2869 hptmi
y = {80,80},
2870
}
2871
2872 \SetProtrusion
2873 hm-ti
[ name
= T1-sc,
2874 hbchi
[ name
= bch-sc-T1,
2875 hcmri
[ name
= cmr-sc-T1,
2876 hpadi
[ name
= pad-sc-T1,
2877 hpmni
[ name
= pmnj-sc-T1,
2878 hppli
[ name
= ppl-sc-T1,
2879 hptmi
[ name
= ptm-sc-T1,
2880 hm-ti
load
= T1-default ]
2881 hbchi
load
= bch-T1
]
2882 hcmri
load
= cmr-T1
]
2883 hpadi
load
= pad-T1
]
2884 hpmni
load
= pmnj-T1
]
2885 hppli
load
= ppl-T1
]
2886 hptmi
load
= ptm-T1
]
2887
{ encoding = {T1,LY1},
2888 hbchi
family
= bch,
2889 hcmri
family
= cmr,
2890 hpadi
family
= {pad,padx,padj},
2891 hpmni
family
= pmnj,
2892 hppli
family
= {ppl,pplx,pplj},
2893 hptmi
family
= {ptm,ptmx,ptmj},
2894
shape
= sc }
2895
{
2896
a = {50,50},
2897 hcmr|pad|ppl|ptmi
\ae = {50, },
2898 hbch|pmni
c = {50, },
2899 hbch|pad|pmni
d = { ,50},
2900 hm-t|bch|cmr|pad|pmn|ptmi
f = { ,50},
2901 hbch|pad|pmni
g = {50, },
2902 hm-t|cmr|pad|pmn|ppl|ptmi
j = {50, },
2903 hbchi
j = {100, },
2904 hm-t|bch|cmr|pad|pmn|ppli
l = { ,50},
2905 hptmi
l = { ,80},
2906 hm-t|bch|cmr|pad|pmn|ppli
029 = { ,50}, % fl
2907 hptmi
029 = { ,80}, % fl
2908 hbch|pad|pmni
o = {50,50},
2909 hbch|pad|pmni
\oe = {50, },
89
CONFIGURATION FILES: Character Protrusion
2910 hppli
p = { 0, 0},
2911 hbch|pad|pmni
q = {50,70},
2912 hppli
q = { 0, },
2913 hm-t|cmr|pad|pmn|ppl|ptmi
r = { , 0},
2914
t = {50,50},
2915 hm-t|bch|cmr|pad|pmn|ppli
y = {50,50},
2916 hptmi
y = {80,80},
2917
}
2918
2919 h*pmni
2920 \SetProtrusion
2921
[ name
= pmnx-sc,
2922
load
= pmnj-sc ]
2923
{ encoding = OT1,
2924
family
= pmnx,
2925
shape
= sc }
2926
{
2927
1 = {230,180},
2928
}
2929
2930 \SetProtrusion
2931
[ name
= pmnx-sc-T1,
2932
load
= pmnj-sc-T1 ]
2933
{ encoding = {T1,LY1},
2934
family
= pmnx,
2935
shape
= sc }
2936
{
2937
1 = {230,180},
2938
}
2939
Minion provides real small caps in italics.
2940 \SetProtrusion
2941
[ name
= pmnj-scit,
2942
load
= pmnj-it
]
2943
{ encoding = OT1,
2944
family
= pmnj,
2945
shape
= {scit,si} }
2946
{
2947
a = {50, },
2948
\ae = { ,-50},
2949
b = {20,-50},
2950
c = {50,-50},
2951
d = {20, 0},
2952
e = {20,-50},
2953
f = {10, 0},
2954
012 = {10,-50}, % fi
2955
013 = {10,-50}, % fl
2956
014 = {10,-50}, % ffi
2957
015 = {10,-50}, % ffl
2958
g = {50,-50},
2959
i = {20,-50},
2960
j = {20, 0},
2961
k = {20, },
90
CONFIGURATION FILES: Character Protrusion
2962
l = {20,50},
2963
m = { ,-30},
2964
n = { ,-30},
2965
o = {50, },
2966
\oe = {50,-50},
2967
p = {20,-50},
2968
q = {50, },
2969
r = {20, 0},
2970
s = {20,-30},
2971
t = {70, },
2972
u = {50,-50},
2973
v = {100, },
2974
w = {100, },
2975
y = {50, },
2976
z = { ,-50},
2977
}
2978
2979 \SetProtrusion
2980
[ name
= pmnj-scit-T1,
2981
load
= pmnj-it-T1
]
2982
{ encoding = {T1,LY1},
2983
family
= pmnj,
2984
shape
= {scit,si}
}
2985
{
2986
a = {50, },
2987
\ae = { ,-50},
2988
b = {20,-50},
2989
c = {50,-50},
2990
d = {20, 0},
2991
e = {20,-50},
2992
f = {10, 0},
2993
028 = {10,-50}, % fi
2994
029 = {10,-50}, % fl
2995
030 = {10,-50}, % ffi
2996
031 = {10,-50}, % ffl
2997
g = {50,-50},
2998
i = {20,-50},
2999
188 = {20, 0}, % ij
3000
j = {20, 0},
3001
k = {20, },
3002
l = {20,50},
3003
m = { ,-30},
3004
n = { ,-30},
3005
o = {50, },
3006
\oe = {50,-50},
3007
p = {20,-50},
3008
q = {50, },
3009
r = {20, 0},
3010
s = {20,-30},
3011
t = {70, },
3012
u = {50,-50},
3013
v = {100, },
3014
w = {100, },
3015
y = {50, },
91
CONFIGURATION FILES: Character Protrusion
3016
z = { ,-50},
3017
}
3018
3019 \SetProtrusion
3020
[ name
= pmnx-scit,
3021
load
= pmnj-scit ]
3022
{ encoding = OT1,
3023
family
= pmnx,
3024
shape
= {scit,si} }
3025
{
3026
1 = {100,150},
3027
}
3028
3029 \SetProtrusion
3030
[ name
= pmnx-scit-T1,
3031
load
= pmnj-scit-T1 ]
3032
{ encoding = {T1,LY1},
3033
family
= pmnx,
3034
shape
= {scit,si}
}
3035
{
3036
1 = {100,150},
3037
}
3038
3039 h/pmni
11.3.4
textcomp
Finally the TS1 encoding. Still very incomplete for Times and Palatino.
3040 \SetProtrusion
3041 hm-ti
[ name
= textcomp ]
3042 hbchi
[ name
= bch-textcomp ]
3043 hcmri
[ name
= cmr-textcomp ]
3044 hpadi
[ name
= pad-textcomp ]
3045 hpmni
[ name
= pmn-textcomp ]
3046 hppli
[ name
= ppl-textcomp ]
3047 hptmi
[ name
= ptm-textcomp ]
3048 hm-ti
{ encoding = TS1
}
3049 h!m-ti
{ encoding = TS1,
3050 hbchi
family
= bch }
3051 hcmri
family
= cmr }
3052 hpadi
family
= {pad,padx,padj} }
3053 hpmni
family
= {pmnx,pmnj} }
3054 hppli
family
= {ppl,pplx,pplj} }
3055 hptmi
family
= {ptm,ptmx,ptmj} }
3056
{
3057 hcmri
\textquotestraightbase
= {300,300},
3058 hpad|pmni
\textquotestraightbase
= {400,400},
3059 hcmr|pmni
\textquotestraightdblbase = {300,300},
3060 hpadi
\textquotestraightdblbase = {400,400},
3061 hbch|cmr|pad|pmni
\texttwelveudash
= {200,200},
3062 hbch|cmr|pad|pmni
\textthreequartersemdash = {150,150},
3063 hcmr|pmni
\textquotesingle
= {300,400},
3064 hpadi
\textquotesingle
= {400,500},
92
CONFIGURATION FILES: Character Protrusion
3065 hbch|cmr|pmni
\textasteriskcentered
= {200,300},
3066 hpadi
\textasteriskcentered
= {300,300},
3067 hpmni
\textfractionsolidus
= {-200,-200},
3068 hcmri
\textoneoldstyle
= {100,100},
3069 hpmni
\textoneoldstyle
= {
, 50},
3070 hcmri
\textthreeoldstyle
= {
, 50},
3071 hpad|pmni
\textthreeoldstyle
= { 50,
},
3072 hcmri
\textfouroldstyle
= { 50, 50},
3073 hpad|pmni
\textfouroldstyle
= { 50,
},
3074 hcmr|pad|pmni
\textsevenoldstyle
= { 50, 80},
3075 hcmri
\textlangle
= {400,
},
3076 hcmri
\textrangle
= {
,400},
3077 hm-t|bch|pmn|ptmi
\textminus
= {200,200},
3078 hcmr|pad|ppli
\textminus
= {300,300},
3079 hbch|pad|pmni
\textlbrackdbl
= {100,
},
3080 hbch|pad|pmni
\textrbrackdbl
= {
,100},
3081 hpmni
\textasciigrave
= {200,500},
3082 hbch|cmr|pad|pmni
\texttildelow
= {200,250},
3083 hpmni
\textasciibreve
= {300,400},
3084 hpmni
\textasciicaron
= {300,400},
3085 hpmni
\textacutedbl
= {200,300},
3086 hpmni
\textgravedbl
= {150,300},
3087 hbch|pmni
\textdagger
= { 80, 80},
3088 hcmr|padi
\textdagger
= {100,100},
3089 hcmr|pad|pmni
\textdaggerdbl
= { 80, 80},
3090 hbchi
\textbardbl
= {100,100},
3091 hbchi
\textbullet
= {200,200},
3092 hcmr|pad|pmni
\textbullet
= {
,100},
3093 hbch|cmr|pmni
\textcelsius
= { 50,
},
3094 hpadi
\textcelsius
= { 80,
},
3095 hbchi
\textflorin
= { 50, 50},
3096 hpadi
\textflorin
= {
,100},
3097 hpmni
\textflorin
= { 50,100},
3098 hcmri
\textcolonmonetary
= {
, 50},
3099 hpad|pmni
\textcolonmonetary
= { 50,
},
3100 hpmni
\textinterrobang
= {
,100},
3101 hpmni
\textinterrobangdown
= {100,
},
3102 hm-t|pad|ptmi
\texttrademark
= {100,100},
3103 hbchi
\texttrademark
= {150,150},
3104 hcmr|ppli
\texttrademark
= {200,200},
3105 hpmni
\texttrademark
= { 50, 50},
3106 hbchi
\textcent
= { 50,
},
3107 hbchi
\textsterling
= { 50,
},
3108 hbchi
\textbrokenbar
= {200,200},
3109 hpmni
\textasciidieresis
= {300,400},
3110 hm-t|bch|cmr|pad|ptmi
\textcopyright
= {100,100},
3111 hpmni
\textcopyright
= {100,150},
3112 hppli
\textcopyright
= {200,200},
3113 hbch|cmri
\textordfeminine
= {100,200},
3114 hpad|pmni
\textordfeminine
= {200,200},
3115 hbch|cmr|pad|pmni
\textlnot
= {200,
},
3116 hm-t|bch|cmr|pad|ptmi
\textregistered
= {100,100},
3117 hpmni
\textregistered
= { 50,150},
3118 hppli
\textregistered
= {200,200},
93
CONFIGURATION FILES: Character Protrusion
3119 hpmni
\textasciimacron
= {150,200},
3120 hm-t|ppl|ptmi
\textdegree
= {300,300},
3121 hbchi
\textdegree
= {150,200},
3122 hcmr|padi
\textdegree
= {400,400},
3123 hpmni
\textdegree
= {150,400},
3124 hbch|cmr|pad|pmni
\textpm
= {150,200},
3125 hbchi
\texttwosuperior
= {100,200},
3126 hcmri
\texttwosuperior
= { 50,100},
3127 hpad|pmni
\texttwosuperior
= {200,200},
3128 hbchi
\textthreesuperior
= {100,200},
3129 hcmri
\textthreesuperior
= { 50,100},
3130 hpad|pmni
\textthreesuperior
= {200,200},
3131 hpmni
\textasciiacute
= {300,400},
3132 hbchi
\textmu
= {
,100},
3133 hbch|pad|pmni
\textparagraph
= { ,100},
3134 hbch|cmr|pad|pmni
\textperiodcentered
= {300,400},
3135 hbchi
\textonesuperior
= {200,300},
3136 hcmr|pad|pmni
\textonesuperior
= {200,200},
3137 hbch|pad|pmni
\textordmasculine
= {200,200},
3138 hcmri
\textordmasculine
= {100,200},
3139 hbch|cmr|pmni
\texteuro
= {100,
},
3140 hpadi
\texteuro
= { 50,100},
3141 hbchi
\texttimes
= {100,100},
3142 hcmri
\texttimes
= {150,250},
3143 hpadi
\texttimes
= {100,150},
3144 hpmni
\texttimes
= { 70,100},
3145 hbch|pad|pmni
\textdiv
= {150,200},
3146 hcmri
\textdiv
= {150,250},
3147
}
3148
3149 h*cmr|pad|pmni
3150 \SetProtrusion
3151 hcmri
[ name
= cmr-textcomp-it ]
3152 hpadi
[ name
= pad-textcomp-it ]
3153 hpmni
[ name
= pmn-textcomp-it ]
3154
{ encoding = TS1,
3155 hcmri
family
= cmr,
3156 hpadi
family
= {pad,padx,padj},
3157 hpmni
family
= {pmnx,pmnj},
3158
shape
= {it,sl} }
3159
{
3160 hcmri
\textquotestraightbase
= {300,600},
3161 hpad|pmni
\textquotestraightbase
= {400,400},
3162 hcmri
\textquotestraightdblbase = {300,600},
3163 hpadi
\textquotestraightdblbase = {300,400},
3164 hpmni
\textquotestraightdblbase = {300,300},
3165
\texttwelveudash
= {200,200},
3166
\textthreequartersemdash = {150,150},
3167 hcmri
\textquotesingle
= {600,300},
3168 hpadi
\textquotesingle
= {800,100},
3169 hpmni
\textquotesingle
= {300,200},
3170 hcmri
\textasteriskcentered
= {300,200},
3171 hpadi
\textasteriskcentered
= {500,100},
3172 hpmni
\textasteriskcentered
= {200,300},
94
CONFIGURATION FILES: Character Protrusion
3173 hpmni
\textfractionsolidus
= {-200,-200},
3174 hcmri
\textoneoldstyle
= {100, 50},
3175 hpadi
\textoneoldstyle
= {100,
},
3176 hpmni
\textoneoldstyle
= { 50,
},
3177 hpadi
\texttwooldstyle
= { 50,
},
3178 hpmni
\texttwooldstyle
= {-50,
},
3179 hcmri
\textthreeoldstyle
= {100, 50},
3180 hpmni
\textthreeoldstyle
= {-100, },
3181 hcmri
\textfouroldstyle
= { 50, 50},
3182 hpadi
\textfouroldstyle
= { 50,100},
3183 hcmri
\textsevenoldstyle
= { 50, 80},
3184 hpadi
\textsevenoldstyle
= { 50,
},
3185 hpmni
\textsevenoldstyle
= { 20,
},
3186 hcmri
\textlangle
= {400,
},
3187 hcmri
\textrangle
= {
,400},
3188 hcmr|padi
\textminus
= {300,300},
3189 hpmni
\textminus
= {200,200},
3190 hpad|pmni
\textlbrackdbl
= {100,
},
3191 hpad|pmni
\textrbrackdbl
= {
,100},
3192 hpmni
\textasciigrave
= {300,300},
3193
\texttildelow
= {200,250},
3194 hpmni
\textasciibreve
= {300,300},
3195 hpmni
\textasciicaron
= {300,300},
3196 hpmni
\textacutedbl
= {200,300},
3197 hpmni
\textgravedbl
= {150,300},
3198 hcmri
\textdagger
= {100,100},
3199 hpadi
\textdagger
= {200,100},
3200 hpmni
\textdagger
= { 80, 50},
3201 hcmr|padi
\textdaggerdbl
= { 80, 80},
3202 hpmni
\textdaggerdbl
= { 80, 50},
3203 hcmri
\textbullet
= {200,100},
3204 hpadi
\textbullet
= {300,
},
3205 hpmni
\textbullet
= { 30, 70},
3206 hcmri
\textcelsius
= {100,
},
3207 hpadi
\textcelsius
= {200,
},
3208 hpmni
\textcelsius
= { 50,-50},
3209 hpadi
\textflorin
= {100,
},
3210 hpmni
\textflorin
= { 50,100},
3211 hcmri
\textcolonmonetary
= {150,
},
3212 hpadi
\textcolonmonetary
= {100,
},
3213 hpmni
\textcolonmonetary
= { 50,-50},
3214 hcmr|padi
\texttrademark
= {200,
},
3215 hpmni
\texttrademark
= { 50,100},
3216 hpmni
\textasciidieresis
= {300,200},
3217 hcmri
\textcopyright
= {100,
},
3218 hpadi
\textcopyright
= {200,100},
3219 hpmni
\textcopyright
= {100,150},
3220 hcmri
\textordfeminine
= {100,100},
3221 hpmni
\textordfeminine
= {200,200},
3222 hcmr|padi
\textlnot
= {300,
},
3223 hpmni
\textlnot
= {200,
},
3224 hcmri
\textregistered
= {100,
},
3225 hpadi
\textregistered
= {200,100},
3226 hpmni
\textregistered
= { 50,150},
95
CONFIGURATION FILES: Character Protrusion
3227 hpmni
\textasciimacron
3228 hcmr|padi
\textdegree
3229 hpmni
\textdegree
3230 hcmri
\textpm
3231 hpadi
\textpm
3232 hpmni
\textpm
3233 hcmri
\textonesuperior
3234 hpadi
\textonesuperior
3235 hpmni
\textonesuperior
3236 hcmri
\texttwosuperior
3237 hpadi
\texttwosuperior
3238 hpmni
\texttwosuperior
3239 hcmri
\textthreesuperior
3240 hpadi
\textthreesuperior
3241 hpmni
\textthreesuperior
3242 hpmni
\textasciiacute
3243 hcmri
\textparagraph
3244 hpmni
\textparagraph
3245 hcmri
\textperiodcentered
3246 hpad|pmni
\textperiodcentered
3247 hcmri
\textordmasculine
3248 hpmni
\textordmasculine
3249 hcmri
\texteuro
3250 hpadi
\texteuro
3251 hpmni
\texteuro
3252 hcmri
\texttimes
3253 hpadi
\texttimes
3254 hpmni
\texttimes
3255 hcmr|padi
\textdiv
3256 hpmni
\textdiv
3257
}
3258
3259 h/cmr|pad|pmni
11.3.5
96
= {150,200},
= {500,100},
= {150,150},
= {150,100},
= {200,150},
= {150,200},
= {400,
},
= {300,100},
= {200,100},
= {400,
},
= {300,
},
= {200,100},
= {400,
},
= {300,
},
= {200,100},
= {300,200},
= {200,
},
= {
,100},
= {500,500},
= {300,400},
= {100,100},
= {200,200},
= {200,
},
= {100,
},
= {100,-50},
= {200,200},
= {200,100},
= { 70,100},
= {200,200},
= {150,200},
Math
Now to the math symbols for Computer Modern Roman. Definitions have
been extracted from fontmath.ltx. 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
\DeclareMathAlphabet
{\mathbf}{OT1}{cmr}{bx}{n}
{\mathit}{OT1}{cmr}{m}{it}
while these aren’t (and won’t be, for now):
CONFIGURATION FILES: Character Protrusion
\DeclareMathAlphabet
\DeclareMathAlphabet
97
{\mathsf}{OT1}{cmss}{m}{n}
{\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.
3260 h*cmri
3261 \SetProtrusion
3262
[ name
= cmr-math-letters ]
3263
{ encoding = OML,
3264
family
= {cmm,cmr} }
3265
{
3266
A = {100, 50}, % \mathnormal
3267
B = { 50,
},
3268
C = { 50,
},
3269
D = { 50, 50},
3270
E = { 50,
},
3271
F = {100, 50},
3272
G = { 50, 50},
3273
H = { 50, 50},
3274
I = { 50, 50},
3275
J = {150, 50},
3276
K = { 50,100},
3277
L = { 50, 50},
3278
M = { 50,
},
3279
N = { 50,
},
3280
O = { 50,
},
3281
P = { 50,
},
3282
Q = { 50, 50},
3283
R = { 50,
},
3284
S = { 50,
},
3285
T = { 50,100},
3286
U = { 50, 50},
3287
V = {100,100},
3288
W = { 50,100},
3289
X = { 50,100},
3290
Y = {100,100},
3291
f = {100,100},
3292
h = {
,100},
3293
i = {
, 50},
3294
j = {
, 50},
3295
k = {
, 50},
3296
r = {
, 50},
3297
v = {
, 50},
3298
w = {
, 50},
3299
x = {
, 50},
3300
"0B = { 50,
}, % \alpha
3301
"0C = { 50,
}, % \beta
3302
"0D = {200,
}, % \gamma
CONFIGURATION FILES: Character Protrusion
3303
3304
3305
3306 %
3307
3308 %
3309 %
3310
3311 %
3312
3313 %
3314
3315
3316
3317
3318
3319
3320
3321
3322 %
3323 %
3324 %
3325 %
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344 %
3345
3346 %
3347 %
3348
3349
3350 %
3351 %
3352
3353
3354
3355
"0E
"0F
"10
"11
"12
"13
"14
"15
"16
"17
"18
"19
"1A
"1B
"1C
"1D
"1E
"1F
"20
"21
"22
"23
"24
"25
"26
"27
"28
"29
"2A
"2B
"2C
"2D
"2E
"2F
% 0
"3A
"3B
"3C
"3D
"3E
"3F
"40
"5B
"5C
"5D
"5E
"5F
"60
"7B
"7C
"7D
}
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
{ 50,
},
{ 50,
},
{100,
},
{
,
},
{ 50,
},
{
,
},
{
,
},
{100,
},
{
,
},
{ 50,
},
{
,
},
{ 50,
},
{ 50,
},
{ 50,
},
{ 50,
},
{ 50,
},
{ 50,
},
{ 50,
},
{ 50,
},
{
,
},
{
,
},
{
,
},
{
,
},
{100,
},
{100,
},
{ 50,
},
{100,100},
{100,100},
{100,100},
{100,100},
{300,200},
{200,300},
{
,100},
{100,
},
9
{
,500},
{
,500},
{200,100},
{300,400},
{100,200},
{200,200},
{
,
},
{
,100},
{
,
},
{
,
},
{200,200},
{200,200},
{
,
},
{
,
},
{100,
},
{
,100},
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
\delta
\epsilon
\zeta
\eta
\theta
\iota
\kappa
\lambda
\mu
\nu
\xi
\pi
\rho
\sigma
\tau
\upsilon
\phi
\chi
\psi
\omega
\varepsilon
\vartheta
\varpi
\varrho
\varsigma
\varphi
\leftharpoonup
\leftharpoondown
\rightharpoonup
\rightharpoondown
\lhook
\rhook
\triangleright
\triangleleft
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
., \ldotp
,
<
/
>
\star
\partial
\flat
\natural
\sharp
\smile
\frown
\ell
\imath
\jmath
\wp
98
CONFIGURATION FILES: Character Protrusion
Math font symbols is declared as:
\DeclareSymbolFont{symbols}
{OMS}{cmsy}{m}{n}
\SetSymbolFont{symbols} {bold}{OMS}{cmsy}{b}{n}
\DeclareSymbolFontAlphabet{\mathcal}
{symbols}
3356 \SetProtrusion
3357
[ name
= cmr-math-symbols ]
3358
{ encoding = OMS,
3359
family
= {cmsy,cmr} }
3360
{
3361
A = {150, 50}, % \mathcal
3362
C = {
,100},
3363
D = {
, 50},
3364
F = { 50,100},
3365
J = {100,100},
3366
K = {
,100},
3367
L = {100,
},
3368
M = { 50,
},
3369
N = { 50, 50},
3370
P = {
, 50},
3371
Q = { 50,
},
3372
T = { 50,100},
3373
X = {100,100},
3374
Y = {100,
},
3375
Z = {100,100},
3376
"00 = {300,300}, % 3377
"01 = {
,700}, % \cdot, \cdotp
3378
"02 = {150,250}, % \times
3379
"03 = {150,250}, % *, \ast
3380
"04 = {200,300}, % \div
3381
"05 = {150,250}, % \diamond
3382
"06 = {200,200}, % \pm
3383
"07 = {200,200}, % \mp
3384
"08 = {100,100}, % \oplus
3385
"09 = {100,100}, % \ominus
3386
"0A = {100,100}, % \otimes
3387
"0B = {100,100}, % \oslash
3388
"0C = {100,100}, % \odot
3389
"0D = {100,100}, % \bigcirc
3390
"0E = {100,100}, % \circ
3391
"0F = {100,100}, % \bullet
3392
"10 = {100,100}, % \asymp
3393
"11 = {100,100}, % \equiv
3394
"12 = {200,100}, % \subseteq
3395
"13 = {100,200}, % \supseteq
3396
"14 = {200,100}, % \leq
3397
"15 = {100,200}, % \geq
3398
"16 = {200,100}, % \preceq
3399
"17 = {100,200}, % \succeq
3400
"18 = {200,200}, % \sim
3401
"19 = {150,150}, % \approx
3402
"1A = {200,100}, % \subset
3403
"1B = {100,200}, % \supset
3404
"1C = {200,100}, % \ll
99
CONFIGURATION FILES: Character Protrusion
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430 %
3431 %
3432
3433
3434
3435 %
3436 %
3437 %
3438
3439
3440 %
3441 %
3442 %
3443 %
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456 %
3457 %
3458
"1D
"1E
"1F
"20
"21
"22
"23
"24
"25
"26
"27
"28
"29
"2A
"2B
"2C
"2D
"2E
"2F
"30
"31
"32
"33
"34
"35
"36
"37
"38
"39
"3A
"3B
"3C
"3D
"3E
"3F
"40
"5B
"5C
"5D
"5E
"5F
"60
"61
"62
"63
"64
"65
"66
"67
"68
"69
"6A
"6B
"6C
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
{100,200},
{300,100},
{100,300},
{100,200},
{200,100},
{100,100},
{100,100},
{100,100},
{100,100},
{100,100},
{100,100},
{100,100},
{100,100},
{100,100},
{100,100},
{100,100},
{100,100},
{100,100},
{
,100},
{
,400},
{100,100},
{150,100},
{100,150},
{100,100},
{100,100},
{
,
},
{
,
},
{
,100},
{100,
},
{200,
},
{
,
},
{
,
},
{
,
},
{200,200},
{200,200},
{
,
},
{
,
},
{
,
},
{
,
},
{100,200},
{100,200},
{
,300},
{300,
},
{100,100},
{100,100},
{100,100},
{100,100},
{150,
},
{
,150},
{400,
},
{
,400},
{
,
},
{
,
},
{100,100},
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
\gg
\prec
\succ
\leftarrow
\rightarrow
\uparrow
\downarrow
\leftrightarrow
\nearrow
\searrow
\simeq
\Leftarrow
\Rightarrow
\Uparrow
\Downarrow
\Leftrightarrow
\nwarrow
\swarrow
\propto
\prime
\infty
\in
\ni
\triangle, \bigtriangleup
\bigtriangledown
\not
\mapstochar
\forall
\exists
\neg
\emptyset
\Re
\Im
\top
\bot, \perp
\aleph
\cup
\cap
\uplus
\wedge
\vee
\vdash
\dashv
\lfloor
\rfloor
\lceil
\rceil
\lbrace
\rbrace
\langle
\rangle
\arrowvert, \mid, \vert, |
\Arrowvert, \parallel, \Vert
\updownarrow
100
CONFIGURATION FILES: Character Protrusion
3459
3460
3461 %
3462 %
3463 %
3464
3465 %
3466 %
3467 %
3468 %
3469 %
3470 %
3471
3472
3473
3474
3475
3476
3477
3478
3479
"6D
"6E
"6F
"70
"71
"72
"73
"74
"75
"76
"77
"78
"79
"7A
"7B
"7C
"7D
"7E
"7F
}
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
{100,100},
{100,300},
{
,
},
{
,
},
{
,
},
{100,100},
{
,
},
{
,
},
{
,
},
{
,
},
{
,
},
{
,
},
{200,200},
{100,100},
{100,
},
{100,100},
{100,100},
{100,100},
{100,100},
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
101
\Updownarrow
\, \backslash, \setminus
\wr
\sqrtsign
\amalg
\nabla
\smallint
\sqcup
\sqcap
\sqsubseteq
\sqsupseteq
\mathsection
\dagger
\ddagger
\mathparagraph
\clubsuit
\diamondsuit
\heartsuit
\spadesuit
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}
3480 %\SetProtrusion
3481 %
[ name
= cmr-math-largesymbols ]
3482 %
{ encoding = OMX,
3483 %
family
= {cmex,cmr} }
3484 %
{
3485 %
"00 % (
3486 %
"01 % )
3487 %
"02 % [
3488 %
"03 % ]
3489 %
"04 % \lfloor
3490 %
"05 % \rfloor
3491 %
"06 % \lceil
3492 %
"07 % \rceil
3493 %
"08 % \lbrace
3494 %
"09 % \rbrace
3495 %
"0A % <, \langle
3496 %
"0B % >, \rangle
3497 %
"0C % \vert, |
3498 %
"0D % \Vert
3499 %
"0E % /
3500 %
"0F % \backslash
3501 %
"3A % \lgroup
3502 %
"3B % \rgroup
3503 %
"3C % \arrowvert
3504 %
"3D % \Arrowvert
3505 %
"3E % \bracevert
3506 %
"3F % \updownarrow
3507 %
"40 % \lmoustache
AUXILIARY FILE FOR MICRO FINE TUNING
3508 %
"41
3509 %
"46
3510 %
"48
3511 %
"4A
3512 %
"4C
3513 %
"4E
3514 %
"50
3515 %
"51
3516 %
"52
3517 %
"53
3518 %
"54
3519 %
"55
3520 %
"56
3521 %
"57
3522 %
"60
3523 %
"70
3524 %
"77
3525 %
"78
3526 %
"79
3527 %
"7A
3528 %
"7B
3529 %
"7C
3530 %
"7D
3531 %
"7E
3532 %
"7F
3533 %
}
3534 h/cmri
3535 h/configi
12
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
102
\rmoustache
\bigsqcup
\ointop
\bigodot
\bigoplus
\bigotimes
\sum
\prod
\intop
\bigcup
\bigcap
\biguplus
\bigwedge
\bigvee
\coprod
\sqrtsign
\Updownarrow
\uparrow
\downarrow
\braceld, \lmoustache
\bracerd, \rmoustache
\bracelu
\braceru
\Uparrow
\Downarrow
Auxiliary File for Micro Fine Tuning
This file can be used to test protrusion and expansion settings.
3536 h*testi
3537 \documentclass{article}
3538
3539 %% Here you can set the font you want to test, using
3540 %% the commands \fontfamily, \fontseries, and \fontshape.
3541 %% Make sure to end all lines with a comment character!
3542 \newcommand{\TestFont}{%
3543
\fontfamily{ppl}%
3544 %%
\fontseries{b}%
3545 %%
\fontshape{it}% sc, sl
3546 }
3547
3548 \usepackage{ifthen}
3549 \usepackage[T1]{fontenc}
3550 %%\usepackage[latin1]{inputenc}
3551 \usepackage[verbose,expansion=alltext,stretch=50]{microtype}
3552
3553 \pagestyle{empty}
3554 \setlength{\parindent}{0pt}
3555 \newcommand{\crulefill}{\cleaders\hbox{$\mkern-2mu\smash-\mkern-2mu$}\hfill}
AUXILIARY FILE FOR MICRO FINE TUNING
103
3556 \newcommand{\testprotrusion}[2][]{%
3557 \ifthenelse{\equal{#1}{r}}{}{#2}%
3558
lorem ipsum dolor sit amet,
3559
\ifthenelse{\equal{#1}{r}}{\crulefill}{\leftarrowfill} #2
3560
\ifthenelse{\equal{#1}{l}}{\crulefill}{\rightarrowfill}
3561
you know the rest%
3562 \ifthenelse{\equal{#1}{l}}{}{#2}%
3563
\linebreak
3564 {\fontencoding{\encodingdefault}%
3565
\fontseries{\seriesdefault}%
3566
\fontshape{\shapedefault}%
3567
\selectfont
3568
Here is the beginning of a line, \dotfill and here is its end}\linebreak
3569 }
3570 \newcommand{\showTestFont}{\expandafter\stripprefix\meaning\TestFont}
3571 \def\stripprefix#1>{}
3572 \newcount\charcount
3573 \begin{document}
3574 \microtypesetup{expansion=false}
3575
3576 {\centering The font in this document is called by:\\
3577 \texttt{\showTestFont}\par}\bigskip
3578
3579 \TestFont\selectfont
3580 This line intentionally left empty\linebreak
3581 %% A -- Z
3582 \charcount=65
3583 \loop
3584
\testprotrusion{\char\charcount}
3585
\advance\charcount 1
3586
\ifnum\charcount < 91 \repeat
3587 %% a -- z
3588 \charcount=97
3589 \loop
3590
\testprotrusion{\char\charcount}
3591
\advance\charcount 1
3592
\ifnum\charcount < 123 \repeat
3593 %% 0 -- 9
3594 \charcount=48
3595 \loop
3596
\testprotrusion{\char\charcount}
3597
\advance\charcount 1
3598
\ifnum\charcount < 58 \repeat
3599 %%
3600 \testprotrusion[r]{,}
3601 \testprotrusion[r]{.}
3602 \testprotrusion[r]{;}
3603 \testprotrusion[r]{:}
3604 \testprotrusion[r]{?}
3605 \testprotrusion[r]{!}
3606 \testprotrusion[l]{\textexclamdown}
3607 \testprotrusion[l]{\textquestiondown}
3608 \testprotrusion[r]{)}
3609 \testprotrusion[l]{(}
104
CHANGE HISTORY
3610 \testprotrusion{/}
3611 \testprotrusion{\char‘\\}
3612 \testprotrusion{-}
3613 \testprotrusion{\textendash}
3614 \testprotrusion{\textemdash}
3615 \testprotrusion{\textquoteleft}
3616 \testprotrusion{\textquoteright}
3617 \testprotrusion{\textquotedblleft}
3618 \testprotrusion{\textquotedblright}
3619 \testprotrusion{\quotesinglbase}
3620 \testprotrusion{\quotedblbase}
3621 \testprotrusion{\guilsinglleft}
3622 \testprotrusion{\guilsinglright}
3623 \testprotrusion{\guillemotleft}
3624 \testprotrusion{\guillemotright}
3625
3626 \bigskip
3627 The following displays the current font stretched by 5\%,
3628 normal, and shrunk by 5\%:
3629
3630 \microtypesetup{expansion=true}
3631
3632 \bigskip
3633 \newlength{\MTln}
3634 \newcommand{\teststring}
3635
{ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789}
3636 \settowidth{\MTln}{\teststring}
3637
3638 \parbox{1.05\MTln}{\teststring\linebreak\\
3639
\teststring}\par\bigskip
3640 \parbox{0.95\MTln}{\teststring}
3641 \end{document}
3642 h/testi
Needless to say that things may always be improved. For suggestions,
mail to [email protected].
A
Change History
Version 1.0 (2004/09/11)
General: Initial version . . . . . . . . . 1
Version 1.1 (2004/09/21)
General: bug fix concerning version check (reported by Harald Harders) . . . . . . . . . . . 20
configuration file names in lowercase (suggested by Harald
Harders) . . . . . . . . . . . . . . . 37
issue an error instead of a warning, when pdfTEX version is
too old for autoexpand . . . . . 72
protrusion: add factors for some
CHANGE HISTORY
more characters . . . . . . . . . 77
protrusion: settings for Adobe
Minion (contributed by Harald
Harders) . . . . . . . . . . . . . . . 77
remove 8-bit characters from the
configuration files (suggested
by Harald Harders) . . . . . . . 74
\DeclareCharacterInheritance:
new macro: possibility to specify character inheritance . . . 58
\MT@declare@sets: remove spaces
around set name . . . . . . . . . 48
\MT@DeclareSet@: remove spaces
around first argument . . . . . 47
\MT@find@file: bug fix: also check
whether the file for the base
font family has already been
loaded . . . . . . . . . . . . . . . . 37
\MT@get@basefamily: only remove
105
suffix, if it is ‘x’ or ‘j’ . . . . . . . 38
\MT@get@listname: don’t check for
empty characteristics list . . . 39
\MT@get@number: numbers may also
be specified in hexadecimal
or octal (suggested by Harald
Harders) . . . . . . . . . . . . . . . 44
\MT@ifempty: bug fix: use category
code 12 for the percent character (reported by Tom Kink) 24
\MT@permute: don’t use sets for
empty encoding . . . . . . . . . 60
\MT@pr@split: bug fix: allow zero
and negative values . . . . . . . 31
\MT@use@set: remove spaces around
set name . . . . . . . . . . . . . . . 52
\UseMicroTypeSet: remove spaces
around first argument . . . . . 52
Version 1.2 (2004/10/03)
General: add protrusion factors for
Adobe Garamond and Computer Modern Roman in TS1
encoding . . . . . . . . . . . . . . 92
add protrusion factors for Computer Modern Roman math
symbols . . . . . . . . . . . . . . . 96
check for packages that might
load fonts . . . . . . . . . . . . . . 46
declare cmr as an alias for cmor 54
new font sets: allmath and
basicmath . . . . . . . . . . . . . . 53
\MT@check@default: new macro . . 49
\MT@checkfor: also check for alias
font name . . . . . . . . . . . . . . 28
\MT@define@inh@key@encoding:
check whether only one encoding specified . . . . . . . . . 59
\MT@familyalias: define alias font
name as an alternative, not as
a replacement . . . . . . . . . . . 30
\MT@get@basefamily: also remove
‘w’ (swash capitals) . . . . . . . 38
\MT@get@highlevel: check whether
defaults have changed . . . . . 49
\MT@get@listname:
alternatively
check for alias font name . . . 39
\MT@get@size: additional magic to
catch some errors . . . . . . . . 51
hijack \set@fontsize instead of
\@setfontsize . . . . . . . . . . 51
\MT@get@slot: bug fix: group must
also include \MT@get@composite
. . . . . . . . . . . . . . . . . . . . . . 42
\MT@loop: bug fix: new macro, used
instead of \loop . . . . . . . . . 26
\MT@permute@@@@@: more sanity
checks for \SetProtrusion
and \SetExpansion . . . . . . . 61
\MT@set@prot@codes: bug fix: set
inheritance list \globally to
\@empty . . . . . . . . . . . . . . . 30
\MT@setupfont: also search for alias
font file . . . . . . . . . . . . . . . 27
bug fix: call \@@enc@update if
necessary . . . . . . . . . . . . . . 27
CHANGE HISTORY
106
Version 1.3 (2004/10/27)
General: declare cmr as an alias for
ifying load option does no
aer, zer and hfor . . . . . . . . 54
longer require to give a name,
\MT@catcodes: check some catetoo . . . . . . . . . . . . . . . . . . . 55
\MT@load@list: check whether list
gory codes (compatibility with
exists . . . . . . . . . . . . . . . . . 36
german) . . . . . . . . . . . . . . . 20
\MT@get@codes@name: bug fix: spec-
Version 1.4 (2004/11/26)
General: don’t use scratch registers
in global definitions . . . . . . . 41
new message if \pdfoutput is
changed . . . . . . . . . . . . . . . 70
new option: final . . . . . . . . . 67
no need to check for packages
that might load fonts anymore 46
optimization: use less \csnames
and \expandafters . . . . . . . 23
protrusion: harmonize dashes in
upshape and italic (cmr, pad,
ppl) . . . . . . . . . . . . . . . . . . 77
protrusion: slanted like italics . 82
protrusion: tweak quote characters for cmr variants (OT1, T1,
lmr) . . . . . . . . . . . . . . . . . . 81
set catcodes before reading
global configuration file (reported by Christoph Bier) . . 69
use \pickup@font instead of
\define@newfont as the hook
for \MT@setupfont . . . . . . . . 46
use one instead of five counters 26
\microtypesetup: bug fix: set the
correct levels, and remember
them; warning when enabling
an option disabled in package
options . . . . . . . . . . . . . . . . 64
\MT@begin@catcodes: bug fix: reset some more catcodes when
reading files (reported by
Michael Hoppe) . . . . . . . . . 37
\MT@checklist@family@: bug fix:
don’t try alias family name if
encoding failed . . . . . . . . . . 29
\MT@get@basefamily: bug fix: failed
for font names of the form
abczz (reported by Georg Verweyen) . . . . . . . . . . . . . . . . 38
\MT@get@size: don’t set \MT@count
globally (save stack problem) 51
\MT@get@slot:
don’t
define
\MT@char globally (save stack
problem) . . . . . . . . . . . . . . 42
\MT@in@llist: bug fix: compare
with \\ instead of \relax (discovered by Herb Schulz) . . . 25
\MT@pdfcprot@error: check for
pdfcprot . . . . . . . . . . . . . . 21
\MT@set@exp@opt: bug fix: specifying extra options does no
longer require to give a name,
too . . . . . . . . . . . . . . . . . . . 56
\MT@use@set: don’t use undeclared
font sets . . . . . . . . . . . . . . . 52
Version 1.5 (2004/12/15)
General: defaults: step: 4 (suggested by Hàn Thế Thành) . . 68
defaults: calculate step as
min(stretch,shrink)/5 . . . . 71
defaults: turn off expansion for
DVI output . . . . . . . . . . . . . 70
disable automatic expansion for
DVI output . . . . . . . . . . . . . 72
new option: selected, by default
false (suggested by Hàn Thế
Thành) . . . . . . . . . . . . . . . . 67
new: Short History . . . . . . . . . 16
CHANGE HISTORY
protrusion: settings for Bitstream
Charter . . . . . . . . . . . . . . . . 77
remove \ss from T1 character inheritance list, add \DJ . . . . . 74
\DeclareMicroTypeAlias: remove
spaces around arguments . . . 52
\MT@adjustprotcode: don’t use
\lpcode and \rpcode for the
calculation . . . . . . . . . . . . . 32
warning for protrusion factors
greater than 1000 . . . . . . . . 32
\MT@begin@catcodes: reset catcode
107
of ‘=’ (compatibility with Turkish babel) . . . . . . . . . . . . . . 37
\MT@catcodes: reset catcode of ‘ˆ’
(compatibility with chemsym) 20
\MT@get@highlevel: don’t test defaults if called after begin document . . . . . . . . . . . . . . . . 49
\MT@set@exp@codes: allow nonselected font expansion . . . . 34
\MT@set@prot@codes: adjust protrusion factors before setting the
inheriting characters . . . . . . 30
Version 1.6 (2005/02/02)
General: defaults: turn off expansion for old pdfTEX versions . 69
disable automatic expansion for
old pdfTEX versions . . . . . . . 72
load a font, if none is active . . 22
new option: factor, by default
1000 . . . . . . . . . . . . . . . . . 68
protrusion: add italic uppercase
Greek letters . . . . . . . . . . . . 82
protrusion: improve settings for
numbers (pointed out by Peter
Muthesius) . . . . . . . . . . . . . 78
protrusion: tune CMR math letters (OML encoding) . . . . . . 97
restructure dtx file . . . . . . . . . 73
test whether \pickup@font has
changed . . . . . . . . . . . . . . . 46
use e-TEX’s \ifdefined and
\ifcsname if available . . . . . 23
\MT@def@num@opt: test whether numeric options receive a num-
ber . . . . . . . . . . . . . . . . . . . 68
\MT@get@charwd:
use
e-TEX’s
\fontcharwd, if available . . . 32
\MT@get@inh@list: correct message
if selected is false . . . . . . . . 40
\MT@get@slot: completely redone,
hopefully more robust (compatible with frenchpro) . . . . 42
\MT@pdftex@no: new macro . . . . . 19
\MT@resetefcode:
only
reset
\efcodes for older pdfTEX versions . . . . . . . . . . . . . . . . . 35
\MT@set@exp@codes:
introduce
factor option . . . . . . . . . . . 34
\MT@set@prot@codes:
introduce
factor option . . . . . . . . . . . 30
\MT@use@set: retain current set if
new set is undeclared . . . . . 52
\MT@vinfo: new macro: used instead
of \ifMT@verbose . . . . . . . . 18
Version 1.7 (2005/03/23)
General: \SetExpansion: bug fix: renew value for verbose option:
move space after autoexpand 58
errors . . . . . . . . . . . . . . . . 68
\SetExpansion: don’t allow autoprotrusion: fix: remove \ from
matic expansion for old pdfTEX
OT1, add \textbackslash to
versions . . . . . . . . . . . . . . . 58
T1 encoding . . . . . . . . . . . . 79
allow specification of size ranges
shorter command names . . . . . 27
(suggested by Andreas Bühwarning when running in draft
mann) . . . . . . . . . . . . . . . . 50
mode . . . . . . . . . . . . . . . . . 71
modify \showhyphens . . . . . . . 73 \DeclareMicroTypeAlias: may also
108
INDEX
be used inside configuration
files . . . . . . . . . . . . . . . . . . 52
\LoadMicroTypeFile: new macro
(suggested by Andreas Bühmann) . . . . . . . . . . . . . . . . 52
\MicroType@Hook: new macro for
font package authors . . . . . . 69
\microtypesetup: bug fix: warning also when setting to
(no)compatibility . . . . . . . 64
\MT@begin@catcodes: also use inside
configuration commands . . . 37
reset catcode of ‘:’ (compatibility
with french* packages) . . . . 37
\MT@get@codes@list: don’t define
\MT@#1@c@name \globally, here
and elsewhere . . . . . . . . . . . 40
\MT@get@composite: new macro:
construct command for composite character; no uncontrolled expansion . . . . . . . . 45
\MT@get@listname: use \@tfor (Andreas Bühmann’s idea) . . . . 39
\MT@get@range: new macro: allow
size ranges . . . . . . . . . . . . . 50
\MT@get@size: comparison with 1 to
allow size smaller than 1 (suggested by Andreas Bühmann) 51
B
\MT@get@slot:
check
whether
\hencodingi\h..i is defined . . 43
remove backslash hack . . . . . . 42
test for \chardefed commands 43
\MT@increment: use e-TEX’s \numexpr
if available . . . . . . . . . . . . . 26
\MT@prot@too@large: new macro:
type out maximum protrusion
factor . . . . . . . . . . . . . . . . . 33
\MT@scale: new macro: use e-TEX’s
\numexpr if available . . . . . . 26
\MT@set@exp@codes: two versions of
this macro . . . . . . . . . . . . . 34
\MT@setupfont@hook: compatibility
with the chemsym package . . 21
compatibility with the statex
package . . . . . . . . . . . . . . . 21
\MT@split@name:
don’t
define
\MT@encoding &c. \globally . 30
\MT@test@ast: make it simpler . . . 49
\MT@try@order: always check for
size, too (suggested by Andreas Bühmann) . . . . . . . . . 39
bug fix: also check for //series/shape// (reported by Andreas Bühmann) . . . . . . . . . 39
\MT@warn@err: new macro: for
verbose=errors . . . . . . . . . 18
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.
Options:
DVIoutput .
activate . .
auto . . . . .
draft . . . .
expansion .
factor . . . .
final . . . .
protrusion
selected . .
shrink . . . .
step . . . . .
stretch . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
verbose . . . . . . . . . . . . . . . . . . 5
5
4 User Commands:
\DeclareCharacterInheritance 12
6
\DeclareMicroTypeAlias
. . . . 13
5
\DeclareMicroTypeSet
.
.
..... 7
4
\DeclareMicroTypeSet
.
.
.... 7
*
6
\LoadMicroTypeFile
.
.
.
.
.
. . . 14
5
\microtypesetup
.
.
.
.
.
.
.
.... 7
4
\SetExpansion
.
.
.
.
.
.
.
.
.
. . . 11
7
\SetProtrusion
.
.
.
.
.
.
.
.
.
... 9
6
\UseMicroTypeSet
.
.
.
.
.
.
.
... 9
6
6
109
INDEX
\@@enc@update . . . . . . . . . . . . . 343
A
a0poster (package) .
activate (option) . .
ae (package) . . . . . .
AMS (package) . . . . .
auto (option) . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
. . . . . . 51
. . . . 4, 67
13, 14, 54
. . . . . . 51
. . . . 6, 67
544, 577, 578, 583, 600, 607,
635, 785, 857, 1031, 1043, 1046
\fontcharwd . . . . . . . . . . . . . . . 513
\fontdimen . . . . . . . . . 501, 523, 544
fontenc (package) . . . . . . . . . . . 15
french (package) . . . . . . . . . . . 108
frenchpro (package) . . . . 16, 45, 107
G
B
german (package) . . . . . 17, 20, 106
babel (package) . . . . . . . 17, 37, 107 graphics (package) . . . . . . . . . 5, 70
C
\cf@encoding . . . . . . . . . . . . . . 343
chemsym (package) 16, 21, 27, 107, 108
CJK (package) . . . . . . . . . . . . 15, 46
color (package) . . . . . . . . . . . 5, 70
contour (package) . . . . . . . . . . . 70
crop (package) . . . . . . . . . . . . . . 70
csquotes (package) . . . . . . . . . . . 80
H
hfoldsty (package) . . . . . 13, 14, 54
hyperref (package) . . . . . . 5, 46, 70
I
IEEEtran (package) . . . . . . . . . . . 46
\ifdim . . . . 258, 263, 272, 279, 286
\ifMT@auto . . . . . . . 142, 2065, 2100
\ifMT@draft . . . . . . . . . . . 142, 2011
\ifMT@DVIoutput . . . . . . . 142, 1998
\ifMT@expansion . . . 142, 2033, 2115
\ifMT@font@ex . . . . . . . . . 351, 357
\ifMT@font@pr . . . . . . . . . 345, 357
\ifMT@inlist@ 233, 379, 400, 417,
703, 714, 810, 830, 1044, 1283
\ifMT@nonselected . . . 586, 845, 852
\ifMT@opt@auto . . 1833, 2068, 2080
\ifMT@opt@expansion . . 1833, 2004
\ifMT@opt@protrusion . . . . . . 1833
\ifMT@protrusion . . 142, 2022, 2112
\ifMT@selected . . . 142, 2095, 2103
ifpdf (package) . . . . . . . . . . . 5, 70
D
\DeclareCharacterInheritance . .
. . . . . . . . . . . . . 12, 18, 1504
\DeclareMicroTypeAlias 13, 15, 1272
\DeclareMicroTypeSet . . . . . . . .
. . . . . . . . . 7, 13, 21, 27, 1067
\DeclareMicroTypeSet* . . . . 7, 1067
\define@key . . 1108, 1165, 1428,
1439, 1453, 1458, 1463,
1477, 1486, 1540, 1745,
1819, 1825, 1829, 1837,
1880, 1885, 1902, 1918, 1940
\define@newfont . . . . . . . . . . . 1031
docstrip (package) . . . . . . . . . . . 18
J
draft (option) . . . . . . . . . . . . 5, 67
DVIoutput (option) . . . . . . 5, 67, 70 jurabib (package) . . . . . . . . . . . 46
K
E
eco (package) . . . . . . . . . 13, 14, 54 keyval (package) . . . . . . 27, 31, 48
\efcode . . . . . . . 577, 578, 607, 635 \KV@@sp@def . . . . . . . . . . . . 326,
1084, 1095, 1249, 1259,
expansion (option) . . . 4, 5, 9, 66, 70
1273, 1274, 1489, 1509, 1746
F
L
\f@encoding . . . . . . . . . . . . . . . 343
factor (option) . . . 6, 10, 12, 16, 68 ledmac (package) . . . . . . . . . 22, 46
final (option) . . . . . . . . . 5, 17, 67 lineno (package) . . . . . . . . . . . . 22
\font . . . . . . . . . . . . . . . . . . . . 141 lmodern (package) . . . . . . . . . . . 81
\LoadMicroTypeFile . . 14, 19, 1280
\font@name . . 337, 340, 454–457,
\lpcode . . . . . . . . . . . 454, 456, 484
484, 490, 501, 508, 513, 523,
INDEX
M
mathpazo (package) . . . . . . . . . . . 15
memoir (package) . . . . . . . . . . . . 46
\MicroType@Hook . . . . . . . . . . . 1977
\microtypesetup . . 7, 20, 1743, 2017
minimal (package) . . . . . . . . . . . 22
\MT@abbr@ex . . . . . . . . . . . . . . . 328
\MT@abbr@ex@c . . . . . . . . . . . . . 332
\MT@abbr@ex@inh . . . . . . . . . . . . 334
\MT@abbr@pr . . . . . . . . . . . . . . . 327
\MT@abbr@pr@c . . . . . . . . . . . . . 331
\MT@abbr@pr@inh . . . . . . . . . . . . 333
\MT@abbrx@expansion . . . . . . . . 330
\MT@abbrx@protrusion . . . . . . . 329
\MT@addto@list . . . . . . 1113, 1124
\MT@adjustprotcode . . 482, 488, 498
\MT@adjustprotcode@ . 503, 520, 525
\MT@auto . . . . . . . . . . . . . . 597,
675, 2064, 2077, 2088, 2092
\MT@auto@ . . . . . . 583, 597, 600, 644
\MT@autofalse . . . . . . . . 2075, 2087
\MT@autotrue . . . . . . . . . . . . . 1960
\MT@begin@catcodes . . . . . . . . . .
. . . . . 704, 705, 728, 1286,
1355, 1377, 1505, 1965, 1966
\MT@break@tfor . . . . . . . . 783, 789
\MT@catcodes . . . . . . . . . . . . 77, 95
\MT@char 453–457, 473, 483, 484,
489, 490, 493, 494, 508, 513,
576–578, 629, 634, 635, 637,
638, 931, 939, 942, 954, 963,
969, 1572, 1573, 1578, 1581
\Mt@char . . . . . . . . . . . 872, 934,
940, 946, 952, 963, 977, 979,
982, 983, 986, 987, 991, 995
\Mt@characterstring . . . . 896, 942
\Mt@charstring . . . . 906, 954, 1010
\MT@check@default . . . . 1140, 1153
\MT@check@range . . . . . . 1696, 1702
\MT@check@range@ . . . . . 1703, 1706
\MT@check@rlist . . . . . . 1652, 1690
\MT@checkfor . . . . . . . 344, 350, 357
\MT@checklist . . 362, 364, 365, 369
\MT@checklist@ . . . . . 370, 372, 393
\MT@checklist@family . . . 363, 389
\MT@checklist@family@ . . . 390, 392
\MT@checklist@size . . . . . 366, 408
\MT@checklist@size@ . . . . 409, 411
110
\MT@checksetup . . . . . . . . . . . . .
. . . . . 1760, 1770, 1780, 1806
\MT@cnt@encoding . 1592, 1599, 1600
\MT@cnt@family . . 1597, 1607, 1608
\MT@cnt@series . . 1605, 1615, 1616
\MT@cnt@shape . . . 1613, 1622, 1623
\MT@count 298, 932, 971, 1231, 1232
\MT@declare@char@inh . . . . . . . .
. . . . . 1511, 1512, 1514, 1519
\MT@declare@codes 1452, 1474, 1475
\MT@declare@sets . . . . . . . . . . . .
. . . . . 1086, 1087, 1089, 1094
\MT@DeclareSet . . . . . . . . . . . . .
. 23, 24, 26, 1073, 1074, 1076
\MT@DeclareSet@ . . 1077, 1080, 1083
\MT@DeclareSetAndUseIt . . . . . . .
. . . . . . . . . . 1070, 1071, 1079
\MT@def@bool@opt . . . . . 1884, 1900
\MT@def@n . . . . . 166, 1265, 1359,
1381, 1455, 1479, 1523, 1867
\MT@def@num@opt . . . . . . 1939, 1954
\MT@define@code@key . . . . . . . . .
. 1427, 1468–1471, 1556–1558
\MT@define@code@key@size . . . . .
. . . . . . . . . . 1438, 1472, 1559
\MT@define@expcodes@key . . . . . .
. . . . . . . . . . 1476, 1483–1485
\MT@define@inh@key@encoding . . .
. . . . . . . . . . . . . . 1539, 1555
\MT@define@inh@keys . . . . . . . 1554
\MT@define@option 1836, 1878, 1879
\MT@define@optionX 1743, 1817, 1818
\MT@define@set@key 1101–1104, 1107
\MT@define@set@key@size 1105, 1164
\MT@define@set@keys . . . . . . . . .
. . . . . . . . . . 1100, 1246, 1247
\MT@draftfalse . . . . . . . . . . . 1903
\MT@drafttrue . . . . . . . . . . . . 1910
\MT@edef@n . . . . . . . . . . . . . . . . .
. 167, 844, 865, 1137, 1261,
1275, 1395, 1433, 1534,
1544, 1660, 1668, 1864, 1945
\MT@encoding . . . . 427, 799, 819,
947, 957, 967, 994, 1006, 1022
\MT@encoding@check . . . 1542, 1547
\MT@end@catcodes . . . . . 706, 762,
1294, 1360, 1382, 1517, 1967
\MT@error . . . . . . . . . . . 3, 98, 1053
\MT@escapechar . . . . . . 1112, 1118
INDEX
\MT@etex@no 158, 171, 299, 310, 506
\MT@ex@c@name . . . . . . . 562, 580,
581, 590, 645, 646, 651, 652,
657, 658, 663, 664, 669, 670,
846, 1363, 1373, 1381, 1412,
1415, 1418, 1421, 1424, 1496
\MT@ex@do . . . . . . . . . . . . . 582, 620
\MT@ex@factor@ . . . . . . . . . 593,
606, 607, 615, 631, 632, 644
\MT@ex@inh@name . . . . . . . . . . . . .
. . 566, 567, 570, 572, 636–638
\MT@ex@level . . . . . 148, 2101, 2116
\MT@ex@setname . . . . . . . . . . . 2106
\MT@ex@split . . . . . . . . . . 622, 625
\MT@exitornot . . . . . . . . 58, 60, 76
\MT@expansionfalse . . . 2005, 2015
\MT@expansiontrue . . . . . . . . . 1959
\MT@extra@auto . . . . . . . . . . . . .
. 1369, 1423, 1424, 1492, 1500
\MT@extra@factor . . . 1347, 1365,
1406, 1407, 1411, 1412, 1465
\MT@extra@shrink . 1367, 1417, 1418
\MT@extra@step . . 1368, 1420, 1421
\MT@extra@stretch 1366, 1414, 1415
\MT@factor . . . . . . . . 148, 557, 2025
\MT@factor@default . . . . . . . . . 154
\MT@family . . . . 341, 427, 800, 1276
\MT@familyalias . . 342, 395, 399,
402, 403, 433, 818, 820, 1277
\MT@file@list . . . . 699, 1282, 1287
\MT@find@file . . . . . . 341, 342, 699
\MT@font@list . . . 1030, 1043, 1046
\MT@get@basefamily . . . . . 711, 763
\MT@get@charwd . 500, 506, 523, 543
\MT@get@codes@list . . . . . . . . . .
. . . . . . . . . 439, 561, 589, 841
\MT@get@codes@name 1349, 1371, 1384
\MT@get@composite . . . . . 950, 1016
\MT@get@exp@opt . . . . . 563, 591, 644
\MT@get@highlevel . . . . . . . . . . .
. . . . . 1111, 1128, 1432, 1543
\MT@get@inh@list . . . . 442, 565, 841
\MT@get@inh@name . . . . . 1521, 1528
\MT@get@listname . . . . 783, 842, 863
\MT@get@number . . . . . . . . 944, 973
\MT@get@prot@opt . . . . . . . 441, 551
\MT@get@range . . . 1168, 1177, 1442
\MT@get@size 1185, 1190, 1201, 1218
111
\MT@get@slot . . . . . . . . . . . . . . .
. . . 472, 628, 931, 1571, 1577
\MT@get@symbol . . . . . . . 948, 1001
\MT@given . . . . . . . . . . . . . 237, 240
\MT@gobblethree . . . . . . . 1823, 1827
\MT@hop@else@fi . . . . . . . . 170, 171
\MT@ifdefined@c . . . . . . . . . . . . .
. . . . . . 171, 443, 492, 566,
636, 789, 843, 864, 1276,
1401, 1406, 1411, 1414,
1417, 1420, 1423, 1636, 1977
\MT@ifdefined@n . . 171, 374, 413,
434, 440, 493, 552, 562, 590,
637, 645, 651, 657, 663, 669,
685, 805, 825, 947, 1260,
1264, 1385, 1386, 1392,
1531, 1600, 1608, 1616,
1623, 1645, 1667, 1685,
1691, 1863, 1982, 2026, 2104
\MT@ifempty . . . . . . . . . . . . . . . .
. 204, 481, 487, 1017, 1085,
1131, 1149, 1179, 1180,
1193, 1194, 1250, 1454,
1459, 1464, 1478, 1487,
1510, 1548, 1750, 1842, 1941
\MT@ifeq . . . . . . . . . . . . . . 257,
271, 1211, 1708–1710, 1720
\MT@ifgt 271, 1202, 1712, 1713, 1726
\MT@iflt . . . 271, 1721, 1722, 1725
\MT@ifnumber . . . . . . 215, 985, 1944
\MT@in@l . . . . . . . . . . . . . 247, 252
\MT@in@list . . . . . . . . 233, 376, 398
\MT@in@llist . . . . . . . . . . . . . . .
. . . 245, 701, 712, 1042, 1281
\MT@in@rlist . . . 254, 415, 807, 827
\MT@increment . . . . . . . . . . . . . .
. . 298, 1599, 1607, 1615, 1622
\MT@info
3, 32, 337, 1262, 1755,
1763, 1774, 1784, 1826, 1830
\Mt@info . . . . . . . . . . . . . . . . . 872
\MT@info@nl . . . . . . . . . . . 3, 33,
336, 1865, 1919, 1963, 1970,
2000, 2003, 2009, 2023,
2027, 2031, 2100, 2105, 2109
\MT@inh@do . . . . . . . . 448, 571, 1563
\MT@inh@name . 447, 570, 1580, 1587
\MT@inh@split . . . . . . . 1565, 1568
\MT@inlist@false . . . . 236, 246, 255
\MT@inlist@true . 241, 249, 259, 264
INDEX
\Mt@isachar . . . . . . . 906, 953, 1009
\Mt@isacharacter . . . . . . . 896, 941
\Mt@isaletter 886, 938, 1012, 1026
\MT@iterate . . . . . . . . . . . 293–295
\MT@let@cn . . . . . . 169, 435, 444,
460, 553, 567, 581, 646, 652,
658, 664, 670, 680, 690, 814,
834, 1154, 1223, 1400, 1942
\MT@let@nc . . . . . . 168, 449, 572,
851, 869, 1096, 1142, 1402,
1407, 1412, 1415, 1418,
1421, 1424, 1520, 1670,
1683, 1773, 1783, 1851, 1856
\Mt@letterstring . . . . . . . . . . . .
. . . . . . . 886, 939, 1013, 1027
\MT@listname . . . . . . . . . . . 414,
416, 787, 789, 811, 814,
831, 834, 843, 844, 864, 865
\MT@load . . . . . . . . . . . . . . . . . .
. 1346, 1364, 1401, 1402, 1460
\MT@load@list . . . . . . 459, 580, 678
\MT@loop 292, 605, 1391, 1530, 1682
\MT@lower 1171, 1183, 1192, 1202,
1204, 1206, 1207, 1211, 1446
\MT@lt . . . . . . . . . . . . . . . . 233,
452, 575, 1126, 1581, 1585
\MT@next . . . . . . . . . . . . . 239, 240
\MT@next@listname . . . . . . 790, 798
\MT@nonselectedtrue . . . . . . . . 588
\MT@pdfcprot@error . . . . . . . . . . 97
\MT@pdfcprot@errror . . . . . . . . 123
\MT@pdftex@no . . . 35, 39, 41, 44,
47, 51, 57, 59, 66, 498, 611,
1491, 1499, 1958, 2066, 2091
\MT@permute 1354, 1376, 1526, 1591
\MT@permute@ . . . . . . . . . . . . . 1591
\MT@permute@@ . . . . . . . . . . . . 1591
\MT@permute@@@ . . . . . . . . . . . 1591
\MT@permute@@@@ . . . . . . . . . . . 1591
\MT@permute@@@@@ . . . . . . . . . . 1591
\MT@permute@define 1628–1631, 1665
\MT@permute@reset . . . . 1594, 1673
\MT@permute@reset@ 1674–1677, 1680
\MT@permutelist . . . . . . . . 1353,
1375, 1525, 1641, 1642,
1645–1648, 1653, 1655,
1658, 1660, 1661, 1734, 1735
\MT@pickupfont . . . . . . . . . . . . .
. . . . . 1031, 1032, 1050, 1052
112
\MT@pr@c@name . . . . . . . . . . . . . .
. . 440, 459, 460, 547, 552,
553, 1345, 1351, 1359, 1407
\MT@pr@do . . . . . . . . . . . . . 461, 464
\MT@pr@factor@ . . . . . . . . . . . . .
. . . . . 526, 527, 540, 541, 551
\MT@pr@inh@name . . . . . . . . . . . . .
. . 443, 444, 447, 449, 492–494
\MT@pr@level . . . . . 148, 2024, 2113
\MT@pr@setname . . . . . . . . . . . 2028
\MT@pr@split . . . . . . . . . . 466, 469
\MT@pr@split@val . . . . . . . 475, 479
\MT@prot@too@large . . 531, 535, 539
\MT@protrusionfalse . . . . . . . 2014
\MT@protrusiontrue . . . . . . . . 1956
\MT@range . . . . . . . . . . . . . . . . . .
. 256, 1171, 1177, 1446, 1693
\MT@remove@spaces . . . 326, 1110,
1167, 1431, 1441, 1748, 1840
\MT@repeat . . . . . . . . . . . . . . . . .
. . 292, 609, 1398, 1537, 1688
\MT@resetefcode . . . . . 564, 599, 611
\MT@resetefcode@ . . . . 603, 612, 616
\Mt@rest . . . . . . 924, 935, 962, 997
\MT@restore@catcodes . . . . . 86, 96
\MT@saved@setupfont . . . 1824, 1831
\MT@scale . . . . . . . . . . . . . . . . . .
. . 310, 501, 527, 541, 544, 632
\MT@series . . . . . . . . . 427, 801, 821
\MT@set@exp@codes . . . . . . . . . . .
. . . . . . . 352, 602, 2096, 2098
\MT@set@exp@codes@n 586, 602, 2098
\MT@set@exp@codes@s . . . 560, 2096
\MT@set@exp@list . . . . . 1378, 1380
\MT@set@exp@opt . . . . . . 1372, 1410
\MT@set@inh@list . . . . . 1506, 1508
\MT@set@prot@codes . . . . . 346, 438
\MT@set@prot@list . . . . 1356, 1358
\MT@set@prot@opt . . . . . 1350, 1405
\MT@setupfont . . . . . . . . . . 335,
1045, 1824, 1827, 1831, 2016
\MT@setupfont@hook . . . . . . . . . .
. . . . . 109, 124, 126, 131, 338
\MT@shape . . . . . . . . . . 427, 802, 822
\MT@shrink . . . . . . . . . . . . . 148,
595, 661, 2037, 2039, 2041,
2045, 2046, 2049, 2053, 2102
\MT@shrink@ . . . . 583, 595, 600, 644
\MT@shrink@default . . . . . 154, 2041
113
INDEX
\MT@size 416, 418, 421, 427, 808, 828
\MT@size@name . . 260, 265, 811, 831
\MT@split@name . . . . . . . . 340, 427
\MT@step . . . . . . . . . . . 148, 596,
667, 2044, 2060, 2063, 2103
\MT@step@ . . . . . . 583, 596, 600, 644
\MT@step@default . . . . . . . . . . . 154
\MT@stretch . . . . . . . . . 148, 594,
655, 2034, 2035, 2038, 2039,
2045, 2047, 2052, 2055, 2102
\MT@stretch@ . . . 583, 594, 600, 644
\MT@stretch@default . . . 154, 2035
\MT@tempencoding . . . . . 1632, 1639
\MT@tempfamily . . . . . . . . . . . 1633
\MT@tempseries . . . . . . . . . . . 1634
\MT@tempshape . . . . . . . . . . . . 1635
\MT@tempsize . . . . . . . . . . . . . . .
. 1636, 1644, 1653, 1656, 1678
\MT@test@ast . . . . . . . . 1129, 1147
\Mt@testrest . . . . . . . . . . . . . . 924
\MT@tmp@setname . . . 1093, 1095–
1097, 1115, 1125, 1135,
1137, 1138, 1142, 1170,
1174, 1205, 1242, 1400, 1402
\MT@try@order . . . . . . . . . 788, 794
\MT@upper 1171, 1186, 1195, 1197,
1206, 1209, 1211, 1212, 1446
\MT@use@set 1251, 1252, 1254, 1258
\MT@val . . . . . . . 788, 790, 1109,
1110, 1112, 1113, 1121,
1129, 1132, 1137, 1166–
1169, 1181, 1184, 1186,
1189, 1191, 1192, 1200,
1202, 1204, 1207, 1209,
1220, 1223, 1227, 1231,
1238, 1239, 1241, 1243,
1430, 1431, 1433, 1440–
1443, 1541, 1542, 1544,
1549, 1573, 1580, 1586,
1587, 1747, 1748, 1750,
1753, 1756, 1759, 1765,
1769, 1775, 1779, 1785,
1788, 1790, 1813, 1839,
1840, 1842, 1845, 1847,
1850, 1852, 1855, 1857,
1859, 1861, 1863–1865,
1869, 1899, 1900, 1953, 1954
\MT@vinfo . . . . . 3, 336, 348, 354,
554, 647, 653, 659, 665, 672,
686, 708, 716, 720, 846, 848,
853, 1284, 1289, 1919, 1929
\MT@warn@err . . . . . . . 3, 1926, 1927
\MT@warning 3, 682, 693, 855, 956,
965, 992, 1241, 1267, 1291,
1387, 1494, 1550, 1640,
1646, 1734, 1789, 1810, 1926
\MT@warning@nl . . . . . . . . 3, 65,
545, 1033, 1157, 1203, 1868,
1891, 1912, 1927, 1932,
1947, 1972, 2012, 2069, 2081
\MT@xadd 222, 709, 717, 721, 1125,
1170, 1287, 1444, 1579, 1654
N
ngerman (package)
\normalfont . . . .
\normalsize . . . .
\nullfont . . . . . .
. . . . . . . . . . . 17
. . 141, 2119, 2127
. . . . . . . . . . 1221
. . . . . . . . . . . 141
P
\pdfadjustspacing 1797, 2116, 2124
pdfcprot (package) . . . . . . . . . . .
. . . . . . . . 3, 4, 15, 21, 45, 106
\pdffontexpand . . . . . . . . 583, 600
\pdfoutput . . . . . . . . . . . . . . . . .
. 1957, 1999, 2002, 2009, 2067
\pdfprotrudechars . . . . 1799, 2113
\pdftexrevision . . . . . . . 38, 43, 46
\pdftexversion . . 36–38, 40, 42, 50
\pickup@font . . . . . . 1032, 1034,
1039, 1050, 1052, 1055, 1060
pifont (package) . . . . . . . . . . . . 46
\ProcessOptionsWithKV . . 1978, 1997
protrusion (option) . . . . 4, 5, 9, 66
pstricks (package) . . . . . . . . . 5, 70
R
relsize (package) . . . . . . . . . . . 51
\rpcode . . . . . . . . . . . 455, 457, 490
S
selected (option) . . . . . . . . . . . .
. . . . . 7, 11, 12, 17, 33, 40, 67
\set@fontsize . . . . . . . . . . . . 1227
\SetExpansion . . 11, 17, 1362, 2020
\setkeys . . . . 1098, 1348, 1352,
1370, 1374, 1524, 1743,
1820, 1821, 1881, 1882, 1989
\SetProtrusion . . 9, 16, 1343, 2019
INDEX
\showhyphens . .
shrink (option)
statex (package)
step (option) . .
stretch (option)
\strip@pt . . . . .
114
. . . . . . 2117, 2121
U
. . . . . . 6, 17, 68, 71 \UseMicroTypeSet . . . . . . . . . . . .
. . . 16, 21, 27, 108
. . 9, 14, 28, 1081, 1248, 2018
. . . . . . 6, 17, 68, 71
V
6, 12, 14, 17, 68, 71
verbose
(option)
.
5, 16, 68, 107, 108
. . . . . . . . . . . 1239
Z
T
tipa (package) . . . . . . . . . . . . . . 46 zefonts (package) . . . . . 13, 14, 54