%\iffalse meta-comment
% -*- TeX:DTX:UK -*-
% $Id: microtype.dtx,v 1.14 2005-02-03 00:15:04+01 schlicht Exp schlicht $
% -----------------------------------------------------------------------
%                      The `microtype' package
%       An interface to the micro-typographic extensions of pdfTeX
%          Copyright (c) 2004, 2005 R Schlicht <w.m.l@gmx.net>
%
% This work  may be  distributed and/or modified  under the conditions of
% the LaTeX Project Public License, either version 1.3 of this license or
% (at your option) any later version.  The latest version of this license
% is in:  http://www.latex-project.org/lppl.txt, and version 1.3 or later
% is part of all distributions of LaTeX version 2003/12/01 or later.
%
% This work has the LPPL maintenance status `author-maintained'.
%
% This work consists of the files microtype.dtx and microtype.ins and the
% derived file microtype.sty.
%
% -----------------------------------------------------------------------
%
%<*driver>
\ProvidesFile{microtype.dtx}
%</driver>
%<package>\NeedsTeXFormat{LaTeX2e}
%<package>\ProvidesPackage{microtype}
%<*package>
      [2005/02/02 v1.6a Micro-typography with pdfTeX (RS)]
%</package>
%<*config>
%<m-t>\ProvidesFile{microtype.cfg}
%<bch>\ProvidesFile{mt-bch.cfg}
%<cmr>\ProvidesFile{mt-cmr.cfg}
%<pad>\ProvidesFile{mt-pad.cfg}
%<pmn>\ProvidesFile{mt-pmn.cfg}
%<ppl>\ProvidesFile{mt-ppl.cfg}
%<ptm>\ProvidesFile{mt-ptm.cfg}
%<m-t>      [2005/01/11 v1.5 microtype configuration file (RS)]
%<bch>      [2005/01/31 v1.2 microtype config. file: Bitstream Charter (RS)]
%<cmr>      [2005/01/11 v1.5 microtype config. file: Computer Modern (RS)]
%<pad>      [2005/01/11 v1.4 microtype config. file: Adobe Garamond (RS)]
%<pmn>      [2004/11/21 v1.1a microtype config. file: Adobe Minion (HH)]
%<ppl>      [2005/01/11 v1.4 microtype config. file: Palatino (RS)]
%<ptm>      [2005/01/11 v1.3 microtype config. file: Times (RS)]
%</config>
%
%<*driver>
\documentclass[11pt,a4paper]{ltxdoc}
\usepackage[latin1]{inputenc}
\usepackage{textcomp}
\usepackage{array}
\IfFileExists{booktabs.sty}{
   \usepackage{booktabs}}{}
\IfFileExists{url.sty}{
   \usepackage{url}}{\def\url##1{\texttt{##1}}}
% Let's abolish CM! We use Charter and Letter Gothic
% (for the pre-built documentation on CTAN):
% \def\rmdefault{bch}
% \def\ttdefault{blg}
% \usepackage[T1]{fontenc}
\IfFileExists{microtype.sty}{
   \usepackage[expansion=false,protrusion=basictext]{microtype}}{}
\makeatletter
\def\Describe#1#2#3{%
   \noindent\csname Describe#1\endcsname{#2}{\ttfamily#3\\*[.25\baselineskip]}}
\def\DescribeOption{\leavevmode\@bsphack
   \begingroup\MakePrivateLetters\Describe@Option}
\def\Describe@Option#1{\endgroup
   \marginpar{\raggedleft\PrintDescribeOption{#1}}%
   \SpecialOptionIndex{#1}\@esphack\ignorespaces}
% additional bells and ...
\def\SpecialOptionIndex#1{\@bsphack
   \index{#1\actualchar{\protect\ttfamily#1} (option)\encapchar usage}%
   \index{\quotechar!User Options % the `!' will be sorted first
      \actualchar{\protect\indexspace\protect\bfseries User Options:}%
      \levelchar{\protect\ttfamily#1}\encapchar usage}%
   \@esphack}
% ... whistles
\def\SpecialUsageIndex#1{\@bsphack
   {\index{\quotechar!User Commands
      \actualchar{\protect\bfseries User Commands:}%
      \levelchar\expandafter\@gobble\string#1\actualchar\string\verb
         \quotechar*\verbatimchar\string#1\verbatimchar\encapchar usage}%
    \let\special@index\index\SpecialIndex@{#1}{\encapchar usage}}%
    \@esphack}
\def\PrintDescribeOption#1{\strut \MacroFont\color{theblue}\string #1}
\def\PrintDescribeMacro#1{\strut \MacroFont\color{thegreen}\string #1}
\def\pkg#1{{\PackageFont#1}\@bsphack
   \index{#1\actualchar{\protect\ttfamily#1} (package)\encapchar package}%
   \@esphack}
\def\Indexing{\let\special@index\codeline@wrindex}
\def\NoIndexing{\let\special@index\@gobble}
\def\MacroFont{\ttfamily\small}% will be set to \footnotesize before `Implementation'
\def\AltMacroFont{\ttfamily\itshape\footnotesize}
\def\Option#1{{\color{thered}\ttfamily\itshape\small#1}}
\def\OptionV#1{{\color{thered}\rmfamily\itshape\normalsize$\langle$#1$\rangle$}}
\def\Default#1{\underline{#1}}
\def\theCodelineNo{\reset@font\color{thegrey}\scriptsize\arabic{CodelineNo}}
\def\todo#1{}
\def\todo{\changes{zTo Do}{0000/00/00}}
% Heiko Oberdiek's workaround from latexbugs (latex/3540):
\begingroup
%  \makeatletter
  \def\x\begingroup#1\@nil{%
    \endgroup
    \def\DoNotIndex{%
      \begingroup
      \@makeother\#%
      \@makeother\$%
      \@makeother\%%
      \@makeother\^%
      \@makeother\_%
      \@makeother\~%
      \@makeother\ %
      \@makeother\&%
      % \@makeother\{\@makeother\} cannot be used here
      #1}}%
\expandafter\x\DoNotIndex\@nil
\def\@tempa{bch}
\ifx\rmdefault\@tempa
   \def\PackageFont{\ttfamily}
   \def\bfdefault{b}
   \def\Module#1{{\rmfamily\itshape\color{theblue}$\langle$#1$\rangle$}}
   \def\match{{\large\raisebox{-.15em}{\textbullet}}}
   \DeclareRobustCommand{\LaTeX}{L\kern-.26em{%
      \sbox\z@ T\vbox to\ht\z@{%
       \hbox{\check@mathfonts\fontsize\sf@size\z@\math@fontsfalse\selectfont A}%
      \vss}}\kern-.1em\TeX}
\else
   \def\PackageFont{\sffamily}
   \def\match{\textbullet}
\fi
\let\l@section@\l@section
\def\l@section{\vskip -.7ex \l@section@}
\def\l@table{\@dottedtocline{1}{0pt}{1.5em}}
\def\@biblabel#1{}
\def\@makefntext#1{%
   \leftskip 1.5em
   \parindent -1.5em
   \leavevmode\hbox to 1.5em{\@thefnmark\hss}#1}
\skip\@mpfootins=.5\baselineskip
\def\descriptionlabel#1{\hspace\labelsep\normalfont#1}
\long\def\@makecaption#1#2{% make the captions a bit fancier
   \vskip\abovecaptionskip
   \sbox\@tempboxa{\small\itshape #1: #2}%
   \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
   \vskip\belowcaptionskip}
\def\thebibliography#1{%
   \section{\refname}
   \list{}{\leftmargin 0pt}%
   \sloppy
   \clubpenalty 4000
   \@clubpenalty \clubpenalty
   \widowpenalty 4000}
\IndexPrologue{\section{Index}% add to pdf bookmarks
   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.}
\IfFileExists{multicol.sty}{
   %\raggedcolumns
   \setcounter{finalcolumnbadness}{100}
   \setcounter{IndexColumns}{2}
   \def\IndexMin{12\baselineskip}
   \def\GlossaryParms{% make the change history a bit fancier
      \IndexParms
      \def\@idxitem ####1####2\efill{%
         \end{multicols}
         \begin{multicols}{2}
            [\subsection*{\if####1v\relax Version ####2 (\csname MTversiondate####2\endcsname)%
                          \else ####2\fi}][6\baselineskip]
         \GlossaryParms
         \let\item\@idxitem
         \ignorespaces \makeatletter \scan@allowedfalse}%
      \def\subitem{\par\hangindent 25pt}%
      \def\subsubitem{\subitem\hspace*{15pt}}}
   \GlossaryPrologue{%
      \section{Change History}\label{sec:changes}%
      \vspace*{-2\multicolsep}}
}{%
   \GlossaryPrologue{%
      \section{Change History}\label{sec:changes}}
}
\headheight15pt
\def\ps@MTheadings{% fancy headings
   \let\@oddfoot\@empty
   \def\@oddhead{\hbox to\textwidth{\vbox{\hbox to\textwidth{%
         \footnotesize{\itshape\leftmark\rightmark\strut}\hfill\thepage\strut}%
         \hrule\@height0.4pt\@width\textwidth \vskip-0.4pt
      }}\hss}
   \let\@mkboth\markboth
   \def\sectionmark##1{%
      \markboth{\MakeUppercase{##1}}{}}
   \def\subsectionmark##1{%
      \markright{: ##1}}
}
\pagestyle{MTheadings}
% now we can relax...
\makeatother
\frenchspacing
\def\MacroTopsep{0pt}
\def\MacrocodeTopsep{3pt}
\settowidth\MacroIndent{\scriptsize 000\ }
\hyphenation{Ha-rald Har-ders}
% fancy PDF document
\let\pdftrue\empty
\ifx\pdfoutput\undefined\else\ifx\pdfoutput\relax\else
   \ifcase\pdfoutput\else\let\pdftrue\relax\fi\fi\fi
\ifx\pdftrue\relax
   \usepackage{color}
   \definecolor{thegrey}{gray}{0.45}
   \definecolor{thered}{rgb}{0.75,0.00,0.00}
   \definecolor{theblue}{rgb}{0.16,0.24,0.64}
   \definecolor{thegreen}{rgb}{0.18,0.58,0.08}
   \definecolor{linkcolor}{rgb}{0,0,0.42}
   \usepackage[
      bookmarks=true,
      colorlinks=true,
      linkcolor=linkcolor,
      urlcolor=linkcolor,
      citecolor=linkcolor,
      hyperindex=false,
      hyperfootnotes=false,
      pdftitle={The microtype package},
      pdfauthor={R Schlicht <w.m.l@gmx.net>},
      pdfsubject={An interface to the micro-typographic extension of pdfTeX},
      pdfkeywords={TeX, LaTeX, pdftex, typography, micro-typography,
                   font expansion, character protrusion, margin kerning}
     ]{hyperref}
   \def\usage#1{\textbf{\textit{\hyperpage{#1}}}}% for indexing of \DescribeMacro ...
   \def\package#1{\hyperpage{#1}}
   \makeatletter
   \def\changes@#1#2#3{% ... the changes ...
      \protected@edef\@tempa{\noexpand\glossary{#1\levelchar
         \ifx\saved@macroname\@empty \space\actualchar\generalname
         \else\expandafter\@gobble\saved@macroname\actualchar
            \string\verb\quotechar*\verbatimchar\saved@macroname\verbatimchar\fi
         :\levelchar #3\encapchar hyperpage}}%
      \@tempa\endgroup\@esphack}
%   \def\theCodelineNo{% % ... and everything else (would double the pdf file size)
%      \reset@font\color{thegrey}\scriptsize
%      \@tempcnta\arabic{CodelineNo}\advance\@tempcnta by\@ne
%      \hypertarget{L:\number\@tempcnta}{\arabic{CodelineNo}}}
%   \def\main#1{\underline{\hyperlink{L:#1}{#1}}}
%   \def\codeline#1{\link@sanitize#1-\@nil{#1}}
%   \def\link@sanitize#1-#2\@nil{\link@@sanitize#1,\@nil}
%   \def\link@@sanitize#1,#2\@nil{\hyperlink{L:#1}}
%   \def\SpecialIndex#1{\@bsphack\special@index{\expandafter\@gobble
%         \string#1\actualchar
%         \string\verb\quotechar*\verbatimchar\string#1\verbatimchar
%         \encapchar codeline}%
%      \@esphack}
   \makeatother
   \def\ctanurl#1{\href{http://www.tex.ac.uk/tex-archive#1}{\texttt{#1}}}
   \def\mailto#1{\href{mailto:#1}{\texttt{#1}}}
   \def\mailtoRS{\href{mailto:<w.m.l@gmx.net> R Schlicht?subject=microtype \fileversion}
                 {\texttt{w.m.l@gmx.net}}}
\else
   \def\package#1{#1}
   \def\color#1{}
   \def\texorpdfstring#1#2{#1}
   \def\ctanurl#1{\url{#1}}
   \def\mailto#1{\texttt{#1}}
   \def\mailtoRS{\texttt{w.m.l@gmx.net}}
\fi
% some abbreviations
\def\pdftex{\texorpdfstring{pdf\kern.05em\TeX}{pdfTeX}}
\def\thanh{H\`an Th\^e\llap{\raisebox{0.5ex}{\'{}}} Th\`anh}
\def\etex{e-\TeX}
\def\acro#1{{\small#1}}
\def\pdf{\acro{PDF}}
\def\dvi{\acro{DVI}}
\def\nfss{\acro{NFSS}}
\def\ctan{\acro{CTAN}}
\def\tOne{\acro{T1}}
\def\otOne{\acro{OT1}}
\def\lyOne{\acro{LY1}}
\def\tsOne{\acro{TS1}}
\CodelineIndex
\RecordChanges
\begin{document}
   \DocInput{microtype.dtx}
\end{document}
%</driver>
% \fi
% ^^A -------------------------------------------------------------------------
%\changes{v1.0}{2004/09/11}{Initial version}
%
%\newif\ifbooktabs
%\IfFileExists{booktabs.sty}{\booktabstrue}{}
%\newcolumntype{L}[1]{p{#1}<{\raggedright}}
%
% \GetFileInfo{microtype.dtx}
% \title{The \pkg{microtype} package\\[.4\baselineskip]\large
%        An interface to the micro-typographic extensions of \pdftex}
% \author{R Schlicht\quad\mailtoRS}
% \date{\fileversion\ --- \filedate}
%
% \maketitle
%
%\begin{abstract}
% \noindent\hspace*{-.1em}The \pkg{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.\footnote{
%     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.}
%
% 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.
%\end{abstract}
%
% \tableofcontents
% \listoftables\enlargethispage{\baselineskip}\thispagestyle{empty}
%
%\newpage
%\section{Micro-Typography with \pdftex}\label{sec:micro-type}
%
% \pdftex, the \TeX\ extension written by \thanh, 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:
% \textit{character protrusion} (also known as margin kerning) and
% \textit{font expansion}. Quoting \thanh's thesis:
%
%\begin{quote}\small
%\dimen0=\lpcode\font`\`em
%\divide\dimen0 by 1000
%\hspace{-\dimen0}^^A Cheat!
%  `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.' \cite[323]{ThanhThesis}
%\end{quote}
%
% Both these features have been lacking a simple \LaTeX\ user interface for
% quite some time. Then, the \pkg{pdfcprot} package was published
% \cite{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, \thanh\ 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 compile-time, and completely
% in memory.
%
% This package provides a simple interface to both font expansion and character
% protrusion.\footnote{
%     Therefore, it is an alternative, not a supplement, to the \pkg{pdfcprot}
%     package.}
% 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.
%
%
%\section{Invoking the Package}
%
% There is nothing surprising in loading this package:
%\begin{verbatim}
%\usepackage{microtype}
%\end{verbatim}
%
% 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.
%
%\subsection{General Options}\label{sub:options-general}
%
% Like many other \LaTeX\ packages, the \pkg{microtype} package accepts options
% in the well known |key=value| syntax. In the following, you'll find a
% description of all {\color{theblue}|keys|} and their possible
% \Option{\normalsize values} (the \Option{\normalsize\Default{underlined}}
% value may be omitted in the options list; some values are
% \OptionV{placeholders}; multiple values, where allowed, must be enclosed in
% braces).
%
%\bigskip
%\Describe{Option}{protrusion}
%   {\Default{\Option{true}}, \Option{false}, \Option{compatibility},
%    \Default{\Option{nocompatibility}}, \OptionV{font set name}}
%\DescribeOption{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| option
%\DescribeOption{activate}
% 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):
%\begin{verbatim}
%\usepackage[protrusion=true,expansion=true]{microtype}
%\end{verbatim}
%\begin{verbatim}
%\usepackage[protrusion,expansion]{microtype}
%\end{verbatim}
%\begin{verbatim}
%\usepackage[activate={true,nocompatibility}]{microtype}
%\end{verbatim}
%\begin{verbatim}
%\usepackage{microtype}
%\end{verbatim}
%
% When \pdftex\ employs font expansion and character protrusion, line breaks
% (and consequently, page breaks) may turn out differently. If that is not
% desired, you may pass the value |compatibility| to the |protrusion| and/or
% |expansion| options. Typographically, however, the results may be suboptimal.
%
% Finally, you may also specify the name of a font set to which character
% protrusion and/or font expansion should be restricted. See
% chapter~\ref{sec:font-sets} for a detailed discussion.
%
%\bigskip
%\Describe{Option}{DVIoutput}{\Default{\Option{true}}, \Option{false}}
% \pdftex\ is not only able to generate \pdf\ output but can also spit out \dvi\
% files.\footnote{
%     \TeX\ systems are beginning to switch to \pdftex\ as the default engine
%     even for DVI output.}
% The latter can be ordered with the option |DVIoutput|, which will set
% \cs{pdfoutput} to zero.
%
% Note that this might confuse packages that depend on the value of
% \cs{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: \pkg{graphics}, \pkg{color},
% \pkg{hyperref}, \pkg{pstricks} and, of course, \pkg{ifpdf}. Either load these
% packages after \pkg{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.
% \emph{Automatic} font expansion will not work because dvips (resp. the \dvi\
% viewer) is not able to generate the expanded fonts on the fly.
%
%\bigskip
%\Describe{Option}{draft}{\Default{\Option{true}}, \Option{false}}
%\DescribeOption{final}
% If the |draft| option is passed to the package, font expansion and character
% protrusion will be turned off. The |draft| and |final| may options may also
% be inherited from the class options; of course, you can override them in the
% package options.
%
%\bigskip
%\Describe{Option}{verbose}{\Default{\Option{true}}, \Option{false}}
% Information on each font being set up will be written into the log file if you
% enable the |verbose| option, which is disabled by default.
%
%
%\subsection{Option for Character Protrusion}\label{sub:options-protrusion}
%
%\Describe{Option}{factor}{\OptionV{number} (\Default{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~\ref{sub:fine-tuning}) will be used, a value of 500 would result in
% halving all protrusion factors of the configuration. This might be useful if
% you are happy with the settings but prefer the margin kerning to be less or
% more visible (e.\,g., if you are so proud of being able to use this feature
% that you want everybody to see it, or -- to mention a motivation more in
% compliance with typographical correctness -- if you are using a large font
% that calls for more modest protrusion).
%
%
%\subsection{Options for Font Expansion}\label{sub:options-expansion}
%
%\Describe{Option}{auto}{\Default{\Option{true}}, \Option{false}}
% As noted in chapter~\ref{sec:micro-type}, font expansion may take place
% automatically. This option is true by default provided that \pdftex's version
% is found to be 1.20 or higher and output mode is \pdf; otherwise, it will be
% disabled. If |auto| is set to false, the fonts for all expansion steps
% must exist.
%
%\iffalse
% Note that if |auto| is true, but expanded fonts do actually exist (with files
% called \meta{font~name}|[+-]|\meta{expansion factor}, e.\,g. |cmr12+10.tfm|
% etc., as described by Thành \cite{ThanhThesis,ThanhTUG}), these fonts
% \emph{will} be used -- only any missing ones will be calculated on the fly.
%\fi
%
%\bigskip
%\Describe{Option}{stretch}{\OptionV{number} (\Default{20})}
%\DescribeOption{shrink}
% You may specify the stretchability and shrinkability of a font, i.\,e. the
% maximum amount that a font may stretch or shrink. The numbers will be divided
% by 1000, so that a stretch factor of 10 means that the font may be expanded
% by up to 1\%.
%
% The default stretch factor is 20. The shrink factor will by default be the
% same as the stretch factor. Therefore, the following lines are equivalent:
%\begin{verbatim}
%\usepackage[stretch=20,shrink=20]{microtype}
%\end{verbatim}
%\begin{verbatim}
%\usepackage[stretch=20]{microtype}
%\end{verbatim}
%\begin{verbatim}
%\usepackage{microtype}
%\end{verbatim}
%
%\Describe{Option}{step}
%   {\OptionV{number} \textrm{(\Default{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 \textminus20 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.
%
%\bigskip
%\Describe{Option}{selected}{\Default{\Option{true}}, \Option{false}}
% When applying font expansion, some characters may be expanded by a lesser
% amount than others if they are more sensitive to deformation (e.\,g., the `O',
% in contrast to the `I'). This is called \emph{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~\ref{sub:expansion} for a more detailed discussion.
%
%\newpage
%\section{User Command}\label{sec:user-command}
%
%\Describe{Macro}{\microtypesetup}{\{\OptionV{key = value list}\}}
% This command may be used anywhere in the document to change the general
% settings of the micro-typographic extensions. It accepts the keys:
% |expansion|, |protrusion| and |activate|, which in turn may receive the
% values |true|, |false|, |compatibility| or |nocompatibility| (but not the
% name of a font set). Thus, you could temporarily disable font expansion by
% saying:
%\begin{verbatim}
%\microtypesetup{expansion=false}
%\end{verbatim}
%
%
%\section{Configuration}
%
%\subsection{Declaring Font Sets}\label{sec:font-sets}
% By default, all text fonts that are being used in the document will be
% subjected to protrusion and a basic set of fonts to expansion. You may want
% to customize the set of fonts which should get the benefit of
% 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.
%
%\bigskip
%\Describe{Macro}{\DeclareMicroTypeSet}
%   {[\Option{protrusion}\textbar\Option{expansion}]
%    \{\OptionV{set name}\} \{\OptionV{set of fonts}\}}
%\DescribeMacro{\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:
%\begin{tabbing}\MacroFont
%|\UseMicroTypeSet[|\Option{protrusion}\textbar\Option{expansion}|]{|\OptionV{set name}|}|
%\end{tabbing}
%
% The starred version of the command declares \emph{and} activates the font
% set at the same time.
%
% \paragraph{The set of fonts} is specified by assigning values to the \nfss\
% font attributes: encoding, family, series, shape, and size (cf.~\cite{fntguide}).
% Let's start with an example. This package defines a font set called
% `|basictext|' in the configuration file as follows:
%\begin{verbatim}
%\DeclareMicroTypeSet{basictext}
%   { encoding = {T1,OT1,LY1},
%     family   = {rm*,sf*},
%     series   = {m},
%     shape    = {},
%     size     = {normalsize,footnotesize,small,large}
%   }
%\end{verbatim}
% If you now call
%\begin{verbatim}
%\UseMicroTypeSet[expansion]{basictext}
%\end{verbatim}
% in the document's preamble, only fonts in the text encodings \tOne, \otOne\ or
% \lyOne, roman or sans serif families, normal (or `medium') series, and in
% sizes called by \cs{normalsize}, \cs{footnotesize}, \cs{small} or \cs{large},
% will be expanded. Math fonts, on the other hand, will not, since they are in
% a different encoding. Neither will fonts in bold face, or huge fonts. Etc.
% (This font set will be activated for font expansion unless you choose a
% different one.)
%
% If an attribute list is left empty -- be it by saying something like
% `|shape={}|', as in the above example, or by not specifying it at all --, it
% does not constitute a restriction. In other words, this is equivalent to specifying
% \emph{all} possible values for that attribute.
%
% Therefore, the predefined set `|alltext|', declared like this:
%\begin{verbatim}
%\DeclareMicroTypeSet{alltext}
%   { encoding = {T1,OT1,LY1,TS1} }
%\end{verbatim}
% is far less restrictive. Here, the only condition is the encoding. (This is
% the default font set for character protrusion.)
%
% If a value is followed by an asterisk (like `|rm*|' and `|sf*|' in the example
% above), it does not designate a \nfss\ code, but will expand to the current
% |\|\meta{value}|default|, e.\,g. \cs{rmdefault}.\footnote{
%     Note that this expansion will take place immediately, so you should make
%     all relevant changes \emph{before} loading this package.}
% For example, if you want to include the bold font, too, you should say `|bf*|'
% instead of `|b|' (\cs{bfdefault} for Computer Modern is `|bx|', while for
% other fonts, it might be `|b|' or even `|sb|'). A single asterisk means
% |\|\meta{characteristic}|default|, e.\,g. \cs{encodingdefault}, respectively
% \cs{normalsize} for the size axis. Sizes may be either specified as a
% dimension (|10| or |10pt|), or as a size selection command \emph{without} the
% backslash.
%
%\begin{table}\small
%\begin{tabular}{@{}L{41pt}L{30pt}L{80pt}L{70pt}L{84pt}@{}}
%\ifbooktabs\addlinespace\toprule\addlinespace\else\hline\fi
%         &|all|& |alltext|\linebreak(|allmath|)
%                       & |basictext| (|basicmath|)       & |normalfont|\\
%\ifbooktabs\cmidrule(lr){2-2}\cmidrule(lr){3-3}\cmidrule(lr){4-4}\cmidrule(l){5-5}\else\hline\fi
% encoding & -- &\footnotesize T1, OT1, LY1, TS1 \linebreak (OML, OMS)
%                       & \footnotesize T1, OT1, LY1 \linebreak (OML, OMS)
%                                                         & \cs{encodingdefault} \\
% family   & -- & --    & \cs{rmdefault}, \cs{sfdefault}  & \cs{familydefault}   \\
% series   & -- & --    & m                               & \cs{seriesdefault}   \\
% shape    & -- & --    & --                              & \cs{shapedefault}    \\
% size     & -- & --    & \cs{normalsize}, \cs{footnotesize},
%                         \cs{small}, \cs{large}          & \cs{normalsize}      \\
%\ifbooktabs\bottomrule\else\hline\fi
%\end{tabular}
%\caption{Predefined font sets}\label{tab:predefined-font-sets}
%\end{table}
% Table~\ref{tab:predefined-font-sets} shows an overview of all predefined font
% sets. You may also activate these by passing their name to the |expansion|
% resp. |protrusion| option when loading the package, for example:
%\enlargethispage{1.5\baselineskip}
%\begin{verbatim}
%\usepackage[protrusion=allmath,expansion=basicmath]{microtype}
%\end{verbatim}
%
%\bigskip
%\Describe{Macro}{\UseMicroTypeSet}
%   {[\Option{protrusion}\textbar\Option{expansion}] \{\OptionV{set name}\}}
% This macro activates a font set previously defined by \cs{DeclareMicroTypeSet}.
% Using the optional argument, you can limit the application of the set to
% protrusion or expansion only.
%
%\bigskip\noindent
% The commands \cs{DeclareMicroTypeSet} and \cs{UseMicroTypeSet} may only be
% used in the preamble or in the main configuration file (cf.
% chapter~\ref{sub:config-file}).
%
%
%\subsection{Micro Fine Tuning}\label{sub:fine-tuning}
% For typographic reasons, not all characters should be protruded by the same
% amount. It may also be desirable to restrict expansion of certain characters.
% Therefore, you can specify this amount for each character. Furthermore, since
% every font looks different, you will want to be able to do this for each font
% or set of fonts separately.
%
%\subsubsection{Character Protrusion}\label{sub:protrusion}
%\Describe{Macro}{\SetProtrusion}
%   {[\OptionV{options}] \{\OptionV{set of fonts}\} \{\OptionV{character list}\}}
% Using this macro, you can set the protrusion factors for each character of a
% font or a set of fonts.
%
% A very incomplete example would be the following:
%\begin{verbatim}
%\SetProtrusion
%   { encoding = T1,
%     family   = cmr }
%   {  A             = {50,50},
%     \textquoteleft = {700, }  }
%\end{verbatim}
% which would result in the character `A' being protruded by 5\% of its width on
% both sides, and the left quote character by 70\% into the left margin. This
% would apply to all font shapes, series and sizes of the Computer Modern Roman
% family in encoding~\tOne.
%
% \paragraph{The character list} may contain a number of \meta{character}~=
% \meta{protrusion factors} pairs. Characters can be specified either as a
% single character (`|A|'), as a command that has been defined by
% \cs{DeclareTextSymbol} (`\cs{textquoteleft}'), or as a slot number: three
% digits for decimal notation, prefixed with~|"| for hexadecimal, with~|'| for
% octal (e.\,g.:~|092|, |"5C|, |'134|). \mbox{8-bit} characters may be entered
% directly or in the \LaTeX\ \mbox{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~\ref{sub:inherit}).
%
% The numbers 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.
%
% \paragraph{The set of fonts} should be declared using the same syntax of
% \meta{font axis}~|=| \meta{value list} pairs as in the command
% \cs{DeclareMicroTypeSet}.
%
% To determine whether a given font matches the specified set, the package will
% test all combinations of font family, series and shape. The font size will
% only be taken into account if all other criteria match as well. The encoding
% must always match.
%
% Table~\ref{tab:test-order} shows the order in which the combinations of font
% characteristics will be tested.
%
%\begin{table}\centering\small
%\begin{tabular}{@{}l*{8}l@{}}
%\ifbooktabs\addlinespace\toprule\addlinespace\else\hline\fi
%          & 1.     & 2.     & 3.     & 4.     & 5.     & 6.     & 7.     & 8. \\
%\ifbooktabs\cmidrule(r){2-2}\cmidrule(r){3-3}\cmidrule(r){4-4}\cmidrule(r){5-5}
%   \cmidrule(r){6-6}\cmidrule(r){7-7}\cmidrule(r){8-8}\cmidrule{9-9}\else\hline\fi
% encoding & \match & \match & \match & \match & \match & \match & \match & \match\\
% family   & \match & \match & \match & \match & \match & --     & --     & --    \\
% series   & \match & \match & \match & --     & --     & \match & --     & --    \\
% shape    & \match & \match & --     & \match & --     & --     & \match & --    \\
% size     & \match & --     & --     & --     & --     & --     & --     & --    \\
%\ifbooktabs\bottomrule\else\hline\fi
%\end{tabular}
%\caption{Order for matching font attributes}\label{tab:test-order}
%\end{table}
%
% \paragraph{Optional Options:}
%\begin{description}
%   \item[|name|] You may assign a name to the protrusion settings, so that you
%        are able to load it by another set.
%   \item[|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.
%   \item[|factor|] This option can be used to influence all protrusion factors
%        of the font or font set, overriding any global |factor| setting
%        (see section~\ref{sub:options-protrusion}).
%\end{description}
% 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.
%
%\subsubsection{Font Expansion}\label{sub:expansion}
%
%\Describe{Macro}{\SetExpansion}
%   {[\OptionV{options}] \{\OptionV{set of fonts}\} \{\OptionV{character list}\}}
% By default, all characters of a font are allowed to be stretched or shrunk by
% the same amount. However, it is also possible to limit the expansion of
% certain characters if they are more sensitive to deformation. This is the
% purpose of the \cs{SetExpansion} macro. Note that it will only have an effect
% if the package has been loaded with the |selected| option.
%
%\paragraph{The character list} contains a number of \meta{character} =
% \meta{expansion factor} pairs. You may specify one number for each character,
% which determines the amount that a character may be expanded.
% The numbers denominate thousandth of the full expansion.
% For example, if you set the expansion factor for the character `O' to 500,
% it will only be expanded or shrunk by one half of the amount that the rest
% of the characters will be expanded or shrunk.
% While the default value for character protrusion is~0~-- that is, if you
% didn't specify any characters, none would be protruded~--, the default value
% for expansion is 1000, which means that all characters would be expanded by
% the same amount.
%
%\paragraph{The font set} is specified in the same way as in \cs{SetProtrusion}.
%
%\paragraph{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:
%\begin{verbatim}
%\SetExpansion
%   [ load     = T1-default,
%     stretch  = 10 ]
%   { series   = bf*,
%     encoding = T1  }
%   { }
%\end{verbatim}
% This would use the settings for the characters as defined in the list
% |T1-default|, but expand the bold font by a smaller value (compared to the
% default stretch factor of~20).
%
% However, since \pdftex\ does not allow different expansion limits or steps
% within one paragraph, a different method is also provided with the |factor|
% option, using which you can influence the expansion factors of all characters
% (in contrast to the overall stretchability) of the font. The |factor| option
% can only be used to decrease the stretchability of the characters, that is,
% it may only receive values smaller than 1000. Also, it can only be used on a
% per-font basis, since setting it globally in the package options wouldn't
% make much sense -- for that, you use the |stretch| etc. options.
%
% These options in the first argument will even be taken into account if the
% package has not been loaded with the |selected| option.
%
%\bigskip\noindent
% If the |selected| option has been passed to the package (cf.
% section~\ref{sub:options-expansion}), 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.:
%\begin{verbatim}
%\SetExpansion
%   { encoding = T1,
%     family = {pkpx,pkpj} }
%   { }
%\end{verbatim}
%
%\subsection{Character Inheritance}\label{sub:inherit}
%
% \Describe{Macro}{\DeclareCharacterInheritance}
%           {\hspace{1em}[\Option{protrusion}\textbar\Option{expansion}]
%           \{\OptionV{font set}\} \{\OptionV{inheritance list}\}}
% In most cases, accented characters should inherit the protrusion resp.
% expansion factors from the respective base character. For example, all of the
% characters \`A, \'A, \^A, \~A, \"A, \r{A} and \u{A} should probably be
% protruded by the same amount as the character A. Using the command
% \cs{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 \meta{base character} |=| \meta{list of inheriting
% characters}. Unless you are using a different encoding, there should be no
% need to change the default character inheritance settings.
%
%\bigskip\noindent
% See the configuration file |microtype.cfg| and the other font-specific files
% for examples of all these commands.
%
%\subsection{Configuration Files}\label{sub:config-file}
%
% The default configuration will be loaded from the file |microtype.cfg|. You
% may extend this file with custom settings.
%
% If you are embarking on creating new expansion and protrusion settings for a
% different font family, you should put them into a separate file, whose name
% must be: `|mt-|\meta{font family}|.cfg|' (e.\,g. `|mt-pad.cfg|'), and may
% contain the commands \cs{SetProtrusion}, \cs{SetExpansion} and
% \cs{DeclareCharacterInheritance}. These files will only be loaded if you are
% actually using the respective fonts. If the font name consists of four
% characters, the package will also try to find the file for the base font
% family by removing the suffix denoting the sub-family, so that you may put
% settings for the fonts |padx| (expert set), |padj| (oldstyle numerals) and
% |pad| (normal) into one and the same file.
%
%\begin{table}\small
%\begin{minipage}{\textwidth}
%\def\arraystretch{1.2}
%\let\footnoterule\relax
%\newcommand{\fnref}[1]{\textsuperscript{\itshape#1}}
%\settowidth{\dimen0}{(}
%\def\p{\hskip\dimen0}
%\begin{tabular}{@{}L{165pt}L{25pt}L{65pt}*2{L{25pt}}@{}}
%\ifbooktabs\addlinespace\toprule\addlinespace\else\hline\fi
%  Font family (NFSS code)           & Series & Shapes                      & TS1      & Math \\
%\ifbooktabs\cmidrule(r){1-1}\cmidrule(lr){2-2}\cmidrule(lr){3-3}\cmidrule(lr){4-4}\cmidrule(l){5-5}\else\hline\fi
%  Generic                                & m & n, (it, sl, sc)\footnote{Incomplete} & (\match)\fnref{a}\\
%  Computer Modern Roman (|cmr|)\footnote{Also used for: Latin Modern (|lmr|), \pkg{ae} (|aer|), \pkg{zefonts} (|zer|),
%                                         \pkg{eco} (|cmor|), \pkg{hfoldsty} (|hfor|)}
%                                         & m & n, it (sl)\footnote{Settings taken from italic shape}, sc
%                                                                           & \p\match & \p\match \\
%  Bitstream Charter (|bch|)              & m & n, it (sl)\fnref{c}, sc     & \p\match \\
%  Adobe Garamond (|pad|, |padx|, |padj|) & m & n, it (sl)\fnref{c}, sc     & \p\match \\
%  Adobe Minion (|pmnx|, |pmnj|)          & m & n, it (sl)\fnref{c}, sc, si & \p\match \\
%  Palatino (|ppl|, |pplx|, |pplj|)       & m & n, it (sl)\fnref{c}, sc     & (\match)\fnref{a}  \\
%  Times (|ptm|, |ptmx|, |ptmj|)          & m & n, it (sl)\fnref{c}, sc     & (\match)\fnref{a}  \\
%\ifbooktabs\bottomrule\else\hline\fi
%\end{tabular}
%\end{minipage}\caption{Fonts with tailored protrusion settings}\label{tab:fonts}
%\end{table}
% This package ships with configuration files for the fonts Computer Modern
% Roman, Palatino, the inescapable Times, for Adobe Garamond and Minion\footnote{
%     By courtesy of Harald Harders (\mailto{h.harders@tu-bs.de}).}
% and for Bitstream Charter. Table~\ref{tab:fonts} lists them all. Remember that
% when settings for a font family cannot be found, the best matching generic
% settings will be used (see table~\ref{tab:test-order}).
%
% 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.
%
%\bigskip
%\Describe{Macro}{\DeclareMicroTypeAlias}
%    {\{\OptionV{font name}\} \{\OptionV{alias font}\}}
% You may use this command for fonts that are very similar, or actually the
% same (for instance if you did not stick to the Berry naming scheme when
% installing the font). An example would be the Latin Modern fonts which are
% clones of the Computer Modern fonts, so that you probably don't want to
% create new settings for them -- you could say:
%\begin{verbatim}
%\DeclareMicroTypeAlias{lmr}{cmr}
%\end{verbatim}
% 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 \pkg{ae}, \pkg{zefonts}, \pkg{eco} and
% \pkg{hfoldsty}.
%
%
%\section{Caveats}\label{sec:caveats}
%
% \paragraph{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.
%
% \paragraph{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\%.
%
% \paragraph{Don't use font expansion for web documents.} Because each instance
% of the font will be embedded in the \pdf\ file, the file size may increase
% by quite a large factor (depending on expansion limits and step). Therefore,
% courtesy and thriftiness of bandwidth command it not to enable font expansion
% when creating files to be distributed electronically.
%
%
%\section{Contributions}\label{sec:contrib}
%
% 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: \mailtoRS.\footnote{
%     Should you have lots of \pkg{pdfcprot} configuration files lying around,
%     I can also provide you with a \TeX\ conversion script. Just ask me.}
%
%
%\section{Acknowledgments}
%
% This package would be pointless if \thanh\ 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 (\mailto{h.harders@tu-bs.de}) has contributed protrusion
% settings for Adobe Minion. I would also like to thank him for a number of
% bug reports and suggestions he had to make.
%
%
%\begin{thebibliography}{}
% \bibitem[Th\`anh 2000]{ThanhThesis}
%   \thanh, \emph{Micro-typographic extensions to the \TeX\ typesetting system},
%   \newblock Diss. Masaryk University Brno 2000,
%   \newblock in: \textit{TUGBoat}, vol.~21(2000), no.\ 4, pp.~317--434.
%   \newblock (Online at \url{http://www.tug.org/TUGboat/Articles/tb21-4/tb69thanh.pdf})
%
% \bibitem[Th\`anh 2001]{ThanhTUG}
%   \thanh, \emph{Margin Kerning and Font Expansion with \pdftex},
%   \newblock in: \textit{TUGBoat}, vol.~22(2001), no.\ 3 -- Proceedings of the
%            2001 Annual Meeting, pp.~146--148.
%   \newblock (Online at \url{http://www.tug.org/TUGboat/Articles/tb22-3/tb72thanh.pdf})
%
% \bibitem[\LaTeXe\ font selection]{fntguide}
%   \LaTeX3 Project Team, \emph{\LaTeXe\ font selection},
%   \newblock 10 February 2004.
%   \newblock (Available from \ctan\ at \ctanurl{/macros/latex/doc/fntguide.pdf})
%
% \bibitem[\texttt{pdfcprot}]{pdfcprot}
%   Carsten Schurig, \emph{The |pdfcprot.sty| package},
%   \newblock 14 August 2002.
%   \newblock (Available from \ctan\ in \ctanurl{/macros/latex/contrib/pdfcprot/})
%\end{thebibliography}
%
%
%\section{Short History}
%\changes{v1.5}{2004/12/11}{new: short history}
%
%\makeatletter
%\def\MTreforwarn#1{^^A
%  \expandafter\ifx\csname r@#1\endcsname\relax
%     \@latex@warning{Reference `#1' on page \thepage \space undefined.\MessageBreak
%        You can create the change history by running\MessageBreak
%       `makeindex -s gglo.ist -o microtype.gls microtype.glo'\MessageBreak}^^A
%     can be obtained by running
%    `|makeindex \mbox{-s gglo.ist} \mbox{-o microtype.gls} microtype.glo|'\else
%  can be found in appendix~\ref{#1}\fi}
%\makeatother
% The comprehensive list of changes \MTreforwarn{sec:changes}.
% The following is a list of all changes relevant in the user land; bug fixes
% are swept under the rug.
%
%\newenvironment{History}
%  {\list{}{^^A
%     \leftmargin 2.5\parindent
%     \itemindent -\parindent
%     \labelsep 0pt
%     \labelwidth 1.5\parindent
%     \rightmargin 0pt
%     \parsep  0pt
%     \itemsep 0pt plus 1pt
%     \def\makelabel##1{##1\hss}
%     }}
%  {\endlist}
%\def\Version #1 (#2.#3.#4){^^A
%  \vskip 1ex plus 1pt
%  \pagebreak[2]
%  \VersionDate{#1}{#2.\,#3.\,#4}^^A
%  \item[#1](#2.\,#3.\,#4)
%  \nopagebreak[4]
%}
%\def\VersionDate#1#2{^^A needed for the Change History
%  \global\expandafter\def\csname MTversiondate#1\endcsname{#2}}
%
%\begin{History}
%\Version 1.6a (2.2.2005)
%  \item Compatibility with the \pkg{frenchpro} package
%\Version 1.6 (24.1.2005)\VersionDate{1.6}{2.\,2.\,2005}
%  \item New option `|factor|' to influence protrusion resp. expansion of all
%        characters of a font or font set
%        (see sections~\ref{sub:options-protrusion} and~\ref{sub:fine-tuning})
%  \item When \pdftex\ is too old to expand fonts automatically, font expansion
%        has to be enabled explicitly, automatic expansion will be disabled
%        (see section~\ref{sub:options-general})\pagebreak[2]
%  \item Protrusion settings of digits improved
%  \item Use \etex\ extensions, if available
%\Version 1.5 (15.12.2004)
%  \item When output mode is \dvi, font expansion has to be enabled
%        explicitly, automatic expansion will be disabled
%        (see section~\ref{sub:options-general})
%  \item New option `|selected|' to enable selected expansion
%        (see sections~\ref{sub:options-expansion} and~\ref{sub:expansion});
%        default is: |false|
%  \item New default for expansion option `|step|': 4 (min(|stretch|,|shrink|)/5)
%        (see section~\ref{sub:options-expansion})
%  \item Protrusion settings for Bitstream Charter
%  \item Compatibility with turkish \pkg{babel}
%\Version 1.4b (26.11.2004)
%  \item \cs{UseMicroTypeSet} requires the set to be declared
%        (see section~\ref{sec:font-sets})
%  \item Internal optimization
%^^A\Version 1.4a (17.11.2004)
%^^A  \item Bug fix update (font setup inside |tabular|s)
%\Version 1.4 (12.11.2004)\VersionDate{1.4}{26.\,11.\,2004}
%  \item Set up fonts independently from \LaTeX\ font loading
%        (therefore, no risk of overlooking fonts anymore, and the package may
%        be loaded at any time)
%  \item \cs{microtypesetup} now sets the correct level of character protrusion
%        (see chapter~\ref{sec:user-command})
%  \item New option: `|final|'
%\Version 1.3 (27.10.2004)
%  \item Compatibility with the \pkg{german} and \pkg{ngerman} packages
%\Version 1.2 (3.10.2004)
%  \item New font sets: `|allmath|' and `|basicmath|'
%        (see section~\ref{sec:font-sets} and table~\ref{tab:predefined-font-sets})
%  \item Protrusion settings for Computer Modern Roman math symbols
%  \item Protrusion settings for \tsOne\ encoding completed for Computer Modern
%        Roman and Adobe Garamond
%  \item If an alias font name is specified, it will be used as an alternative,
%        not as a replacement (see section~\ref{sub:config-file})
%  \item More tests for sanity of settings and whether all fonts will be set up
%  \item More robust parsing of sizes in font sets
%\Version 1.1 (21.9.2004)
%  \item Protrusion settings for Adobe Minion, contributed by Harald Harders
%  \item New macro: \cs{DeclareCharacterInheritance}
%        (see section~\ref{sub:inherit})
%  \item Characters may also be specified as octal or hexadecimal numbers
%        (see section~\ref{sub:fine-tuning})
%  \item Configuration file names in lowercase (see section~\ref{sub:config-file})
%\Version 1.0 (11.9.2004)
%  \item First \ctan\ release
%\end{History}
%
%
% \StopEventually{
%   \typeout{:?1000}
%   \newpage
%   \appendix
%   \PrintChanges
%   \PrintIndex
%   \typeout{:?1111}
% }
%
%
% ^^A =========================================================================
%
%\DoNotIndex{\!,\",\',\*,\,,\-,\.,\/,\;,\<,\=,\>,\?,\[,\\,\],\`}
%\DoNotIndex{\#,\$,\%,\&,\{,\},\^,\_,\~,\ }
%\DoNotIndex{\advance,\begingroup,\catcode,\char,\csname,\def,\divide,\do,\edef}
%\DoNotIndex{\else,\endcsname,\endgroup,\endinput,\escapechar,\expandafter}
%\DoNotIndex{\fi,\gdef,\global,\hbox,\if,\ifcat,\ifnum,\ifx,\input,\let,\meaning}
%\DoNotIndex{\multiply,\newcount,\newif,\next,\noexpand,\number,\or,\relax}
%\DoNotIndex{\romannumeral,\setbox,\space,\string,\the,\uppercase,\wd,\xdef} ^^A \font,\fontdimen,\nullfont
%\DoNotIndex{\ifcsname,\ifdefined} ^^A \fontcharwd
%^^A \efcode,\lpcode,\rpcode,\pdf*
%\DoNotIndex{\@cclv,\@cclvi,\@classoptionslist,\@currext,\@currname,\@defaultunits}
%\DoNotIndex{\@empty,\@expandtwoargs,\@firstoftwo,\@for,\@gobble,\@ifnextchar}
%\DoNotIndex{\@ifpackageloaded,\@ifstar,\@ifundefined,\@m,\@makeother,\@ne,\@nil}
%\DoNotIndex{\@nnil,\@nodocument,\@onlypreamble,\@ptionlist,\@removeelement,\@secondoftwo}
%\DoNotIndex{\@tempa,\@tempb,\@tempc,\@tempcnta,\@tempcntb,\@tempdima,\@tempswafalse}
%\DoNotIndex{\@tempswatrue,\@undefined,\@unprocessedoptions,\@unusedoptionlist}
%\DoNotIndex{\g@addto@macro,\if@tempswa,\m@ne,\toks@,\thr@@,\tw@,\z@}
%^^A \@@enc@update,\cf@encoding,\f@encoding,\font@name,\pickup@font,\set@fontsize,\strip@pt
%\DoNotIndex{\makeatletter,\newcommand,\renewcommand}  ^^A \normalfont,\normalsize
%\DoNotIndex{\AtBeginDocument,\AtEndOfPackage,\CurrentOption,\IfFileExists}
%\DoNotIndex{\InputIfFileExists,\MessageBreak,\PackageError,\PackageInfo}
%\DoNotIndex{\PackageWarning,\RequirePackage}
%\DoNotIndex{\x,\y,\CHAR}
%^^A \define@key,\KV@@sp@def,\KVo@tempa,\setkeys ^^A keyval
%
% ^^A -------------------------------------------------------------------------
%
%\newpage
%\setlength\hfuzz{35pt}
%\section{Implementation}
%\def\MacroFont{\ttfamily\footnotesize}
%\makeatletter\def\macro@font{\ttfamily\footnotesize}\makeatother
%
% The \pkg{docstrip} modules in this file are:
%\begin{itemize}\setlength{\itemsep}{0pt}
%  \item[|driver|:]  The documentation driver (only visible in the |dtx| file).
%  \item[|package|:] The code for the \pkg{microtype} package.
%  \item[|debug|:]   Code for additional output in the log file.\\
%                    Used for -- surprise! -- debugging purposes.
%  \item[|config|:]  Surrounds all configuration modules.
%  \item[|m-t|:]     The main configuration file (|microtype.cfg|).
%  \item[|bch|:]     Settings for Bitstream Charter (|mt-bch.cfg|).
%  \item[|cmr|:]     Settings for Computer Modern Roman (|mt-cmr.cfg|).
%  \item[|pad|:]     Settings for Adobe Garamond (|mt-pad.cfg|).
%  \item[|ppl|:]     Settings for Palatino (|mt-ppl.cfg|).
%  \item[|ptm|:]     Settings for Times (|mt-ptm.cfg|).
%  \item[|pmn|:]     Settings for Adobe Minion (|mt-pmn.cfg|). \\
%                    Contributed by Harald Harders.
%  \item[|test|:]    A helper file that may be used to create and test
%                    protrusion settings (|test-microtype.tex|).
%\end{itemize}
% And now for something completely different.
%
%    \begin{macrocode}
%<*package>
\RequirePackage{keyval}[1997/11/10]
%    \end{macrocode}
%\begin{macro}{\MT@info}
%\begin{macro}{\MT@info@nl}
%\begin{macro}{\MT@vinfo}
%\changes{v1.6}{2005/01/06}{new macro instead of \cs{ifMT@verbose}}
%\begin{macro}{\MT@warning}
%\begin{macro}{\MT@warning@nl}
%\begin{macro}{\MT@error}
% Save some typing.
%    \begin{macrocode}
\def\MT@info{\PackageInfo{microtype}}
\def\MT@info@nl#1{\MT@info{#1\@gobble}}
%<!debug>\let\MT@vinfo\@gobble
%<debug>\let\MT@vinfo\MT@info@nl
\def\MT@warning{\PackageWarning{microtype}}
\def\MT@warning@nl#1{\MT@warning{#1\@gobble}}
\def\MT@error{\PackageError{microtype}}
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
% 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.
%    \begin{macrocode}
\newcommand{\DeclareMicroTypeSet}[3][]{}
\newcommand{\UseMicroTypeSet}[2][]{}
\newcommand{\DeclareMicroTypeAlias}[2]{}
\newcommand{\SetProtrusion}[3][]{}
\newcommand{\SetExpansion}[3][]{}
\newcommand{\DeclareCharacterInheritance}[3][]{}
\newcommand{\microtypesetup}[1]{}
%    \end{macrocode}
% This command also has a starred version.
%    \begin{macrocode}
\def\DeclareMicroTypeSet{%
   \@ifstar
      {\@ifnextchar[\MT@DeclareSet{\MT@DeclareSet[]}}%
      {\@ifnextchar[\MT@DeclareSet{\MT@DeclareSet[]}}%
}
\def\MT@DeclareSet[#1]#2#3{}
%    \end{macrocode}
% Set declarations are only allowed in the preamble (resp. the main
% configuration file). \cs{SetExpansion} and \cs{SetProtrusion}, on the other
% hand, must be allowed in the document, too, since they may be loaded from
% font configuration files.
%    \begin{macrocode}
\@onlypreamble{\DeclareMicroTypeSet}
\@onlypreamble{\UseMicroTypeSet}
\@onlypreamble{\DeclareMicroTypeAlias}
%    \end{macrocode}
%\subsection{Requirements}
%
%\begin{macro}{\MT@pdftex@no}
% Test which \pdftex\ we're using, if any.
%\changes{v1.6}{2005/02/02}{new macro}
%    \begin{macrocode}
\let\MT@pdftex@no\z@
%    \end{macrocode}
%\end{macro}
% Cases for \cs{MT@pdftex@no} are:
%\begin{itemize}\setlength{\itemsep}{0pt}
%  \item[0:] not running \pdftex
%  \item[1:] pdftex (\textless 0.14f)
%  \item[2:] + micro-typographic extensions (0.14f -- 0.14g)
%  \item[3:] + protrusion relative to 1em (0.14h -- \textless1.20)
%  \item[4:] + automatic font expansion (\textgreater= 1.20a)
%\end{itemize}
% At first check whether we are using \pdftex.
%    \begin{macrocode}
\ifx\pdftexversion\@undefined \else
   \ifx\pdftexversion\relax \else
%<debug>      \MT@info@nl{running pdftex \the\pdftexversion(\pdftexrevision)}
      \def\MT@pdftex@no{4}
%    \end{macrocode}
% The |autoexpand| feature only works since \pdftex\ 1.20.
%    \begin{macrocode}
      \ifnum\pdftexversion < 120
         \let\MT@pdftex@no\thr@@
         \ifnum\pdftexversion = 14
%    \end{macrocode}
% Only \pdftex\ versions 0.14f and 0.14g do not need adjustment of protrusion
% factors.
%\changes{v1.1}{2004/09/13}{bug fix concerning version check
%                           (reported by Harald Harders)}
%    \begin{macrocode}
            \ifnum \expandafter`\pdftexrevision < `h
               \let\MT@pdftex@no\tw@
            \fi
            \ifnum \expandafter`\pdftexrevision < `f
               \let\MT@pdftex@no\@ne
            \fi
         \else
            \ifnum\pdftexversion < 14
               \let\MT@pdftex@no\@ne
            \fi
         \fi
      \fi
   \fi
\fi
%<debug>\MT@info@nl{pdftex no: \number\MT@pdftex@no}
%    \end{macrocode}
%\begin{macro}{\MT@exitornot}
% If we are not using \pdftex\ or in case it is too old, we disable everything
% and exit here.
%    \begin{macrocode}
\let\MT@exitornot\relax
%    \end{macrocode}
%\end{macro}
%    \begin{macrocode}
\ifnum\MT@pdftex@no<\tw@
   \def\MT@exitornot{%
      \AtEndOfPackage{\let\@unprocessedoptions\relax}%
      \let\CurrentOption\@empty
      \endinput
   }
   \MT@warning@nl{%
      \ifcase\MT@pdftex@no
         You don't seem to be using pdftex.\MessageBreak
      \or
         You are using a pdftex version older than 0.14f.\MessageBreak
         microtype doesn't support such antiquated versions.\MessageBreak
         Please install a newer version of pdftex.\MessageBreak
      \fi
         All micro-typographic features will be disabled%
   }
\fi
\MT@exitornot
%    \end{macrocode}
% Still there? Then we can begin:
%\begin{macro}{\MT@catcodes}
%\changes{v1.3}{2004/10/27}{check some category codes (compatibility with \protect\pkg{german})}
%\changes{v1.5}{2004/12/03}{reset catcode of `\texttt{\^}' (compatibility with \protect\pkg{chemsym})}
% We have to make sure that the category codes of some characters are correct
% (the \pkg{german} package, for instance, makes |"| active). Probably overly
% cautious. Ceterum censeo: It should be forbidden for packages to change
% catcodes within the preamble.
%    \begin{macrocode}
\def\MT@catcodes{%
   \@makeother\-%
   \@makeother\,%
   \@makeother\/%
   \@makeother\`%
   \@makeother\'%
   \@makeother\"%
   \catcode`\^7\relax
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@restore@catcodes}
% Polite as we are, we'll restore them afterwards.
%    \begin{macrocode}
\def\MT@restore@catcodes#1{%
   \ifx\relax#1\else
      \noexpand\catcode`\noexpand#1\the\catcode`#1\relax
      \expandafter\MT@restore@catcodes
   \fi
}
\edef\MT@restore@catcodes{%
   \MT@restore@catcodes\-\,\/\`\'\"\^\relax
}
%    \end{macrocode}
%\end{macro}
%    \begin{macrocode}
\MT@catcodes
\AtEndOfPackage{\MT@restore@catcodes}
%    \end{macrocode}
%\changes{v1.4}{2004/11/04}{check for \protect\pkg{pdfcprot}}
% Our competitor, the \pkg{pdfcprot} package, must not be tolerated!
%    \begin{macrocode}
\AtBeginDocument{%
   \@ifpackageloaded{pdfcprot}{%
      \MT@error{%
         Detected the `pdfcprot' package!\MessageBreak
         `microtype' and `pdfcprot' may not be used together}%
         {The `pdfcprot' package provides an interface to
          character protrusion.\MessageBreak
          So does the `microtype' package.
          Using both packages at the same\MessageBreak
          time will almost certainly lead to undesired results.
          Have your choice!}%
   }{}%
%    \end{macrocode}
% The \pkg{ledmac} package puts each line of a paragraph into a \cs{hbox} before
% actually typesetting them by \cs{unhbox}ing. This will (at least with current
% \pdftex) destroy character protrusion. (Interestingly, there aren't any
% problems with the \pkg{lineno} package.) We issue a warning, so that nobody
% can say they didn't know.
%^^A\changes{v1.6}{2004/12/29}{warning when using the \protect\pkg{ledmac} package}
% This is fixed in \pdftex\ 1.20c, so we no longer warn.
%^^A\changes{v1.6}{2004/02/02}{no warning when using the \protect\pkg{ledmac} package}
%    \begin{macrocode}
}
%    \end{macrocode}
%\changes{v1.6}{2005/01/19}{load a font, if none is active}
% We need a font (the \pkg{minimal} class doesn't load one).
%    \begin{macrocode}
\expandafter\ifx\the\font\nullfont\normalfont\fi
%    \end{macrocode}
%\begin{macro}{\ifMT@DVIoutput}
%\begin{macro}{\ifMT@draft}
%\begin{macro}{\ifMT@protrusion}
%\begin{macro}{\ifMT@expansion}
%\begin{macro}{\ifMT@auto}
%\begin{macro}{\ifMT@selected}
%\begin{macro}{\MT@expansionlevel}
%\begin{macro}{\MT@protrusionlevel}
%\begin{macro}{\MT@stretch}
%\begin{macro}{\MT@shrink}
%\begin{macro}{\MT@step}
%\begin{macro}{\MT@prot@factor}
% These are the global switches and settings.
%    \begin{macrocode}
\newif\ifMT@DVIoutput
\newif\ifMT@draft
\newif\ifMT@protrusion
\newif\ifMT@expansion
\newif\ifMT@auto
\newif\ifMT@selected
\def\MT@expansionlevel{2}
\def\MT@protrusionlevel{2}
\let\MT@stretch\m@ne
\let\MT@shrink\m@ne
\let\MT@step\m@ne
\let\MT@prot@factor\@m
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%
%\subsection{Auxiliary macros}
%
%\changes{v1.4}{2004/11/21}{optimization: use less \cs{csname}s and \cs{expandafter}s}
%\begin{macro}{\MT@def@n}
% This is \cs{@namedef}.
%    \begin{macrocode}
\def\MT@def@n#1{\expandafter\def\csname #1\endcsname}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@edef@n}
% Its expanding version.
%    \begin{macrocode}
\def\MT@edef@n#1{\expandafter\edef\csname #1\endcsname}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@let@nc}
% \cs{let} a csname to a command.
%    \begin{macrocode}
\def\MT@let@nc#1{\expandafter\let\csname #1\endcsname}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@let@cn}
% \cs{let} a command to a csname.
%    \begin{macrocode}
\def\MT@let@cn#1#2{\expandafter\let\expandafter#1\csname #2\endcsname}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@hop@else@fi}
% We need this a couple of lines down to mask \cs{ifcsname}~\dots~\cs{fi} and
% \cs{ifdefined}~\dots~\cs{fi}, if \cs{ifcsname} and \cs{ifdefined} aren't
% defined.
%    \begin{macrocode}
\def\MT@hop@else@fi#1\else#2\fi{\fi#1}
%    \end{macrocode}
%\end{macro}
%\changes{v1.6}{2005/01/19}{use \etex, if available}
%\begin{macro}{\MT@ifdefined@c}
%\begin{macro}{\MT@ifdefined@n}
% Wrapper for testing whether command or \cs{csname} sequence is defined.
%    \begin{macrocode}
\ifx\ifdefined\@undefined\MT@hop@else@fi
%<debug>   \MT@info@nl{not using etex}%
   \def\MT@ifdefined@c#1{%
      \ifx#1\@undefined
         \expandafter\@secondoftwo
      \else
         \expandafter\@firstoftwo
      \fi
   }
   \def\MT@ifdefined@n#1{%
      \expandafter\ifx\csname#1\endcsname\relax
         \expandafter\@secondoftwo
      \else
         \expandafter\@firstoftwo
      \fi
   }
\else
%    \end{macrocode}
% If we are running \etex, we will use its new primitives \cs{ifdefined} and
% \cs{ifcsname}, which decreases memory use substantially.
%    \begin{macrocode}
%<debug>   \MT@info@nl{using etex}%
   \def\MT@ifdefined@c#1{%
      \ifdefined#1%
         \expandafter\@firstoftwo
      \else
         \expandafter\@secondoftwo
      \fi
   }
   \def\MT@ifdefined@n#1{%
      \ifcsname#1\endcsname
         \expandafter\@firstoftwo
      \else
         \expandafter\@secondoftwo
      \fi
   }
\fi
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\begin{macro}{\MT@ifempty}
% Test whether argument is empty.
%\changes{v1.1}{2004/09/15}{bug fix: use category code 12 for the percent character
%                           (reported by Tom Kink)} ^^A <kink{at}hia.rwth-aachen.de>
%                                         ^^A in <MID:2qrkp9F134l6lU1@uni-berlin.de>
%    \begin{macrocode}
\begingroup
\catcode`\%=12\relax
\catcode`\&=14\relax
\gdef\MT@ifempty#1{&
  \if %#1%&
    \expandafter\@firstoftwo
  \else
    \expandafter\@secondoftwo
  \fi}
\endgroup
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@ifnumber}
% Test whether argument is a number [0-9] (using an old trick by Mr. Arseneau).
%    \begin{macrocode}
\def\MT@ifnumber#1{%
   \if!\ifnum9<1#1!\else_\fi
      \expandafter\@firstoftwo
   \else
      \expandafter\@secondoftwo
   \fi
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@xadd}
% Add item to a list. (Yes, definitions must be global.)
%    \begin{macrocode}
\def\MT@xadd#1#2{%
   \expandafter\ifx#1\relax
      \xdef#1{#2}%
   \else
      \begingroup
         \edef\x{#2}%
         \toks@=\expandafter\expandafter\expandafter{\expandafter#1\x}%
         \xdef#1{\the\toks@}%
      \endgroup
   \fi
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@in@list}
% Test whether item is in list (separated by \cs{MT@lt}; allows to operate on
% the list items).
%    \begin{macrocode}
\newif\ifMT@inlist@
\def\MT@in@list#1#2{%
   \MT@inlist@false
   \def\MT@given{#1}%
   \def\MT@lt##1{%
      \def\MT@next{##1}\ifx\MT@next\MT@given\MT@inlist@true\fi}#2%
}
\let\MT@lt\@empty
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@in@llist}
% Test whether item is in list (separated by a comma; faster for long lists,
% since the command only has to be executed once).
%\changes{v1.4}{2004/11/22}{bug fix: compare with \cs{\string\bslash} instead of \cs{relax}
%                          (reported by Herb Schulz)}  ^^A <herbs{at}wideopenwest.com>
%                                    ^^A in <MID:BDBFA967.C01F%herbs@wideopenwest.com>
%    \begin{macrocode}
\def\MT@in@llist#1#2{%
   \MT@inlist@false
   \def\MT@in@l##1#1,##2\@nil{%
      \ifx\\##2\\\else
         \MT@inlist@true
      \fi}%
   \expandafter\MT@in@l#2,#1,\@nil
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@loop}
%\changes{v1.2}{2004/09/23}{bug fix: new macro, used instead of \cs{loop}}
%\begin{macro}{\MT@repeat}
% This is the same as \LaTeX's \cs{loop}, which we mustn't use, since this could
% confuse an outer \cs{loop} in the document.
%    \begin{macrocode}
\def\MT@loop#1\MT@repeat{%
   \def\MT@iterate{#1\relax\expandafter\MT@iterate\fi}%
   \MT@iterate \let\MT@iterate\relax}
\let\MT@repeat\fi
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\changes{v1.4}{2004/11/12}{use one instead of five counters}
%\begin{macro}{\MT@count}
%\begin{macro}{\MT@increment}
% Increment macro \meta{\#1} by one. Saves using up too many counters.
%    \begin{macrocode}
\newcount\MT@count
\def\MT@increment#1{%
   \MT@count#1\relax
   \advance\MT@count \@ne
   \edef#1{\number\MT@count}%
}
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\begin{macro}{\MT@remove@spaces}
% Remove spaces around \meta{\#1} (\cs{KV@@sp@def} is from \pkg{keyval}).
%    \begin{macrocode}
\def\MT@remove@spaces#1{\expandafter\KV@@sp@def\expandafter#1\expandafter{#1}}
%    \end{macrocode}
%\end{macro}
%
%\subsection{Setting up a font}
%\begin{macro}{\MT@setupfont}
% Setting up a font entails checking whether protrusion/expansion is desired for
% the current font (\cs{font@name}), and if so, adjusting \cs{lpcode} and
% \cs{rpcode} (protrusion) and \cs{efcode} (expansion) for each character.
%    \begin{macrocode}
\def\MT@setupfont{%
   \ifx\MT@vinfo\MT@info@nl
      \MT@info{Setting up font `\expandafter\string\font@name'}\fi
%    \end{macrocode}
% The font properties must be extracted from \cs{font@name}, since the current
% value of \cs{f@encoding} and friends may be wrong!
%    \begin{macrocode}
   \expandafter\expandafter\expandafter
      \MT@split@name\expandafter\string\font@name\@nil
%    \end{macrocode}
% Try to find a configuration file for the current font family.
%\changes{v1.2}{2004/09/29}{also search for alias font file}
%    \begin{macrocode}
   \MT@find@file{\MT@family}%
   \ifx\MT@familyalias\@empty\else\MT@find@file{\MT@familyalias}\fi
%    \end{macrocode}
%\changes{v1.2}{2004/09/26}{bug fix: call \cs{@@enc@update} if necessary}
% We have to make sure that \cs{cf@encoding} expands to the correct value, which
% isn't the case when \cs{selectfont} chooses a new encoding (this would be
% done one second later, anyway).
%    \begin{macrocode}
   \ifx\f@encoding\cf@encoding\else\@@enc@update\fi
%    \end{macrocode}
% Protrusion has to be set up first, says Thành!
%    \begin{macrocode}
   \MT@checkfor{protrusion}%
   \ifMT@font@protrusion
      \MT@set@prot@codes
   \else
      \MT@vinfo{... No protrusion}%
   \fi
   \MT@checkfor{expansion}%
   \ifMT@font@expansion
      \MT@set@exp@codes
   \else
      \MT@vinfo{... No expansion}%
   \fi
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\ifMT@font@protrusion}
%\begin{macro}{\ifMT@font@expansion}
%\begin{macro}{\MT@checkfor}
% We check all features of the current font against the lists defined by the
% |expansion| resp. |protrusion| option, and set \cs{MT@font@expansion} resp.
% \cs{MT@font@protrusion} accordingly.
%\changes{v1.2}{2004/09/29}{also check for alias font name}
%    \begin{macrocode}
\newif\ifMT@font@protrusion
\newif\ifMT@font@expansion
\def\MT@checkfor#1{%
%    \end{macrocode}
% (but only if protrusion/expansion isn't globally set to false)
%    \begin{macrocode}
   \csname ifMT@#1\endcsname
%    \end{macrocode}
% Begin with setting micro-typography to true for this font. The \cs{MT@checklist}
% test will set it to false, if the property is not in the list.
%    \begin{macrocode}
      \csname MT@font@#1true\endcsname
      \MT@checklist{#1}{encoding}%
%    \end{macrocode}
% |family| is special, since there may also be an alias name.
%    \begin{macrocode}
      \MT@checklist@family{#1}%
      \MT@checklist{#1}{series}%
      \MT@checklist{#1}{shape}%
      \MT@checklist{#1}{size}%
   \fi
}
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\end{macro}
%\begin{macro}{\MT@checklist}
% If we've already found that a property is not in the list, we don't have to
% bother any more.
%    \begin{macrocode}
\def\MT@checklist#1#2{%
   \csname ifMT@font@#1\endcsname\MT@checklist@{#1}{#2}\fi
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@checklist@}
%    \begin{macrocode}
\def\MT@checklist@#1#2{%
   \edef\@tempa{\csname MT@#1@setname\endcsname}%
   \MT@ifdefined@n{MT@#1list@#2@\@tempa}{%
%    \end{macrocode}
% Begin a \cs{expandafter} orgy to test whether the font characteristic is in
% the list.
%    \begin{macrocode}
      \def\MT@listname{\csname MT@#1list@#2@\@tempa\endcsname}%
      \expandafter\expandafter\expandafter\MT@in@list
         \expandafter\expandafter\expandafter
            {\csname MT@#2\endcsname}\MT@listname
      \ifMT@inlist@
%<debug>         \MT@info@nl{#1: #2 `\csname MT@#2\endcsname' in list}%
      \else
         \csname MT@font@#1false\endcsname
%<debug>         \MT@info@nl{#1: #2 `\csname MT@#2\endcsname' not in list}%
      \fi
   }{%
%    \end{macrocode}
% 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.
%    \begin{macrocode}
%<debug>      \MT@info@nl{#1: #2 list empty}%
   }%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@checklist@family}
% Also test for the alias font.
%    \begin{macrocode}
\def\MT@checklist@family#1{%
   \csname ifMT@font@#1\endcsname\MT@checklist@family@{#1}\fi
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@checklist@family@}
%\changes{v1.4}{2004/11/22}{bug fix: don't try alias family name if encoding failed}
%    \begin{macrocode}
\def\MT@checklist@family@#1{%
   \MT@checklist@{#1}{family}%
%    \end{macrocode}
% Only try if the original font is not in the list.
%    \begin{macrocode}
   \csname ifMT@font@#1\endcsname\else
      \ifx\MT@familyalias\@empty\else
         \edef\@tempa{\csname MT@#1@setname\endcsname}%
         \def\MT@listname{\csname MT@#1list@family@\@tempa\endcsname}%
         \expandafter\expandafter\expandafter\MT@in@list
            \expandafter
               {\MT@familyalias}\MT@listname
         \ifMT@inlist@
            \csname MT@font@#1true\endcsname
%<debug>            \MT@info@nl{#1: alias `\MT@familyalias' in list}%
%<debug>         \else\MT@info@nl{#1: alias `\MT@familyalias' not in list}%
         \fi
      \fi
   \fi
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@split@name}
% Split up the font name (definitions must be global, since this will be called
% from inside a group).
%    \begin{macrocode}
\def\MT@split@name#1/#2/#3/#4/#5\@nil{%
   \gdef\MT@encoding{#1}%
   \gdef\MT@family{#2}%
   \gdef\MT@series{#3}%
   \gdef\MT@shape{#4}%
   \gdef\MT@size{#5}%
%    \end{macrocode}
% Alias family?
%\changes{v1.2}{2004/09/29}{define alias font name as an alternative, not
%                          as a replacement}
%    \begin{macrocode}
   \global\let\MT@familyalias\@empty
   \MT@ifdefined@n{MT@\MT@family @alias}{%
      \MT@escapechar{\csname MT@\MT@family @alias\endcsname}%
      \global\let\MT@familyalias\MT@val
   }{}%
}
%    \end{macrocode}
%\end{macro}
%
%\subsubsection{Protrusion}
%\begin{macro}{\MT@set@prot@codes}
% This macro is called by \cs{MT@setupfont}, and does all the work for setting
% up a font for protrusion.
%\changes{v1.5}{2004/12/10}{adjust protrusion factors before setting the inheriting
%                           characters}
%\changes{v1.6}{2004/12/18}{introduce \texttt{factor} option}
%    \begin{macrocode}
\def\MT@set@prot@codes{%
%    \end{macrocode}
% Check which list should be applied to the current font.
%    \begin{macrocode}
   \MT@get@codes@list{prot}%
%    \end{macrocode}
% We might not have found a list.
%    \begin{macrocode}
   \MT@ifdefined@n{MT@protcodes@\MT@protcodes@name}{%
      \MT@get@factor
%    \end{macrocode}
% Get the name of the inheritance list and parse it.
%    \begin{macrocode}
      \MT@get@inh@list{protrusion}%
      \MT@ifdefined@c\MT@protrusioninh@name{%
         \MT@let@cn\@tempc{MT@protrusioninh@\MT@protrusioninh@name}%
%         \MT@ifdefined@c\@tempc{% this can't happen?
            \ifx\@tempc\@empty\else
               \let\MT@inh@name\MT@protrusioninh@name
               \expandafter\MT@inhdo\@tempc,\relax,%
            \fi
%         }{}%
%    \end{macrocode}
% Set to \cs{@empty}, so that we only parse the list once.
%\changes{v1.2}{2004/09/26}{bug fix: set inheritance list \cs{global}ly to \cs{@empty}}
%    \begin{macrocode}
         \global\MT@let@nc{MT@protrusioninh@\MT@protrusioninh@name}\@empty
      }{}%
%    \end{macrocode}
% Load additional lists?
%    \begin{macrocode}
      \MT@load@list{prot}{\MT@protcodes@name}%
%    \end{macrocode}
% Load the main list.
%    \begin{macrocode}
      \MT@let@cn\@tempc{MT@protcodes@\MT@protcodes@name}%
      \expandafter\MT@protdo\@tempc,\relax,%
   }{}%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@protdo}
% Split up the values and set \cs{lpcode} and \cs{rpcode}.
%    \begin{macrocode}
\def\MT@protdo#1,{%
   \ifx\relax#1\@empty\else
      \MT@protsplit #1==\relax
      \expandafter\MT@protdo\fi
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@protsplit}
%\changes{v1.1}{2004/09/13}{bug fix: allow zero and negative values}
%    \begin{macrocode}
\def\MT@protsplit#1=#2=#3\relax{%
   \KV@@sp@def\@tempa{#1}%
   \ifx\@tempa\@empty\else
      \MT@get@slot
      \ifnum\MT@char > \m@ne
         \KV@@sp@def\@tempb{#2}%
         \expandafter\MT@protsplit@val\@tempb\relax
      \fi
   \fi
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@protsplit@val}
%    \begin{macrocode}
\def\MT@protsplit@val#1,#2\relax{%
   \KV@@sp@def\@tempb{#1}%
   \MT@ifempty{\@tempb}{}{%
      \MT@adjustprotcode
      \lpcode\font@name\MT@char=\@tempcntb
   }%
   \KV@@sp@def\@tempb{#2}%
   \MT@ifempty{\@tempb}{}{%
      \MT@adjustprotcode
      \rpcode\font@name\MT@char=\@tempcntb
   }%
%    \end{macrocode}
% Now we can set the values for the inheriting characters. Their slot numbers
% are saved in the macro |\MT@inh@|\meta{list name}|@|\meta{slot number}|@|.
%    \begin{macrocode}
   \MT@ifdefined@c\MT@protrusioninh@name{%
      \MT@ifdefined@n{MT@inh@\MT@protrusioninh@name @\MT@char @}{%
         \MT@set@prot@children
      }{}%
   }{}%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@adjustprotcode}
% Since \pdftex\ version 0.14h, we have to adjust the protrusion factors
% (i.\,e., convert numbers from thousandth of character width to thousandth of
% an \emph{em} of the font). We have to do this before setting the inheriting
% characters, so that they inherit the absolute value not the relative one if
% they have a differing width (e.\,g. the `ff' ligature).
%\changes{v1.5}{2004/12/10}{don't use \cs{lpcode} and \cs{rpcode} for the
%                           calculation}
% We do not calculate with \cs{lpcode} resp. \cs{rpcode}, since this would
% disallow protrusion factors larger than the character width (since
% \cs{[lr]pcode}'s limit is 1000). Now, the maximum protrusion is 1em of the
% font.
%\changes{v1.5}{2004/12/10}{warning for protrusion factors greater than 1000}
%    \begin{macrocode}
\ifnum\MT@pdftex@no>\tw@
   \def\MT@adjustprotcode{%
      \MT@get@charwd
      \multiply\@tempcntb \@tempb
      \ifnum\@tempcntb=\z@ \else
         \divide\@tempcntb \fontdimen6 \font@name
         \MT@adjustprotcode@
      \fi
   }
%    \end{macrocode}
%\begin{macro}{\MT@get@charwd}
%\changes{v1.6}{2005/01/19}{use \etex's \cs{fontcharwd}, if available}
% When using \etex, we can employ \cs{fontcharwd}.
%    \begin{macrocode}
   \MT@ifdefined@c\fontcharwd{%
      \def\MT@get@charwd{%
         \@tempcntb=\number\fontcharwd\font@name\MT@char}%
   }{%
      \def\MT@get@charwd{%
         \setbox\z@=\hbox{\font@name \char\MT@char}%
         \@tempcntb=\wd\z@}%
   }
%    \end{macrocode}
%\end{macro}
% No adjustment here.
%    \begin{macrocode}
\else
   \def\MT@adjustprotcode{%
      \@tempcntb=\@tempb
      \ifnum\@tempcntb=\z@ \else
         \MT@adjustprotcode@
      \fi
   }
\fi
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@adjustprotcode@}
% The rest, we can share.
%    \begin{macrocode}
\def\MT@adjustprotcode@{%
   \multiply\@tempcntb \MT@prot@factor@
   \divide\@tempcntb \@m
   \ifnum\@tempcntb > \@m
      \MT@warning@nl{Protrusion factor \@tempb\space for character
         `\@tempa'\MessageBreak too large (= \the\@tempcntb) in
         protrusion list `\MT@protcodes@name'}%
   \else
      \ifnum\@tempcntb < -\@m
         \MT@warning@nl{Protrusion factor \@tempb\space for character
            `\@tempa'\MessageBreak too small (= \the\@tempcntb) in
            protrusion list `\MT@protcodes@name'}%
      \fi
   \fi
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@set@prot@children}
%\changes{v1.4}{2004/11/21}{remove group}
%    \begin{macrocode}
\def\MT@set@prot@children{%
   \def\MT@lt##1{%
%<debug>      \MT@info@nl{-- heir of \MT@char: ##1}%
      \lpcode\font@name##1=\lpcode\font@name\MT@char
      \rpcode\font@name##1=\rpcode\font@name\MT@char
   }%
   \csname MT@inh@\MT@protrusioninh@name @\MT@char @\endcsname
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@get@factor}
%    \begin{macrocode}
\def\MT@get@factor{%
   \MT@ifdefined@n{MT@protcodes@\MT@protcodes@name @factor}{%
      \MT@let@cn\MT@prot@factor@{MT@protcodes@\MT@protcodes@name @factor}%
      \MT@vinfo{... ... Multiplying protrusion factors by \MT@prot@factor@/1000}%
   }{%
      \let\MT@prot@factor@\MT@prot@factor
   }%
}
%    \end{macrocode}
%\end{macro}
%
%\subsubsection{Expansion}
%\begin{macro}{\MT@set@exp@codes}
%\changes{v1.5}{2004/12/02}{allow non-selected font expansion}
%\changes{v1.6}{2004/12/26}{introduce \texttt{factor} option}
% Setting up font expansion is a bit different because of the |selected| option.
%    \begin{macrocode}
\newif\ifMT@selected@exp
\def\MT@set@exp@codes{%
%    \end{macrocode}
% If |selected=true|, we only apply font expansion to fonts for which a list
% has been declared (i.\,e., like for protrusion).
%    \begin{macrocode}
   \ifMT@selected
      \MT@get@codes@list{exp}%
      \MT@ifdefined@n{MT@expcodes@\MT@expcodes@name}{%
         \MT@get@extraopt
         \MT@resetefcode
         \MT@get@inh@list{expansion}%
         \MT@ifdefined@c\MT@expansioninh@name{%
            \MT@let@cn\@tempc{MT@expansioninh@\MT@expansioninh@name}%
%            \MT@ifdefined@c\@tempc{%
               \ifx\@tempc\@empty\else
                  \let\MT@inh@name\MT@expansioninh@name
                  \expandafter\MT@inhdo\@tempc,\relax,%
               \fi
%            }{}%
            \global\MT@let@nc{MT@expansioninh@\MT@expansioninh@name}\@empty
         }{}%
         \MT@load@list{exp}{\MT@expcodes@name}%
         \MT@let@cn\@tempc{MT@expcodes@\MT@expcodes@name}%
         \expandafter\MT@expdo\@tempc,\relax,%
         \pdffontexpand\font@name \MT@stretch@ \MT@shrink@ \MT@step@ \MT@auto@
      }{}%
%    \end{macrocode}
% If, on the other hand, all characters should be expanded by the same amount,
% we only care about the first optional argument to the \cs{SetExpansion}
% declarations.
%    \begin{macrocode}
   \else
%    \end{macrocode}
% We need this boolean in \cs{MT@get@codes@list}, so that no warning will be
% issued.
%    \begin{macrocode}
      \MT@selected@exptrue
      \MT@get@codes@list{exp}%
      \MT@ifdefined@n{MT@expcodes@\MT@expcodes@name}{%
         \MT@get@extraopt
      }{%
         \let\MT@exp@factor@\@m
         \let\MT@stretch@\MT@stretch
         \let\MT@shrink@\MT@shrink
         \let\MT@step@\MT@step
         \let\MT@auto@\MT@auto
      }%
      \MT@resetefcode
      \pdffontexpand\font@name \MT@stretch@ \MT@shrink@ \MT@step@ \MT@auto@
   \fi
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@resetefcode@}
% At first, all expansion factors for the characters will be set to 1000.
%    \begin{macrocode}
\def\MT@resetefcode@{%
   \@tempcnta\z@
   \MT@loop
      \efcode\font@name\@tempcnta=\MT@exp@factor@
      \advance\@tempcnta \@ne
      \ifnum\@tempcnta < \@cclvi \MT@repeat
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@resetefcode}
% This is only necessary for versions prior to~1.20a.
%\changes{v1.6}{2005/01/30}{only reset \cs{efcode}s for older \pdftex\ versions}
%    \begin{macrocode}
\ifnum\MT@pdftex@no<4
   \let\MT@resetefcode\MT@resetefcode@
\else
   \def\MT@resetefcode{%
      \ifnum\MT@exp@factor@=\@m \else
         \MT@resetefcode@
      \fi
   }
\fi
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@expdo}
% There's only one number per character.
%    \begin{macrocode}
\def\MT@expdo#1,{%
   \ifx\relax#1\@empty\else
      \MT@expsplit #1==\relax
      \expandafter\MT@expdo\fi
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@expsplit}
%    \begin{macrocode}
\def\MT@expsplit#1=#2=#3\relax{%
   \KV@@sp@def\@tempa{#1}%
   \ifx\@tempa\@empty\else
      \MT@get@slot
      \ifnum\MT@char > \m@ne
         \KV@@sp@def\@tempb{#2}%
         \@tempcnta=\@tempb
%    \end{macrocode}
% Take the optional factor into account.
%    \begin{macrocode}
         \multiply\@tempcnta \MT@exp@factor@
         \divide\@tempcnta \@m
         \efcode\font@name\MT@char=\@tempcnta
%    \end{macrocode}
% Heirs, heirs, I love thy heirs.
%    \begin{macrocode}
         \MT@ifdefined@c\MT@expansioninh@name{%
            \MT@ifdefined@n{MT@inh@\MT@expansioninh@name @\MT@char @}%
               {\MT@set@exp@children}{}%
         }{}%
      \fi
   \fi
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@set@exp@children}
%    \begin{macrocode}
\def\MT@set@exp@children{%
   \def\MT@lt##1{%
%<debug>      \MT@info@nl{-- heir of \MT@char: ##1}%
      \efcode\font@name##1=\efcode\font@name\MT@char
   }%
   \csname MT@inh@\MT@expansioninh@name @\MT@char @\endcsname
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@get@extraopt}
% Apply different values to this font?
%    \begin{macrocode}
\def\MT@get@extraopt{%
   \MT@ifdefined@n{MT@expcodes@\MT@expcodes@name @factor}{%
      \MT@let@cn\MT@exp@factor@{MT@expcodes@\MT@expcodes@name @factor}%
      \MT@vinfo{... ... Multiplying expansion factors by \MT@exp@factor@/1000}%
   }{%
      \let\MT@exp@factor@\@m
   }%
   \MT@ifdefined@n{MT@expcodes@\MT@expcodes@name @stretch}{%
      \MT@let@cn\MT@stretch@{MT@expcodes@\MT@expcodes@name @stretch}%
      \MT@vinfo{... ... Setting stretch factor to \MT@stretch@}%
   }{%
      \let\MT@stretch@\MT@stretch
   }%
   \MT@ifdefined@n{MT@expcodes@\MT@expcodes@name @shrink}{%
      \MT@let@cn\MT@shrink@{MT@expcodes@\MT@expcodes@name @shrink}%
      \MT@vinfo{... ... Setting shrink factor to \MT@shrink@}%
   }{%
      \let\MT@shrink@\MT@shrink
   }%
   \MT@ifdefined@n{MT@expcodes@\MT@expcodes@name @step}{%
      \MT@let@cn\MT@step@{MT@expcodes@\MT@expcodes@name @step}%
      \MT@vinfo{... ... Setting step factor to \MT@step@}%
   }{%
      \let\MT@step@\MT@step
   }%
   \MT@ifdefined@n{MT@expcodes@\MT@expcodes@name @auto}{%
      \MT@let@cn\MT@auto@{MT@expcodes@\MT@expcodes@name @auto}%
      \MT@vinfo{... ... Setting automatic expansion to \MT@auto@}%
   }{%
      \let\MT@auto@\MT@auto
   }%
}
%    \end{macrocode}
%\end{macro}
%
%\subsubsection{Generic macros}
%\begin{macro}{\MT@load@list}
% Recurse through the lists to be loaded.
%\changes{v1.3}{2004/10/27}{check whether list exists}
%    \begin{macrocode}
\def\MT@load@list#1#2{%
   \edef\@tempa{#2}%
   \MT@let@cn\@tempb{MT@#1codes@\@tempa load}%
   \ifx\@tempa\@tempb
      \MT@warning{#1. list `\@tempa' cannot load itself}%
   \else
      \ifx\@tempb\relax\else
         \MT@ifdefined@n{MT@#1codes@\@tempb}{%
            \MT@vinfo{... ... Additionally loading #1. list `\@tempb'}%
            \begingroup
               \MT@load@list{#1}{\@tempb}%
            \endgroup
            \MT@let@cn\@tempc{MT@#1codes@\@tempb}%
            \expandafter\csname MT@#1do\expandafter\endcsname\@tempc,\relax,%
         }{%
            \MT@warning{%
               #1. list `\@tempb' undefined. Cannot load it\MessageBreak
               from list `\@tempa'}%
         }%
      \fi
   \fi
}
%    \end{macrocode}
%\end{macro}
%\changes{v1.1}{2004/09/13}{configuration file names in lowercase
%                           (suggested by Harald Harders)}
%\begin{macro}{\MT@find@file}
%\changes{v1.1}{2004/09/14}{bug fix: also check whether the file for the base
%                           font family has already been loaded}
% Micro-typographic settings may be written into a file |mt-|\meta{font family}|.cfg|:
%    \begin{macrocode}
\let\MT@file@list\@empty
\def\MT@find@file#1{%
%    \end{macrocode}
% Check for existence of the file only once.
%    \begin{macrocode}
   \expandafter\MT@in@llist\expandafter
         {\csname MT@file@#1\endcsname}\MT@file@list
   \ifMT@inlist@\else
%    \end{macrocode}
% 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.
%\changes{v1.4}{2004/11/16}{bug fix: reset some more catcodes when reading files
%                          (reported by Michael Hoppe)} ^^A <mh{at}michael-hoppe.de>
%                                  ^^A in <MID:p06002000bdbff1f93eb7@[192.168.0.34]>
%    \begin{macrocode}
      \begingroup
      \MT@file@catcodes
      \InputIfFileExists{mt-#1.cfg}{%
         \MT@xadd\MT@file@list{\csname MT@file@#1\endcsname,}%
         \MT@vinfo{... Loading font settings from mt-#1.cfg}%
      }{%
         \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@xadd\MT@file@list{\csname MT@file@\@tempa\endcsname,}%
               \MT@vinfo{... Loading font settings from mt-\@tempa.cfg}%
            }{%
               \MT@xadd\MT@file@list{\csname MT@file@#1\endcsname,}%
               \MT@vinfo{... No file mt-#1.cfg}%
            }%
         \fi
      }%
      \endgroup
   \fi
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@file@catcodes}
% We have to make sure that all characters have the correct category code.
% Especially, new lines and spaces should be ignored, since files might be
% loaded in the middle of the document. This is basically \cs{nfss@catcodes}
% (from the \LaTeX\ kernel). I've added: |&| (in |tabular|s), |;|, |,|, |!|,
% |?|, and |$|, |_|, |~|,
%\changes{v1.5}{2004/11/28}{reset catcode of `\texttt{\quotechar=}'
%                           (compatibility with turkish \protect\pkg{babel})}
% and |=| (turkish).
%    \begin{macrocode}
\def\MT@file@catcodes{%
     \makeatletter
     \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\=%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@get@basefamily}
% The family name might have a suffix
%\changes{v1.1}{2004/09/14}{only remove suffix, if it is `x' or `j'}
% for expert or old style number font set
%\changes{v1.2}{2004/09/26}{also remove `w' (swash capitals)}
% 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| \textit{and}
% |cmsy| (OK, |cmex| will still become |cme|~\dots).
%\changes{v1.4}{2004/11/25}{bug fix: failed for font names of the form \texttt{abczz}
%                           (reported by Georg Verweyen)} ^^A <Georg.Verweyen{at}WEB.DE>
%                                                  ^^A in: <MID:41A64DC7.7040404@web.de>
%    \begin{macrocode}
\def\MT@get@basefamily#1#2#3#4\relax{%
   \ifx\relax#2\relax\def\@tempa{#1}\else
      \ifx\relax#3\relax\def\@tempa{#1#2}\else
         \def\@tempa{#1#2#3}%
         \ifx\relax#4\relax\else
            \edef\@tempc{\string#4}%
            \edef\@tempb{\string x}%
            \ifx\@tempc\@tempb\else
               \edef\@tempb{\string j}%
               \ifx\@tempc\@tempb\else
                  \edef\@tempb{\string w}%
                  \ifx\@tempc\@tempb\else
                     \def\@tempa{#1#2#3#4}%
                  \fi
               \fi
            \fi
         \fi
      \fi
   \fi
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@get@listname}
% Try all combinations of font family, series and shape to get a list for the
% current font.
%\changes{v1.1}{2004/09/15}{don't check for empty characteristics list}
%\changes{v1.2}{2004/09/30}{alternatively check for alias font name}
%    \begin{macrocode}
\def\MT@get@listname#1{%
%<debug>   \MT@info@nl{trying to find #1. list for font \font@name}%
   \def\@tempb{#1}%
   \MT@next@listname1111\relax
   \MT@ifdefined@n{MT@\@tempb @\@tempa}{}{%
      \MT@next@listname1110\relax
   }%
   \MT@ifdefined@n{MT@\@tempb @\@tempa}{}{%
      \MT@next@listname1100\relax
   }%
   \MT@ifdefined@n{MT@\@tempb @\@tempa}{}{%
      \MT@next@listname1010\relax
   }%
   \MT@ifdefined@n{MT@\@tempb @\@tempa}{}{%
      \MT@next@listname1000\relax
   }%
   \MT@ifdefined@n{MT@\@tempb @\@tempa}{}{%
      \MT@next@listname0100\relax
   }%
   \MT@ifdefined@n{MT@\@tempb @\@tempa}{}{%
      \MT@next@listname0010\relax
   }%
   \MT@ifdefined@n{MT@\@tempb @\@tempa}{}{%
      \MT@next@listname0000\relax
   }%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@next@listname}
%    \begin{macrocode}
\def\MT@next@listname#1#2#3#4{%
   \edef\@tempa{\MT@encoding/%
                \ifnum#1=\@ne \MT@family\fi/%
                \ifnum#2=\@ne \MT@series\fi/%
                \ifnum#3=\@ne \MT@shape\fi/%
                \ifnum#4=\@ne \MT@size\fi}%
%<debug>   \MT@info@nl{trying \@tempa}%
   \MT@ifdefined@n{MT@\@tempb @\@tempa}{}{%
      \ifnum#1=\@ne
         \ifx\MT@familyalias\@empty\else
            \edef\@tempa{\MT@encoding/%
                         \MT@familyalias/%
                         \ifnum#2=\@ne \MT@series\fi/%
                         \ifnum#3=\@ne \MT@shape\fi/%
                         \ifnum#4=\@ne \MT@size\fi}%
%<debug>            \MT@info@nl{(alias) \@tempa}%
         \fi
      \fi
   }%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@get@codes@list}
%\begin{macro}{\MT@get@inh@list}
%\changes{v1.6}{2004/12/18}{correct message if \texttt{selected} is false}
%    \begin{macrocode}
\def\MT@get@codes@list#1{%
   \MT@get@listname{#1codes}%
   \MT@ifdefined@n{MT@#1codes@\@tempa}{%
      \global\MT@edef@n{MT@#1codes@name}{\csname MT@#1codes@\@tempa\endcsname}%
      \ifMT@selected@exp
         \MT@vinfo{... Applying non-selected expansion (list `\MT@expcodes@name')}%
      \else
         \MT@vinfo{... Using #1. list `\csname MT@#1codes@name\endcsname'}%
      \fi
   }{%
      \global\MT@let@nc{MT@#1codes@\csname MT@#1codes@name\endcsname}\@undefined
%    \end{macrocode}
% Don't warn if |selected=false|.
%    \begin{macrocode}
      \ifMT@selected@exp
         \MT@vinfo{... Applying non-selected expansion}%
      \else
         \MT@warning{I cannot find a #1. list for
                     `\expandafter\string\font@name'.\MessageBreak
                     Switching off #1. for this font}%
       \fi
   }%
}
\def\MT@get@inh@list#1{%
   \MT@get@listname{#1inh}%
   \MT@ifdefined@n{MT@#1inh@\@tempa}{%
      \MT@edef@n{MT@#1inh@name}{\csname MT@#1inh@\@tempa\endcsname}%
%<debug>      \MT@info@nl{... Using #1 inheritance list
%<debug>                  `\csname MT@#1inh@name\endcsname'}%
   }{%
      \MT@let@nc{MT@#1inh@name}\@undefined
   }%
}
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\changes{v1.4}{2004/11/04}{don't use scratch registers in global definitions}
% Get the slot number of the character in the current encoding.
%
% First we define some helper macros which inspect the \cs{meaning} of their
% arguments. No upper case |T| in macro names!
%    \begin{macrocode}
\begingroup
   \catcode`\/=0
   /catcode`/\=12
   /catcode`/"=12
   /catcode`/A=12
   /catcode`/C=12
   /catcode`/E=12
   /catcode`/H=12
   /catcode`/L=12
   /catcode`/R=12
   /catcode`/T=12
   /lowercase{%
      /def/x{%
%    \end{macrocode}
%\begin{macro}{\MT@isaletter}
%\begin{macro}{\MT@letterstring}
% Test whether argument expands to a letter.
%    \begin{macrocode}
         /def/Mt@letterstring{THE LETTER}%
         /def/Mt@isaletter ##1THE LETTER##2##3/relax{%
            /@tempswafalse
            /ifx/relax##1/relax
               /@tempswatrue
               /edef/Mt@char{/number`##2}%
               /Mt@testrest{/Mt@letterstring}{##3}%
            /fi
         }%
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\begin{macro}{\MT@isacharacter}
%\begin{macro}{\MT@characterstring}
% Argument expands to a character (anything with catcode 12, also a number).
%    \begin{macrocode}
         /def/Mt@characterstring{THE CHARACTER}%
         /def/Mt@isacharacter ##1THE CHARACTER##2##3/relax{%
            /@tempswafalse
            /ifx/relax##1/relax
               /@tempswatrue
               /edef/Mt@char{/number`##2}%
               /Mt@testrest{/Mt@characterstring}{##3}%
            /fi
         }%
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\begin{macro}{\MT@isachar}
%\begin{macro}{\MT@charstring}
% Everything that has been defined with \cs{DeclareTextSymbol} in the encoding
% definition files.
%    \begin{macrocode}
         /def/Mt@charstring{\CHAR"}%
         /def/Mt@isachar##1\CHAR"##2##3##4/relax{%
            /@tempswafalse
            /ifx/relax##1/relax
               /@tempswatrue
               /if##3\/relax
                  /edef/Mt@char{/number"##2}%
                  /Mt@testrest{/Mt@charstring}{##3##4}%
               /else
                  /edef/Mt@char{/number"##2##3}%
                  /Mt@testrest{/Mt@charstring}{##4}%
               /fi
            /fi
         }%
      }%
   }
/expandafter/endgroup/x
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\begin{macro}{\Mt@testrest}
% Test whether all of the string has been used up.
%    \begin{macrocode}
\def\Mt@testrest#1#2{%
   \edef\x{#1}%
   \edef\y{#2}%
   \ifx\x\y\else
      \def\Mt@rest{#2}%
   \fi
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@get@slot}
%\changes{v1.2}{2004/09/26}{bug fix: group must also include \cs{MT@two@tokens}}
%\changes{v1.4}{2004/11/22}{don't define \cs{MT@char} globally (save stack problem)}
%\changes{v1.6}{2005/01/30}{completely redone, hopefully more robust
%                           (compatible with \protect\pkg{frenchpro})}
% There are lots of possibilities how a character is defined in the
% configuration, which makes translating them into slot numbers hard. Let's
% begin with the simplest cases:
%    \begin{macrocode}
\def\MT@get@slot{%
   \MT@count=\escapechar
   \escapechar=`\\
   \let\Mt@rest\@empty
   \let\Mt@char\m@ne
   \edef\MT@char{\expandafter\meaning\@tempa}%
%    \end{macrocode}
%\begin{itemize}
% \item It's either a single letter.
%    \begin{macrocode}
   \expandafter\expandafter\expandafter\Mt@isaletter
         \expandafter\MT@char\Mt@letterstring \relax\relax
   \ifnum\Mt@char < \z@
%    \end{macrocode}
% \item A number or a `other' character (catcode 12).
%    \begin{macrocode}
      \expandafter\expandafter\expandafter\Mt@isacharacter
            \expandafter\MT@char\Mt@characterstring \relax\relax
      \if@tempswa
         \expandafter\MT@get@number\@tempa\relax\relax
      \fi
      \ifnum\Mt@char < \z@
%    \end{macrocode}
% \item Well then, maybe a backslash?
%    \begin{macrocode}
         \expandafter\ifx\expandafter\ \@tempa\relax
            \edef\Mt@char{\number`\\}%
         \else
%    \end{macrocode}
% \item OK, so it must be a macro. Now comes the hairy part.
%
% Fortunately, we can assume that the command actually exists in the current
% encoding. Therefore, we can simply call |\|\meta{encoding}|\|\meta{command}
% (that's \emph{one} command) instead of |\|\meta{command} itself, which might
% expand to funny stuff, depending on context.
%    \begin{macrocode}
            \edef\MT@char{\expandafter\csname\expandafter\MT@encoding
                              \expandafter\string\@tempa\endcsname}%
            \edef\MT@char{\expandafter\meaning\MT@char}%
            \expandafter\expandafter\expandafter\Mt@isachar
                  \expandafter\MT@char\Mt@charstring \relax\relax\relax
            \if@tempswa \else
%    \end{macrocode}
% Not all symbols have been defined by \cs{DeclareTextSymbol}, in which case
% they don't expand to \cs{char}|"|\meta{hex number} (e.\,g. \cs{i}, when using
% \pkg{frenchpro}). ^^A as noted by Bernard Gaulle <gaulle{at}idris.fr>,
%                   ^^A private mail, 28/1/2005
% Therefore, we also test whether it's a letter.
%    \begin{macrocode}
               \expandafter\expandafter\expandafter\Mt@isaletter
                     \expandafter\MT@char\Mt@letterstring \relax\relax
            \fi
         \fi
         \ifnum\Mt@char < \z@
%    \end{macrocode}
% \item Now, we'll catch the rest, which will in most cases consist of two
%       tokens (e.\,g. |\"A|). Errors will most likely occur here. How could I
%       make this more robust?
%    \begin{macrocode}
            \expandafter\MT@two@tokens\@tempa\relax\relax
            \edef\MT@char{\expandafter\meaning\@tempa}%
            \expandafter\expandafter\expandafter\Mt@isaletter
                  \expandafter\MT@char\Mt@letterstring \relax\relax
            \if@tempswa \else
               \MT@warning{Unknown slot number of `\@tempa' in\MessageBreak
                           encoding `\MT@encoding'. Ignoring it}%
            \fi
         \fi
      \fi
   \fi
%    \end{macrocode}
%\end{itemize}
% If the user has specified something like `|ab|', or he wanted to define a number
% but forgot to use three digits, we'll have something left of the string. In
% this case, we issue a warning and forget the complete string.
%    \begin{macrocode}
   \ifx\Mt@rest\@empty\else
      \MT@warning{Unknown slot number of `\@tempa' in\MessageBreak
                  encoding `\MT@encoding'.
                  Make sure it's a single character\MessageBreak
                  (or a number). Ignoring it}%
      \let\Mt@char\m@ne
   \fi
   \let\MT@char\Mt@char
   \escapechar=\MT@count
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@two@tokens}
% If we find two tokens, expand them to get the actual character (or so we hope).
%    \begin{macrocode}
\def\MT@two@tokens#1#2\relax{%
   \MT@ifempty{#2}{}%
      {\edef\@tempa{\@tempa}}%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@get@number}
% Numbers may be specified as a three-digit decimal number (|092|),
%\changes{v1.1}{2004/09/13}{numbers may also be specified in hexadecimal or octal
%                           (suggested by Harald Harders).}
% as a hexadecimal number (prefixed with~|"|: |"5C|) or as a octal number
% (prefixed with~|'|: |'134|). They must consist of at least three letters
% (including the prefix), that is, |"F| is not permitted.
%    \begin{macrocode}
\def\MT@get@number#1#2#3\relax{%
   \ifx\relax#3\relax\else
      \ifx\relax#2\relax\else
         \if#1"\relax
            \def\@tempc{\uppercase{\edef\Mt@char{\number#1#2#3}}}%
            \@tempc
         \else
            \if#1'\relax
               \def\Mt@char{\number#1#2#3}%
            \else
               \MT@ifnumber{#1#2#3}{%
                  \def\Mt@char{\number#1#2#3}%
               }{}%
            \fi
         \fi
         \ifnum\Mt@char > \@cclv
            \MT@warning{%
               Number \noexpand#1\noexpand#2\noexpand#3 in encoding
               `\MT@encoding' too large!\MessageBreak Ignoring it}%
            \let\Mt@char\m@ne
         \fi
         \let\Mt@rest\@empty
      \fi
   \fi
}
%    \end{macrocode}
%\end{macro}
%
%\subsubsection{Hook into \LaTeX's font selection}
% We append \cs{MT@setupfont} to \cs{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 \pkg{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:
%\begin{itemize}
%  \item \cs{pickup@font} calls \cs{define@newfont}.
%  \item \cs{define@newfont} may call
%  \begin{itemize}
%     \item \cs{wrong@fontshape}, which in turn will call \cs{pickup@font},
%        and thus \cs{define@newfont} again, or
%     \item \cs{extract@font}.
%  \end{itemize}
%  \item \cs{pickup@font} is called by \cs{wrong@fontshape}, \cs{selectfont},
%     or \\\cs{getanddefine@fonts} (for math).
%\end{itemize}
%
%\changes{v1.2}{2004/10/02}{check for packages that might load fonts}
%\changes{v1.4}{2004/11/04}{no need to check for packages that might load fonts anymore}
%\changes{v1.4}{2004/11/04}{use \cs{pickup@font} instead of \cs{define@newfont}
%                           as the hook for \cs{MT@setupfont}}
% Up to version 1.3 of this package, we were using \cs{define@newfont} as the
% hook, which is only called for new fonts.
% This meant that we had to take special care to catch all fonts: We
% additionally had to set up the default font, the error font (if it wasn't the
% default font), we had to check for some packages that might have been loaded
% before \pkg{microtype} and were loading fonts, e.g. \pkg{jurabib},
% \pkg{ledmac}, \pkg{pifont} (loaded by \pkg{hyperref}), \pkg{tipa}, and
% probably many more. Furthermore, we had to include a hack for the
% \pkg{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
% \pkg{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 \cs{pickup@font} and
% decide for ourselves whether we've already seen that font. I hope the
% overhead isn't too large. (We use a comma-separated list.)
%    \begin{macrocode}
\let\MT@font@list\@empty
\g@addto@macro\pickup@font{%
   \begingroup \escapechar\m@ne
   \expandafter\MT@in@llist\expandafter
         {\font@name}\MT@font@list
   \ifMT@inlist@\else
      \MT@setupfont
      \xdef\MT@font@list{\MT@font@list\font@name,}%
   \fi
   \endgroup
}
%    \end{macrocode}
%\changes{v1.6}{2004/12/29}{test whether \cs{pickup@font} has changed}
%\begin{macro}{\MT@pickupfont}
% Test whether our definition has survived (at least \pkg{CJK} redefines
% \cs{pickup@font})\footnote{
%     Can anybody say something about how \pkg{microtype} and \pkg{CJK} work
%     together?}.
%    \begin{macrocode}
\let\MT@pickupfont\pickup@font
%    \end{macrocode}
%\end{macro}
%    \begin{macrocode}
\AtBeginDocument{%
   \ifx\MT@pickupfont\pickup@font\else
      \MT@warning@nl{%
         Another package has overwritten the definition\MessageBreak
         of \string\pickup@font. I might not be able to\MessageBreak
         apply any micro-typography. Please find the\MessageBreak
         culprit, and load it before the microtype package}%
   \fi
}
%    \end{macrocode}
%
%\subsection{Configuration}
%\subsubsection{Font Sets}
%\begin{macro}{\DeclareMicroTypeSet}
%\begin{macro}{\DeclareMicroTypeSet*}
% Calling this macro will create a list for every font characteristic of the form:
% |\MT|\meta{|expansion|\textbar|protrusion|}|list@|\meta{characteristic}|@|\meta{set name}.
% If the optional argument is empty, lists for both expansion and protrusion will
% be created.
%
% The third argument must be a list of |key=value| pairs. If a font characteristic
% is not specified, we define the corresponding list to \cs{relax}, so that it
% does not constitute a constraint.
%
% The internal list will be of the form |\MT@lt{|\meta{var1}|} \MT@lt{|\meta{var2}|}|~\dots,
% where \cs{MT@lt} acts as the delimiter between the list entries.
%    \begin{macrocode}
\def\DeclareMicroTypeSet{%
   \@ifstar
      {\@ifnextchar[%]
         \MT@DeclareSetAndUseIt
         {\MT@DeclareSetAndUseIt[]}}%
      {\@ifnextchar[%]
         \MT@DeclareSet
         {\MT@DeclareSet[]}}%
}
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\begin{macro}{\MT@DeclareSet}
%    \begin{macrocode}
\def\MT@DeclareSet[#1]#2#3{%
   \MT@DeclareSet@{#1}{#2}{#3}%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@DeclareSetAndUseIt}
%    \begin{macrocode}
\def\MT@DeclareSetAndUseIt[#1]#2#3{%
   \MT@DeclareSet@{#1}{#2}{#3}%
   \UseMicroTypeSet[#1]{#2}%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@DeclareSet@}
%\changes{v1.1}{2004/09/15}{remove spaces around first argument}
%    \begin{macrocode}
\def\MT@DeclareSet@#1#2#3{%
  \KV@@sp@def\@tempa{#1}%
  \MT@ifempty{\@tempa}{%
     \MT@declare@sets{protrusion}{#2}{#3}%
     \MT@declare@sets{expansion} {#2}{#3}%
  }{%
     \expandafter\MT@declare@sets\expandafter{\@tempa}{#2}{#3}%
  }%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@tmp@setname}
% We need to remember the name of the set currently being declared.
%    \begin{macrocode}
\let\MT@tmp@setname\@empty
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@declare@sets}
% Define the current set name and parse the keys.
%\changes{v1.1}{2004/09/20}{remove spaces around set name}
%    \begin{macrocode}
\def\MT@declare@sets#1#2#3{%
   \KV@@sp@def\MT@tmp@setname{#2}%
   \global\MT@let@nc{MT@#1list@@\MT@tmp@setname}\@empty
%<debug>   \MT@info{declaring #1 set `\MT@tmp@setname'}%
   \setkeys{MT#1@set}{#3}%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@define@set@keys}
% Define the \pkg{keyval} keys for expansion and protrusion sets.
%    \begin{macrocode}
\def\MT@define@set@keys#1{%
   \MT@define@set@key{#1}{encoding}%
   \MT@define@set@key{#1}{family}%
   \MT@define@set@key{#1}{series}%
   \MT@define@set@key{#1}{shape}%
   \MT@define@set@key@size{#1}%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@define@set@key}
% \meta{\#1} = [|expansion|\textbar|protrusion|], \meta{\#2} = font axis,
%    \begin{macrocode}
\def\MT@define@set@key#1#2{%
   \define@key{MT#1@set}{#2}[]{%
      \@for\MT@val:=##1\do{%
%    \end{macrocode}
% Get rid of spaces.
%    \begin{macrocode}
         \MT@remove@spaces{\MT@val}%
         \MT@get@highlevel{#2}%
         \MT@escapechar{\MT@val}%
         \MT@addto@list{#1}{#2}{\MT@val}%
      }%
%<debug>      \MT@info@nl{-- #2: \csname MT@#1list@#2@\MT@tmp@setname\endcsname}%
   }%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@get@highlevel}
% Saying, for instance, |family={rm*}| or |shape={bf*}| will lead to
% \cs{rmdefault} resp. \cs{bfdefault} being expanded/protruded.
%\changes{v1.2}{2004/09/26}{check whether defaults have changed}
%    \begin{macrocode}
\def\MT@get@highlevel#1{%
   \MT@getlast{\MT@val}%
   \if*\@tempb
%    \end{macrocode}
% And |family = *| will become \cs{familydefault}.
%    \begin{macrocode}
      \MT@ifempty{\@tempa}{\def\@tempa{#1}}{}%
      \def\MT@val{\csname \@tempa default\endcsname}%
%    \end{macrocode}
% Beware that \cs{rmdefault} etc. might change after this package has been
% loaded! Therefore, we check (once for each characteristic/list) at the
% beginning of the document.
%\changes{v1.5}{2004/12/02}{don't test defaults if called after begin document}
%    \begin{macrocode}
      \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
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@check@default}
%\changes{v1.2}{2004/09/26}{new macro}
%    \begin{macrocode}
\def\MT@check@default#1#2{%
   \MT@let@cn\@tempa{MT@#1@#2@default}%
   \edef\@tempb{\csname #2default\endcsname}%
   \ifx\@tempa\@tempb\else
      \MT@warning@nl{\expandafter\noexpand\csname #2default\endcsname
            has changed (`\@tempa' <> `\@tempb')!\MessageBreak
            This might affect the `#1' font set.\MessageBreak
            Please make all relevant font changes *before*\MessageBreak
            loading the `microtype' package}%
   \fi
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@getlast}
%    \begin{macrocode}
\def\MT@getlast#1{\def\@tempa{}\def\@tempb{}%
   \expandafter\MT@getlast@#1\@nil}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@getlast@}
%    \begin{macrocode}
\def\MT@getlast@#1{\ifx#1\@nil \let\next=\relax
   \else \edef\@tempa{\@tempa\@tempb}\def\@tempb{#1}%
      \let\next=\MT@getlast@\fi \next}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@escapechar}
% Make sure that the escape char is set to -1, and catcodes are the same as in
% the original font name, so that the comparison doesn't fail.
%    \begin{macrocode}
\def\MT@escapechar#1{%
   \begingroup
   \escapechar\m@ne
   \xdef\MT@val{\expandafter\string\csname #1\endcsname}%
   \endgroup
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@define@set@key@size}
% |size| requires special treatment.
%    \begin{macrocode}
\def\MT@define@set@key@size#1{%
   \define@key{MT#1@set}{size}[]{%
      \@for\MT@val:=##1\do{%
         \MT@remove@spaces{\MT@val}%
         \MT@get@size
         \MT@addto@list{#1}{size}{\MT@val}%
      }%
%<debug>      \MT@info@nl{-- size: \csname MT@#1list@size@\MT@tmp@setname\endcsname}%
   }%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@get@size}
% If it's not specified as a dimension, we tackle the size selection command
% here.
%    \begin{macrocode}
\def\MT@get@size{%
   \let\@tempa\relax
%    \end{macrocode}
% A single star means \cs{sizedefault}, which doesn't exist, so we define it to
% be \cs{normalsize}.
%    \begin{macrocode}
   \if*\MT@val\relax
      \def\@tempa{\normalsize}%
   \else
      \MT@let@cn\@tempa{\MT@val}%
   \fi
   \ifx\@tempa\relax\else
%    \end{macrocode}
% The \pkg{relsize} solution of parsing \cs{@setfontsize} does not work with the
% \pkg{AMS} classes, among others. I hope my hijacking doesn't do any harm.
%\changes{v1.2}{2004/09/26}{hijack \cs{set@fontsize} instead of \cs{@setfontsize}}
% We redefine \cs{set@fontsize}, and not \cs{@setfontsize} because some classes
% might define the size selection commands by simply using \cs{fontsize} (e.\,g.
% the \pkg{a0poster} class).
%    \begin{macrocode}
      \begingroup
         \def\set@fontsize##1##2##3##4\@nil{\gdef\MT@val{##2}}%
         \@tempa\@nil
      \endgroup
   \fi
%    \end{macrocode}
%\changes{v1.2}{2004/09/27}{additional magic to catch some errors}
% Test whether we finally got a number or dimension so that we can strip the
% `|pt|' (\cs{@defaultunits} and \cs{strip@pt} are kernel macros).
%\changes{v1.4}{2004/11/22}{don't set \cs{MT@count} globally (save stack problem)}
%    \begin{macrocode}
   \setbox\z@=\hbox{\MT@count=0\MT@val\relax
      \ifnum\MT@count=\z@
         \@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'}%
   \fi
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@addto@list}
% Append the value \meta{\#3} to the expansion or protrusion (= \meta{\#1}) list
% for font axis \meta{\#2}.
%    \begin{macrocode}
\def\MT@addto@list#1#2#3{%
   \expandafter\MT@xadd\csname MT@#1list@#2@\MT@tmp@setname\endcsname
      {\noexpand\MT@lt{#3}}%
}
%    \end{macrocode}
%\end{macro}
% We have finally assembled all pieces to define \cs{DeclareMicroTypeSet}'s
% keys.
%    \begin{macrocode}
\MT@define@set@keys{protrusion}
\MT@define@set@keys{expansion}
%    \end{macrocode}
%\begin{macro}{\UseMicroTypeSet}
% To use a particular set we simply redefine
% |MT@|\meta{|expansion|\textbar|protrusion|}|@setname|. If the optional
% argument is empty, both \cs{MT@expansion@setname} and
% \cs{MT@protrusion@setname} will be redefined.
%\changes{v1.1}{2004/09/20}{remove spaces around first argument}
%    \begin{macrocode}
\renewcommand{\UseMicroTypeSet}[2][]{%
   \KV@@sp@def\@tempa{#1}%
   \MT@ifempty{\@tempa}{%
      \MT@use@sets{protrusion}{#2}%
      \MT@use@sets{expansion} {#2}%
   }{%
      \expandafter\MT@use@sets\expandafter{\@tempa}{#2}%
   }%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@use@sets}
% The set must be declared.
%\changes{v1.1}{2004/09/20}{remove spaces around set name}
%\changes{v1.4}{2004/11/25}{don't use undeclared font sets}
%\changes{v1.6}{2005/01/19}{keep current set if new set is undeclared}
%    \begin{macrocode}
\def\MT@use@sets#1#2{%
   \KV@@sp@def{\@tempa}{#2}%
   \MT@ifdefined@n{MT@#1list@@\@tempa}{%
      \global\MT@edef@n{MT@#1@setname}{\@tempa}%
      \MT@info{Using #1 set `\@tempa'}%
   }{%
      \MT@ifdefined@n{MT@#1@setname}{}{%
         \global\MT@def@n{MT@#1@setname}{alltext}%
      }%
      \MT@warning{The #1 set `\@tempa' is undeclared.\MessageBreak
                  Using set `\csname MT@#1@setname\endcsname' instead}%
   }%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\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.
%\changes{v1.5}{2004/12/03}{remove spaces around arguments}
%    \begin{macrocode}
\renewcommand{\DeclareMicroTypeAlias}[2]{%
   \KV@@sp@def\@tempa{#1}%
   \KV@@sp@def\@tempb{#2}%
   \global\MT@edef@n{MT@\@tempa @alias}{\@tempb}%
}
%</package>
%    \end{macrocode}
%\end{macro}
%
%\subsubsection{Declarations}
% We now set up some default sets (in the main configuration file).
%\changes{v1.2}{2004/10/02}{new font sets: \texttt{allmath} and \texttt{basicmath}}
%    \begin{macrocode}
%<*config&m-t>

%%% ----------------------------------------------------------------------
%%% FONT SETS

\DeclareMicroTypeSet{all}
   {}

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

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

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

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

\DeclareMicroTypeSet{normalfont}
   { encoding = *,
     family   = *,
     series   = *,
     shape    = *,
     size     = *
   }

%    \end{macrocode}
% The Latin Modern fonts, the virtual fonts from the \pkg{ae} and \pkg{zefonts},
% and the \pkg{eco} and \pkg{hfoldsty} packages (oldstyle numerals) all inherit
% the (basic) settings from Computer Modern Roman.
%\changes{v1.2}{2004/10/03}{declare \texttt{cmr} as an alias for \texttt{cmor}}
%\changes{v1.3}{2004/10/22}{declare \texttt{cmr} as an alias for
%                          \texttt{aer}, \texttt{zer} and \texttt{hfor}}
%    \begin{macrocode}
%%% ----------------------------------------------------------------------
%%% FONT ALIASES

\DeclareMicroTypeAlias{lmr} {cmr}
\DeclareMicroTypeAlias{aer} {cmr}
\DeclareMicroTypeAlias{zer} {cmr}
\DeclareMicroTypeAlias{cmor}{cmr}
\DeclareMicroTypeAlias{hfor}{cmr}
%</config&m-t>
%    \end{macrocode}
%
%\subsubsection{Fine Tuning}
% The macros \cs{SetExpansion} and \cs{SetProtrusion} provide a similar
% interface for setting the character protrusion resp. expansion factors for a
% set of fonts.
%
%\begin{macro}{\SetProtrusion}
% This macro accepts three arguments: [options,] set of font characteristics and
% list of character protrusion factors.
%
% A new macro called |\MT@protcodes@|\meta{name} will be defined to be \meta{\#3}
% (i.e. the list of characters, not expanded).
%    \begin{macrocode}
%<*package>
\renewcommand{\SetProtrusion}[3][]{%
   \global\let\MT@protcodes@name\@undefined
   \let\MT@load\@undefined
   \let\MT@extra@factor\@undefined
%    \end{macrocode}
% Parse the first argument:
%    \begin{macrocode}
   \setkeys{MT@protcodes}{#1}%
%    \end{macrocode}
% If the user hasn't specified a name, we will create one.
%    \begin{macrocode}
   \MT@get@codes@name{prot}%
   \MT@set@factor
%<debug>   \MT@info{creating protrusion list `\MT@protcodes@name'}%
%    \end{macrocode}
% Now we can define the macro to be \meta{\#3}. Here, as elsewhere, we have to
% make the definitions global, since they may occur inside a group.
%    \begin{macrocode}
   \global\MT@def@n{MT@protcodes@\MT@protcodes@name}{#3}%
%    \end{macrocode}
% The second argument: We define macros for all permutations of the font
% characteristics to point to this macro.
%    \begin{macrocode}
   \setkeys{MT@protcodes}{#2}%
   \def\MT@permutelist{protcodes}%
   \MT@permute
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\SetExpansion}
% \cs{SetExpansion} only differs in that it allows some extra options (|stretch|,
% |shrink|, |step|, |auto|).
%    \begin{macrocode}
\renewcommand{\SetExpansion}[3][]{%
   \global\let\MT@expcodes@name\@undefined
   \let\MT@extra@factor\@undefined
   \let\MT@extra@stretch\@undefined
   \let\MT@extra@shrink\@undefined
   \let\MT@extra@step\@undefined
   \let\MT@extra@auto\@undefined
   \let\MT@load\@undefined
   \setkeys{MT@expcodes}{#1}%
   \MT@get@codes@name{exp}%
   \MT@set@exp@opt
%<debug>   \MT@info{creating expansion list `\MT@expcodes@name'}%
   \global\MT@def@n{MT@expcodes@\MT@expcodes@name}{#3}%
   \setkeys{MT@expcodes}{#2}%
   \def\MT@permutelist{expcodes}%
   \MT@permute
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@get@codes@name}
% Simply use a roman number as the list name if the user didn't bother creating
% one.
%    \begin{macrocode}
\def\MT@get@codes@name#1{%
   \MT@ifdefined@n{MT@#1codes@name}{%
      \MT@ifdefined@n{MT@#1codes@\csname MT@#1codes@name\endcsname}{%
         \MT@warning{Redefining list `\csname MT@#1codes@name\endcsname'}%
      }{}%
   }{%
      \@tempcnta=\@ne
      \MT@loop
         \MT@ifdefined@n{MT@#1codes@#1-\romannumeral\@tempcnta}{%
            \advance \@tempcnta \@ne
         }{%
            \global\MT@edef@n{MT@#1codes@name}{#1-\romannumeral\@tempcnta}%
            \@tempcnta=\z@
         }%
         \ifnum\@tempcnta > \z@ \MT@repeat
   }%
%    \end{macrocode}
%\changes{v1.3}{2004/10/27}{bug fix: specifying \texttt{load} option does no
%                           longer require to give a \texttt{name}, too}
% Now that we know the name, we can cater for any set to be loaded by this list.
%    \begin{macrocode}
   \MT@ifdefined@c\MT@load{%
      \global\MT@let@nc{MT@#1codes@\csname MT@#1codes@name\endcsname load}\MT@load
   }{}%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@set@factor}
%    \begin{macrocode}
\def\MT@set@factor{%
   \MT@ifdefined@c\MT@extra@factor{%
      \global\MT@let@nc{MT@protcodes@\MT@protcodes@name @factor}\MT@extra@factor
   }{}%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@set@exp@opt}
% The extra options to \cs{SetExpansion} also have to be dealt with only after
% we know the name.
%\changes{v1.4}{2004/11/10}{bug fix: specifying extra options does no
%                           longer require to give a \texttt{name}, too}
%    \begin{macrocode}
\def\MT@set@exp@opt{%
   \MT@ifdefined@c\MT@extra@factor{%
      \global\MT@let@nc{MT@expcodes@\MT@expcodes@name @factor}\MT@extra@factor
   }{}%
   \MT@ifdefined@c\MT@extra@stretch{%
      \global\MT@let@nc{MT@expcodes@\MT@expcodes@name @stretch}\MT@extra@stretch
   }{}%
   \MT@ifdefined@c\MT@extra@shrink{%
      \global\MT@let@nc{MT@expcodes@\MT@expcodes@name @shrink}\MT@extra@shrink
   }{}%
   \MT@ifdefined@c\MT@extra@step{%
      \global\MT@let@nc{MT@expcodes@\MT@expcodes@name @step}\MT@extra@step
   }{}%
   \MT@ifdefined@c\MT@extra@auto{%
      \global\MT@let@nc{MT@expcodes@\MT@expcodes@name @auto}\MT@extra@auto
   }{}%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@define@code@key}
% Define the keys for expansion and protrusion character code lists.
%    \begin{macrocode}
\def\MT@define@code@key#1#2{%
   \define@key{MT@#1}{#2}[]{%
      \@tempcnta=\@ne
      \@for\MT@val:=##1\do{%
         \MT@remove@spaces{\MT@val}%
%    \end{macrocode}
% Here, too, we allow for something like `|bf*|'. It will expanded immediately.
%    \begin{macrocode}
         \MT@get@highlevel{#2}%
         \MT@edef@n{MT@temp#2\romannumeral\@tempcnta}{\MT@val}%
         \advance\@tempcnta \@ne
      }%
   }%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@define@code@key@size}
%    \begin{macrocode}
\def\MT@define@code@key@size#1{%
   \define@key{MT@#1}{size}[]{%
      \@tempcnta=\@ne
      \@for\MT@val:=##1\do{%
         \MT@remove@spaces{\MT@val}%
         \MT@get@size
         \MT@edef@n{MT@tempsize\romannumeral\@tempcnta}{\MT@val}%
         \advance\@tempcnta \@ne
      }%
   }%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@declare@codes}
%    \begin{macrocode}
\def\MT@declare@codes#1{%
   \define@key{MT@#1codes}{name}[]{%
      \MT@ifempty{##1}{}{%
         \global\MT@def@n{MT@#1codes@name}{##1}%
      }%
   }%
   \define@key{MT@#1codes}{load}[]{%
      \MT@ifempty{##1}{}{%
         \def\MT@load{##1}%
      }%
   }%
   \define@key{MT@#1codes}{factor}[]{%
      \MT@ifempty{##1}{}{%
         \def\MT@extra@factor{##1 }%
      }%
   }%
   \MT@define@code@key{#1codes}{encoding}%
   \MT@define@code@key{#1codes}{family}%
   \MT@define@code@key{#1codes}{series}%
   \MT@define@code@key{#1codes}{shape}%
   \MT@define@code@key@size{#1codes}%
}
%    \end{macrocode}
%\end{macro}
%    \begin{macrocode}
\MT@declare@codes{prot}
\MT@declare@codes{exp}
%    \end{macrocode}
%\begin{macro}{\MT@define@expcodes@key}
% The first argument to \cs{SetExpansion} accepts some more options.
%    \begin{macrocode}
\def\MT@define@expcodes@key#1{%
   \define@key{MT@expcodes}{#1}[]{%
      \MT@ifempty{##1}{}{%
%    \end{macrocode}
% A space terminates the number.
%    \begin{macrocode}
         \MT@def@n{MT@extra@#1}{##1 }%
      }%
   }%
}
%    \end{macrocode}
%\end{macro}
%    \begin{macrocode}
\MT@define@expcodes@key{stretch}
\MT@define@expcodes@key{shrink}
\MT@define@expcodes@key{step}
\define@key{MT@expcodes}{auto}[]{%
   \MT@ifempty{#1}{\def\@tempb{true}}{\def\@tempb{#1}}%
   \csname if\@tempb\endcsname
      \def\MT@extra@auto{autoexpand }%
   \else
      \let\MT@extra@auto\@empty
   \fi
}
%    \end{macrocode}
%
%\subsubsection{Character Inheritance}
%
%\begin{macro}{\DeclareCharacterInheritance}
%\changes{v1.1}{2004/09/15}{new macro: possibility to specify 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.
%    \begin{macrocode}
\renewcommand{\DeclareCharacterInheritance}[3][]{%
   \KV@@sp@def\@tempa{#1}%
   \MT@ifempty{\@tempa}{%
       \MT@declare@char@inh{protrusion}{#2}{#3}%
       \MT@declare@char@inh{expansion} {#2}{#3}%
   }{%
       \expandafter\MT@declare@char@inh\expandafter{\@tempa}{#2}{#3}%
   }%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@declare@char@inh}
% The optional argument may be used to restrict the inheritance list to
% protrusion or expansion.
%    \begin{macrocode}
\def\MT@declare@char@inh#1#2#3{%
   \MT@let@nc{MT@#1inh@name}\@undefined
   \MT@get@inh@name{#1}%
%<debug>   \MT@info{creating inheritance list `\csname MT@#1inh@name\endcsname'}%
   \global\MT@def@n{MT@#1inh@\csname MT@#1inh@name\endcsname}{#3}%
   \setkeys{MT@#1inh}{#2}%
   \def\MT@permutelist{#1inh}%
   \MT@permute
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@get@inh@name}
% The inheritance lists cannot be named by the user.
%    \begin{macrocode}
\def\MT@get@inh@name#1{%
   \@tempcnta=\@ne
   \MT@loop
      \MT@ifdefined@n{MT@#1inh@#1-inh-\romannumeral\@tempcnta}{%
         \advance \@tempcnta \@ne
      }{%
         \MT@edef@n{MT@#1inh@name}{#1-inh-\romannumeral\@tempcnta}%
         \@tempcnta=\z@
      }%
      \ifnum\@tempcnta > \z@ \MT@repeat
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@define@inh@key@encoding}
% Parse the first argument. \cs{DeclareCharacterInheritance} may also be set
% up for various combinations.
%\changes{v1.2}{2004/09/29}{check whether only one encoding specified}
%    \begin{macrocode}
\def\MT@define@inh@key@encoding#1{%
   \define@key{MT@#1}{encoding}[]{%
      \KV@@sp@def\MT@val{##1}%
      \expandafter\MT@encoding@check\MT@val,\@nil
      \MT@get@highlevel{encoding}%
      \MT@edef@n{MT@tempencoding\romannumeral1}{\MT@val}%
   }%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@encoding@check}
% But we only allow \emph{one} encoding.
%    \begin{macrocode}
\def\MT@encoding@check#1,#2\@nil{%
   \MT@ifempty{#2}{}{%
      \edef\MT@val{#1}%
      \MT@warning{You may only specify one encoding for character\MessageBreak
                  inheritance lists. Ignoring encoding #2}%
   }%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@define@inh@keys}
%    \begin{macrocode}
\def\MT@define@inh@keys#1{%
   \MT@define@inh@key@encoding{#1inh}%
%    \end{macrocode}
% For the rest, we can reuse the key setup from \cs{SetProtrusion} resp.
% \cs{SetExpansion}.
%    \begin{macrocode}
   \MT@define@code@key{#1inh}{family}%
   \MT@define@code@key{#1inh}{series}%
   \MT@define@code@key{#1inh}{shape}%
   \MT@define@code@key@size{#1inh}%
}
\MT@define@inh@keys{protrusion}
\MT@define@inh@keys{expansion}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@inhdo}
% Parse the second argument, the inheritance lists. We define the commands
% |\MT@inh@|\meta{name}|@|\meta{slot}|@|, containing the inheriting characters.
% They will also be translated to slot numbers here, to save some time. The
% following will be executed only once, namely the first time this inheritance
% list is encountered (in \cs{MT@set@prot@codes} resp. \cs{MT@set@exp@codes}).
%    \begin{macrocode}
\def\MT@inhdo#1,{%
   \ifx\relax#1\@empty\else
      \MT@inhsplit #1==\relax
      \expandafter\MT@inhdo\fi
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@inhsplit}
% At the right time (viz. in |MT@set@|\meta{|exp|\textbar|prot|}|@children|),
% \cs{MT@lt} will be redefined to set the codes for the inheriting characters
% gathered here.
%    \begin{macrocode}
\def\MT@inhsplit#1=#2=#3\relax{%
   \KV@@sp@def\@tempa{#1}%
   \ifx\@tempa\@empty\else
      \MT@get@slot
      \ifnum\MT@char > \m@ne
         \let\MT@val\MT@char
         \let\MT@lt\relax
         \KV@@sp@def\@tempb{#2}%
         \@for\@tempa:=\@tempb\do{%
            \MT@remove@spaces{\@tempa}%
            \ifx\@tempa\@empty\else
               \MT@get@slot
               \ifnum\MT@char > \m@ne
                  \expandafter\MT@xadd\csname MT@inh@\MT@inh@name @\MT@val @\endcsname
                     {\noexpand\MT@lt{\MT@char}}%
               \fi
            \fi
         }%
%<debug>      \let\MT@lt\@empty
%<debug>      \MT@info@nl{children of #1 (\MT@val):
%<debug>          \csname MT@inh@\MT@inh@name @\MT@val @\endcsname}%
      \fi
   \fi
}
%    \end{macrocode}
%\end{macro}
%
%\subsubsection{Permutation}
%
%\begin{macro}{\MT@permute}
%\changes{v1.1}{2004/09/15}{don't use sets for empty encoding}
%\begin{macro}{\MT@permute@}
%\begin{macro}{\MT@permute@@}
%\begin{macro}{\MT@permute@@@}
%\begin{macro}{\MT@permute@@@@}
%\begin{macro}{\MT@permute@@@@@}
% Calling \cs{MT@permute} will define commands for all permutations
% of specified font characteristics of the form
% |\MT@|\meta{list type}|@/|\meta{encoding}|/|\meta{family}|/|\hskip0pt
%                           \meta{series}|/|\meta{shape}|/|\meta{size}
% to be the expansion of |\MT@|\meta{list type}|@name|, i.\,e. the name of
% the currently defined list.
% This permutation can certainly be done in a more elegant way.
%    \begin{macrocode}
\def\MT@permute{%
   \let\MT@cnt@encoding\@ne
   \MT@permute@
%    \end{macrocode}
% Undefine commands for the next round.
%    \begin{macrocode}
   \MT@permute@reset
}
\def\MT@permute@{%
   \let\MT@cnt@family\@ne
   \MT@permute@@
   \MT@increment\MT@cnt@encoding
   \MT@ifdefined@n{MT@tempencoding\romannumeral\MT@cnt@encoding}%
      {\MT@permute@}{}%
}
\def\MT@permute@@{%
   \let\MT@cnt@series\@ne
   \MT@permute@@@
   \MT@increment\MT@cnt@family
   \MT@ifdefined@n{MT@tempfamily\romannumeral\MT@cnt@family}%
      {\MT@permute@@}{}%
}
\def\MT@permute@@@{%
   \let\MT@cnt@shape\@ne
   \MT@permute@@@@
   \MT@increment\MT@cnt@series
   \MT@ifdefined@n{MT@tempseries\romannumeral\MT@cnt@series}%
      {\MT@permute@@@}{}%
}
\def\MT@permute@@@@{%
   \let\MT@cnt@size\@ne
   \MT@permute@@@@@
   \MT@increment\MT@cnt@shape
   \MT@ifdefined@n{MT@tempshape\romannumeral\MT@cnt@shape}%
      {\MT@permute@@@@}{}%
}
\def\MT@permute@@@@@{%
   \MT@permute@define{encoding}%
   \MT@permute@define{family}%
   \MT@permute@define{series}%
   \MT@permute@define{shape}%
   \MT@permute@define{size}%
   \edef\@tempa{\MT@tempencoding/%
                \MT@tempfamily/%
                \MT@tempseries/%
                \MT@tempshape/%
                \MT@tempsize}%
%    \end{macrocode}
% Some sanity checks: only one list should apply to a given combination;
%\changes{v1.2}{2004/09/29}{more sanity checks for \cs{SetProtrusion} and
%                          \cs{SetExpansion}}
% an encoding must be specified (unless nothing else is); size may only be
% defined if all the rest is, too.
%    \begin{macrocode}
   \def\@tempb{////}%
   \ifx\@tempa\@tempb\else
      \ifx\MT@tempencoding\@empty
         \MT@warning{%
            You have to specify an encoding for \MT@permutelist. list\MessageBreak
            `\csname MT@\MT@permutelist @name\endcsname'. I will ignore it}%
      \else
         \MT@ifdefined@n{MT@\MT@permutelist @\@tempa}{%
            \MT@warning{\MT@permutelist. list
               `\csname MT@\MT@permutelist @name\endcsname' will override list\MessageBreak
               `\csname MT@\MT@permutelist @\@tempa\endcsname' for font `\@tempa'}%
         }{}%
         \ifx\MT@tempsize\@empty\else
            \expandafter\MT@size@check\@tempa//\@nil
         \fi
         \global\MT@edef@n{MT@\MT@permutelist @\@tempa}%
               {\csname MT@\MT@permutelist @name\endcsname}%
%<debug>         \MT@info@nl{initializing: use list for font \@tempa}%
      \fi
   \fi
   \MT@increment\MT@cnt@size
   \MT@ifdefined@n{MT@tempsize\romannumeral\MT@cnt@size}%
      {\MT@permute@@@@@}{}%
}
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\begin{macro}{\MT@size@check}
% Check whether all font characteristics are specified.
%\changes{v1.3}{2004/10/27}{check only once}
%    \begin{macrocode}
\def\MT@size@check#1//#2\@nil{%
   \MT@ifempty{#2}{}{%
      \MT@let@nc{MT@tempsize\romannumeral\MT@cnt@size}\@undefined
      \edef\@tempa{\MT@tempencoding/\MT@tempfamily/\MT@tempseries/\MT@tempshape/}%
      \MT@warning{Size may only be specified if all other font\MessageBreak
         characteristics are specified, too. Ignoring size\MessageBreak
         in \MT@permutelist. list `\csname MT@\MT@permutelist @name\endcsname'}%
   }%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@permute@define}
% Define and reset the commands.
%    \begin{macrocode}
\def\MT@permute@define#1{%
   \expandafter\@tempcnta\csname MT@cnt@#1\endcsname
   \MT@ifdefined@n{MT@temp#1\romannumeral\@tempcnta}{%
      \MT@edef@n{MT@temp#1}{\csname MT@temp#1\romannumeral\@tempcnta\endcsname}%
   }{%
      \MT@let@nc{MT@temp#1}\@empty
   }%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@permute@reset}
%    \begin{macrocode}
\def\MT@permute@reset{%
   \MT@permute@reset@{encoding}%
   \MT@permute@reset@{family}%
   \MT@permute@reset@{series}%
   \MT@permute@reset@{shape}%
   \MT@permute@reset@{size}%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@permute@reset@}
%    \begin{macrocode}
\def\MT@permute@reset@#1{%
   \@tempcnta\@ne
   \MT@loop
      \MT@let@nc{MT@temp#1\romannumeral\@tempcnta}\@undefined
      \advance\@tempcnta\@ne
      \MT@ifdefined@n{MT@temp#1\romannumeral\@tempcnta}
         {\@tempswatrue}
         {\@tempswafalse}%
      \if@tempswa\MT@repeat
}
%</package>
%    \end{macrocode}
%\end{macro}
%
%\subsection{User Command}
%\begin{macro}{\microtypesetup}
%\changes{v1.4}{2004/11/04}{bug fix: set the correct levels, and remember them;
%                           warning when enabling an option disabled in package options}
%\begin{macro}{\MT@define@optionX}
% This command may be used anywhere in the document. It accepts the options:
% |protrusion|, |expansion| and |activate|. Specifying font sets is not
% allowed.
%    \begin{macrocode}
%<*package>
\def\MT@capitalize#1#2\@nil{%
   \uppercase{\def\@tempb{#1}}%
   \edef\@tempb{\@tempb#2}}%
\def\microtypesetup{\setkeys{MTX}}
\def\MT@define@optionX#1{%
   \define@key{MTX}{#1}[true]{%
      \@for\MT@val:=##1\do{%
         \MT@capitalize#1\@nil
         \MT@remove@spaces{\MT@val}%
         \MT@ifempty{\MT@val}{}{%
            \@tempcnta\m@ne
            \def\@tempa{true}%
            \ifx\MT@val\@tempa
%    \end{macrocode}
% Enabling micro-typography in the middle of the document is not possibly if it
% has been disabled in the package options since fonts might already have been
% loaded and hence wouldn't be set up.
% (A whole caboodle of \cs{expandafter}s because we have to use \cs{csname}s
% which would confuse the \cs{if} \dots\ \cs{fi} grouping.)
%    \begin{macrocode}
               \expandafter\expandafter\expandafter\ifx\expandafter
               \csname ifMT@#1\expandafter\endcsname\csname iftrue\endcsname
                  \expandafter\@tempcnta\csname MT@#1level\endcsname
                  \MT@info{\@tempb\space enabled}%
               \else
                  \MT@warning{You cannot enable #1 if it was disabled\MessageBreak
                              in the package options,}%
               \fi
               \let\MT@val\relax
            \fi
            \def\@tempa{false}%
            \ifx\MT@val\@tempa
               \@tempcnta\z@
               \MT@info{\@tempb\space disabled}%
               \let\MT@val\relax
            \fi
            \def\@tempa{compatibility}%
            \ifx\MT@val\@tempa
               \@tempcnta\@ne
               \MT@let@nc{MT@#1level}\@ne
               \MT@info{\@tempb\space set to level 1}%
               \let\MT@val\relax
            \fi
            \def\@tempa{nocompatibility}%
            \ifx\MT@val\@tempa
               \@tempcnta\tw@
               \MT@let@nc{MT@#1level}\tw@
               \MT@info{\@tempb\space set to level 2}%
               \let\MT@val\relax
            \fi
            \ifx\MT@val\relax\else
               \MT@warning{Value `\MT@val' not recognized}%
            \fi
            \ifnum\@tempcnta>\m@ne
               \def\@tempa{Expansion}%
               \ifx\@tempa\@tempb
                  \pdfadjustspacing\@tempcnta
               \else
                  \pdfprotrudechars\@tempcnta
               \fi
            \fi
         }%
      }%
   }%
}
%    \end{macrocode}
%\end{macro}
%\end{macro}
%    \begin{macrocode}
\MT@define@optionX{protrusion}
\MT@define@optionX{expansion}
\define@key{MTX}{activate}[]{%
   \setkeys{MTX}{protrusion={#1}}%
   \setkeys{MTX}{expansion={#1}}%
}
%    \end{macrocode}
% Disable everything -- may be used as a work-around in case setting up fonts
% doesn't work in certain environments. (Undocumented.)
%    \begin{macrocode}
\def\MT@gobblethree#1#2#3{}
\let\MT@saved@setupfont\MT@setupfont
\define@key{MTX}{disable}[]{%
   \MT@info{Inactivate microtype package}%
   \let\MT@setupfont\MT@gobblethree
}
\define@key{MTX}{enable}[]{%
   \MT@info{Reactivate microtype package}%
   \let\MT@setupfont\MT@saved@setupfont
}
%    \end{macrocode}
%
%\subsection{Package Options}
%\begin{macro}{\ifMT@opt@protrusion}
%\begin{macro}{\ifMT@opt@expansion}
%\begin{macro}{\ifMT@opt@auto}
% Keep track of whether the user explicitly set these options.
%    \begin{macrocode}
\newif\ifMT@opt@protrusion
\newif\ifMT@opt@expansion
\newif\ifMT@opt@auto
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\end{macro}
%\begin{macro}{\MT@define@option}
% |expansion| and |protrusion| may be |true|, |false|, |compatibility|,
% |nocompatibility| and/or a \meta{set name}.
%    \begin{macrocode}
\def\MT@define@option#1{%
   \define@key{MT}{#1}[true]{%
      \csname MT@opt@#1true\endcsname
      \@for\MT@val:=##1\do{%
         \MT@remove@spaces{\MT@val}%
         \MT@ifempty{\MT@val}{}{%
            \def\@tempa{false}%
            \ifx\MT@val\@tempa
               \csname MT@#1false\endcsname
               \let\MT@val\relax
            \fi
            \def\@tempa{compatibility}%
            \ifx\MT@val\@tempa
               \MT@def@n{MT@#1level}{1}%
               \let\MT@val\relax
            \fi
            \def\@tempa{nocompatibility}%
            \ifx\MT@val\@tempa
               \MT@def@n{MT@#1level}{2}%
               \let\MT@val\relax
            \fi
            \ifx\MT@val\relax\else
               \csname MT@#1true\endcsname
               \def\@tempa{true}%
               \ifx\MT@val\@tempa
               \else
%    \end{macrocode}
% If everything failed, it must be a set name.
%    \begin{macrocode}
                  \MT@ifdefined@n{MT@#1list@@\MT@val}{%
                     \global\MT@edef@n{MT@#1@setname}{\MT@val}%
                     \MT@info@nl{Using #1 set `\MT@val'}%
                  }{%
                     \global\MT@def@n{MT@#1@setname}{alltext}%
                     \MT@warning@nl{%
                        The #1 set `\MT@val' is undeclared.\MessageBreak
                        Using set `\csname MT@#1@setname\endcsname' instead}%
                  }%
               \fi
            \fi
         }%
      }%
   }%
}
%    \end{macrocode}
%\end{macro}
%    \begin{macrocode}
\MT@define@option{protrusion}
\MT@define@option{expansion}
%    \end{macrocode}
% |activate| is a shortcut.
%    \begin{macrocode}
\define@key{MT}{activate}[]{%
   \setkeys{MT}{protrusion={#1}}%
   \setkeys{MT}{expansion={#1}}%
}
\define@key{MT}{DVIoutput}[true]{\csname MT@DVIoutput#1\endcsname}
%    \end{macrocode}
% |draft| may be inherited from the class options.
%    \begin{macrocode}
\define@key{MT}{draft}[true]{\csname MT@draft#1\endcsname}
%    \end{macrocode}
% |final| is the opposite.
%\changes{v1.4}{2004/11/16}{new option: \texttt{final}}
%    \begin{macrocode}
\define@key{MT}{final}[true]{%
   \def\@tempa{#1}\def\@tempb{true}%
   \ifx\@tempa\@tempb
      \MT@draftfalse
   \else
      \MT@drafttrue
   \fi}
%    \end{macrocode}
% For verbose output, we simply redefine \cs{MT@vinfo}.
%    \begin{macrocode}
\define@key{MT}{verbose}[true]{%
   \def\@tempa{#1}\def\@tempb{true}%
   \ifx\@tempa\@tempb
      \let\MT@vinfo\MT@info@nl
   \fi}
\define@key{MT}{auto}[true]{\csname MT@auto#1\endcsname\MT@opt@autotrue}
\define@key{MT}{selected}[true]{\csname MT@selected#1\endcsname}
%    \end{macrocode}
%\changes{v1.5}{2004/12/02}{defaults: \texttt{step}: 4}
%\changes{v1.5}{2004/12/02}{new option: \texttt{selected}, by default false}
%\changes{v1.6}{2004/12/18}{new option: \texttt{factor}, by default 1000}
%    \begin{macrocode}
\define@key{MT}{factor}[1000]{\MT@define@number\MT@prot@factor{#1}{factor}}
\define@key{MT}{stretch}[20]{\MT@define@number\MT@stretch{#1}{stretch}}
\define@key{MT}{shrink}[20]{\MT@define@number\MT@shrink{#1}{shrink}}
\define@key{MT}{step}[5]{\MT@define@number\MT@step{#1}{step}}
%    \end{macrocode}
%\begin{macro}{\MT@define@number}
% No nonsense in \cs{MT@prot@factor} et al.?
%\changes{v1.6}{2005/01/06}{test whether numeric options received a number}
%    \begin{macrocode}
\def\MT@define@number#1#2#3{%
   \MT@ifnumber{#2}{%
%    \end{macrocode}
% A space terminates the number.
%    \begin{macrocode}
      \def#1{#2 }%
   }{%
      \MT@warning@nl{Value `#2' for option `#3' is not a number.\MessageBreak
                     Using default value}%
   }%
}
%    \end{macrocode}
%\end{macro}
% 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.)
%    \begin{macrocode}
\MT@protrusiontrue
\ifnum\pdfoutput=\z@\else
%    \end{macrocode}
% Also, we only enable expansion by default if \pdftex\ can expand the fonts
% automatically.
%\changes{v1.6}{2004/12/23}{defaults: turn off expansion for old \pdftex\ versions}
%    \begin{macrocode}
   \ifnum\MT@pdftex@no=4\relax
      \MT@expansiontrue
      \MT@autotrue
   \fi
\fi
%    \end{macrocode}
% Load the local configuration file before executing the package options.
%\changes{v1.4}{2004/11/25}{set catcodes before reading global configuration file
%                           (reported by Christoph Bier)} ^^A <christoph.bier{at}web.de>
%                                            ^^A in: <MID:30k2tqF30v483U1@uni-berlin.de>
%    \begin{macrocode}
\MT@info@nl{Trying to load local config file `microtype.cfg' ..}
\IfFileExists{microtype.cfg}{%
   \begingroup
   \MT@file@catcodes
   \input{microtype.cfg}%
   \endgroup
   \MT@info@nl{... local config file loaded successfully}%
}{%
   \MT@warning@nl{... local config file not found! This will\MessageBreak
                  almost certainly lead to undesired results}%
}
%    \end{macrocode}
%\begin{macro}{\ProcessOptionsWithKV}
% Parse options.
%    \begin{macrocode}
\def\ProcessOptionsWithKV#1{%
   \let\@tempc\relax
   \let\KVo@tempa\@empty
   \@for\CurrentOption:=\@classoptionslist\do{%
      \@ifundefined{KV@#1@\CurrentOption}{}{%
         \edef\KVo@tempa{\KVo@tempa,\CurrentOption,}%
         \@expandtwoargs\@removeelement\CurrentOption
            \@unusedoptionlist\@unusedoptionlist
      }%
   }%
   \edef\KVo@tempa{%
      \noexpand\setkeys{#1}{%
         \KVo@tempa\@ptionlist{\@currname.\@currext}%
      }%
   }%
   \KVo@tempa
   \AtEndOfPackage{\let\@unprocessedoptions\relax}%
   \let\CurrentOption\@empty
}
%    \end{macrocode}
%\end{macro}
%    \begin{macrocode}
\ProcessOptionsWithKV{MT}
%    \end{macrocode}
% Now we can process the options:
%
% \pdftex\ can create \dvi\ output, too. However, both the \dvi\ viewer and
% dvips need to find actual fonts. Therefore, expansion will only work if the
% fonts for different degrees of expansion are readily available.
%
%\changes{v1.4}{2004/11/19}{new message if \cs{pdfoutput} is changed}
% Some packages depend on the value of \cs{pdfoutput} and will get confused if
% we change it after they have been loaded. These packages are, among others:
% \pkg{color}, \pkg{graphics}, \pkg{hyperref}, \pkg{crop}, \pkg{contour},
% \pkg{pstricks} and of course \pkg{ifpdf}. Instead of testing for each package
% (that's not our job), we issue a different message if \cs{pdfoutput} is
% actually changed by |DVIoutput|. That must be sufficient!
%    \begin{macrocode}
\ifMT@DVIoutput
   \ifnum\pdfoutput=\z@
      \MT@info@nl{Generating DVI output}
   \else
      \MT@info@nl{Changing output mode to DVI}
      \pdfoutput\z@
%    \end{macrocode}
% For \dvi\ output, the user must have explicitly passed the |expansion| option
% to the package.
%\changes{v1.5}{2004/12/02}{defaults: turn off expansion for \dvi\ output}
%    \begin{macrocode}
      \ifMT@opt@expansion\else
         \MT@expansionfalse
      \fi
   \fi
\else
   \MT@info@nl{Generating \ifnum\pdfoutput=\z@ DVI \else PDF \fi output}
\fi
%    \end{macrocode}
% 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 \arabic{CodelineNo} lines
% above if we are running in draft mode.
%    \begin{macrocode}
\ifMT@draft
   \MT@info@nl{`draft' option active.\MessageBreak
               Disabling all micro-typographic features}
   \MT@protrusionfalse
   \MT@expansionfalse
   \let\MT@setupfont\relax
   \let\microtypesetup\@gobble
   \renewcommand{\UseMicroTypeSet}[2][]{}
   \renewcommand{\SetProtrusion}[3][]{}
   \renewcommand{\SetExpansion}[3][]{}
\else
   \ifMT@protrusion
      \MT@info@nl{Character protrusion enabled (level \MT@protrusionlevel)%
         \ifnum\MT@prot@factor=\@m\else,\MessageBreak factor: \MT@prot@factor\fi}
%    \end{macrocode}
% 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.
%    \begin{macrocode}
      \MT@ifdefined@n{MT@protrusion@setname}{}{%
         \global\def\MT@protrusion@setname{alltext}%
         \MT@info@nl{Using default protrusion set `alltext'}%
      }
   \else
      \MT@info@nl{No character protrusion}
   \fi
   \ifMT@expansion
%    \end{macrocode}
% Set up the values for font expansion: If |stretch| has not been specified, we
% take the default value of 20.
%    \begin{macrocode}
      \ifnum\MT@stretch=\m@ne
         \def\MT@stretch{20 }
      \fi
%    \end{macrocode}
% If |shrink| has not been specified, it will inherit the value from |stretch|.
%    \begin{macrocode}
      \ifnum\MT@shrink=\m@ne
         \ifnum\MT@stretch>\z@
            \let\MT@shrink\MT@stretch
         \else
            \def\MT@shrink{20 }
         \fi
      \fi
%    \end{macrocode}
% If |step| has not been specified, we will set it to min(|stretch|,|shrink|)/5,
% rounded off, minimum value 1.
%\changes{v1.5}{2004/12/02}{defaults: calculate \texttt{step} as
%                           min(\texttt{stretch},\texttt{shrink})/5}
%    \begin{macrocode}
      \ifnum\MT@step=\m@ne
         \ifnum\MT@stretch>\MT@shrink
            \ifnum\MT@shrink=\z@
               \@tempcnta=\MT@stretch
            \else
               \@tempcnta=\MT@shrink
            \fi
         \else
            \ifnum\MT@stretch=\z@
               \@tempcnta=\MT@shrink
            \else
               \@tempcnta=\MT@stretch
            \fi
         \fi
         \divide\@tempcnta by 5\relax
      \else
         \@tempcnta=\MT@step
      \fi
      \ifnum\@tempcnta=\z@ \@tempcnta=\@ne\fi
      \edef\MT@step{\number\@tempcnta\space}
%    \end{macrocode}
%\begin{macro}{\MT@auto}
% Automatic expansion of the font? This new feature of \pdftex\ 1.20 makes the
% \textit{hz}-algorithm really usable. It must be either `|autoexpand|' or
% empty (or `|1000|' for older versions of \pdftex).
%    \begin{macrocode}
      \let\MT@auto\@empty
      \ifMT@auto
         \ifnum\MT@pdftex@no=4\relax
%    \end{macrocode}
%\end{macro}
% We turn off automatic expansion if output mode is \dvi.
%\changes{v1.5}{2004/12/02}{disable automatic expansion for \dvi\ output}
%    \begin{macrocode}
            \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
%    \end{macrocode}
% Also, if \pdftex\ is too old.
%\changes{v1.1}{2004/09/13}{issue an error instead of a warning, when \pdftex\
%                            version is too old for \texttt{autoexpand}}
%\changes{v1.6}{2004/12/23}{disable automatic expansion for old \pdftex\ versions}
%    \begin{macrocode}
         \else
            \ifMT@opt@auto
               \MT@warning@nl{%
                  Your version of pdftex 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.20a or newer}
            \fi
            \MT@autofalse
            \def\MT@auto{1000 }
         \fi
%    \end{macrocode}
% No automatic expansion.
%    \begin{macrocode}
      \else
         \ifnum\MT@pdftex@no<4\relax
            \def\MT@auto{1000 }
         \fi
      \fi
%    \end{macrocode}
% Info.
%    \begin{macrocode}
      \MT@info@nl{\ifMT@auto Automatic f\else F\fi ont expansion enabled
                  (level \MT@expansionlevel),\MessageBreak
                  stretch: \MT@stretch/ shrink: \MT@shrink/ step: \MT@step/
                  \ifMT@selected\else non-\fi selected}
      \MT@ifdefined@n{MT@expansion@setname}{}{%
         \global\def\MT@expansion@setname{basictext}%
         \MT@info@nl{Using default expansion set `basictext'}%
      }
   \else
      \MT@info@nl{No font expansion}
   \fi
\fi
%    \end{macrocode}
% Finally, we enable the micro-typographic extensions, or we don't.
%    \begin{macrocode}
\ifMT@protrusion
   \pdfprotrudechars\MT@protrusionlevel
\fi
\ifMT@expansion
   \pdfadjustspacing\MT@expansionlevel
\fi
%</package>
%    \end{macrocode}
% That was that.
%
% ^^A -------------------------------------------------------------------------
% ^^A From now on, don't bother indexing:
%\NoIndexing
%
%\section{Configuration Files}
%\changes{v1.6}{2005/01/24}{restructure \texttt{dtx} file}
% Let's now write the font configuration files.
%    \begin{macrocode}
%<*config>
%    \end{macrocode}
%
%\subsection{Character Inheritance}
% First the lists of inheriting characters. We only declare those characters
% that are the same on \emph{both} sides, i.\,e. not \AE\ for A.
%\changes{v1.1}{2004/09/14}{removed 8-bit characters from the configuration files
%                           (suggested by Harald Harders)}
%    \begin{macrocode}
%<*m-t>

%%% ----------------------------------------------------------------------
%%% CHARACTER INHERITANCE

%    \end{macrocode}
% Other interesting glyphs that should possibly inherit settings on one side:
% |012|~(`fi' ligature), |013|~(`fl'), |014|~(`ffi'), |015|~(`ffl'),
% \AE, \ae, \OE, \oe.
%    \begin{macrocode}
\DeclareCharacterInheritance
   { encoding = OT1 }
   { f = {011}, % ff
     i = {\i},
     j = {\j},
     O = {\O},
     o = {\o},
  }

%    \end{macrocode}
% Candidates here: |028|~(`fi'), |029|~(`fl'), |030|~(`ffi'), |031|~(`ffl'),
% |156| (`IJ'~ligature), |188|~(`ij'), \AE, \ae, \OE, \oe.
%\changes{v1.5}{2004/12/11}{remove \cs{ss} from character inheritance list, add \cs{DJ}}
%    \begin{macrocode}
\DeclareCharacterInheritance
   { encoding = T1 }
   { A = {\`A,\'A,\^A,\~A,\"A,\r{A},\k{A},\u{A}},
     a = {\`a,\'a,\^a,\~a,\"a,\r{a},\k{a},\u{a}},
     C = {\'C,\c{C},\v{C}},
     c = {\'c,\c{c},\v{c}},
     D = {\v{D},\DH,\DJ},
     d = {\v{d},\dj},
     E = {\`E,\'E,\^E,\"E,\k{E},\v{E}},
     e = {\`e,\'e,\^e,\"e,\k{e},\v{e}},
     f = {027}, % ff
     G = {\u{G}},
     g = {\u{g}},
     I = {\`I,\'I,\^I,\"I,\.I},
     i = {\`i,\'i,\^i,\"i,\i},
     j = {\j},
     L = {\L,\'L,\v{L}},
     l = {\l,\'l,\v{l}},
     N = {\'N,\~N,\v{N}},
     n = {\'n,\~n,\v{n}},
     O = {\O,\`O,\'O,\^O,\~O,\"O,\H{O}},
     o = {\o,\`o,\'o,\^o,\~o,\"o,\H{o}},
     R = {\'R,\v{R}},
     r = {\'r,\v{r}},
     S = {\'S,\c{S},\v{S},\SS},
     s = {\'s,\c{s},\v{s}},
     T = {\c{T},\v{T}},
     t = {\c{t},\v{t}},
     U = {\`U,\'U,\^U,\"U,\H{U},\r{U}},
     u = {\`u,\'u,\^u,\"u,\H{u},\r{u}},
     Y = {\'Y,\"Y},
     y = {\'y,\"y},
     Z = {\'Z,\.Z,\v{Z}},
     z = {\'z,\.z,\v{z}},
     - = {127},
  }

%    \end{macrocode}
% More characters: |008|~(`fl'), |012|~(`fi'), |014|~(`ffi'), |015|~(`ffl'),
% \AE, \ae, \OE, \oe.
%    \begin{macrocode}
\DeclareCharacterInheritance
   { encoding = LY1 }
   { A = {\`A,\'A,\^A,\~A,\"A,\r{A}},
     a = {\`a,\'a,\^a,\~a,\"a,\r{a}},
     C = {\c{C}},
     c = {\c{c}},
     D = {\DH},
     E = {\`E,\'E,\^E,\"E},
     e = {\`e,\'e,\^e,\"e},
     f = {011}, % ff
     I = {\`I,\'I,\^I,\"I},
     i = {\`i,\'i,\^i,\"i,\i},
     L = {\L},
     l = {\l},
     N = {\~N},
     n = {\~n},
     O = {\`O,\'O,\^O,\~O,\"O,\O},
     o = {\`o,\'o,\^o,\~o,\"o,\o},
     S = {\v{S}},
     s = {\v{s}},
     U = {\`U,\'U,\^U,\"U},
     u = {\`u,\'u,\^u,\"u},
     Y = {\'Y,\"Y},
     y = {\'y,\"y},
     Z = {\v{Z}},
     z = {\v{z}},
  }

%</m-t>
%    \end{macrocode}
%\subsection{Font Expansion}
% These are the original expansion settings from \thanh. They are used for all
% fonts (until somebody shows mercy and creates font-specific settings).
%    \begin{macrocode}
%<*m-t>
%%% ----------------------------------------------------------------------
%%% EXPANSION SETTINGS

\SetExpansion
%<m-t>   [ name     = default      ]
%<bch>   [ name     = bch-default  ]
%<cmr>   [ name     = cmr-default  ]
%<pad>   [ name     = pad-default  ]
%<pmn>   [ name     = pmn-default  ]
%<ppl>   [ name     = ppl-default  ]
%<ptm>   [ name     = ptm-default  ]
%<m-t>   { encoding = {OT1,T1,LY1} }
%<!m-t>   { encoding = {OT1,T1,LY1},
%<bch>     family   = bch }
%<cmr>     family   = cmr }
%<pad>     family   = {pad,padx,padj} }
%<pmn>     family   = {pmn,pmnx,pmnj} }
%<ppl>     family   = {ppl,pplx,pplj} }
%<ptm>     family   = {ptm,ptmx,ptmj} }
   {
     A = 500,     a = 700,
   \AE = 500,   \ae = 700,
     B = 700,     b = 700,
     C = 700,     c = 700,
     D = 500,     d = 700,
     E = 700,     e = 700,
     F = 700,
     G = 500,     g = 700,
     H = 700,     h = 700,
     K = 700,     k = 700,
     M = 700,     m = 700,
     N = 700,     n = 700,
     O = 500,     o = 700,
   \OE = 500,   \oe = 700,
     P = 700,     p = 700,
     Q = 500,     q = 700,
     R = 700,
     S = 700,     s = 700,
     U = 700,     u = 700,
     W = 700,     w = 700,
     Z = 700,     z = 700,
     2 = 700,
     3 = 700,
     6 = 700,
     8 = 700,
     9 = 700,
   }
%</m-t>
%    \end{macrocode}
%\subsection{Character Protrusion}
%\changes{v1.1}{2004/09/14}{protrusion: added factors for some more characters}
%\changes{v1.4}{2004/11/19}{protrusion: harmonize dashes in upshape and italic
%                           (\texttt{cmr}, \texttt{pad}, \texttt{ppl})}
%
%    \begin{macrocode}

%%% ----------------------------------------------------------------------
%%% PROTRUSION SETTINGS

%    \end{macrocode}
% For future historians, the original settings from \thanh.
%    \begin{macrocode}
%\SetProtrusion
%   [ name     = thanh ]
%   { }
%   {
%     A = {50,50},
%     F = { 0,50},
%     J = {50, 0},
%     K = { 0,50},
%     L = { 0,50},
%     T = {50,50},
%     V = {50,50},
%     W = {50,50},
%     X = {50,50},
%     Y = {50,50},
%     k = { 0,50},
%     r = { 0,50},
%     t = { 0,50},
%     v = {50,50},
%     w = {50,50},
%     x = {50,50},
%     y = {50,50},
%     . = {0,700},    {,}= {0,700},
%     : = {0,500},     ; = {0,500},
%     ! = {0,200},     ? = {0,200},
%     ( = {50, 0},     ) = { 0,50},
%     - = {0,700},
%     \textendash        = {0,300},     \textemdash        = {0,200},
%     \textquoteleft     = {700,0},     \textquoteright    = {0,700},
%     \textquotedblleft  = {500,0},     \textquotedblright = {0,500},
%   }
%
%    \end{macrocode}
% We also create configuration files for the fonts
%\changes{v1.5}{2004/11/28}{protrusion: settings for Bitstream Charter}
% Bitstream Charter (\nfss\ code |bch|),
% Computer Modern Roman (|cmr|),
% Palatino (|ppl|, |pplx|, |pplj|),
% Times (|ptm|, |ptmx|, |ptmj|),
% Adobe Garamond (|pad|, |padx|, |padj|) and
%\changes{v1.1}{2004/09/14}{protrusion: settings for Adobe Minion
%                           (contributed by Harald Harders)}
% Minion\footnote{
%     Contributed by Harald Harders (\mailto{h.harders@tu-bs.de})}
% (|pmnx|, |pmnj|).
%
%\subsubsection{Default}
% The default settings always use the most moderate value.
%    \begin{macrocode}
\SetProtrusion
%<m-t>   [ name     = default ]
%<bch>   [ name     = bch-default ]
%<cmr>   [ name     = cmr-default ]
%<pad>   [ name     = pad-default ]
%<pmn>   [ name     = pmnj-default ]
%<ppl>   [ name     = ppl-default ]
%<ptm>   [ name     = ptm-default ]
%<m-t>   { encoding = OT1     }
%<!m-t>   { encoding = OT1,
%<bch>     family   = bch }
%<cmr>     family   = cmr }
%<pad>     family   = {pad,padx,padj} }
%<pmn>     family   = pmnj }
%<ppl>     family   = {ppl,pplx,pplj} }
%<ptm>     family   = {ptm,ptmx,ptmj} }
   {
     A = {50,50},
%<m-t|cmr|pad|ptm>   \AE = {50,  },
%<bch|pad|pmn>     C = {50,  },
%<bch|pad|pmn>     D = {  ,50},
%<m-t|bch|cmr|pad|pmn|ptm>     F = {  ,50},
%<bch|pad|pmn>     G = {50,  },
%<m-t|cmr|pad|pmn|ppl|ptm>     J = {50,  },
%<bch>     J = {100,  },
     K = {  ,50},
%<m-t|bch|cmr|pad|pmn|ppl>     L = {  ,50},
%<ptm>     L = {  ,80},
%<bch|pad|pmn>     O = {50,50},
%<bch|pad|pmn>   \OE = {50,  },
%<bch|pad|pmn>     Q = {50,70},
%<bch>     R = {  ,50},
     T = {50,50},
     V = {50,50},
     W = {50,50},
     X = {50,50},
%<m-t|bch|cmr|pad|pmn|ppl>     Y = {50,50},
%<ptm>     Y = {80,80},
     k = {  ,50},
%<pmn>     l = {  ,-50},
%<pad|ppl>     p = {50,50},
%<pad|ppl>     q = {50,  },
     r = {  ,50},
%<cmr|pad|pmn>     t = {  ,70},
%<bch>     t = {  ,50},
     v = {50,50},
     w = {50,50},
     x = {50,50},
%<m-t|bch|pad|pmn>     y = {  ,50},
%<cmr|ppl|ptm>     y = {50,70},
%    \end{macrocode}
%\changes{v1.6}{2005/01/11}{protrusion: improve settings for numbers
%                          (pointed out by Peter Muthesius)} ^^A <newsname{at}gmx.de>
%                                        ^^A in: <MID:34b1h7F48s44tU1@individual.net>
%    \begin{macrocode}
%<cmr>     0 = {  ,50},
%<m-t>     1 = {50,50},
%<bch|pad|ptm>     1 = {150,150},
%<cmr>     1 = {100,200},
%<pmn>     1 = {  ,50},
%<ppl>     1 = {100,100},
%<bch|cmr|pad>     2 = {50,50},
%<cmr|pad>     3 = {50,50},
%<bch|pmn>     3 = {50,  },
%<m-t|pad>     4 = {50,50},
%<bch>     4 = {100,50},
%<cmr>     4 = {70,70},
%<pmn>     4 = {50,  },
%<ptm>     4 = {70,  },
%<cmr>     5 = {  ,50},
%<pad>     5 = {50,50},
%<bch>     6 = {50,  },
%<cmr>     6 = {  ,50},
%<pad>     6 = {50,50},
%<m-t>     7 = {50,50},
%<bch|pad|pmn>     7 = {50,80},
%<cmr|ptm>     7 = {50,100},
%<ppl>     7 = { ,50},
%<cmr>     8 = {  ,50},
%<bch|pad>     9 = {50,50},
%<cmr>     9 = {  ,50},
%<m-t|cmr|pad|pmn|ppl|ptm>     . = { ,700},
%<bch>     . = { ,600},
    {,}= { ,500},
%<m-t|cmr|pad|pmn|ppl|ptm>     : = { ,500},
%<bch>     : = { ,400},
%<m-t|bch|pad|pmn|ptm>     ; = { ,300},
%<cmr|ppl>     ; = { ,500},
     ! = { ,100},
%<m-t|pad|pmn|ptm>     ? = { ,100},
%<bch|cmr|ppl>     ? = { ,200},
%<pmn>     " = {300,300},
%<m-t|bch|cmr|pad|pmn|ppl>     @ = {50,50},
%<ptm>     @ = {100,100},
     ~ = {200,250},
%<m-t|bch|pad|pmn|ppl|ptm>     _ = {100,100},
%<cmr>     _ = {200,200},
%<pad|ppl|ptm>     & = {50,100},
%<m-t|cmr|pad|pmn>   037 = {50,50},  % \%
%<bch>   037 = {  ,50},  % \%
%<ppl|ptm>   037 = {100,100},  % \%
%<m-t|ppl|ptm>     * = {200,200},
%<bch|pmn>     * = {200,300},
%<cmr|pad>     * = {300,300},
%<m-t|cmr|ppl|ptm>     + = {250,250},
%<bch>     + = {150,250},
%<pad>     + = {300,300},
%<pmn>     + = {150,200},
%<m-t|pad|pmn|ptm>     ( = {100,   },    ) = {   ,200},
%<bch>     ( = {200,   },    ) = {   ,200},
%<cmr|ppl>     ( = {100,   },    ) = {   ,300},
%<bch|pmn>     [ = {100,   },    ] = {   ,100},
%<m-t|pad|pmn|ptm>     \ = {100,200},    / = {100,200},
%<bch>     \ = {150,200},    / = { ,200},
%<cmr|ppl>     \ = {200,300},    / = {200,300},
%<m-t|ptm>     - = {500,500},
%<bch|cmr|ppl>     - = {400,500},
%<pad>     - = {300,500},
%<pmn>     - = {200,400},
%<m-t|pmn>     \textendash       = {200,200},   \textemdash        = {150,150},
%<bch>     \textendash       = {200,300},   \textemdash        = {150,250},
%<cmr>     \textendash       = {400,300},   \textemdash        = {300,200},
%<pad|ppl|ptm>     \textendash       = {300,300},   \textemdash        = {200,200},
%    \end{macrocode}
% Why settings for left \emph{and} right quotes? Because in some languages they
% might be used like that (see the \pkg{csquotes} package for examples).
%    \begin{macrocode}
%<m-t|bch|pmn>     \textquoteleft    = {300,400},   \textquoteright    = {300,400},
%<cmr>     \textquoteleft    = {500,700},   \textquoteright    = {500,600},
%<pad|ppl>     \textquoteleft    = {500,700},   \textquoteright    = {500,700},
%<ptm>     \textquoteleft    = {500,500},   \textquoteright    = {300,500},
%<m-t|bch|pmn>     \textquotedblleft = {300,300},   \textquotedblright = {300,300},
%<cmr>     \textquotedblleft = {500,300},   \textquotedblright = {200,600},
%<pad|ppl|ptm>     \textquotedblleft = {300,400},   \textquotedblright = {300,400},
%    \end{macrocode}
% Greek uppercase letters (for math mode).
%    \begin{macrocode}
%<*cmr>
   "00 = {   ,150}, % \Gamma
   "01 = {100,100}, % \Delta
   "02 = { 50, 50}, % \Theta
   "03 = {100,100}, % \Lambda
%  "04 = {   ,   }, % \Xi
%  "05 = {   ,   }, % \Pi
   "06 = { 50, 50}, % \Sigma
   "07 = {100,100}, % \Upsilon
   "08 = { 50, 50}, % \Phi
   "09 = { 50, 50}, % \Psi
%  "0A = {   ,   }, % \Omega
%</cmr>
   }

%    \end{macrocode}
% \tOne\ and \lyOne\ encodings contain some more characters. The default list
% will be loaded first.
%
% We won't bother about the extra characters of \lyOne. Whoever uses that
% encoding, should complain to me.
%    \begin{macrocode}
\SetProtrusion
%<m-t>   [ name     = T1-default,
%<bch>   [ name     = bch-T1,
%<cmr>   [ name     = cmr-T1,
%<pad>   [ name     = pad-T1,
%<pmn>   [ name     = pmnj-T1,
%<ppl>   [ name     = ppl-T1,
%<ptm>   [ name     = ptm-T1,
%<m-t>     load     = default     ]
%<bch>     load     = bch-default ]
%<cmr>     load     = cmr-default ]
%<pad>     load     = pad-default ]
%<pmn>     load     = pmnj-default ]
%<ppl>     load     = ppl-default ]
%<ptm>     load     = ptm-default ]
%<m-t>   { encoding = {T1,LY1}    }
%<!m-t>   { encoding = {T1,LY1},
%<bch>     family   = bch }
%<cmr>     family   = cmr }
%<pad>     family   = {pad,padx,padj} }
%<pmn>     family   = pmnj }
%<ppl>     family   = {ppl,pplx,pplj} }
%<ptm>     family   = {ptm,ptmx,ptmj} }
   {
%    \end{macrocode}
%\changes{v1.4}{2004/10/30}{protrusion: tweak quote characters for \texttt{cmr}
%                           variants (\otOne, \tOne, \texttt{lmr})}
% The EC fonts do something weird: They insert a kern between quote and boundary
% character. Therefore, we must override the settings from \otOne.
%    \begin{macrocode}
%<cmr>     \textquotedblleft = {200,600},
%<pmn>     \TH = {  , 50},
%<m-t|cmr|pad|ppl|ptm>     \quotesinglbase   = {400,400},   \quotedblbase      = {400,400},
%<bch|pmn>     \quotesinglbase   = {400,400},   \quotedblbase      = {300,300},
%<m-t|bch|pmn>     \guilsinglleft    = {400,300},   \guilsinglright    = {300,400},
%<cmr|pad|ppl|ptm>     \guilsinglleft    = {400,400},   \guilsinglright    = {300,500},
%<m-t>     \guillemotleft    = {200,200},   \guillemotright    = {200,200},
%<cmr>     \guillemotleft    = {300,200},   \guillemotright    = {100,400},
%<bch|pmn>     \guillemotleft    = {200,200},   \guillemotright    = {150,300},
%<pad>     \guillemotleft    = {300,300},   \guillemotright    = {200,400},
%<ppl|ptm>     \guillemotleft    = {300,300},   \guillemotright    = {200,400},
%<m-t|bch|cmr|pad|pmn|ppl>     \textexclamdown   = {100,   },   \textquestiondown  = {100,   },
%<ptm>     \textexclamdown   = {200,   },   \textquestiondown  = {200,   },
%<m-t|cmr|pad|ppl|ptm>     \textbraceleft    = {400,200},   \textbraceright    = {200,400},
%<bch|pmn>     \textbraceleft    = {200,   },   \textbraceright    = {   ,300},
%<m-t|bch|cmr|pad|ppl|ptm>     \textless         = {200,100},   \textgreater       = {100,200},
%<pmn>     \textless         = {100,   },   \textgreater       = {   ,100},
%<pmn>     \textvisiblespace = {100,100},
   }

%    \end{macrocode}
% The \pkg{lmodern} fonts, on the other hand, restore the original kerning from
% the \otOne\ fonts, and so do we. Silly, isn't it?
%    \begin{macrocode}
%<*cmr>
\SetProtrusion
   [ name     = lmr-T1,
     load     = cmr-T1   ]
   { encoding = {T1,LY1},
     family   = lmr      }
   {
     \textquotedblleft = {500,300},
     \quotedblbase     = {500,300},
   }

%</cmr>
%<*pmn>
\SetProtrusion
   [ name     = pmnx-OT1,
     load     = pmnj-default ]
   { encoding = OT1,
     family   = pmnx }
   {
     1 = {230,180},
   }

\SetProtrusion
   [ name     = pmnx-T1,
     load     = pmnj-T1  ]
   { encoding = {T1,LY1},
     family   = pmnx     }
   {
     1 = {230,180},
   }

%</pmn>
%    \end{macrocode}
%\subsubsection{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.
%\changes{v1.4}{2004/11/22}{protrusion: slanted like italics}
%\changes{v1.6}{2004/12/26}{protrusion: add italic uppercase Greek letters}
%    \begin{macrocode}
\SetProtrusion
%<m-t>   [ name     = OT1-it   ]
%<bch>   [ name     = bch-it   ]
%<cmr>   [ name     = cmr-it   ]
%<pad>   [ name     = pad-it   ]
%<pmn>   [ name     = pmnj-it  ]
%<ppl>   [ name     = ppl-it   ]
%<ptm>   [ name     = ptm-it   ]
   { encoding = OT1,
%<bch>     family   = bch,
%<cmr>     family   = cmr,
%<pad>     family   = {pad,padx,padj},
%<pmn>     family   = pmnj,
%<ppl>     family   = {ppl,pplx,pplj},
%<ptm>     family   = {ptm,ptmx,ptmj},
     shape    = {it,sl}  }
   {
%<cmr|ptm>     A = {100,50},
%<pad|pmn>     A = {50,  },
%<ppl>     A = {50,50},
%<cmr|ptm>   \AE = {100,  },
%<pad|ppl>   \AE = {50,  },
%<pmn>   \AE = {  ,-50},
%<cmr|pad|ppl|ptm>     B = {50,  },
%<pmn>     B = {20,-50},
%<bch|ppl|ptm>     C = {50,  },
%<cmr|pad>     C = {100, },
%<pmn>     C = {50,-50},
%<cmr|pad|ppl|ptm>     D = {50,50},
%<pmn>     D = {20,  },
%<cmr|pad|ppl|ptm>     E = {50,  },
%<pmn>     E = {20,-50},
%<cmr|pad|ptm>     F = {100, },
%<pmn>     F = {10,  },
%<ppl>     F = {50,  },
%<bch|ppl|ptm>     G = {50,  },
%<cmr|pad>     G = {100, },
%<pmn>     G = {50,-50},
%<cmr|pad|ppl|ptm>     H = {50,  },
%<cmr|pad|ptm>     I = {50,  },
%<pmn>     I = {20,-50},
%<cmr|ptm>     J = {100, },
%<pad>     J = {50,  },
%<pmn>     J = {20,  },
%<cmr|pad|ppl|ptm>     K = {50,  },
%<pmn>     K = {20,  },
%<cmr|pad|ppl|ptm>     L = {50,  },
%<pmn>     L = {20,50},
%<cmr|ptm>     M = {50,  },
%<pmn>     M = {  ,-30},
%<cmr|ptm>     N = {50,  },
%<pmn>     N = {  ,-30},
%<bch|pmn|ppl|ptm>     O = {50,  },
%<cmr|pad>     O = {100, },
%<bch|pmn|ppl|ptm>   \OE = {50,  },
%<cmr|pad>   \OE = {100, },
%<cmr|pad|ppl|ptm>     P = {50,  },
%<pmn>     P = {20,-50},
%<bch|pmn|ppl|ptm>     Q = {50,  },
%<cmr|pad>     Q = {100, },
%<cmr|pad|ppl|ptm>     R = {50,  },
%<pmn>     R = {20,  },
%<bch|cmr|pad|ppl|ptm>     S = {50,  },
%<pmn>     S = {20,-30},
%<bch|cmr|pad|ppl|ptm>     $ = {50,  },
%<pmn>     $ = {20,-30},
%<bch|pmn>     T = {70,  },
%<cmr|pad|ppl|ptm>     T = {100, },
%<cmr|pad|ppl|ptm>     U = {50,  },
%<pmn>     U = {50,-50},
%<cmr|pad|pmn>     V = {100, },
%<ppl|ptm>     V = {100,50},
%<cmr|pad|pmn>     W = {100, },
%<ppl>     W = {50,  },
%<ptm>     W = {100,50},
%<cmr|ppl|ptm>     X = {50,  },
%<cmr|ptm>     Y = {100, },
%<pmn>     Y = {50,  },
%<ppl>     Y = {100,50},
%<pmn>     Z = {  ,-50},
%<pmn>     d = {  ,-50},
%<pad|pmn>     f = { ,-100},
%<pmn>     i = {  ,-30},
%<pmn>     j = {  ,-30},
%<pmn>     l = {  ,-100},
%<bch>     o = {50,50},
%<bch>     p = {  ,50},
%<pmn>     p = {-50,  },
%<bch>     q = {50,  },
%<pmn>     r = {  ,50},
%<bch>     t = {  ,50},
%<pmn>     v = {50,  },
%<bch>     w = {  ,50},
%<pmn>     w = {50,  },
%<bch>     y = {  ,50},
%<cmr>     0 = {100, },
%<bch|ptm>     1 = {150,100},
%<cmr>     1 = {200,50},
%<pad>     1 = {150, },
%<pmn>     1 = {50,  },
%<ppl>     1 = {100, },
%<cmr>     2 = {100,-100},
%<pad|ppl|ptm>     2 = {50,  },
%<pmn>     2 = {-50,  },
%<bch>     3 = {50,  },
%<cmr>     3 = {100,-100},
%<pmn>     3 = {-100, },
%<ptm>     3 = {100,50},
%<bch>     4 = {100, },
%<cmr|pad>     4 = {150, },
%<ppl|ptm>     4 = {50,  },
%<cmr>     5 = {100, },
%<ptm>     5 = {50,  },
%<bch>     6 = {50,  },
%<cmr>     6 = {100, },
%<bch|pad|ptm>     7 = {100, },
%<cmr>     7 = {200,-150},
%<pmn>     7 = {20,  },
%<ppl>     7 = {50,  },
%<cmr>     8 = {50,-50},
%<cmr>     9 = {100,-100},
%<m-t|cmr|pad|pmn|ppl>     . = { ,500},
%<bch|ptm>     . = { ,700},
%<m-t|cmr|pad|pmn|ppl>    {,}= { ,500},
%<bch>    {,}= { ,600},
%<ptm>    {,}= { ,700},
%<m-t|cmr|pad|ppl>     : = { ,300},
%<bch>     : = { ,400},
%<pmn>     : = { ,200},
%<ptm>     : = { ,500},
%<m-t|cmr|pad|ppl>     ; = { ,300},
%<bch>     ; = { ,400},
%<pmn>     ; = { ,200},
%<ptm>     ; = { ,500},
%<ptm>     ! = { ,100},
%<bch>     ? = { ,200},
%<ptm>     ? = { ,100},
%<ppl>     ? = { ,300},
%<pmn>     " = {400,200},
%<m-t|bch|pmn>     _ = {  ,100},
%<cmr>     _ = {100,200},
%<pad|ppl|ptm>     _ = {100,100},
%<m-t|pad|pmn|ppl|ptm>     & = {50,50},
%<bch>     & = {  ,80},
%<cmr>     & = {100,50},
%<m-t|cmr|pad|pmn>   037 = {100, },
%<bch>   037 = {50,50},
%<ppl|ptm>   037 = {100,100},
%<m-t|pmn|ppl>     * = {200,200},
%<bch>     * = {300,200},
%<cmr>     * = {400,100},
%<pad>     * = {500,100},
%<ptm>     * = {400,200},
%<m-t|cmr|pmn|ppl>     + = {150,200},
%<bch>     + = {250,250},
%<pad|ptm>     + = {250,200},
%<m-t|pad|pmn|ppl>     @ = {50,50},
%<bch>     @ = {80,50},
%<cmr>     @ = {200,50},
%<ptm>     @ = {150,150},
%<m-t|bch>     ~ = {150,150},
%<cmr|pad|pmn|ppl|ptm>     ~ = {200,150},
     ( = {200, },     ) = {   ,200},
%<m-t|cmr|pad|ppl|ptm>     \ = {100,200},   / = {100,200},
%<bch>     \ = {150,150},   / = {  ,150},
%<pmn>     \ = {100,150},   / = {100,150},
%<m-t>     - = {300,300},
%<bch|pad>     - = {300,400},
%<pmn>     - = {200,300},
%<cmr>     - = {500,300},
%<ppl>     - = {300,500},
%<ptm>     - = {500,500},
%<m-t|pmn>     \textendash       = {200,200},   \textemdash        = {150,150},
%<bch>     \textendash       = {200,300},   \textemdash        = {150,200},
%<cmr|pad|ppl|ptm>     \textendash       = {300,300},   \textemdash        = {200,200},
%<m-t|bch|pmn>     \textquoteleft    = {400,200},   \textquoteright    = {400,200},
%<cmr|pad>     \textquoteleft    = {800,200},   \textquoteright    = {800,200},
%<ppl>     \textquoteleft    = {700,400},   \textquoteright    = {700,400},
%<ptm>     \textquoteleft    = {800,500},   \textquoteright    = {800,500},
%<m-t|bch|pmn>     \textquotedblleft = {400,200},   \textquotedblright = {400,200},
%<cmr>     \textquotedblleft = {700,100},   \textquotedblright = {500,300},
%<pad>     \textquotedblleft = {700,200},   \textquotedblright = {700,200},
%<ppl>     \textquotedblleft = {500,300},   \textquotedblright = {500,300},
%<ptm>     \textquotedblleft = {700,400},   \textquotedblright = {700,400},
%<*cmr>
   "00 = {200,150}, % \Gamma
   "01 = {150,100}, % \Delta
   "02 = {150, 50}, % \Theta
   "03 = {150, 50}, % \Lambda
   "04 = {100,100}, % \Xi
   "05 = {100,100}, % \Pi
   "06 = {100, 50}, % \Sigma
   "07 = {200,150}, % \Upsilon
   "08 = {150, 50}, % \Phi
   "09 = {150,100}, % \Psi
   "0A = { 50, 50}, % \Omega
%</cmr>
   }

\SetProtrusion
%<m-t>   [ name     = T1-it-default,
%<bch>   [ name     = bch-it-T1,
%<cmr>   [ name     = cmr-it-T1,
%<pad>   [ name     = pad-it-T1,
%<pmn>   [ name     = pmnj-it-T1,
%<ppl>   [ name     = ppl-it-T1,
%<ptm>   [ name     = ptm-it-T1,
%<m-t>     load     = OT1-it   ]
%<bch>     load     = bch-it   ]
%<cmr>     load     = cmr-it   ]
%<pmn>     load     = pmnj-it  ]
%<pad>     load     = pad-it   ]
%<ppl>     load     = ppl-it   ]
%<ptm>     load     = ptm-it   ]
   { encoding = {T1,LY1},
%<bch>     family   = bch,
%<cmr>     family   = cmr,
%<pmn>     family   = pmnj,
%<pad>     family   = {pad,padx,padj},
%<ppl>     family   = {ppl,pplx,pplj},
%<ptm>     family   = {ptm,ptmx,ptmj},
     shape    = {it,sl}  }
   {
%<cmr>     \textquotedblleft = {500,300},
%<pmn>     188 = {  ,-30}, % ij
%<pmn>     031 = { ,-100}, % ffl
%<cmr|ptm>     156 = {100, },  % IJ
%<pad>     156 = {50,  },  % IJ
%<pmn>     156 = {20,  },  % IJ
%<pmn>   \v{t} = { ,100},
%<m-t|ptm>     \quotesinglbase   = {300,700},   \quotedblbase      = {400,500},
%<cmr>     \quotesinglbase   = {300,700},   \quotedblbase      = {200,600},
%<bch|pmn>     \quotesinglbase   = {200,500},   \quotedblbase      = {150,500},
%<pad|ppl>     \quotesinglbase   = {500,500},   \quotedblbase      = {400,400},
%<m-t|ppl|ptm>     \guilsinglleft    = {400,400},   \guilsinglright    = {300,500},
%<bch|pmn>     \guilsinglleft    = {300,400},   \guilsinglright    = {200,500},
%<cmr>     \guilsinglleft    = {500,300},   \guilsinglright    = {400,400},
%<pad>     \guilsinglleft    = {500,400},   \guilsinglright    = {300,500},
%<m-t|ppl>     \guillemotleft    = {300,300},   \guillemotright    = {300,300},
%<bch|pmn>     \guillemotleft    = {200,300},   \guillemotright    = {150,400},
%<cmr>     \guillemotleft    = {400,100},   \guillemotright    = {200,300},
%<pad>     \guillemotleft    = {300,300},   \guillemotright    = {200,400},
%<ptm>     \guillemotleft    = {300,400},   \guillemotright    = {200,400},
%<m-t|pad|ppl>     \textexclamdown   = {100,   },   \textquestiondown  = {200,   },
%<cmr|ptm>     \textexclamdown   = {200,   },   \textquestiondown  = {200,   },
%<pmn>     \textexclamdown   = {-50,   },   \textquestiondown  = {-50,   },
%<m-t|ppl>     \textbraceleft    = {200,100},   \textbraceright    = {200,200},
%<bch|pmn>     \textbraceleft    = {200,   },   \textbraceright    = {   ,200},
%<cmr|pad|ptm>     \textbraceleft    = {400,100},   \textbraceright    = {200,200},
%<bch|pmn>     \textless         = {100,   },   \textgreater       = {   ,100},
%<cmr|pad|ppl|ptm>     \textless         = {300,100},   \textgreater       = {200,100},
%<pmn>     \textvisiblespace = {100,100},
   }

%<*cmr>
\SetProtrusion
   [ name     = lmr-it-T1,
     load     = cmr-it-T1 ]
   { encoding = {T1,LY1},
     family   = lmr,
     shape    = {it,sl} }
   {
     \textquotedblleft = {700,100},
     \quotedblbase     = {600,300},
   }

%    \end{macrocode}
% Oldstyle numerals are slightly different.
%    \begin{macrocode}
\SetProtrusion
   [ name = cmr(oldstyle)-it,
     load = cmr-it-T1 ]
   { encoding = T1,
     family   = {hfor,cmor},
     shape    = {it,sl}  }
   {
     1 = {250, 50},
     2 = {150,-100},
     3 = {100,-50},
     4 = {150,150},
     6 = {200,   },
     7 = {200, 50},
     8 = {150,-50},
     9 = {100, 50},
   }

%</cmr>
%<*pmn>
\SetProtrusion
   [ name     = pmnx-it,
     load     = pmnj-it ]
   { encoding = OT1,
     family   = pmnx,
     shape    = {it,sl} }
   {
     1 = {100,150},
   }

\SetProtrusion
   [ name     = pmnx-it-T1,
     load     = pmnj-it-T1 ]
   { encoding = {T1,LY1},
     family   = pmnx,
     shape    = {it,sl} }
   {
     1 = {100,150},
   }

%</pmn>
%    \end{macrocode}
%\subsubsection{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.
%    \begin{macrocode}
\SetProtrusion
%<m-t>   [ name     = OT1-sc,
%<bch>   [ name     = bch-sc,
%<cmr>   [ name     = cmr-sc,
%<pad>   [ name     = pad-sc,
%<pmn>   [ name     = pmnj-sc,
%<ppl>   [ name     = ppl-sc,
%<ptm>   [ name     = ptm-sc,
%<m-t>     load     = default ]
%<bch>     load     = bch-default ]
%<cmr>     load     = cmr-default ]
%<pad>     load     = pad-default ]
%<pmn>     load     = pmnj-default ]
%<ppl>     load     = ppl-default ]
%<ptm>     load     = ptm-default ]
   { encoding = OT1,
%<bch>     family   = bch,
%<cmr>     family   = cmr,
%<pad>     family   = {pad,padx,padj},
%<pmn>     family   = pmnj,
%<ppl>     family   = {ppl,pplx,pplj},
%<ptm>     family   = {ptm,ptmx,ptmj},
     shape    = sc }
   {
     a = {50,50},
%<cmr|pad|ppl|ptm>   \ae = {50,  },
%<bch|pmn>     c = {50,  },
%<bch|pad|pmn>     d = {  ,50},
%<m-t|bch|cmr|pad|pmn|ptm>     f = {  ,50},
%<bch|pad|pmn>     g = {50,  },
%<m-t|cmr|pad|pmn|ppl|ptm>     j = {50,  },
%<bch>     j = {100,  },
%<m-t|bch|cmr|pad|pmn|ppl>     l = {  ,50},
%<ptm>     l = {  ,80},
%<m-t|bch|cmr|pad|pmn|ppl>   013 = { 0,50}, % fl
%<ptm>   013 = { 0,80}, % fl
%<bch|pad|pmn>     o = {50,50},
%<bch|pad|pmn>   \oe = {50,  },
%<ppl>     p = { 0, 0},
%<bch|pad|pmn>     q = {50,70},
%<ppl>     q = { 0,  },
%<m-t|cmr|pad|pmn|ppl|ptm>     r = {  , 0},
     t = {50,50},
%<m-t|bch|cmr|pad|pmn|ppl>     y = {50,50},
%<ptm>     y = {80,80},
   }

\SetProtrusion
%<m-t>   [ name     = T1-sc,
%<bch>   [ name     = bch-sc-T1,
%<cmr>   [ name     = cmr-sc-T1,
%<pad>   [ name     = pad-sc-T1,
%<pmn>   [ name     = pmnj-sc-T1,
%<ppl>   [ name     = ppl-sc-T1,
%<ptm>   [ name     = ptm-sc-T1,
%<m-t>     load     = T1-default ]
%<bch>     load     = bch-T1     ]
%<cmr>     load     = cmr-T1     ]
%<pad>     load     = pad-T1     ]
%<pmn>     load     = pmnj-T1    ]
%<ppl>     load     = ppl-T1     ]
%<ptm>     load     = ptm-T1     ]
   { encoding = {T1,LY1},
%<bch>     family   = bch,
%<cmr>     family   = cmr,
%<pad>     family   = {pad,padx,padj},
%<pmn>     family   = pmnj,
%<ppl>     family   = {ppl,pplx,pplj},
%<ptm>     family   = {ptm,ptmx,ptmj},
     shape    = sc }
   {
     a = {50,50},
%<cmr|pad|ppl|ptm>   \ae = {50,  },
%<bch|pmn>     c = {50,  },
%<bch|pad|pmn>     d = {  ,50},
%<m-t|bch|cmr|pad|pmn|ptm>     f = {  ,50},
%<bch|pad|pmn>     g = {50,  },
%<m-t|cmr|pad|pmn|ppl|ptm>     j = {50,  },
%<bch>     j = {100,  },
%<m-t|bch|cmr|pad|pmn|ppl>     l = {  ,50},
%<ptm>     l = {  ,80},
%<m-t|bch|cmr|pad|pmn|ppl>   029 = {  ,50}, % fl
%<ptm>   029 = {  ,80}, % fl
%<bch|pad|pmn>     o = {50,50},
%<bch|pad|pmn>   \oe = {50,  },
%<ppl>     p = { 0, 0},
%<bch|pad|pmn>     q = {50,70},
%<ppl>     q = { 0,  },
%<m-t|cmr|pad|pmn|ppl|ptm>     r = {  , 0},
     t = {50,50},
%<m-t|bch|cmr|pad|pmn|ppl>     y = {50,50},
%<ptm>     y = {80,80},
   }

%<*pmn>
\SetProtrusion
   [ name     = pmnx-sc,
     load     = pmnj-sc ]
   { encoding = OT1,
     family   = pmnx,
     shape    = sc }
   {
     1 = {230,180},
   }

\SetProtrusion
   [ name     = pmnx-sc-T1,
     load     = pmnj-sc-T1 ]
   { encoding = {T1,LY1},
     family   = pmnx,
     shape    = sc }
   {
     1 = {230,180},
   }

%    \end{macrocode}
% Minion provides real small caps in italics.
%    \begin{macrocode}
\SetProtrusion
   [ name     = pmnj-scit,
     load     = pmnj-it   ]
   { encoding = OT1,
     family   = pmnj,
     shape    = {scit,si} }
   {
     a = {50,  },
   \ae = {  ,-50},
     b = {20,-50},
     c = {50,-50},
     d = {20, 0},
     e = {20,-50},
     f = {10, 0},
   012 = {10,-50}, % fi
   013 = {10,-50}, % fl
   014 = {10,-50}, % ffi
   015 = {10,-50}, % ffl
     g = {50,-50},
     i = {20,-50},
     j = {20, 0},
     k = {20,  },
     l = {20,50},
     m = {  ,-30},
     n = {  ,-30},
     o = {50,  },
   \oe = {50,-50},
     p = {20,-50},
     q = {50,  },
     r = {20, 0},
     s = {20,-30},
     t = {70,  },
     u = {50,-50},
     v = {100,  },
     w = {100,  },
     y = {50,  },
     z = {  ,-50},
   }

\SetProtrusion
   [ name     = pmnj-scit-T1,
     load     = pmnj-it-T1   ]
   { encoding = {T1,LY1},
     family   = pmnj,
     shape    = {scit,si}    }
   {
     a = {50,  },
   \ae = {  ,-50},
     b = {20,-50},
     c = {50,-50},
     d = {20, 0},
     e = {20,-50},
     f = {10, 0},
   028 = {10,-50}, % fi
   029 = {10,-50}, % fl
   030 = {10,-50}, % ffi
   031 = {10,-50}, % ffl
     g = {50,-50},
     i = {20,-50},
   188 = {20, 0},  % ij
     j = {20, 0},
     k = {20,  },
     l = {20,50},
     m = {  ,-30},
     n = {  ,-30},
     o = {50,  },
   \oe = {50,-50},
     p = {20,-50},
     q = {50,  },
     r = {20, 0},
     s = {20,-30},
     t = {70,  },
     u = {50,-50},
     v = {100,  },
     w = {100,  },
     y = {50,  },
     z = {  ,-50},
   }

\SetProtrusion
   [ name     = pmnx-scit,
     load     = pmnj-scit ]
   { encoding = OT1,
     family   = pmnx,
     shape    = {scit,si} }
   {
     1 = {100,150},
   }

\SetProtrusion
   [ name     = pmnx-scit-T1,
     load     = pmnj-scit-T1 ]
   { encoding = {T1,LY1},
     family   = pmnx,
     shape    = {scit,si}    }
   {
     1 = {100,150},
   }

%</pmn>
%    \end{macrocode}
%\subsubsection{\texttt{textcomp}}
% Finally the \tsOne\ encoding. Still very incomplete for Times and Palatino.
%\changes{v1.2}{2004/09/28}{added protrusion factors for Adobe Garamond and
%                           Computer Modern Roman in \tsOne\ encoding}
%    \begin{macrocode}
\SetProtrusion
%<m-t>   [ name     = textcomp ]
%<bch>   [ name     = bch-textcomp ]
%<cmr>   [ name     = cmr-textcomp ]
%<pad>   [ name     = pad-textcomp ]
%<pmn>   [ name     = pmn-textcomp ]
%<ppl>   [ name     = ppl-textcomp ]
%<ptm>   [ name     = ptm-textcomp ]
%<m-t>   { encoding = TS1      }
%<!m-t>   { encoding = TS1,
%<bch>     family   = bch }
%<cmr>     family   = cmr }
%<pad>     family   = {pad,padx,padj} }
%<pmn>     family   = {pmnx,pmnj} }
%<ppl>     family   = {ppl,pplx,pplj} }
%<ptm>     family   = {ptm,ptmx,ptmj} }
   {
%<cmr>     \textquotestraightbase = {300,300},
%<pad|pmn>     \textquotestraightbase = {400,400},
%<cmr|pmn>     \textquotestraightdblbase = {300,300},
%<pad>     \textquotestraightdblbase = {400,400},
%<bch|cmr|pad|pmn>     \texttwelveudash = {200,200},
%<bch|cmr|pad|pmn>     \textthreequartersemdash = {150,150},
%<cmr|pmn>     \textquotesingle = {300,400},
%<pad>     \textquotesingle = {400,500},
%<bch|cmr|pmn>     \textasteriskcentered = {200,300},
%<pad>     \textasteriskcentered = {300,300},
%<pmn>     \textfractionsolidus = {-200,-200},
%<cmr>     \textoneoldstyle = {100,100},
%<pmn>     \textoneoldstyle = {  ,50},
%<cmr>     \textthreeoldstyle = {  ,50},
%<pad|pmn>     \textthreeoldstyle = {50,  },
%<cmr>     \textfouroldstyle = {50,50},
%<pad|pmn>     \textfouroldstyle = {50,  },
%<cmr|pad|pmn>     \textsevenoldstyle = {50,80},
%<cmr>     \textlangle     = {400,   },
%<cmr>     \textrangle     = {   ,400},
%<m-t|bch|pmn|ptm>     \textminus      = {200,200},
%<cmr|pad|ppl>     \textminus      = {300,300},
%<bch|pad|pmn>     \textlbrackdbl = {100,  },
%<bch|pad|pmn>     \textrbrackdbl = {  ,100},
%<pmn>     \textasciigrave = {200,500},
%<bch|cmr|pad|pmn>     \texttildelow = {200,250},
%<pmn>     \textasciibreve = {300,400},
%<pmn>     \textasciicaron = {300,400},
%<pmn>     \textacutedbl = {200,300},
%<pmn>     \textgravedbl = {150,300},
%<bch|pmn>     \textdagger = {80,80},
%<cmr|pad>     \textdagger = {100,100},
%<cmr|pad|pmn>     \textdaggerdbl = {80,80},
%<bch>     \textbardbl = {100,100},
%<bch>     \textbullet = {200,200},
%<cmr|pad|pmn>     \textbullet = {  ,100},
%<bch|cmr|pmn>     \textcelsius = {50,  },
%<pad>     \textcelsius = {80,  },
%<bch>     \textflorin = {50,50},
%<pad>     \textflorin = { ,100},
%<pmn>     \textflorin = {50,100},
%<cmr>     \textcolonmonetary = {  ,50},
%<pad|pmn>     \textcolonmonetary = {50,  },
%<pmn>     \textinterrobang = {  ,100},
%<pmn>     \textinterrobangdown = {100,  },
%<m-t|pad|ptm>     \texttrademark  = {100,100},
%<bch>     \texttrademark  = {150,150},
%<cmr|ppl>     \texttrademark  = {200,200},
%<pmn>     \texttrademark  = {50,50},
%<bch>     \textcent = {50, },
%<bch>     \textsterling = {50,  },
%<bch>     \textbrokenbar = {200,200},
%<pmn>     \textasciidieresis = {300,400},
%<m-t|bch|cmr|pad|ptm>     \textcopyright  = {100,100},
%<pmn>     \textcopyright  = {100,150},
%<ppl>     \textcopyright  = {200,200},
%<bch|cmr>     \textordfeminine = {100,200},
%<pad|pmn>     \textordfeminine = {200,200},
%<bch|cmr|pad|pmn>     \textlnot = {200,  },
%<m-t|bch|cmr|pad|ptm>     \textregistered = {100,100},
%<pmn>     \textregistered = {50,150},
%<ppl>     \textregistered = {200,200},
%<pmn>     \textasciimacron = {150,200},
%<m-t|ppl|ptm>     \textdegree     = {300,300},
%<bch>     \textdegree     = {150,200},
%<cmr|pad>     \textdegree     = {400,400},
%<pmn>     \textdegree     = {150,400},
%<bch|cmr|pad|pmn>     \textpm = {150,200},
%<bch>     \texttwosuperior = {100,200},
%<cmr>     \texttwosuperior = {50,100},
%<pad|pmn>     \texttwosuperior = {200,200},
%<bch>     \textthreesuperior = {100,200},
%<cmr>     \textthreesuperior = {50,100},
%<pad|pmn>     \textthreesuperior = {200,200},
%<pmn>     \textasciiacute = {300,400},
%<bch>     \textmu = { ,100},
%<bch|pad|pmn>     \textparagraph = {  ,100},
%<bch|cmr|pad|pmn>     \textperiodcentered = {300,400},
%<bch>     \textonesuperior = {200,300},
%<cmr|pad|pmn>     \textonesuperior = {200,200},
%<bch|pad|pmn>     \textordmasculine = {200,200},
%<cmr>     \textordmasculine = {100,200},
%<bch|cmr|pmn>     \texteuro = {100,  },
%<pad>     \texteuro = {50,100},
%<bch>     \texttimes = {100,100},
%<cmr>     \texttimes = {150,250},
%<pad>     \texttimes = {100,150},
%<pmn>     \texttimes = {70,100},
%<bch|pad|pmn>     \textdiv = {150,200},
%<cmr>     \textdiv = {150,250},
   }

%<*cmr|pad|pmn>
\SetProtrusion
%<cmr>   [ name     = cmr-textcomp-it ]
%<pad>   [ name     = pad-textcomp-it ]
%<pmn>   [ name     = pmn-textcomp-it ]
   { encoding = TS1,
%<cmr>     family   = cmr,
%<pad>     family   = {pad,padx,padj},
%<pmn>     family   = {pmnx,pmnj},
     shape    = {it,sl} }
   {
%<cmr>     \textquotestraightbase = {300,600},
%<pad|pmn>     \textquotestraightbase = {400,400},
%<cmr>     \textquotestraightdblbase = {300,600},
%<pad>     \textquotestraightdblbase = {300,400},
%<pmn>     \textquotestraightdblbase = {300,300},
     \texttwelveudash = {200,200},
     \textthreequartersemdash = {150,150},
%<cmr>     \textquotesingle = {600,300},
%<pad>     \textquotesingle = {800,100},
%<pmn>     \textquotesingle = {300,200},
%<cmr>     \textasteriskcentered = {300,200},
%<pad>     \textasteriskcentered = {500,100},
%<pmn>     \textasteriskcentered = {200,300},
%<pmn>     \textfractionsolidus = {-200,-200},
%<cmr>     \textoneoldstyle = {100,50},
%<pad>     \textoneoldstyle = {100,  },
%<pmn>     \textoneoldstyle = {50,  },
%<pad>     \texttwooldstyle = {50,  },
%<pmn>     \texttwooldstyle = {-50,  },
%<cmr>     \textthreeoldstyle = {100,50},
%<pmn>     \textthreeoldstyle = {-100,  },
%<cmr>     \textfouroldstyle = {50,50},
%<pad>     \textfouroldstyle = {50,100},
%<cmr>     \textsevenoldstyle = {50,80},
%<pad>     \textsevenoldstyle = {50,  },
%<pmn>     \textsevenoldstyle = {20,  },
%<cmr>     \textlangle     = {400,   },
%<cmr>     \textrangle     = {   ,400},
%<cmr|pad>     \textminus      = {300,300},
%<pmn>     \textminus = {200,200},
%<pad|pmn>     \textlbrackdbl = {100,  },
%<pad|pmn>     \textrbrackdbl = {  ,100},
%<pmn>     \textasciigrave = {300,300},
     \texttildelow = {200,250},
%<pmn>     \textasciibreve = {300,300},
%<pmn>     \textasciicaron = {300,300},
%<pmn>     \textacutedbl = {200,300},
%<pmn>     \textgravedbl = {150,300},
%<cmr>     \textdagger = {100,100},
%<pad>     \textdagger = {200,100},
%<pmn>     \textdagger = {80,50},
%<cmr|pad>     \textdaggerdbl = {80,80},
%<pmn>     \textdaggerdbl = {80,50},
%<cmr>     \textbullet = {200,100},
%<pad>     \textbullet = {300, },
%<pmn>     \textbullet = {30,70},
%<cmr>     \textcelsius = {100,  },
%<pad>     \textcelsius = {200,  },
%<pmn>     \textcelsius = {50,-50},
%<pad>     \textflorin = {100, },
%<pmn>     \textflorin = {50,100},
%<cmr>     \textcolonmonetary = {150, },
%<pad>     \textcolonmonetary = {100,  },
%<pmn>     \textcolonmonetary = {50,-50},
%<cmr|pad>     \texttrademark  = {200, },
%<pmn>     \texttrademark  = {50,100},
%<pmn>     \textasciidieresis = {300,200},
%<cmr>     \textcopyright  = {100, },
%<pad>     \textcopyright  = {200,100},
%<pmn>     \textcopyright  = {100,150},
%<cmr>     \textordfeminine = {100,100},
%<pmn>     \textordfeminine = {200,200},
%<cmr|pad>     \textlnot = {300,  },
%<pmn>     \textlnot = {200,  },
%<cmr>     \textregistered = {100, },
%<pad>     \textregistered = {200,100},
%<pmn>     \textregistered = {50,150},
%<pmn>     \textasciimacron = {150,200},
%<cmr|pad>     \textdegree     = {500,100},
%<pmn>     \textdegree     = {150,150},
%<cmr>     \textpm = {150,100},
%<pad>     \textpm = {200,150},
%<pmn>     \textpm = {150,200},
%<cmr>     \textonesuperior = {400, },
%<pad>     \textonesuperior = {300,100},
%<pmn>     \textonesuperior = {200,100},
%<cmr>     \texttwosuperior = {400, },
%<pad>     \texttwosuperior = {300, },
%<pmn>     \texttwosuperior = {200,100},
%<cmr>     \textthreesuperior = {400, },
%<pad>     \textthreesuperior = {300, },
%<pmn>     \textthreesuperior = {200,100},
%<pmn>     \textasciiacute = {300,200},
%<cmr>     \textparagraph = {200,},
%<pmn>     \textparagraph = {  ,100},
%<cmr>     \textperiodcentered = {500,500},
%<pad|pmn>     \textperiodcentered = {300,400},
%<cmr>     \textordmasculine = {100,100},
%<pmn>     \textordmasculine = {200,200},
%<cmr>     \texteuro = {200, },
%<pad>     \texteuro = {100, },
%<pmn>     \texteuro = {100,-50},
%<cmr>     \texttimes = {200,200},
%<pad>     \texttimes = {200,100},
%<pmn>     \texttimes = {70,100},
%<cmr|pad>     \textdiv = {200,200},
%<pmn>     \textdiv = {150,200},
   }

%</cmr|pad|pmn>
%    \end{macrocode}
%\subsubsection{Math}
% Now to the math symbols for Computer Modern Roman. Definitions have been
% extracted from |fontmath.ltx|. Not all characters will be protruded on both
% sides (probably because of some restrictions in \pdftex\ (currently 1.20b)).
%\changes{v1.2}{2004/10/02}{added protrusion factors for Computer Modern Roman
%                           math symbols}
% 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:
%\begin{verbatim}
%\DeclareSymbolFont{operators}   {OT1}{cmr} {m}{n}
%\SetSymbolFont{operators}{bold}{OT1}{cmr} {bx}{n}
%\DeclareSymbolFontAlphabet{\mathrm}    {operators}
%\end{verbatim}
% The following alphabets are already set up, too:
%\begin{verbatim}
%\DeclareMathAlphabet      {\mathbf}{OT1}{cmr}{bx}{n}
%\DeclareMathAlphabet      {\mathit}{OT1}{cmr}{m}{it}
%\end{verbatim}
% while these aren't (and won't be, for now):
%\begin{verbatim}
%\DeclareMathAlphabet      {\mathsf}{OT1}{cmss}{m}{n}
%\DeclareMathAlphabet      {\mathtt}{OT1}{cmtt}{m}{n}
%\end{verbatim}
%
% Math font |letters| is declared as:
%\begin{verbatim}
%\DeclareSymbolFont{letters}     {OML}{cmm} {m}{it}
%\SetSymbolFont{letters}  {bold}{OML}{cmm} {b}{it}
%\DeclareSymbolFontAlphabet{\mathnormal}{letters}
%\end{verbatim}
% Since it may also be loaded under the name of |OML/cmr/bx/sc|, or whatever, we
% leave |series| and |shape| empty.
%\changes{v1.6}{2004/12/26}{protrusion: tune CMR math letters (OML encoding)}
%    \begin{macrocode}
%<*cmr>
\SetProtrusion
   [ name     = cmr-math-letters ]
   { encoding = OML,
     family   = {cmm,cmr} }
   {
     A = {100, 50}, % \mathnormal
     B = { 50,   },
     C = { 50,   },
     D = { 50, 50},
     E = { 50,   },
     F = {100, 50},
     G = { 50, 50},
     H = { 50, 50},
     I = { 50, 50},
     J = {150, 50},
     K = { 50,100},
     L = { 50, 50},
     M = { 50,   },
     N = { 50,   },
     O = { 50,   },
     P = { 50,   },
     Q = { 50, 50},
     R = { 50,   },
     S = { 50,   },
     T = { 50,100},
     U = { 50, 50},
     V = {100,100},
     W = { 50,100},
     X = { 50,100},
     Y = {100,100},
     f = {100,100},
     h = {   ,100},
     i = {   , 50},
     j = {   , 50},
     k = {   , 50},
     r = {   , 50},
     v = {   , 50},
     w = {   , 50},
     x = {   , 50},
   "0B = { 50,   }, % \alpha
   "0C = { 50,   }, % \beta
   "0D = {200,   }, % \gamma
   "0E = { 50,   }, % \delta
   "0F = { 50,   }, % \epsilon
   "10 = {100,   }, % \zeta
%  "11 = {   ,   }, % \eta
   "12 = { 50,   }, % \theta
%  "13 = {   ,   }, % \iota
%  "14 = {   ,   }, % \kappa
   "15 = {100,   }, % \lambda
%  "16 = {   ,   }, % \mu
   "17 = { 50,   }, % \nu
%  "18 = {   ,   }, % \xi
   "19 = { 50,   }, % \pi
   "1A = { 50,   }, % \rho
   "1B = { 50,   }, % \sigma
   "1C = { 50,   }, % \tau
   "1D = { 50,   }, % \upsilon
   "1E = { 50,   }, % \phi
   "1F = { 50,   }, % \chi
   "20 = { 50,   }, % \psi
%  "21 = {   ,   }, % \omega
%  "22 = {   ,   }, % \varepsilon
%  "23 = {   ,   }, % \vartheta
%  "24 = {   ,   }, % \varpi
   "25 = {100,   }, % \varrho
   "26 = {100,   }, % \varsigma
   "27 = { 50,   }, % \varphi
   "28 = {100,100}, % \leftharpoonup
   "29 = {100,100}, % \leftharpoondown
   "2A = {100,100}, % \rightharpoonup
   "2B = {100,100}, % \rightharpoondown
   "2C = {300,200}, % \lhook
   "2D = {200,300}, % \rhook
   "2E = {   ,100}, % \triangleright
   "2F = {100,   }, % \triangleleft
   % 0 - 9
   "3A = {   ,500}, % ., \ldotp
   "3B = {   ,500}, % ,
   "3C = {200,100}, % <
   "3D = {300,400}, % /
   "3E = {100,200}, % >
   "3F = {200,200}, % \star
%  "40 = {   ,   }, % \partial
   "5B = {   ,100}, % \flat
%  "5C = {   ,   }, % \natural
%  "5D = {   ,   }, % \sharp
   "5E = {200,200}, % \smile
   "5F = {200,200}, % \frown
%  "60 = {   ,   }, % \ell
%  "7B = {   ,   }, % \imath
   "7C = {100,   }, % \jmath
   "7D = {   ,100}, % \wp
   }

%    \end{macrocode}
% Math font |symbols| is declared as:
%\begin{verbatim}
%\DeclareSymbolFont{symbols}     {OMS}{cmsy}{m}{n}
%\SetSymbolFont{symbols}  {bold}{OMS}{cmsy}{b}{n}
%\DeclareSymbolFontAlphabet{\mathcal}   {symbols}
%\end{verbatim}
%    \begin{macrocode}
\SetProtrusion
   [ name     = cmr-math-symbols ]
   { encoding = OMS,
     family   = {cmsy,cmr} }
   {
     A = {150, 50}, % \mathcal
     C = {   ,100},
     D = {   , 50},
     F = { 50,100},
     J = {100,100},
     K = {   ,100},
     L = {100,   },
     M = { 50,   },
     N = { 50, 50},
     P = {   , 50},
     Q = { 50,   },
     T = { 50,100},
     X = {100,100},
     Y = {100,   },
     Z = {100,100},
   "00 = {300,300}, % -
   "01 = {   ,700}, % \cdot, \cdotp
   "02 = {150,250}, % \times
   "03 = {150,250}, % *, \ast
   "04 = {200,300}, % \div
   "05 = {150,250}, % \diamond
   "06 = {200,200}, % \pm
   "07 = {200,200}, % \mp
   "08 = {100,100}, % \oplus
   "09 = {100,100}, % \ominus
   "0A = {100,100}, % \otimes
   "0B = {100,100}, % \oslash
   "0C = {100,100}, % \odot
   "0D = {100,100}, % \bigcirc
   "0E = {100,100}, % \circ
   "0F = {100,100}, % \bullet
   "10 = {100,100}, % \asymp
   "11 = {100,100}, % \equiv
   "12 = {200,100}, % \subseteq
   "13 = {100,200}, % \supseteq
   "14 = {200,100}, % \leq
   "15 = {100,200}, % \geq
   "16 = {200,100}, % \preceq
   "17 = {100,200}, % \succeq
   "18 = {200,200}, % \sim
   "19 = {150,150}, % \approx
   "1A = {200,100}, % \subset
   "1B = {100,200}, % \supset
   "1C = {200,100}, % \ll
   "1D = {100,200}, % \gg
   "1E = {300,100}, % \prec
   "1F = {100,300}, % \succ
   "20 = {100,200}, % \leftarrow
   "21 = {200,100}, % \rightarrow
   "22 = {100,100}, % \uparrow
   "23 = {100,100}, % \downarrow
   "24 = {100,100}, % \leftrightarrow
   "25 = {100,100}, % \nearrow
   "26 = {100,100}, % \searrow
   "27 = {100,100}, % \simeq
   "28 = {100,100}, % \Leftarrow
   "29 = {100,100}, % \Rightarrow
   "2A = {100,100}, % \Uparrow
   "2B = {100,100}, % \Downarrow
   "2C = {100,100}, % \Leftrightarrow
   "2D = {100,100}, % \nwarrow
   "2E = {100,100}, % \swarrow
   "2F = {   ,100}, % \propto
   "30 = {   ,100}, % \prime
   "31 = {100,100}, % \infty
   "32 = {150,100}, % \in
   "33 = {100,150}, % \ni
   "34 = {100,100}, % \triangle, \bigtriangleup
   "35 = {100,100}, % \bigtriangledown
%  "36 = {   ,   }, % \not
%  "37 = {   ,   }, % \mapstochar
   "38 = {   ,100}, % \forall
   "39 = {100,   }, % \exists
   "3A = {200,   }, % \neg
%  "3B = {   ,   }, % \emptyset
%  "3C = {   ,   }, % \Re
%  "3D = {   ,   }, % \Im
   "3E = {200,200}, % \top
   "3F = {200,200}, % \bot, \perp
%  "40 = {   ,   }, % \aleph
%  "5B = {   ,   }, % \cup
%  "5C = {   ,   }, % \cap
%  "5D = {   ,   }, % \uplus
   "5E = {100,200}, % \wedge
   "5F = {100,200}, % \vee
   "60 = {   ,300}, % \vdash
   "61 = {300,   }, % \dashv
   "62 = {100,100}, % \lfloor
   "63 = {100,100}, % \rfloor
   "64 = {100,100}, % \lceil
   "65 = {100,100}, % \rceil
   "66 = {150,   }, % \lbrace
   "67 = {   ,150}, % \rbrace
   "68 = {200,   }, % \langle
   "69 = {   ,200}, % \rangle
%  "6A = {   ,   }, % \arrowvert, \mid, \vert, |
%  "6B = {   ,   }, % \Arrowvert, \parallel, \Vert
   "6C = {100,100}, % \updownarrow
   "6D = {100,100}, % \Updownarrow
   "6E = {100,300}, % \, \backslash, \setminus
%  "6F = {   ,   }, % \wr
%  "70 = {   ,   }, % \sqrtsign
%  "71 = {   ,   }, % \amalg
   "72 = {100,100}, % \nabla
%  "73 = {   ,   }, % \smallint
%  "74 = {   ,   }, % \sqcup
%  "75 = {   ,   }, % \sqcap
%  "76 = {   ,   }, % \sqsubseteq
%  "77 = {   ,   }, % \sqsupseteq
%  "78 = {   ,   }, % \mathsection
   "79 = {200,200}, % \dagger
   "7A = {100,100}, % \ddagger
   "7B = {100,   }, % \mathparagraph
   "7C = {100,100}, % \clubsuit
   "7D = {100,100}, % \diamondsuit
   "7E = {100,100}, % \heartsuit
   "7F = {100,100}, % \spadesuit
   }

%    \end{macrocode}
% 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:
%\begin{verbatim}
%\DeclareSymbolFont{largesymbols}{OMX}{cmex}{m}{n}
%\end{verbatim}
%    \begin{macrocode}
%\SetProtrusion
%   [ name     = cmr-math-largesymbols ]
%   { encoding = OMX,
%     family   = {cmex,cmr} }
%   {
%     "00 % (
%     "01 % )
%     "02 % [
%     "03 % ]
%     "04 % \lfloor
%     "05 % \rfloor
%     "06 % \lceil
%     "07 % \rceil
%     "08 % \lbrace
%     "09 % \rbrace
%     "0A % <, \langle
%     "0B % >, \rangle
%     "0C % \vert, |
%     "0D % \Vert
%     "0E % /
%     "0F % \backslash
%     "3A % \lgroup
%     "3B % \rgroup
%     "3C % \arrowvert
%     "3D % \Arrowvert
%     "3E % \bracevert
%     "3F % \updownarrow
%     "40 % \lmoustache
%     "41 % \rmoustache
%     "46 % \bigsqcup
%     "48 % \ointop
%     "4A % \bigodot
%     "4C % \bigoplus
%     "4E % \bigotimes
%     "50 % \sum
%     "51 % \prod
%     "52 % \intop
%     "53 % \bigcup
%     "54 % \bigcap
%     "55 % \biguplus
%     "56 % \bigwedge
%     "57 % \bigvee
%     "60 % \coprod
%     "70 % \sqrtsign
%     "77 % \Updownarrow
%     "78 % \uparrow
%     "79 % \downarrow
%     "7A % \braceld, \lmoustache
%     "7B % \bracerd, \rmoustache
%     "7C % \bracelu
%     "7D % \braceru
%     "7E % \Uparrow
%     "7F % \Downarrow
%   }
%</cmr>
%</config>
%    \end{macrocode}
%
%\section{Auxiliary file for micro-fine tuning}
% This file can be used to test protrusion and expansion settings.
%    \begin{macrocode}
%<*test>
\documentclass{article}

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

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

\pagestyle{empty}
\setlength{\parindent}{0pt}
\newcommand{\crulefill}{\cleaders\hbox{$\mkern-2mu\smash-\mkern-2mu$}\hfill}
\newcommand{\testprotrusion}[2][]{%
  \ifthenelse{\equal{#1}{r}}{}{#2}%
   lorem ipsum dolor sit amet,
     \ifthenelse{\equal{#1}{r}}{\crulefill}{\leftarrowfill} #2
     \ifthenelse{\equal{#1}{l}}{\crulefill}{\rightarrowfill}
   you know the rest%
  \ifthenelse{\equal{#1}{l}}{}{#2}%
   \linebreak
  {\fontencoding{\encodingdefault}%
   \fontseries{\seriesdefault}%
   \fontshape{\shapedefault}%
   \selectfont
   Here is the beginning of a line, \dotfill and here is its end}\linebreak
}
\newcommand{\showTestFont}{\expandafter\stripprefix\meaning\TestFont}
\def\stripprefix#1>{}
\newcount\charcount
\begin{document}
\microtypesetup{expansion=false}

{\centering The font in this document is called by:\\
 \texttt{\showTestFont}\par}\bigskip

\TestFont\selectfont
 This line intentionally left empty\linebreak
%% A -- Z
\charcount=65
\loop
   \testprotrusion{\char\charcount}
   \advance\charcount 1
   \ifnum\charcount < 91 \repeat
%% a -- z
\charcount=97
\loop
   \testprotrusion{\char\charcount}
   \advance\charcount 1
   \ifnum\charcount < 123 \repeat
%% 0 -- 9
\charcount=48
\loop
   \testprotrusion{\char\charcount}
   \advance\charcount 1
   \ifnum\charcount < 58 \repeat
%%
 \testprotrusion[r]{,}
 \testprotrusion[r]{.}
 \testprotrusion[r]{;}
 \testprotrusion[r]{:}
 \testprotrusion[r]{?}
 \testprotrusion[r]{!}
 \testprotrusion[l]{\textexclamdown}
 \testprotrusion[l]{\textquestiondown}
 \testprotrusion[r]{)}
 \testprotrusion[l]{(}
 \testprotrusion{/}
 \testprotrusion{\char`\\}
 \testprotrusion{-}
 \testprotrusion{\textendash}
 \testprotrusion{\textemdash}
 \testprotrusion{\textquoteleft}
 \testprotrusion{\textquoteright}
 \testprotrusion{\textquotedblleft}
 \testprotrusion{\textquotedblright}
 \testprotrusion{\quotesinglbase}
 \testprotrusion{\quotedblbase}
 \testprotrusion{\guilsinglleft}
 \testprotrusion{\guilsinglright}
 \testprotrusion{\guillemotleft}
 \testprotrusion{\guillemotright}

\bigskip
The following displays the current font stretched by 5\%,
normal, and shrunk by 5\%:

\microtypesetup{expansion=true}

\bigskip
\newlength{\MTln}
\newcommand{\teststring}
   {ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789}
\settowidth{\MTln}{\teststring}

\parbox{1.05\MTln}{\teststring\linebreak\\
                   \teststring}\par\bigskip
\parbox{0.95\MTln}{\teststring}
\end{document}
%</test>
%    \end{macrocode}
%
% ^^A -------------------------------------------------------------------------
% Needless to say that things may always be improved. For suggestions, mail to
% \mailtoRS.
%
% ^^A -------------------------------------------------------------------------
%
% \CharacterTable
%  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
%   Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
%   Digits        \0\1\2\3\4\5\6\7\8\9
%   Exclamation   \!     Double quote  \"     Hash (number) \#
%   Dollar        \$     Percent       \%     Ampersand     \&
%   Acute accent  \'     Left paren    \(     Right paren   \)
%   Asterisk      \*     Plus          \+     Comma         \,
%   Minus         \-     Point         \.     Solidus       \/
%   Colon         \:     Semicolon     \;     Less than     \<
%   Equals        \=     Greater than  \>     Question mark \?
%   Commercial at \@     Left bracket  \[     Backslash     \\
%   Right bracket \]     Circumflex    \^     Underscore    \_
%   Grave accent  \`     Left brace    \{     Vertical bar  \|
%   Right brace   \}     Tilde         \~}
%
% \CheckSum{4000}
%
% \Finale
%
\endinput
%
