%\iffalse meta-comment
% !Mode:: "TeX:DTX:UK"
% !smartQuote:: "English"
% !DTXversion:: "2.8"
% ------------------------------------------------------------------------
%                       The `microtype' package
%         Subliminal refinements towards typographical perfection
%           Copyright (c) 2004--2020 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.3c 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.3c or later is part
% of all distributions of LaTeX version 2005/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 files microtype.sty, microtype-pdftex.def, microtype-luatex.def,
% microtype-xetex.def, microtype.lua and letterspace.sty.
%
% Modified versions of the configuration files (*.cfg) may be distributed
% provided that: (1) the original copyright statement is not removed, and
% (2) the identification string is changed.
% ------------------------------------------------------------------------
%
%<package|letterspace>\NeedsTeXFormat{LaTeX2e}
%<*driver>
\ProvidesFile{\jobname.dtx}
%</driver>
%<package|letterspace>\ProvidesPackage
%<config|pdftex-def|luatex-def|xetex-def>\ProvidesFile
%<package>  {microtype}
%<letterspace>  {letterspace}
%<m-t>  {microtype.cfg}
%<pdftex-def>  {microtype-pdftex.def}
%<luatex-def>  {microtype-luatex.def}
%<xetex-def>  {microtype-xetex.def}
%<*package|letterspace|m-t|pdftex-def|luatex-def|xetex-def>
  [2020/12/07 v2.8
%<package>   Micro-typographical refinements
%<letterspace>   Robust letterspacing
%<m-t>   microtype main configuration file
%<pdftex-def|luatex-def|xetex-def>   Definitions specific to
%<pdftex-def>   pdftex
%<luatex-def>   luatex
%<xetex-def>   xetex
   (RS)]
%</package|letterspace|m-t|pdftex-def|luatex-def|xetex-def>
%<luafile>microtype        = microtype or {}
%<luafile>local microtype  = microtype
%<luafile>microtype.module = {
%<luafile>    name         = "microtype",
%<luafile>    version      = "2.8",
%<luafile>    date         = "2020/12/07",
%<luafile>    description  = "microtype module.",
%<luafile>    author       = "E. Roux, R. Schlicht and P. Gesang",
%<luafile>    copyright    = "E. Roux, R. Schlicht and P. Gesang",
%<luafile>    license      = "LPPL",
%<luafile>}
%<*config>
%<bch>  {mt-bch.cfg}[2007/03/03 v1.5 microtype config. file: Bitstream Charter (RS)]
%<blg>  {mt-blg.cfg}[2007/07/14 v1.0 microtype config. file: Bitstream Letter Gothic (RS)]
%<cmr>  {mt-cmr.cfg}[2013/05/19 v2.2 microtype config. file: Computer Modern Roman (RS)]
%<pad>  {mt-pad.cfg}[2005/11/07 v1.5 microtype config. file: Adobe Garamond (RS)]
%<pmn>  {mt-pmn.cfg}[2009/11/14 v1.3 microtype config. file: Adobe Minion (HH/KK)]
%<ppl>  {mt-ppl.cfg}[2005/11/16 v1.6 microtype config. file: Palatino (RS)]
%<ptm>  {mt-ptm.cfg}[2006/04/20 v1.7 microtype config. file: Times (RS)]
%<ugm>  {mt-ugm.cfg}[2006/01/26 v1.0 microtype config. file: URW Garamond (RS)]
%<msa>  {mt-msa.cfg}[2006/02/04 v1.1 microtype config. file: AMS symbols (a) (RS)]
%<msb>  {mt-msb.cfg}[2005/06/01 v1.0 microtype config. file: AMS symbols (b) (RS)]
%<euf>  {mt-euf.cfg}[2006/07/03 v1.1 microtype config. file: AMS Euler Fraktur (RS)]
%<eur>  {mt-eur.cfg}[2006/07/31 v1.1 microtype config. file: AMS Euler Roman (RS)]
%<eus>  {mt-eus.cfg}[2006/07/28 v1.2 microtype config. file: AMS Euler Script (RS)]
%<zpeu>  {mt-zpeu.cfg}[2006/05/04 v1.0 microtype config. file: Adobe Euro (RS)]
%<euroitc>  {mt-euroitc.cfg}[2006/05/04 v1.0 microtype config. file: ITC Euro (RS)]
%<mvs>  {mt-mvs.cfg}[2006/07/05 v1.1 microtype config. file: Marvosym Euro (RS)]
%</config>
%
%<*driver|docsty>
%<*driver>
\documentclass[10pt,a4paper]{ltxdoc}
\makeatletter
%</driver>
% Let's abolish CM! We use Charter and Letter Gothic
% (for the pre-built documentation on CTAN):
\usepackage[T1]{fontenc}
\usepackage[charter]{mathdesign}
 \def\rmdefault{bch} % not scaled
 \def\sfdefault{SourceSansPro-TLF}
 \def\SourceSansPro@scale{1.02}
 \def\ttdefault{blg}
 {\ttfamily\selectfont
  \DeclareFontShape{T1}{blg}{eb}{n}{<-> ssub * blg/b/n}{}}
\usepackage{textcomp}
\usepackage{iftex}
%<*!docsty>
\ifxetex\else
\usepackage[latin1]{\ifluatex lua\fi inputenc}
\fi
%</!docsty>
\GetFileInfo{\jobname.dtx}
\usepackage[expansion=false,kerning=true]{microtype}[\filedate]
 \DeclareMicrotypeSet*[protrusion]
      { doc }
      { encoding = {*, TS1, OMS},
        family   = {rm*, tt*},
        size     = {footnotesize, small, normalsize} }
 \SetProtrusion
      { encoding = OMS,
        family   = mdbch }
      { "68 = {400, },  % \langle
        "69 = { ,400} } % \rangle
 \DeclareMicrotypeSet*[kerning]
      { doc }
      { encoding = T1,
        family   = blg, % typewriter font and ...
        font     = * }  % French sample in section \ref{sub:kerning}
 \SetExtraKerning
      { encoding = T1,
        family   = blg }
      { _ = {100,100} } % underscores shouldn't touch
\ifxetex\else
 % disable ?` and !` ligatures (sample in section \ref{sec:disable-ligatures})
 \DisableLigatures[?,!]{encoding = *, family = rm* }
\fi
 % Fraktur sample in section \ref{sec:lettersp}
 \IfFileExists{t1mwr.fd}
   {\def\textfrak##1{{\fontfamily{mwr}\selectfont ##1}}
    \ifpdf
      \SetTracking[no ligatures={f,s,c}]{encoding=T1,family=mwr}{120}
    \fi}
   {\IfFileExists{yfonts.sty}
     {\usepackage{yfonts}
      \ifpdf
        \SetTracking[no ligatures={f,s,c}]{encoding=LY,family=yfrak}{120}
      \fi}
     {\def\textfrak{\rule{.5em}{1.5ex}\@gobble}}}
\ifpdftex\else
  \microtypesetup{kerning=false}
\fi
\tolerance=700
\ifpdf
  \ifluatex % microtype.dtx finally compiles with 0.35!
    \def\pdftexversion{200} % in TeX Live 2015, they let this to \luatexversion
    \let\pdfxform                    \saveboxresource
    \let\pdflastxform                \lastsavedboxresourceindex
    \protected\edef\pdfminorversion  {\pdfvariable minorversion}
    \protected\def\pdfobj            {\pdfextension obj }
    \protected\def\pdfcatalog        {\pdfextension catalog }
    \protected\def\pdfannot          {\pdfextension annot }
    \protected\def\pdfoutline        {\pdfextension outline }
    \protected\def\pdfmapline        {\pdfextension mapline }
    \protected\def\pdfglyphtounicode {\pdfextension glyphtounicode }
    \protected\def\pdflastobj        {\numexpr\pdffeedback lastobj\relax}
  \fi
  \ifnum\pdftexversion<140 \else % pdftex 1.40, including textmatrix patch,
    \microtypesetup{expansion=alltext,step=1} % hence we can activate expansion ...
    \tolerance=300         % ... and make TeX almost as intolerant as it normally is
    \g@addto@macro\macrocode{\microtypesetup{expansion=false}}
    \pdfminorversion=5 % for the OCGs (default since TeX Live 2010)
  \fi
  % bonus material
  \InputIfFileExists{microtype-logo.dtx}\relax\relax
  \InputIfFileExists{microtype-lssample.dtx}\relax\relax
\else
  \ifluatex\else
    \let\lsstyle\relax
  \fi
\fi
\usepackage{booktabs}
\usepackage{array}
 \newcolumntype{L}[1]{p{#1}<{\raggedright}}
\usepackage{color}
 \definecolor{thered}    {rgb} {0.65,0.04,0.07}
 \definecolor{thegreen}  {rgb} {0.06,0.44,0.08}
 \definecolor{theblue}   {rgb} {0.02,0.04,0.48}
 \definecolor{sectioning}{gray}{0.44}
 \definecolor{thegrey}   {gray}{0.5}
 \definecolor{theframe}  {gray}{0.75}
 \definecolor{theshade}  {gray}{0.94}
\usepackage{graphicx}
% general layout
\frenchspacing
\DeclareRobustCommand\textoractual[2]{\ifpdf
  \pdfliteral direct{/Span<</ActualText(#2)>>BDC}#1\pdfliteral direct{EMC}%
  \else #1\fi}
\expandafter\newif\csname ifcmr\endcsname
\long\def\@tempa{cmr}
\ifx\rmdefault\@tempa
  \cmrtrue
  \def\PackageFont{\sffamily}
  \def\match{\textbullet}
  \usepackage{amssymb} % \varnothing
  \expandafter\let\expandafter\OrigTeX\csname TeX \endcsname
  \DeclareRobustCommand\TeX{\textoractual{\OrigTeX}{TeX}}
  \setlength\textheight{49\baselineskip}
\else
  \let\bfdefault\bfdefault@previous % undo mathdesign's \def\bdefault{b}
  \def\Module#1{{\color{theblue}\textoractual{$\langle$}{<}\textit{#1}\textoractual{$\rangle$}{>}}}
  \DeclareRobustCommand\TeX{\textoractual{T\kern-.1em\lower.4ex\hbox{E}\kern-.075emX\@}{TeX}}
  \DeclareRobustCommand\LaTeX{\textoractual{L\kern-.26em{\sbox\z@ T\vbox to\ht\z@{%
     \hbox{\check@mathfonts\fontsize\sf@size\z@\math@fontsfalse\selectfont A}%
    \vss}}}{La}\kern-.075em\TeX}
  \def\PackageFont{\ttfamily}
  \def\match{{\large\raisebox{-.15em}{\textbullet}}}
  {\catcode`\`=\active % indiscernible from ' in Bitstream Letter Gothic
   \g@addto@macro\macro@code{\let`\textasciigrave}}
  \DeclareEncodingSubset{TS1}{blg}{1} % for \textasciigrave
  \linespread{1.07}\normalfont
  \setlength\textheight{48\baselineskip}
\fi
\addtolength\textheight{\topskip}
\setlength\topmargin{5pt}
% sections
%\def\@seccntformat#1{\setbox0\hbox to0pt{\hss\colorbox{theshade}{\space\color{sectioning}\csname the#1\endcsname\strut\space}\hskip\marginparsep}\ht0=0pt \dp0=0pt \box0}
\def\@seccntformat#1{\llap{\csname the#1\endcsname\hskip\marginparsep}}
\def\section{\@startsection {section}{1}{\z@}%
  {-3.5ex \@plus -1ex \@minus -.2ex}%
  {2.3ex \@plus.2ex}%
  {\normalfont\Large\ifcmr\fontseries{bx}\else\fontseries{eb}\fi\sffamily\color{sectioning}}}
\def\subsection{\@startsection{subsection}{2}{\z@}%
  {-3.25ex\@plus -1ex \@minus -.2ex}%
  {1.5ex \@plus .2ex}%
  {\normalfont\large\ifcmr\fontseries{bx}\else\fontseries{eb}\fi\sffamily\color{sectioning}}}
\def\subsubsection{\@startsection{subsubsection}{3}{\z@}%
  {-3.25ex\@plus -1ex \@minus -.2ex}%
  {1.5ex \@plus .2ex}%
  {\normalfont\normalsize\ifcmr\fontseries{bx}\else\fontseries{eb}\fi\sffamily\color{sectioning}}}
\def\paragraph{\@startsection{paragraph}{4}%
  {0pt}{8pt plus 2pt minus 1pt}{-1em}%
  {\normalfont\normalsize\itshape}}
% title
\def\@maketitle{%
  \newpage\null\vskip 2em
  \begin{center}\let\footnote\thanks\sffamily
    {\huge \@title\par}\vskip 1.5em
    {\large \parbox{.33\textwidth}{\centering\@author}%
            \parbox{.33\textwidth}{\centering\@date}}%
  \vskip2.5em\rule{\textwidth}{.4pt}%
  \end{center}\par\vskip1.5em}
\def\abstractname{}
% headers
\headheight=15pt
\def\ps@MTheadings{%
  \def\@oddhead{%
    \hbox to\textwidth{\vbox{\hbox to\textwidth{%
      \footnotesize\sffamily{\leftmark\rightmark\strut}\hfill\thepage\strut}%
      \hrule height 0.4pt width\textwidth \vskip-0.4pt
    }}\hss}
  \let\@oddfoot\@empty
  \let\@mkboth\markboth
  \def\sectionmark##1{\markboth{\textls*[70]{\MakeUppercase{##1}}}{}}
  \def\subsectionmark##1{\markright{\,: ##1}}}
\pagestyle{MTheadings}
% toc
\let\l@section@\l@section
\def\l@section{\vskip -1.25ex\l@section@}
\def\l@subsection{\vskip.35ex \penalty\@secpenalty \@dottedtocline{2}{1.5em}{2.7em}}
\def\l@subsubsection#1#2{%
  \leftskip 4.2em
  \rightskip 2em plus 2em
  \parindent 0pt
  {\let\numberline\@gobble{\small #1~[#2]}}}
\def\l@table{\@dottedtocline{1}{0pt}{1.5em}}
\def\@pnumwidth{1.7em}
\ifpdf
  \let\ORIGpdfoutline\pdfoutline
  \def\special@outlines{attr{/F 01}}
  \def\normaloutline {\protected@write\@outlinefile{}{\let\pdfoutline \ORIGpdfoutline}}
  \def\specialoutline{\protected@write\@outlinefile{}{\def\pdfoutline{\ORIGpdfoutline\special@outlines}}}
  \g@addto@macro\appendix{\specialoutline}
\fi
\def\defspecial@toc#1#2#3{\long\def#1{%
  \ifpdf\phantomsection\specialoutline\pdfbookmark[1]{#2}{#3}\normaloutline\fi
  \section*{#2}\@mkboth{\textls*[70]{\MakeUppercase{#2}}}{}%
  \@starttoc{#3}}}
\defspecial@toc\tableofcontents\contentsname{toc}
\defspecial@toc\listoftables\listtablename{lot}
% bibliography
\def\@cite#1#2{#1\if@tempswa, #2\fi}
\def\thebibliography#1{%
  \section{\refname}%
  \list{}{\leftmargin 0pt}%
  \sloppy
  \clubpenalty 4000
  \@clubpenalty \clubpenalty
  \widowpenalty 4000}
\def\@biblabel#1{}
% footnotes
\long\def\@makefntext#1{%
  \leftskip 0pt
  \parindent 0pt
  \everypar{\parindent 0pt}%
  \leavevmode\llap{\@thefnmark\hskip\marginparsep}#1}
\renewcommand\footnoterule{%
  \kern-3\p@
  \hrule\@width \columnwidth
  \kern2.6\p@}
\skip\@mpfootins=4pt
% lists
\setlength\leftmargini{15pt}
\setlength\leftmarginii{12.5pt}
\setlength\leftmarginiii{10pt}
\def\@listi{\leftmargin \leftmargini
            \parsep 4.5pt plus 1pt minus 1pt
            \topsep 4.5pt plus 1pt minus 1pt
            \itemsep 0pt}
\let\@listI\@listi
\def\descriptionlabel#1{\hspace\labelsep\normalfont#1:}
\renewenvironment{itemize}
  {\ifnum \@itemdepth >\thr@@\@toodeep\else
    \advance\@itemdepth\@ne
    \edef\@itemitem{labelitem\romannumeral\the\@itemdepth}%
    \expandafter\list
      \csname\@itemitem\endcsname
      {\ifnum\@itemdepth=\@ne\leftmargin 0pt\fi
	      \def\makelabel##1{\hss\llap{\color{sectioning}##1}}}%
   \fi}
  {\endlist}
\newenvironment{enum}[1][0]
  {\list\labelenumi
    {\usecounter{enumi}\setcounter{enumi}{#1}\addtocounter{enumi}{-1}%
     \renewcommand\labelenumi{\texttt{\theenumi}:}%
     \leftmargin 30pt
     \itemindent-15pt
     \labelwidth 15pt
     \labelsep 0pt
     \def\makelabel##1{##1\hss}}}
  {\endlist}
\newenvironment{options}
  {\list{}
    {\leftmargin 0pt
     \labelwidth 0pt
     \labelsep 1em
     \itemindent \labelsep
     \lstset{belowskip=0pt}}}
  {\endlist}
% boxes (for some reason, mathdesign changes these values)
\setlength\fboxrule{0.4pt}
\setlength\fboxsep{3pt}
\setlength\arrayrulewidth{0.4pt}
% tables
\setlength\tabcolsep{2pt}
\newbox\mt@box
\newdimen\mt@unvdimen
\long\def\@makecaption#1#2{%
  \setbox\mt@box\vbox{\llap{\vbox{% \fboxsep = 4pt
          \vskip\dimexpr\floatsep-4pt+\fboxrule\relax
          \hsize\dimexpr\marginparwidth-\marginparsep-4pt-\fboxrule\relax
          \rightskip\dimexpr\marginparsep+4pt+\fboxrule\relax plus 2.5em
          \footnotesize \sffamily #1:\\[-\dimexpr\aboverulesep+\cmidrulewidth+3.5\fboxrule]
	  \textcolor{theframe}{\rlap{\vrule width \hsize height\fboxrule}}\\[.3\baselineskip] #2}}}
  \mt@unvdimen\dimexpr\ht\mt@box+\dp\mt@box\relax
  \unvbox\mt@box
  \vskip-\mt@unvdimen}
% index and change log
\IndexPrologue{\section{Index}%
  Numbers in upright shape refer to the page where the corresponding entry is described
  (bold face) resp. occurs. Numbers in italics refer to the code line
  where the corresponding entry is defined (underlined) resp. used.}
\GlossaryPrologue{\section{Change history}\label{sec:changes}\vspace*{-\multicolsep}}
 %\setcounter{finalcolumnbadness}{100}
 %\raggedcolumns
\setcounter{IndexColumns}{2}
\def\IndexMin{12\baselineskip}
\g@addto@macro\IndexParms{%
  \footnotesize
  \def\indexspace#1{%
    \end{multicols}
    \vspace*{-2\baselineskip}%
    \begin{multicols}{2}
      \ifpdf{\let\bfseries\empty\let\hfil\empty\phantomsection\pdfbookmark[2]{#1}{#1}}\fi
      \setbox0\hbox{\sffamily\hss#1}%
      \ifdim\wd0<1em \setbox0\hbox to 1em{\sffamily\hss#1\hss}\fi
      \llap{\color{thegrey}\box0\hskip\marginparsep}%
      \vspace*{-\baselineskip}%
      \IndexParms %\rightskip 15pt
      \let\item\@idxitem
      \raggedcolumns}}
\def\GlossaryParms{\IndexParms
  \let\indexspace\relax
  \def\@idxitem ##1##2\efill{%
    \end{multicols}
    \ifpdf \vspace{-3.25ex}%
      \pdfbookmark[2]{\if##1v\relax ##2
          (\csname MTversiondate##2\endcsname)\else ##2\fi}
        {subsection\zap@space ##2 \@empty}\fi
    \begin{multicols}{2}[%
        \subsubsection*{\if##1v\relax
        \llap{\mdseries\color{thegrey}\footnotesize
              \csname MTversiondate##2\endcsname\hskip\marginparsep}%
         Version ##2\else ##2\fi}][6\baselineskip]
      \GlossaryParms \rightskip 15pt plus 5pt
      \let\item\@idxitem
      \ignorespaces \makeatletter \scan@allowedfalse}%
  \def\subitem{\par\hangindent 15pt}%
  \def\subsubitem{\subitem\hspace*{7.5pt}}}
% macro code
\MacroTopsep=0pt
\MacrocodeTopsep=3pt
\setlength\MacroIndent{0pt}
\def\theCodelineNo{\reset@font\sffamily\color{thegrey}\scriptsize
  \textoractual{\arabic{CodelineNo}\ }{}}% don't copy line numbers
\def\MacroFont{\ttfamily\small}
\def\AltMacroFont{\ttfamily\footnotesize}
\def\PrintMacroName#1{\strut\MacroFont\string #1\hskip15pt}
\def\ImplementationSettings{%
  \linespread{1}%
  \hfuzz=10pt
  \def\MacroFont{\ttfamily\footnotesize}%
  \let\macro@font\MacroFont}
% additional bells ...
\def\Describe#1#2#3{\noindent\csname Describe#1\endcsname{#2}%
  \DescribeValues{#1}{#3}}
\def\DescribeOption{\leavevmode\@bsphack
  \begingroup\MakePrivateLetters\Describe@Option}
\def\Describe@Option#1{\endgroup
  \marginpar{\raggedleft\PrintDescribeOption{#1}}%
  \SpecialOptionIndex{#1}\@esphack\ignorespaces}
\def\DescribePackage{\leavevmode\@bsphack
  \begingroup\MakePrivateLetters\Describe@Package}
\def\Describe@Package#1{\endgroup
  \marginpar{\raggedleft\PrintDescribeOption{#1.sty}}%
  \CatIndex{#1}{package}\@esphack\ignorespaces}
\def\DescribeValues#1#2{%
  \let\@tempa\@empty \let\Option@default\@empty
  \@for\@tempb:=#2\do{%
    \csname Special#1Value\expandafter\endcsname\@tempb\@nil
    \expandafter\g@addto@macro\expandafter\@tempa
      \expandafter{\csname #1Sep\endcsname}%
    \expandafter\g@addto@macro\expandafter\@tempa
      \expandafter{\@tempb}}%
  \@ifnextchar[\PrintValues{\PrintValues[\Option@default]}}
\def\SpecialOptionValue#1#2\@nil{%
  \if#1:\def\@tempb{\Variable{#2}}\else %                      : = variable
  \if#1!\def\@tempb{#2}\def\Option@default{#2}\else %          ! = default
  \if#1*\def\@tempb{#2}\def\Option@default{\MaybeDefault{#2}}% * = default (maybe)
  \fi\fi\fi}
\def\SpecialMacroValue#1#2\@nil{%
  \if#1?\def\@tempb{\normalsize[\Variable{#2}]}%  % ? = optional
   \else\def\@tempb{\normalsize\{\Variable{#1#2}\}}\fi}
\let\SpecialEnvValue\SpecialMacroValue
\DeclareRobustCommand\langlechar{<} % for makeindex
\DeclareRobustCommand\ranglechar{>}
\def\Variable#1{%
  \textoractual{$\langle$}{\langlechar}%
    {\rmfamily\itshape\small#1}%
  \textoractual{$\rangle$}{\ranglechar}}
\let\m@a\meta \def\meta#1{\textoractual{\m@a{#1}}{\langlechar#1\ranglechar}}
\def\MaybeDefault#1{\textrm{*}\,#1}
\def\OptionSep{{\rmfamily, }} \def\MacroSep{\,} \def\EnvironmentSep{\,}
\def\PrintValues[#1]{{\MacroFont\expandafter\@gobble\@tempa\hfill #1}\\*[.25\baselineskip]}
\def\CatIndex#1#2{\index{#1\actualchar{\protect\ttfamily #1} (#2)\encapchar hyperpage}}
\def\CatIndeX#1#2#3{\index{#2\actualchar#1\ (#3)\encapchar hyperpage}}
\def\SpecialOptionIndex#1{\@bsphack
  \index{\quotechar/#1% sort options as `Symbols'
    \actualchar{\protect\ttfamily#1}\encapchar usage}%
  \CatIndex{#1}{option}\@esphack}
\def\SpecialUsageIndex#1{\@bsphack
  \index{\quotechar1% sort commands as `Numbers'
    \actualchar\string\verb
      \quotechar*\verbatimchar\string#1\verbatimchar\encapchar usage}%
  {\let\special@index\index\SpecialIndex@{#1}{\encapchar usage}}\@esphack}
\def\SpecialEnvIndex#1{\CatIndex{#1}{environment}}
%</driver|docsty>
% microtype's index style (microtype-gind.ist):
%<docist>actual '='
%<docist>quote '!'
%<docist>level '>'
%<docist>preamble  "\n \\begin{theindex} \n \\makeatletter\\scan@allowedfalse\n\\indexspace"
%<docist>postamble "\n\n \\end{theindex}\n"
%<docist>item_x1   "\\efill \n \\subitem "
%<docist>delim_0   "\\pfill "
%<docist>delim_1   "\\pfill "
%<docist>heading_prefix    "{\\bfseries\\hfil "
%<docist>heading_suffix    "\\hfil}\\nopagebreak\n"
%<docist>headings_flag      1
%<docist>symhead_positive  "Options"
%<docist>numhead_positive  "Commands"
%<*driver|docsty>
\def\PrintDescribeMacro#1{\strut\MacroFont\color{thegreen}\string #1}
\def\PrintDescribeEnv#1{\strut\MacroFont\bslash begin\{{\color{thegreen}#1}\}%
  \\*[.25\baselineskip]\strut\bslash end\{{\color{thegreen}#1}\}}
\def\PrintDescribeOption#1{\strut\MacroFont\color{thered}#1}
\def\Indexing{\let\special@index\codeline@wrindex}
\def\NoIndexing{\let\special@index\@gobble}
\def\GeneralChanges#1{\edef\generalname{\if*#1 General\else#1\fi}}% mind the space!
\DeclareRobustCommand\key[1]{\textcolor{thered}{\ttfamily#1}}
\DeclareRobustCommand\pkg[1]{{\PackageFont#1}\@bsphack\CatIndex{#1}{package}\@esphack}
\DeclareRobustCommand\opt[1]{{\ttfamily#1}\@bsphack\CatIndex{#1}{option}\@esphack}
\DeclareRobustCommand\file[1]{{\ttfamily#1}}
\def\RequiresSep{ \textbar\ }
\def\requires#1{\let\@tempa\@empty
  \@for\@tempb:=#1\do{%
    \g@addto@macro\@tempa\RequiresSep
    \expandafter\g@addto@macro\expandafter\@tempa\expandafter{\@tempb}}%
  \hfill{\setlength\fboxsep{2pt}%
    \fcolorbox{theframe}{white}{\mdseries\small\strut\color{sectioning}%
      \,\expandafter\@gobble\@tempa\,}}}
% ... and whistles
{\catcode`\"\active
 \gdef\verbatim#1
   {\catcode`\"\active \def"##1"{\colorbox{theshade}{%
      \textrm{Text lost! Please install the \pkg{listings} package.}}}%
    \@beginparpenalty\predisplaypenalty\@verbatim\MacroFont
    \frenchspacing\@vobeyspaces\expandafter\@xverbatim\@gobble}}
\IfFileExists{listings.sty}{
 \usepackage{listings}
 \lstset{
   gobble=1,columns=flexible,keepspaces,upquote,escapechar=",
   basicstyle=\MacroFont,
   keywords=[0]{\microtypesetup,\DeclareMicrotypeSet,\UseMicrotypeSet,
     \DeclareMicrotypeSetDefault,\SetProtrusion,\SetExpansion,\SetTracking,
     \SetExtraKerning,\SetExtraSpacing,\DisableLigatures,\DeclareCharacterInheritance,
     \DeclareMicrotypeVariants,\DeclareMicrotypeAlias,\DeclareMicrotypeBabelHook,
     \LoadMicrotypeFile,\microtypecontext,\textmicrotypecontext,
     \textls,\lsstyle,\lslig,\Microtype@Hook},
   keywordstyle=[0]\color{thegreen},
   keywords=[1]{protrusion,expansion,activate,DVIoutput,draft,final,verbose,
     config,factor,auto,stretch,shrink,step,selected,unit,tracking,kerning,
     spacing,letterspace,babel,context,
    %defersetup,copyfonts,enable,disable,% undocumented
     no ligatures,outer spacing,outer kerning}, % there are three \nobreakspace in this line
   keywordstyle=[1]\color{thered},
   comment=[l]\%,
   commentstyle=\color{thegrey}\itshape,
   alsoother={0123456789_},
   frame=single,backgroundcolor=\color{theshade},rulecolor=\color{theframe},
   framerule=\fboxrule,xleftmargin=3.4pt,xrightmargin=3.4pt,belowskip=\smallskipamount
 }
 \let\verbatim\relax
 \lstnewenvironment{verbatim}[1][]{\lstset{##1}}{}
 \ifpdf \IfFileExists{dummy-space.pfb}{%
   \pdfmapline{=dummy-space <dummy-space.pfb}
   \font\dummyspace=dummy-space
   \pdfglyphtounicode{space}{0020}
   \def\lst@outputspace{% copy spaces (from a font that really has a space at x20)
     \setbox0\hbox{ }\@tempdima\wd0
     \setbox0\hbox{\dummyspace\char"20}\advance\@tempdima-\wd0
     \unhbox0 \kern\@tempdima}
  }\relax \fi
}{
 \let\lstset\@gobble
}
\def\todo#1{\changes{zTo Do}{0000/00/00}{#1}%
  \marginpar{\rightskip2\marginparsep plus1em\hangindent1.5em\hangafter-2
    \smash{\rlap{\raisebox{-3.3ex}{\colorbox{thered}{\Large\color{white}!}}}}%
    \footnotesize\textcolor{thered}{#1}}}
\let\todo\@gobble
\newcommand\microtypesample[1]{\begin{quote}#1\end{quote}}
\let\emptypdfpageresources\relax
% fancy PDF document
\ifpdf
  \ifx\eTeXversion\@undefined \else % errors when not using etex (conflict with multicol)
    \ifnum\pdftexversion < 140      % no longer required with pdftex 1.40
      \usepackage{pdfcolmk}
  \fi\fi
  \usepackage[bookmarks,bookmarksopen,pdfdisplaydoctitle,
              colorlinks,linkcolor=theblue,citecolor=theblue,urlcolor=thered,
              hyperindex=false,hyperfootnotes=false]
             {hyperref}
  \PassOptionsToPackage{nodvi}{totpages} % remove annoying log output
  \usepackage{hyperxmp} % (hyperxmp loads totpages)
  \usepackage{attachfile}
  \usepackage{pdfpages}
  \hypersetup{
    pdftitle={The microtype package},
    pdfauthor={R Schlicht <w.m.l@gmx.net>},
    pdfsubject={Subliminal refinements towards typographical perfection},
    pdfkeywords={TeX, LaTeX, pdfTeX, LuaTeX, XeTeX, typography, micro-typography,
      character protrusion, margin kerning, optical alignment, font expansion,
      font scaling, hz, kerning, spacing, glue, letterspacing, tracking, ligatures},
    pdfcopyright={\textcopyright\ 2004--2020 R Schlicht\012%
      This work may be distributed and/or modified under the conditions
      of the LaTeX Project Public License, either version 1.3c of this
      license or (at your option) any later version.\012%
      This work has the LPPL maintenance status `author-maintained'.},
    pdflicenseurl={http://www.latex-project.org/lppl/}
  }
  \pdfcatalog{/Lang(en-GB)}
  \ifnum\pdftexversion < 130 \else
    \IfFileExists{hypdestopt.sty}{\usepackage{hypdestopt}}\relax\fi
  \def\usage#1{\textbf{\hyperpage{#1}}}% for indexing of \DescribeMacro ...
  \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
    \reset@font\sffamily\color{thegrey}\scriptsize
    \@tempcnta\arabic{CodelineNo}\advance\@tempcnta by\@ne
    \hypertarget{L:\number\@tempcnta}
      {\textoractual{\arabic{CodelineNo}\ }{}}}% don't copy line numbers
  \def\main#1{\underline{\itshape\hyperlink{L:#1}{#1}}}
  \def\codeline#1{{\itshape\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}
  \def\ctanurl#1{Available from \acronym{CTAN} at
                 \href{http://mirror.ctan.org/#1}{\nolinkurl{/#1}}}
  \def\ctanpkgurl#1{Available from \acronym{CTAN} at
                    \href{https://www.ctan.org/pkg/#1}{\nolinkurl{pkg/#1}}}
  \DeclareRobustCommand\mailto[1]{\href{mailto:#1}{\nolinkurl{#1}}}
  \def\mailtoRS{\href % some PDF viewers don't like spaces:
    {mailto:Robert\%20Schlicht\%3cw.m.l@gmx.net\%3e?subject=[microtype\%20\fileversion]}
    {\texttt{w.m.l@gmx.net}}}
  % the samples in the introduction, utilising nested optional content groups (aka. layers):
  \ifnum\pdftexversion<140 \else
    \def\mt@layer#1#2{\pdfliteral page{/OC/#1 BDC}#2\pdfliteral page{EMC}}
    \ifx\mt@objects\@undefined\let\mt@objects\@empty\fi
    \ifx\mt@order  \@undefined\let\mt@order  \@empty\fi
    \let\mt@resources\@empty
    \def\mt@register#1#2{%
      \immediate\pdfobj{<< /Type/OCG /Name(#1:#2) >>}
      \expandafter\xdef\csname mt@#1@#2\endcsname{\the\pdflastobj\space 0 R }
      \xdef\mt@objects  {\mt@objects        \csname mt@#1@#2\endcsname}
      \xdef\mt@order    {\mt@order          \csname mt@#1@#2\endcsname}
      \xdef\mt@resources{\mt@resources/#1#2 \csname mt@#1@#2\endcsname}}
    \xdef\mt@order{\mt@order[(Sample)}
     \mt@register{Protrusion}{true} \mt@register{Protrusion}{false}
     \mt@register{Expansion} {true} \mt@register{Expansion} {false}
     \mt@register{_compatibility}{}
    \xdef\mt@order{\mt@order]}
    \pdfcatalog{/OCProperties <<
                   /OCGs [\mt@objects]
                   /D << /Order [\mt@order]
                         /BaseState/OFF
                         /ON [\mt@Protrusion@false \mt@Expansion@false
                              \ifx\mtl@objects\@undefined\else\mtl@objects\fi] >> >> }
    \def\mt@place#1{%
      \vskip-\mt@unvdimen
      \setbox\mt@box\vbox{#1}%
      \mt@unvdimen\dimexpr\ht\mt@box+\dp\mt@box\relax
      \unvbox\mt@box}
    \def\mt@pseudo@marg#1{%
      \mt@place{\llap{\vbox{%
        \hsize\marginparwidth
        \rightskip \marginparsep plus 1em
        \leavevmode\itshape\footnotesize #1}}}}
    \def\mt@show@sample#1#2{%
      \mt@layer{Protrusion#1}{%
        \mt@layer{Expansion#2}{%
          \mt@place{\microtypesetup{protrusion=#1,expansion=#2}%
            \mt@sample@text\strut}}}}
    \def\mt@toggle@sample#1{%
      \pdfstartlink user{/Subtype/Link
        /BS << /Type/Border/W 1 /S/D /D[4 1] >>
        /H/O /C[0.65 0.04 0.07] /Contents(Click to Toggle #1!)
        %/OC << /Type/OCMD /VE[/Not \csname mt@_compatibility@\endcsname] >> % not honoured by older viewers anyway
        /A << /S/SetOCGState /State[/Toggle \csname mt@#1@true\endcsname
                                            \csname mt@#1@false\endcsname] >>}
      #1 \hfill\pdfendlink & \mt@layer{#1true}{\rlap{on}}\mt@layer{#1false}{off}}
    \renewcommand\microtypesample[1]{%
      \begingroup
      \leftskip 15pt \rightskip 15pt
      \parskip   4pt \parindent  0pt
      \vskip 8pt % = \topsep without vertical stretchability
      \long\def\mt@sample@text{#1}
      \mt@pseudo@marg{\color{theblue}%
        After you have read the text on the right, you can view the effect of
        the features it describes by clicking on the links:\strut\\
        \colorbox{theshade}{%
          \begin{tabular}{@{}>{\upshape}l@{\quad}l}
            \mt@toggle@sample{Protrusion}\\\addlinespace
            \mt@toggle@sample{Expansion}
          \end{tabular}}\\[0.3\baselineskip]
        Both features are enabled throughout this document.}
      \mt@show@sample{false}{false}
      \mt@show@sample{false}{true}
      \mt@show@sample{true} {false}
      \mt@layer{_compatibility}{%
        % for compatibility with older PDF viewers that don't support OCGs, we
        % add a layer that contains a white box, which will hide the underlying
        % layers for older viewers, and will be ignored by PDF 1.5 capable viewers.
        \mt@place{\rlap{\hskip-\marginparwidth \color{white}%
          \vrule width\dimexpr\hsize+\marginparwidth\relax height\mt@unvdimen}}
        \mt@pseudo@marg{\color{thered}%
          If you had a \acronym{PDF} viewer that understands
          \acronym{PDF}\,{\smaller1.5}, you could view the effect of the
          micro-typographic features by clicking on the links.\strut
          \\\vphantom{\colorbox{white}{\tabular l\\\addlinespace\\\endtabular}}%
          \\[0.3\baselineskip] Both features are enabled throughout this document.}}
      \mt@show@sample{true}{true}
      \vskip 4pt
      \endgroup
      \edef\x{\pdfpageresources{/Properties <<\mt@resources>>}}\x}
    \def\emptypdfpageresources{\pdfpageresources{}}
  \fi
\else
  \usepackage{url}
  \newcommand\hyperref[2][]{#2}
  \let\hyperpage\@firstofone
  \let\texorpdfstring\@firstoftwo
  \def\ctanurl{Available from \acronym{CTAN} at \url}
  \let\ctanpkgurl\ctanurl
  \let\nolinkurl\url
  \let\mailto\texttt
  \def\mailtoRS{\mailto{w.m.l@gmx.net}}
  \let\href\texttt
  \newcommand\textattachfile[3][]{#3 \textit{[File \file{#2} not attached,
        because \file{microtype.dtx} hasn't been compiled with \pdftex.]}}
\fi
\ifx\l@ukenglish\@undefined
  \hyphenation{let-ter-spac-ing let-ter-spaced let-ter-space}
\else
  \language=\l@ukenglish
\fi
\hyphenation{%An-dre-as Ber-nard Ha-rald Mi-cha-el Pe-ter Ste-phan Wolf-ram
             %Har-ders Hop-pe Jac-kow-ski Ku-char-czyk Mei-er Mu-the-si-us Zed-ler
             %Die-te-rich Sveinung Marcin RazorXsr
             Dyballa Maverick
             with-out
             Pa-la-ti-no}
\def\fallbacktext#1{{\centering\itshape[#1]\par}}
% abbreviations
\DeclareRobustCommand\thanhthe{Th\^e%
     \ifx\eTeXversion\undefined \llap{\raisebox{0.5ex}{\'{}}}%
     \else \llap{\raisebox{0.45ex}{\'{}\kern\dimexpr.05em-2\fontdimen1\font\relax}}%
     \fi}
\DeclareRobustCommand\thanh{H\`an \thanhthe{} Th\`anh}
\DeclareRobustCommand\pdftex{\texorpdfstring{pdf\kern.05em\TeX\CatIndeX{pdf\TeX}{pdftex}{engine}}{pdfTeX}}
\DeclareRobustCommand\luatex{\texorpdfstring{Lua\kern-.05em\TeX\CatIndeX{Lua\TeX}{luatex}{engine}}{LuaTeX}}
\DeclareRobustCommand\etex{\mbox{e-\kern-.075em\TeX}\CatIndeX{e-\TeX}{etex}{engine}}
\DeclareRobustCommand\nonetex{\rlap{\kern.05em/}\etex} % aka. \TeX
\def\@reflect#1{\ifdim\fontdimen1\font=0pt \reflectbox{#1}\else\rotatebox[origin=c]{180}{#1}\fi}
\DeclareRobustCommand\xe{\textoractual{\@reflect{X}\lower.4ex\hbox{\kern-.066em\@reflect{E}}}{Xe}}% also reflect the initial `X'? 
\DeclareRobustCommand\xetex{\xe\kern-.1em\TeX\CatIndeX{\xe\TeX}{xetex}{engine}}
\DeclareRobustCommand\texlive{\TeX~Live\CatIndeX{\TeX~Live}{TeXLive}{distribution}}
\DeclareRobustCommand\miktex{MiK\TeX\CatIndeX{MiK\TeX}{MiKTeX}{distribution}}
\def\microtype{{\PackageFont microtype}}
\def\letterspace{\pkg{letterspace}}
\def\fontdim{\cmd\fontdimen\,}
\def\eg{e.g.}
\def\ie{i.e.}
\def\EM#1{#1\kern.1emem}
\DeclareRobustCommand\smaller{\setbox\z@\hbox{\@tempcnta=\f@size
  \edef\x{\@tempcnta=\the\@tempcnta}\expandafter}\x
  \advance\@tempcnta-7  \ifcase\@tempcnta\tiny\or\scriptsize\or
    \footnotesize\or\small\or\or\normalsize\or\or\large\or\or\or\Large\fi}
\DeclareRobustCommand\acronym[1]{\texorpdfstring{{\smaller\textls[60]{#1}}}{#1}}
\let\less=<
{\catcode`\<=\active
 \AtBeginDocument{\catcode`\<=\active
   \def<#1>{\acronym{#1}}
   \def\contributor#1 <#2\at#3>{\@contributor{#1}{#2@#3}}}}
\DeclareRobustCommand\@contributor[2]{\textit{#1}}
%\DeclareRobustCommand\@contributor[2]{\href{mailto:#2}{\textit{#1}}}
%\DeclareRobustCommand\@contributor[2]{\textit{#1}%
%    \expandafter\index\expandafter{\@getlastname#1 \@nil\actualchar %\href{mailto:#2}{#1}
%          #1 (contributor)\encapchar hyperpage}}
%\def\@getlastname#1 #2\@nil{\ifx\@nil#2\@nil#1\else\@getlastname#2\@nil\fi}
%<*driver>
\CodelineIndex
\EnableCrossrefs
\RecordChanges
%\OnlyDescription
\begin{document}
  \DocInput{\jobname.dtx}
\end{document}
%</driver>
%</driver|docsty>
% \fi
%
% ^^A -------------------------------------------------------------------------
%\GeneralChanges*
%\changes{v1.0}{2004/09/11}{Initial version}
%\changes{v2.0}{2006/12/29}{new package \letterspace: a stripped-down version,
%                           containing the letterspacing commands only}
%\GeneralChanges{Documentation}
%\changes{v1.9b}{2006/01/13}{activate expansion in the distributed <PDF>}
%\changes{v2.2}{2007/04/01}{logo transparency and amusement}
% ^^A Adobe Reader 8.0 had serious bugs with transparency. Fixed in 8.1.
%
% \GetFileInfo{microtype.dtx}
% \title{\ifx\printlogo\undefined\else\printlogo\fi
%        \textls[40]{The \microtype\ package}\\[.3\baselineskip]\large
%        Subliminal refinements towards typographical perfection}
% \author{R Schlicht\\\mailtoRS}
% \date{\fileversion\\\filedate}
%
% \maketitle \thispagestyle{empty}
%
%\begin{abstract}
%\noindent
% The \microtype\ package provides a \LaTeX\ interface to the micro-typographic
% extensions that were introduced by \pdftex\ and have since also propagated to
% \luatex\ and \xetex: most prominently, character protrusion and font expansion,
% furthermore the adjustment of interword spacing and additional kerning, as
% well as hyphenatable letterspacing (tracking) and the possibility to disable
% all or selected ligatures.
% These features may be applied to customisable sets of fonts, and all
% micro-typographic aspects of the fonts can be configured in a straight-forward
% and flexible way. Settings for various fonts are provided.
%
% Note that character protrusion requires \pdftex\ (version~0.14f or later),
% \luatex, or \xetex\ (at least version~0.9997).
% Font expansion works with \pdftex\ (version~1.20 for automatic expansion)
% or \luatex.
% The package will by default enable protrusion and expansion if they can safely
% be assumed to work.
% Disabling ligatures requires \pdftex\ ($\geq$\,1.30) or \luatex, while the
% adjustment of interword spacing and of kerning only works with \pdftex\ ($\geq$\,1.40).
% Letterspacing is available with \pdftex\ ($\geq$\,1.40) or \luatex\ ($\geq$\,0.62).
%
% The alternative package \letterspace, which also works with plain \TeX,
% provides the user commands for letterspacing only, omitting support for all
% other extensions (see section~\ref{sec:lettersp}).
%
%\bigskip\noindent
% This package is copyright \textcopyright\ 2004\kern.09em--2020 R Schlicht.
% It may be distributed and/or modified under the conditions of the
% \IfFileExists{lppl.tex}{\hyperref[LPPL:LPPL]}{\href{http://www.latex-project.org/lppl/}}
%   {\LaTeX\ Project Public License},
% either version~1.3c of this license or (at your option) any later version.
% This work has the <LPPL> maintenance status `author-maintained'.
%\end{abstract}
%
%
%\newpage
%\emptypdfpageresources ^^A layers of the logo
%{\sffamily\def\familydefault{\sfdefault}\ifcmr\else\DeclareFontSeriesDefault[sf]{bf}{sb}\fi
% \tableofcontents
% \listoftables
%}
%
%
%\newpage
%\section{Micro-typography with \TeX}\label{sec:micro-type}
%
% Micro-typography is the art of enhancing the appearance and readability of a
% document while exhibiting a minimum degree of visual obtrusion. It is
% concerned with what happens between or at the margins of characters,
% words or lines.
% Whereas the macro-typographical aspects of a document (\ie, its layout) are
% clearly visible even to the untrained eye, micro-typographical refinements
% should ideally not even be recognisable. That is, you may think that a
% document looks beautiful, but you might not be able to tell exactly
% why: good micro-typographic practice tries to reduce all potential irritations
% that might disturb a reader.
%
% Some essential micro-typographical aspects are already taken care of by
% \TeX\ out of the box -- and in an outstanding manner -- namely, hyphenation
% and justification, as well as kerning and ligatures.
% Other aspects are in the user's scope of responsibilities, \eg, to specify
% the right amounts of spacing around punctuation characters, numbers, or
% quotation marks.
% On top of this, a number of long-standing micro-typographic techniques have
% been introduced to the \TeX\ world relatively recently with \pdftex, and
% have since also propagated to \luatex\ and \xetex.
% These features make them the tool of choice not only for the creation of
% electronic documents but also of works of outstanding time-honoured typography:
% most prominently, \textit{character protrusion} (also known as margin kerning)
% and \textit{font expansion}. Quoting \thanh, the author of \pdftex, who
% writes in his thesis:
%
%\changes{v1.9b}{2006/01/13}{add samples of micro-typographic features}
%\microtypesample{\small
% `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[p.~323]{ThanhThesis}]}
%
% Another micro-typographic technique, which has always been extremely
% difficult to achieve in \TeX, is robust and hyphenatable \emph{letterspacing
% (tracking)}.\footnote{^^A
%   The \cite{soul} package undertakes great efforts, but may still fail in
%   certain circumstances; even to systematically adjust the tracking of a
%   font throughout the document remains impossible.}
% Whereas letterspacing can easily be, and often is, abused when applying
% it to lowercase letters, readability may be increased by slightly
% letterspacing (small) capitals or by decreasing the tracking of very large
% uppercase type.
%
% Setting \emph{additional kerning} for individual characters is especially
% (but not only) useful for languages whose typographical tradition requires certain
% characters to be separated by a space. For example, it is customary in French
% typography to add a small space before question mark, exclamation mark and
% semi-colon, and a bigger space before the colon and the guillemets. Until
% now, this could only be achieved by making these characters active (as is done,
% for example, by the \pkg{babel} package), which may not always be a robust
% solution. In contrast to the standard kerning built into the fonts
% (which will of course apply as usual), this additional kerning relates to
% single characters, not to character pairs.
%
% \emph{Adjustment of interword spacing} is based upon the idea that in order
% to achieve a uniform greyness of the text, the space between words should
% also depend on the surrounding characters. For example, if a word ends with
% an `r', the following space should be a tiny bit smaller than that following,
% say, an `m'. You can think of this concept as an extension to \TeX's `space
% factors'. This feature may enhance the appearance of paragraphs even more.
% Emphasis in the last sentence is on the word `may': this extension is still
% highly experimental -- in particular, only ending characters will currently
% influence the interword space. Also, the settings shipped with \microtype\
% are but a first approximation, and I~would highly welcome corrections and
% improvements. I suggest reading the reasoning behind the settings in
% section~\ref{sub:conf-spacing}.
%
% The possibility, finally, to \emph{disable all or selected ligatures} is
% particularly useful for typewriter fonts.
%
%\emptypdfpageresources ^^A layers of the sample
%\bigskip\noindent
% The \microtype\ package provides an interface to all these micro-typographic
% extensions. All micro-typographic aspects may be customised to your taste and
% needs in a straight-forward and systematic manner. The next chapters present
% a survey of all options and customisation possibilities. Should the
% micro-typographic extension discussed in a section work only with certain
% \TeX\ engines, this requirement is marked inside a grey text box on the
% right.
%
%
%\section{Getting started}
%
% There is nothing surprising in loading this package:
%\begin{verbatim}[morekeywords={[1]{microtype}}]
%\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 (however
% unlikely this would seem, since using this package is proof of your interest
% in typographic issues), you may actually skip the rest of this document.
%^^A
% If this, on the other hand, does not satisfy you -- be it for theoretical or
% practical reasons -- this manual will guide you on the path to the desired
% results along the following milestones:
%
%\changes{v2.2}{2007/06/06}{add overview}
%\begin{itemize}
%  \item Enable the desired micro-typographic features, either via the
%        respective package option or with the \cs{microtypesetup} command
%        (section~\ref{sec:options}).
%  \item Select the fonts to which this feature should be applied by declaring
%        and activating `sets of fonts'. A number of sets are predefined, which may be
%        activated directly in the package options
%        (section~\ref{sec:font-sets}).
%  \item Fine-tune the micro-typographic settings of the fonts or sets of fonts
%        (section~\ref{sec:fine-tuning}).
%  \item If you're of the kind who always wants to march on, you will certainly
%        be interested in the possibility of context-sensitive setup
%        (section~\ref{sec:context}).
%  \item You are even countenanced to leave the path of typographic virtue and
%        steal some sheep (section~\ref{sec:lettersp}) or trespass in other ways
%        (section~\ref{sec:disable-ligatures}).
%  \item Should you encounter any obstacles, follow the hints and caveats
%        (section~\ref{sec:caveats}).
%\end{itemize}
%
%
%\section{Options}\label{sec:options}
%
% Like many other \LaTeX\ packages, the \microtype\ package accepts options in
% the well-known |key=value| syntax. In the following, you will find a
% description of all \key{keys} and their possible |values|
% (`|true|' may be omitted; multiple values, where allowed, must be enclosed in
% braces; the default value is shown on the right -- if preceded by an asterisk,
% this default only applies when running an up-to-date \pdftex\ in <PDF> mode).
%
%
%\subsection{Enabling the micro-typographic features}\label{sub:options-microtype}
%
%\Describe{Option}{protrusion}
%                 {*true,false,compatibility,nocompatibility,:font set name}
%\DescribeOption{expansion}
% These are the main options to control the level of micro-typographic
% refinement which the fonts in your document should gain. By default, the
% package is moderately greedy: character protrusion will always be enabled,
% font expansion will only be disabled when the fonts cannot be expanded
% automatically, that is, with \pdftex\ versions older than 1.20 or in <DVI>
% output mode (see section~\ref{sub:options-misc}), or with \xetex.
% In other words, \microtype\ will try to apply as much micro-typography as
% can safely be expected to work under the respective conditions (hence, it is
% usually not necessary to load the package with different options, \eg, for <PDF>
% resp. <DVI> mode).
%
% Protrusion and expansion may be enabled or disabled independently from each
% other by setting the respective key to |true| resp. |false|. The
% \opt{activate} option
%\DescribeOption{activate}
% is a shortcut for setting both options at the same time. Therefore, the
% following lines all have the same effect (when creating <PDF> files with a
% recent version of \pdftex):
%\begin{verbatim}
%\usepackage[protrusion=true,expansion]{microtype}
%\end{verbatim}
%\begin{verbatim}
%\usepackage[activate={true,nocompatibility}]{microtype}
%\end{verbatim}
%\begin{verbatim}
%\usepackage{microtype}
%\end{verbatim}
%\smallskip
% With activated font expansion and/or character protrusion, line breaks
% (and consequently, page breaks) may turn out differently. If this is not
% desired -- because you are re-typesetting a book whose pagination must not
% change -- you may pass the value |compatibility| to the \opt{protrusion}
% and/or \opt{expansion} options. Typographically, however, the results will be
% suboptimal, hence the default value is |nocompatibility|.
%
% Finally, you may also specify the name of a font set to which character
% protrusion and/or font expansion should be restricted. See
% section~\ref{sec:font-sets} for a detailed discussion. Specifying a font set
% for a feature implicitly activates this feature.
%
%\medskip
%\Describe{Option}{tracking}{true,!false,:font set name}
% This option will systematically change the tracking of the fonts specified in
% the active font set (by default, all small capitals).
% It is not available with \xetex\ (you may use the `|LetterSpace|'
% option of the \cite{fontspec} package instead).
% With \pdftex, it is only available in <PDF> mode.
%
%\medskip
%\Describe{Option}{kerning}{true,!false,:font set name}
%\DescribeOption{spacing}
% These features do not unconditionally improve the quality of the typeset text:
% the \opt{spacing} feature is still considered experimental, while the \opt{kerning}
% feature only makes sense in special cases.
% Therefore, neither feature is enabled by default. They are not available
% with \xetex\ or \luatex.
%
%\begin{table}\small
%\changes{v2.3a}{2008/02/25}{add table of available and enabled features}
%\caption{Availability of micro-typographic features}\label{tab:available-features}
%\catcode`\!=13 \def!{\textcolor{thegreen}{\hskip.9em $\bigstar$}}
%\catcode`\?=13 \def?{\textcolor{theblue} {\hskip 1em $\boxtimes$}}
%\catcode`\_=13 \def_{\textcolor{thered}  {\hskip 1em $\varnothing$}}
%\setlength\fboxsep{4pt}
%\leavevmode\kern-\dimexpr\fboxsep+\fboxrule\relax
%\fcolorbox{theframe}{white}{^^A
%\begin{minipage}{\textwidth}
%\def\arraystretch{1.2}
%\begin{tabular}{*3{@{}L{40pt}}*2{@{}L{43pt}}*4{@{}L{37pt}}@{}}
%      \multicolumn{3}{@{}l}{\footnotesize \TeX\ engine}
%    & \multicolumn{6}{@{}l}{\footnotesize Micro-typographic features}\\
%\cmidrule(r){1-3}\cmidrule{4-9}
%      \footnotesize Engine
%    & \footnotesize Version
%    & \footnotesize Output
%    & \footnotesize Protrusion
%    & \footnotesize Expansion
%    & \footnotesize (= auto)
%    & \footnotesize Kerning
%    & \footnotesize Spacing
%    & \footnotesize Tracking\\
%\cmidrule(r){1-1}\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}
% \pdftex
%    & $\less$ 0.14f & <DVI>/<PDF> & _ & _ & _ & _ & _ & _\\
%    & $\geq$  0.14f & <DVI>/<PDF> & ! & ? & _ & _ & _ & _\\
%    & $\geq$  1.20  & <DVI>       & ! & ? & _ & _ & _ & _\\
%    &               & <PDF>       & ! & ? & ! & _ & _ & _\\
%    & $\geq$  1.40  & <DVI>       & ! & ? & _ & ? & ? & _\\
%    &               & <PDF>       & ! & ? & ! & ? & ? & ?\\
%\cmidrule(r){1-3}
% \luatex ^^A we will have to re-model kerning and spacing with \luatex
%    & $\geq$  0.30  & <DVI>       & ! & ? & _ & _ & _ & _\\
%    &               & <PDF>       & ! & ? & ! & _ & _ & _\\
%    & $\geq$  0.62  & <DVI>       & ! & _ & \hskip1em\llap{(}\textcolor{theblue}{$\boxtimes$})\textsuperscript{\itshape a} & _ & _ & ?\\
%    &               & <PDF>       & ! & _ & ! & _ & _ & ?\\
%\cmidrule(r){1-3}
% \let\textoractual\@firstoftwo ^^A why?
% \xetex
%    & $\geq$ 0.9997 & <PDF>       & ! & _ & _ & _ & _ & _\\
%\bottomrule
%\end{tabular}^^A
%\vskip4pt\footnotesize
%\hskip-1em
% ! = enabled\quad
% ? = not enabled\quad
% _ = not available
%\hfill
% \textit{a}\quad by means of variable tracking\hskip1em
%\vskip4pt
%\end{minipage}^^A
%}\kern-\dimexpr\fboxsep+\fboxrule\relax ^^A end \fcolorbox
%\end{table}
%
%\medskip\noindent
% Table~\ref{tab:available-features} presents an overview of which
% micro-typographic features are available and enabled by default for the
% relevant \TeX\ versions and output modes.
%
%\medskip\noindent
% Whether ligatures should be disabled cannot be controlled via a package option
% but by using the \cs{DisableLigatures} command, which is explained in
% section~\ref{sec:disable-ligatures}.
%
%
%\subsection[Character protrusion]
%           {Character protrusion \requires{\pdftex~0.14f,\luatex~0.30,\xetex~0.9997}}
%           \label{sub:options-protrusion}
%
%\Describe{Option}{factor}{:integer}[1000]
% Using this option, you can globally increase or decrease the amount by which
% the characters will be protruded. While a value of 1000 means that the full
% protrusion as specified in the configuration (see section~\ref{sub:protrusion})
% will be used, a value of 500 would result in halving all protrusion factors of
% the configuration. This might be useful if you are generally satisfied with
% the settings but prefer the margin kerning to be less or more visible
% (\eg, 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).
%
%\medskip
%\Describe{Option}{unit}{!character,:dimension}
% This option is described in section~\ref{sub:protrusion}, apropos the command
% \cs{SetProtrusion}. Use with care.
%
%
%\subsection[Font expansion]
%           {Font expansion \requires{\pdftex~0.14f,\luatex~0.30}}
%           \label{sub:options-expansion}
%
%\Describe{Option}{auto}{*true,false}
% Beginning with \pdftex\ version 1.20 (inherited by \luatex), the expanded
% instances of the fonts may be calculated automatically and at run-time instead
% of the user having to prepare them in advance. This option is true
% by default provided that you are using a \TeX\ engine with this capability
% and the output mode is <PDF>.\footnote{
% With \pdftex, automatic font expansion does not work with bitmap fonts.
% Therefore, if you are using the Computer Modern Roman fonts in <T1> encoding,
% you should either install the \pkg{cm-super} package or use the Latin Modern
% fonts (package \pkg{lmodern}).}
%\changes{v1.9}{2005/08/27}{add remark about Type\,1 fonts required for
%                           automatic font expansion}
% If \opt{auto} is set to false, the font instances for all expansion steps must exist
% (with files called \meta{font~name}\texttt{\textpm}\meta{expansion value},
% \eg, \file{cmr12+10}, as described in the \cite{pdftexman}).
%\iffalse ^^A no longer true (1.40?)
% If expanded instances of the fonts are available, they will be used
% regardless whether \opt{auto} is true or not.
%\fi
% With \luatex, expansion is always automatic.
%
% When generating <DVI> files, font expansion has to be enabled explicitly.
% With \pdftex, \emph{automatic} font expansion will not work because
% the postprocessing drivers (|dvips|, |dvipdfm|, etc.) resp. the <DVI> viewer
% are not able to generate the fonts on the fly.
%^^A\changes{v2.7}{2017/07/06}{add remark about automatic font expansion with \texttt{dvilualatex}}
%\changes{v2.8}{2020/02/09}{squash fake news about automatic font expansion with \texttt{dvilualatex}}^^A
% With \luatex, on the other hand, expansion in <DVI> mode is realised by
% modifying the inter-letter spacing (tracking) instead of the glyphs
% themselves, which may or may not be desired.
%
%\medskip
%\Describe{Option}{stretch}{:integer}[20]
%\DescribeOption{shrink}
% You may specify the stretchability and shrinkability of a font, \ie, the
% maximum amount that a font may be stretched or shrunk. The numbers will be
% divided by 1000, so that a stretch limit of 10 means that the font may be
% expanded by up to~1\%.
% The default stretch limit is 20. The shrink limit will by default be the
% same as the stretch limit.
%
%\medskip
%\Describe{Option}{step}{:integer}[\MaybeDefault{1}]
% Fonts are not expanded by arbitrary amounts but only by certain discrete
% steps within the expansion limits. With recent versions of \pdftex\ (1.40 or
% newer) or \luatex, this option is by default set to 1, in order to allow
% trying the maximum number of font instances, and hence to guarantee
% the best possible output.\footnote{
%   The downside with this default is that \pdftex\ may run out of memory with
%   huge documents; in this case, read about the error messages in the `Hints
%   and caveats' section~(\ref{sec:caveats}), or try with a larger \opt{step}.}
% Older \pdftex\ versions, however, had to include every font instance in the
% <PDF> file, which may increase the file size quite dramatically. Therefore,
% in case you are using a pre-1.40 \pdftex\ version, \opt{step} is by default
% set to one fifth of the smaller value of \opt{stretch} and \opt{shrink}.
%
%\medskip
%\Describe{Option}{selected}{true,!false}
% When applying font expansion, it is possible to restrict the expansion of some
% characters that are more sensitive to deformation than others (\eg, the `O',
% in contrast to the `I'). This is called \emph{selected expansion}, and its
% usage allows increasing 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. Therefore, this option 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.
%
%
%\subsection[Tracking]
%           {Tracking \requires{\pdftex~1.40,\luatex~0.62}}
%           \label{sub:option-tracking}
%
%\Describe{Option}{letterspace}{:integer}[100]
% This option changes the default amount for tracking (see section~\ref{sub:tracking})
% resp. letterspacing (see section~\ref{sec:lettersp}). The amount is specified
% in thousandths of \EM{1}; admissible values are in the range of \textminus1000
% to +1000.
%
%
%\subsection{Miscellaneous options}\label{sub:options-misc}
%
%\changes{v2.0}{2006/11/28}{add remark about `\opt{draft}' option disabling \microtype\
%               (noted by \contributor Michalis Miatidis <miatidis\at informatik.rwth-aachen.de>)}
%                                                                    ^^A private mail, 2006/11/26
%\Describe{Option}{draft}{true,!false}
%\DescribeOption{final}
% If the \opt{draft} option is passed to the package, \emph{all
% micro-typographic extensions will be disabled}, which may lead to different
% line, and hence page, breaks. The \opt{draft} and \opt{final} options may
% also be inherited from the class options; of course, you can override them in
% the package options. E.g., if you are using the class option |draft| to
% show any overfull boxes, you should load \microtype\ with the |final|
% option.
%
%\medskip
%\Describe{Option}{verbose}{true,!false,errors,silent}
% Information on the settings used for each font will be written into the log
% file if you enable the \opt{verbose} option. When \microtype\ encounters a
% problem that is not fatal (\eg, an unknown character in the settings, or
% non-existent settings), it will by default only issue a warning and try to
% continue. Loading the package with |verbose=errors| will turn all warnings
% into errors, so that you can be sure that no problem will go unnoticed. If on
% the other hand you have investigated all warnings and decide to ignore them,
% you may silence \microtype\ with |verbose=silent|.
%
%\medskip
%\Describe{Option}{babel}{true,!false}
% Loading the package with the \opt{babel} option will adjust the typesetting
% according to the respective selected language. Read section~\ref{sec:context}
% for further information.
%
%\medskip
%\Describe{Option}{config}{:file name}[microtype]
% Various settings for this package will be loaded from a main configuration
% file, by default \file{microtype.cfg} (see section~\ref{sub:config-file}).
% You can have a different configuration file loaded instead by specifying its
% name \emph{without the extension}, \eg, |config=mycrotype|.
%
%\medskip
%\Describe{Option}{DVIoutput}{true,*false}
% \pdftex\ and \luatex\ are not only able to generate <PDF> output but can also
% spit out <DVI> files. In fact, all recent \TeX\ systems are using \pdftex\ as
% the default engine also for <DVI> output, and \luatex\ too can be called
% in <DVI> mode. However, since changing the output mode inside the document
% may have undesired effects, this option should be considered deprecated;
% instead, it is recommended to just call the respective program (|latex| resp.
% |dvilualatex|).
%\changes{v2.8}{2020/04/02}{declare \opt{DVIoutput} option deprecated}
% For \xetex, this option is not applicable.
%
%\iffalse
%\changes{v1.5}{2004/12/15}{add note about \opt{DVIoutput} option}
% The latter can be ordered with the option \opt{DVIoutput}, which will set
% \cmd\pdfoutput\ to zero.
% Note that this will confuse packages that depend on the value of
% \cmd\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, obviously, \pkg{ifpdf}. Either load these
% packages after \microtype\ or else issue the command |\pdfoutput=0| earlier
% -- in the latter case, the \opt{DVIoutput} option is redundant.
%\fi
%
%\iffalse ^^A ... waiting for bug reports before documenting yet another option ...
%\medskip
%\Describe{Option}{defersetup}{!true,false}
% Unlike in earlier versions, \microtype\ will since version 1.9a defer its
% setup until the end of the preamble. This has at least two advantages: the
% command \cs{microtypesetup} described below may be used to change package
% options later on, and it is no longer necessary to set the default fonts and
% encodings before loading \microtype. There is one possible problem: if a box
% is being constructed inside the preamble, \emph{and} this box contains a font
% that is not loaded before the box is being used in the document, then this
% font will not be set up. Should this extremely unlikely case occur, set
% |defersetup=false|. Then, however, the aforementioned restrictions apply.
%
%\medskip
%\Describe{Option}{copyfonts}{true,!false} ^^A and another one ...
% There are some restrictions as to what \pdftex\ can do with a font: Firstly,
% it cannot expand a single font with different parameters, secondly, it cannot
% apply different protrusion settings to one font within the same paragraph.
% Both restrictions, which only matter with a context-sensitive setup
% (cf.~section~\ref{sec:context}), can be circumvented with the \opt{copyfonts}
% option: when it is set to |true|, \microtype\ will use font copies to work
% on. This option will automatically be set to |true|, whenever protrusion or
% expansion settings with a |context| keyword are encountered. If these
% settings are loaded after the preamble, however, it is too late, and you
% should set the \opt{copyfonts} option manually.
% This only works with \pdftex\ 1.40.4 or later, or \luatex.
%\fi
%
%
%\subsection{Changing options later}\label{sub:options-cmd}
%
%\Describe{Macro}{\microtypesetup}{key\,|=|\,value list}
% Inside the preamble, this command accepts all package options described above
% (except for \key{config}).
% In the document body, this command may be used to change the general settings
% of the micro-typographic extensions. It then accepts all options from
% section~\ref{sub:options-microtype}: \key{expansion}, \key{protrusion} and
% \key{activate}, which in turn may receive the values |true|, |false|,
% |compatibility| or |nocompatibility|, and \key{tracking}, \key{kerning} and
% \key{spacing} with the admissible values |true| or |false|.
% Passing the name of a font set is not allowed.
% Using this command, you could for instance temporarily disable font expansion
% by saying:
%\begin{verbatim}
%\microtypesetup{expansion=false}
%\end{verbatim}
%
%
%\section{Selecting fonts for micro-typography}\label{sec:font-sets}
%
% By default, character protrusion will be applied to all text fonts used in
% the document, and a basic set of fonts will be subject to font
% expansion. You may want to customise which fonts should get the benefit of
% micro-typographic treatment. This can be achieved by declaring and activating
% `font sets'; these font sets are specified via font attributes that have to
% match.
%
%\medskip
%\Describe{Macro}{\DeclareMicrotypeSet}{?features,set name,set of fonts}
%\DescribeMacro{\DeclareMicrotypeSet*}
% This command declares a new set of fonts to which the micro-typographic
% extensions should be applied. The optional argument may contain a
% comma-separated list of features to which this set should be restricted.
% 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. In the main configuration file \file{microtype.cfg},
% a font set called `|basictext|' is defined as follows:
%\begin{verbatim}
%\DeclareMicrotypeSet{basictext}
%   { encoding = {OT1,T1,T2A,LY1,OT4,QX,T5,EU1,EU2,TU},
%     family   = {rm*,sf*},
%     series   = {md*},
%     size     = {normalsize,footnotesize,small,large}
%   }
%\end{verbatim}
% If you now call
%\begin{verbatim}[deletekeywords={[1]{protrusion}}]
%\UseMicrotypeSet[protrusion]{basictext}
%\end{verbatim}
% in the document's preamble, only fonts in the text encodings, roman or sans
% serif families, normal (or `medium') series, and in sizes called by
% \cmd\normalsize, \cmd\footnotesize, \cmd\small\ or \cmd\large, will be
% protruded. Math fonts, on the other hand, will not, since they are in another
% encoding. Neither will fonts in bold face, or huge fonts. Etc.
%
% If an attribute list is empty or missing -- like the `shape' attribute
% in the above example -- 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|', which is declared as:
%\begin{verbatim}
%\DeclareMicrotypeSet{alltext}
%   { encoding = {OT1,T1,T2A,LY1,OT4,QX,T5,TS1,EU1,EU2,TU} }
%\end{verbatim}
% is far less restrictive. The only condition here is that the encoding must
% match.
%
% If a value is followed by an asterisk (like `|rm*|' and `|sf*|' in the first
% example), it does not designate an <NFSS> code, but will be translated into
% the document's |\|\meta{value}|default|, \eg, \cmd\rmdefault.\footnote{
%   These translations will take place \cmd\AtBeginDocument, which means that
%   changes to the defaults inside the preamble will also be taken into account.
%   Only in cases where you change font defaults \cmd\AtBeginDocument\ yourself,
%   you need to load \microtype\ after these changes.}
% A single asterisk means |\|\meta{attribute}|default|, \eg,
% \cmd\encodingdefault, respectively \cmd\normalsize\ for the size axis.
% Sizes may either be specified as a dimension (`|10|' or `|10pt|'), or as a
% size selection command \emph{without} the backslash. You may also specify
% ranges (\eg, `|small-Large|'); while the lower boundary is included in the
% range, the upper boundary is not. Thus, `|12-16|' would match 12\,pt,
% 13.5\,pt and 15.999\,pt, for example, but not 16\,pt. You are allowed to omit
% the lower or upper bound (`|-10|', `|large-|').
%
% Additionally to this declaration scheme, you can add single fonts to
% a set using the `|font|' key, which expects the concatenation of all font
% attributes, separated by forward slashes, \ie,
%`|font|\,|=|\,\meta{encoding}|/|\meta{family}|/|\meta{series}|/|\meta{shape}|/|\meta{size}'.
% This allows you to add fonts to the set that are otherwise disjunct from it.
% For instance, if you wanted to have the roman family in all sizes protruded,
% but only the normal sized, possibly italic, typewriter font (in contrast to,
% say, the small one), this is how you could declare the set:
%\begin{verbatim}[deletekeywords={[1]{protrusion}}]
%\DeclareMicrotypeSet[protrusion]
%   { myset }
%   { encoding = T1,
%     family   = rm*,
%     font     = {T1/tt*/m/n/*,
%                 T1/tt*/m/it/*} }
%\end{verbatim}
% As you can tell from the example, the asterisk notation is also permitted for
% the |font| key. A single asterisk is equivalent to `|*/*/*/*/*|', \ie, the
% normal font. Size selection commands are possible, too, however, ranges are
% not allowed.
%
%\newcounter{nrfontsets}
%\begin{table}\microtypesetup{protrusion=false}\small
%\caption{Predefined font sets}\label{tab:predefined-font-sets}
%\catcode`\!=13 \def!{\textcolor{thered}{$\varnothing$}}
%\catcode`\/=13 \def/#1/{\textcolor{thegreen}{#1}}
%\def<#1>{\textcolor{theblue}{\acronym{#1}}}
%\def\s#1{|#1|\stepcounter{nrfontsets}}
%\setlength\fboxsep{4pt}
%\leavevmode\kern-\dimexpr\fboxsep+\fboxrule\relax
%\fcolorbox{theframe}{white}{^^A
%\begin{minipage}{\textwidth}
%\def\arraystretch{1.2}
%\begin{tabular}{@{}L{65pt}L{80pt}*2{L{40pt}}L{43pt}L{67pt}@{}}
%      \footnotesize Set name
%    & \multicolumn{5}{l}{\footnotesize Font attributes}\\
%\cmidrule{2-6}
%    & \footnotesize Encoding
%    & \footnotesize Family
%    & \footnotesize Series
%    & \footnotesize Shape
%    & \footnotesize Size\\
%\cmidrule(r){1-1}\cmidrule(r){2-2}\cmidrule(r){3-3}
%\cmidrule(r){4-4}\cmidrule(r){5-5}\cmidrule{6-6}
% \s{all}
%    & !
%    & !
%    & !
%    & !
%    & ! \\
%\cmidrule(r){1-1}
% \s{alltext}\linebreak(\s{allmath})
%    & Text encodings, <TS1>\linebreak (<OML>, <OMS>, <U>)
%    & !
%    & !
%    & !
%    & ! \\
%\cmidrule(r){1-1}
% \s{alltext-nott}\linebreak(\s{allmath-nott})
%    & Text encodings, <TS1>\linebreak (<OML>, <OMS>, <U>)
%    & /\cmd\rm|*|/,\linebreak/\cmd\sf|*|/
%    & !
%    & !
%    & ! \\
%\cmidrule(r){1-1}
% \s{basictext}\linebreak(\s{basicmath})
%    & Text encodings \linebreak (<OML>, <OMS>)
%    & /\cmd\rm|*|/,\linebreak/\cmd\sf|*|/
%    & /\cmd\md|*|/
%    & !
%    & /\cmd\normalsize/, /\cmd\footnotesize/, /\cmd\small/, /\cmd\large/\\
%\cmidrule(r){1-1}
% \s{smallcaps}
%    & Text encodings
%    & !
%    & !
%    & /\cmd\sc|*|/,/si/,/scit/
%    & ! \\
%\cmidrule(r){1-1}
% \s{footnotesize}
%    & Text encodings, <TS1>
%    & !
%    & !
%    & !
%    & |-|/\cmd\small/\\
%\cmidrule(r){1-1}
% \s{scriptsize}
%    & Text encodings, <TS1>
%    & !
%    & !
%    & !
%    & |-|/\cmd\footnotesize/\\
%\cmidrule(r){1-1}
% \s{normalfont}
%    & /\cmd\encoding|*|/
%    & /\cmd\family|*|/
%    & /\cmd\series|*|/
%    & /\cmd\shape|*|/
%    & /\cmd\normalsize/\\
%\bottomrule
%\end{tabular}
%\vskip4pt\footnotesize
% `Text encodings' = <OT1>, <T1>, <T2A>, <LY1>, <OT4>, <QX>, <T5>, <EU1>, <EU2>, <TU>
%\hfill
% `/\bslash\,\dots|*|/' = `/\bslash\,\dots|default|/'
%\vskip4pt
%\end{minipage}^^A
%}\kern-\dimexpr\fboxsep+\fboxrule\relax ^^A end \fcolorbox
%\ifcase\c@nrfontsets\or\or\or\or\or\or\or\or\or\or\or
%   \def\@currentlabel{eleven}\or \def\@currentlabel{twelve}\else
%   \PackageError{\MT@MT}{I cannot count any further}{}\fi\label{nrfontsets}
%\end{table}
%
%\medskip\noindent
% Table~\ref{tab:predefined-font-sets} lists the \ref*{nrfontsets} predefined font sets.
% They may also be activated by passing their name to the feature options
% \opt{protrusion}, \opt{expansion}, \opt{tracking}, \opt{kerning} and
% \opt{spacing} when loading the package, for example:
%\begin{verbatim}
%\usepackage[protrusion=allmath,tracking=smallcaps]{microtype}
%\end{verbatim}
%
%\ifcmr\else\pagebreak\fi ^^A layout
%\medskip
%\Describe{Macro}{\UseMicrotypeSet}{?features,set name}
% This command activates a font set previously declared by \cs{DeclareMicrotypeSet}.
% Using the optional argument, you can limit the application of the set to one
% or more features. This command only has an effect if the feature was activated
% in the package options.
%
%\medskip
%\Describe{Macro}{\DeclareMicrotypeSetDefault}{?features,set name}
% If a feature is enabled but no font set has been chosen explicitly, the sets
% declared by this command will be activated. By default, the `|alltext|' font
% set will be activated for character protrusion and additional kerning, the
% `|alltext-nott|' set for font expansion and interword spacing, and the
% `|smallcaps|' set for tracking.
%
%\medskip\noindent
% These commands may only be used in the preamble or in the main configuration
% file. Their scope is global to the document. Only one set per feature may be
% activated.
%
%
%\section{Micro fine tuning}\label{sec:fine-tuning}
%
% Every character asks for a particular protrusion, kerning or spacing amount.
% It may also be desirable to restrict the maximum expansion of certain
% characters. Furthermore, since every font looks different, settings have to
% be specific to a font or set of fonts. This package offers flexible and
% straight-forward methods of customising these finer aspects of
% micro-typography.
%
% All fine-tuning commands follow basically the same syntax: they all take
% three arguments; the first one is optional and may contain additional
% options; in the second argument, you specify the set of fonts to which the
% settings should apply; the third argument contains the actual settings.
% Here, as in all configuration commands, all spaces are ignored.
%
% The set of fonts to which the settings should apply is declared using the
% same syntax of \meta{font axis}\,|=|\,\meta{value list} pairs as for the
% command \cs{DeclareMicrotypeSet} (see section~\ref{sec:font-sets}), with the
% only difference that values including asterisks (which, as you may recall,
% stand for the respective default) will be translated immediately
% instead of at the end of the preamble.
% To find the matching settings for a given font the package will try all
% combinations of font encoding, family, series, shape and size,
% with decreasing significance in this order. For instance, if settings exist for
% both the current family (say, |T1/cmr///|) and for italic fonts in the
% normal weight (|T1//m/it/|), the settings for the |cmr| family would apply.
%\changes{v1.7}{2005/03/23}{remove table of match order
%                           (now table~\ref{tab:match-order} on page~\pageref{tab:match-order})}
% The encoding must always match.
%\iffalse
%^^A TODO: When using native TrueType\slash OpenType fonts (with \xetex\ or \luatex, and
%^^A the \pkg{fontspec} package), you may additionally restrict the settings to
%^^A certain |features|.
%\fi
%
% The characters may be specified either as a single letter (|A|),
% as a text symbol command (\cmd\textquoteleft), or as a slot number (resp.
% Unicode number for \luatex\ or \xetex): three or more  digits for decimal
% notation, prefixed with~|"| for hexadecimal, with~|'| for octal numerals (\eg, the
% `fl' ligature in <T1> encoding:~|029|, |"1D|, |'35|).
% \mbox{8-bit} (and even <UTF-8>) characters may be entered directly or in
% \LaTeX's traditional \mbox{7-bit} notation: both |\"A| and \expandafter|\"A|
% are valid, provided the character is actually declared in both the input and
% the font encoding.
% With \luatex\ or \xetex, you may additionally specify a (font-specific)
% glyph name, prefixed with `|/|' (\eg, the `fl' ligature as |/f_l|).
% Note that you also have the possibility to declare lists
% of characters that should inherit settings (see section~\ref{sub:inherit}).
%
%\subsection[Character protrusion]
%           {Character protrusion \requires{\pdftex~0.14f,\luatex~0.30,\xetex~0.9997}}
%           \label{sub:protrusion}
%
%\Describe{Macro}{\SetProtrusion}{?options,set of fonts,protrusion settings}
% Using this command, 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\% of its width into the
% left margin. This would apply to all font shapes, series and sizes of the
% <T1>~encoded Computer Modern Roman family.
%
%\paragraph{The protrusion settings}
% consist of \meta{character}\,|=|\,\meta{protrusion factors} pairs.
% The protrusion factors designate the amount that a character should be
% protruded into the left margin (first value) respectively into the right
% margin (second value). By default, the values are relative to the character
% widths, so that a value of 1000 means that the character should be shifted
% fully into the margin, while, for example, with a value of 50 it would be
% protruded by 5\% of its width. Negative values are admitted, as well as
% numbers larger than 1000 (but effectively not more than \EM{1} of the font).
% You may omit either number if the character should not be protruded on that
% side, but must not drop the separating comma.
%
%\paragraph{Options:}
%\begin{options}
%  \item[\key{name}] You may assign a name to the protrusion settings, so that you
%       are able to load it by another list.
%  \item[\key{load}] You can load another list (provided, you assigned
%       a name to it) before the current list will be loaded, so that the
%       fonts will inherit the values from the loaded list.
%      \par
%       In this way, the configuration may be simplified 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.
%       The following options will affect all loaded lists, in other words,
%       any options from the loaded lists will be ignored:\looseness=-1 ^^A layout
%\changes{v1.8}{2005/06/23}{add example for \texttt{factor} option}
%  \item[\key{factor}] This option can be used to influence all protrusion
%       factors of the list, overriding any global \opt{factor} setting (see
%       section~\ref{sub:options-protrusion}). For instance, if you want fonts
%       in larger sizes to be protruded less, you could load the normal lists,
%       just with a different factor applied to them:
%\begin{verbatim}
%\SetProtrusion
%   [ factor   = 700,
%     load     = cmr-T1 ]
%   { encoding = T1,
%     family   = cmr,
%     size     = large- }
%   { }
%\end{verbatim}
%  \item[\key{unit}] By default, the protrusion factors are relative to the
%       respective character's width. The |unit| option may be used to override
%       this and make \microtype\ regard all values in the list as thousandths
%       of the specified width. Issuing, for instance, `|unit=1em|' would have
%       the effect that a value of, say, 50 now results in the character being
%       protruded by 5\% of an em of the font (thus simulating the internal
%       measuring of \pdftex's \cmd\lpcode\ and \cmd\rpcode\ primitives).
%       The default behaviour can be restored with |unit=character|.\footnote{
%          The |unit| option can even be passed globally to the package (cf.
%          section~\ref{sub:options-protrusion}).
%          However, all provided settings are created under the assumption
%          that the values are relative to the character width. Therefore, you
%          should only change it if you are certain that the
%          default settings will not be used in your document.}
%  \item[\key{preset}] Presets the protrusion codes of all characters to the
%       specified values (|={|\meta{left}|,|\meta{right}|}|), possibly
%       scaled by a |factor|. A |unit| setting will only be taken into account
%       if it is not |=character|.
%  \item[\key{inputenc}] Selects an input encoding that should apply to this
%       list, regardless of what the document's input encoding is. You may
%       specify any encoding that can be loaded via the \pkg{inputenc} package,
%       \eg, |ansinew|, |koi8-r|, |utf8|.
%  \item[\key{context}] The scope of the list may be limited to a certain
%       context. For further details, see section~\ref{sec:context}.
%\end{options}
%
%
%\subsection[Font expansion]
%           {Font expansion \requires{\pdftex~0.14f,\luatex~0.30}}
%           \label{sub:expansion}
%
%\Describe{Macro}{\SetExpansion}{?options,set of fonts,expansion settings}
% 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} command. Note that it will only have an
% effect if the package has been loaded with the \opt{selected} option (cf.
% section~\ref{sub:options-expansion}). Otherwise, the expansion settings will
% be ignored~-- unlike the options in the optional first argument, which will
% still be evaluated.
% If the \opt{selected} option has been set to true, 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 for a particular font (set) all characters should be
% expanded or shrunk by the same amount, you would have to declare an empty
% list for these fonts.
%
%\paragraph{The expansion settings}
% consist 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 thousandths 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{Options:}
%\begin{options}
%  \item[\key{name}, \key{load}, \key{preset}, \key{inputenc}, \key{context}]
%       Analogous to \cs{SetProtrusion}, the optional argument may be used to
%       assign a name to the list, to load another list, to preset all
%       expansion factors, to set the input encoding, or to determine the
%       context of the list (expansion contexts are only possible with \pdftex\
%       version 1.40.4 or newer).
%\changes{v1.8}{2005/04/12}{add example of how to get rid of a widow
%               (suggested by \contributor Adam Kucharczyk <adamk\at ijp-pan.krakow.pl>)}
%                                                          ^^A private mail, 2005/04/09
%  \item[\key{auto}, \key{stretch}, \key{shrink}, \key{step}]
%       These keys can be used to override the global settings from the package
%       options (see section~\ref{sub:options-expansion}). 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).
%
%       As a practical example, suppose you have a paragraph containing a widow
%       that could be avoided by shrinking the font a bit more.
%       In conjunction with the |context| option (see section~\ref{sec:context}
%       for further details), you could thus allow for more expansion in this
%       particular paragraph:
%\begin{verbatim}[gobble=2]
% \SetExpansion
%    [ context = sloppy,
%      stretch = 30,
%      shrink  = 60,
%      step    =  5  ]
%    { encoding = {OT1,T1,TS1} }
%    { }
% % ... END PREAMBLE
% {\microtypecontext{expansion=sloppy}%
%  This paragraph contains a `fussy' widow.}
%\end{verbatim}
%       This method of employing contexts to temporarily apply different
%       expansion parameters only works with \pdftex\ version 1.40.4 or later,^^A
%         \footnote{For older versions, a dirty trick is laid out in
%                   section~\ref{ssec:font-setup} on page~\pageref{exp-hack}.}
%       or with \luatex.
%       Also note that both \pdftex\ and \luatex\ prohibit the use of fonts with different expansion
%       limits or steps (even of different fonts) within one paragraph, hence
%       the |sloppy| context would have to be applied to complete paragraphs.
%  \item[\key{factor}]
%       This option provides a different method to alter expansion settings for
%       certain fonts, working around the restriction just mentioned. The
%       |factor| option influences the expansion factors of all characters (in
%       contrast to the overall stretchability) of the font. For instance, if
%       you want the italic shape to be expanded less, you could declare:
%\begin{verbatim}
%\SetExpansion
%   [ factor   = 500 ]
%   { encoding = *,
%     shape    = it }
%   { }
%\end{verbatim}
%       The |factor| option can only be used to \emph{decrease} the
%       stretchability of the characters, that is, it may only receive values
%       smaller than 1000. Also, it can only be used for single fonts or font
%       sets; setting it globally in the package options wouldn't make much
%       sense -- to this end, you use the package's \opt{stretch} and
%       \opt{shrink} options.
%\end{options}
%
%
%\subsection[Tracking]
%           {Tracking \requires{\pdftex~1.40,\luatex~0.62}}
%           \label{sub:tracking}
%
%\Describe{Macro}{\SetTracking}{?options,set of fonts,tracking amount}
% An important typographic technique -- which was missing in \TeX\ for a long
% time -- is the adjustment of tracking, \ie, the uniform addition or
% subtraction of letter space to/from all the characters in a font. For
% example, it is good typographic practice to slightly space out text set in
% all capitals or small capitals (as in this document). Legibility may also be
% improved by minimally increasing the tracking of smaller and decreasing that
% of larger type.\footnote{
%     With full-featured fonts like Computer Modern, this is usually not
%     necessary, though, since they come in optical sizes, and the tracking of
%     the small-capitals font is already adjusted.}
% The \cs{SetTracking} command allows specifying the tracking amount for
% different fonts or font sets. It will also be evaluated by the \cs{textls}
% command, which may be used for letterspacing shorter pieces of text (see
% section~\ref{sec:lettersp}).
%
%\paragraph{The tracking amount}
% is specified in thousandths of \EM{1} (or the given unit); negative values are
% allowed, too.
%
%\paragraph{Options:}
%\begin{options}
%  \item[\key{name}, \key{unit}, \key{context}]
%       These options serve the same functions as in the previous configuration
%       commands. The unit may be any dimension, default is \EM{1}.
%  \item[\key{spacing}]
%       When the inter-\emph{letter} spacing is altered, the inter-\emph{word}
%       spacing probably also needs to be adjusted. This option expects three
%       numbers for interword space, stretch and shrink respectively, which are
%       given in thousandths of \EM{1} (or of the current \texttt{unit}). If a
%       value is followed by an asterisk, it denotes thousandths of the
%       respective font dimension which will be added to it. For instance, with
%\begin{verbatim}
%\SetTracking[ spacing = {25*,166, } ]{ encoding = *, shape = sc }{ 25 }
%\end{verbatim}
%       the interword space will be increased by 2.5\%, the stretch amount will
%       be set to \EM{0.166}, while the shrink amount will be left untouched. If
%       you don't specify the \texttt{spacing} option, the interword space will
%       be scaled by the current letterspace amount (as in the above example),
%       while stretch and shrink will not be changed.
%  \item[\key{outer spacing}]
%       If an interword space immediately precedes or follows letterspaced text,
%       it will by default be equal to that within the text. With this option,
%       which accepts the same values as \texttt{spacing}, it may be adjusted
%       independently.
%  \item[\key{outer kerning}]
%       If, on the other hand, no interword space precedes or follows, you may
%       still want to slightly set off the first and last letter from adjoining
%       letters. This option expects the kerning amounts for left and right hand
%       side, separated by a comma, in thousandths of \EM{1} (or the current
%       \texttt{unit}). If a value is followed by an asterisk, it denotes
%       thousandths of the current letterspacing amount. A single asterisk means
%       `|500*|'; this is also the default, \ie, the sum of the outer kerns is
%       by default equal to the current letterspace amount. To remove kerning on
%       both sides, you would write `|outer kerning={0,0}|'.
%  \item[\key{no ligatures}]
%       By default, ligatures in letterspaced fonts will be
%       constructed as usual, which may be advisable when changing the
%       tracking by only a small amount. For larger letterspacing amounts, on
%       the other hand, the normal letter space within ligatures would have
%       displeasing \textls[150]{e\lslig{ff}ects}.
%       This key expects a comma-separated list of characters for which
%       ligatures should be disabled; only the character that begins a ligature
%       must be specified.
%       If the key is given without a value, \emph{all} ligatures of the font
%       will be disabled. With \pdftex, this is not recommended, however,
%       since it entails that kerning will be switched off, too. With \luatex,
%       there is no such limitation.
%       The default settings disable ligatures for the character `|f|' only,
%       \ie, `ff', `fi', ffi', etc.\footnote{
%         With \pdftex\ versions older than 1.40.4, \emph{all} ligatures, and
%         hence all kerning, will be disabled. It is therefore recommended to
%         use at least version 1.40.4.}
%       In exceptional situations, you can manually break up a ligature by
%       inserting `|{\kern0pt}|' resp. \pkg{babel}'s \verb="|=
%       shortcut, or protect it by enclosing it in \cs{lslig} (see
%       section~\ref{sec:lettersp}).
%\end{options}
%
%\ifx\lssample\undefined
% \fallbacktext{The original documentation\footnote{
%     \ctanurl{macros/latex/contrib/microtype/microtype.pdf}.}
%   includes an image illustrating all of these options.}
%\medskip\noindent
% As an
%\else
%\changes{v2.3}{2007/11/03}{add letterspacing illustration}
%\medskip\noindent
% Since a picture is worth a thousand words, probably even more if, in our
% case, it depicts a couple of letterspaced words, let's bring one to sum up
% these somewhat confusing options. Suppose you had the following settings
% (which are in no way recommended; they only serve illustrative purposes):
%\begin{verbatim}
%\SetTracking
%  [ no ligatures  = {"\anchorarrow{nolig}"f},
%    spacing       = {60"\anchorarrow{ispace}"0*,-1"\anchorarrow{istretch}"00*, "\anchorarrow{ishrink}"},
%    outer spacing = {4"\anchorarrow{ospace}"50,2"\anchorarrow{ostretch}"50,1"\anchorarrow{oshrink}"50},
%    outer kerning = {"\anchorarrow{okernbegin}"*,"\anchorarrow{okernend}"*} ]
%  { encoding = * }
%  { 1"\anchorarrow{lsamount}"60 }
%\end{verbatim}
% and then write:
%\begin{verbatim}
%Stop \textls{stealing sheep}!
%\end{verbatim}
% this would be the (typographically dubious) outcome:
%
% \lssample
%
%\noindent
% While the word `Stop' is not letterspaced, the space between the letters in
% the other two words is expanded by the \showarrow[tracking]{tracking~amount}{red}
% of \EM{160/1000}\,=\allowbreak\,\EM{0.16}.
% The \showarrow[ispace]{inner~space}{green} within the letterspaced text is
% increased by 60\%, while its \showarrow[istretch]{stretch}{green} amount is
% decreased by 10\% and the \showarrow[ishrink]{shrink}{green} amount is left
% untouched.
% The \showarrow[ospace]{outer~space}{green} (of \EM{0.45}) immediately before the
% piece of text may \showarrow[ostretch]{stretch}{green} by \EM{0.25} and
% \showarrow[oshrink]{shrink}{green} by \EM{0.15}.
% Note that there is no outer space after the text, since the exclamation mark
% immediately follows; instead, the default \showarrow[okern]{outer~kern}{red}
% of half the letterspace amount (\EM{0.08}) is added.
% Furthermore, one \showarrow{ligature}{grey} wasn't broken up, because we
% neglected to specify the `|s|' in the |no ligatures| key.
%
%\medskip\noindent
% As another, more realistic
%\fi
%                            example, suppose you want to space out all small
% capitals by \EM{50/1000}, fonts smaller than \cmd\small\ by \EM{0.02}, and to
% decrease the tracking of large type by \EM{0.02}. This could be achieved with
% the following settings:
%^^A there's a \nobreakspace ahead!
%\begin{verbatim}
%\usepackage[tracking=true]{microtype}
%\DeclareMicrotypeSet*[tracking]{my}
%   { encoding = *,
%     size     = {-small,Large-},
%     font     = */*/*/sc/* }
%\SetTracking[ no ligatures = f ]{ encoding = *, shape = sc}{ 50 }
%\SetTracking{ encoding = *, size = -small }{  20 }
%\SetTracking{ encoding = *, size = Large- }{ -20 }
%\end{verbatim}
%
%\medskip\noindent
% Letterspaced fonts for which settings don't exist will be spaced out by the
% default of \EM{0.1} (adjustable with the package option \opt{letterspace}, see
% section~\ref{sub:options-misc}). Suppose your editor wants you to shorten
% your 1000-pages chef-d'\oe uvre by a handful of pages, you could load
% \microtype\ with (fingers crossed):
%\begin{verbatim}
%\usepackage[tracking=alltext,letterspace=-40]{microtype}
%\end{verbatim}
%
%
%\subsection[Additional kerning]
%           {Additional kerning \requires{\pdftex~1.40}}
%           \label{sub:kerning}
%\todo{Rename to \cs{SetSidebearing}}
%\Describe{Macro}{\SetExtraKerning}{?options,set of fonts,kerning settings}
% With this command, you can fine tune the extra kerning. In contrast to
% standard kerning, which is always associated with a \emph{pair} of
% characters, and to tracking, which specifies the space between \emph{all}
% characters of a font, the extra kerning relates to single characters, that
% is, whenever a particular character appears in the text, the specified
% kerning will be inserted, regardless of which character precedes resp.
% follows it.
% (Put differently, this feature allows modifying the left or right
% \textit{sidebearings} of specific glyphs.)
%
%\emptypdfpageresources ^^A layers of letterspacing illustration
%
% It should not be neglected to mention a limitation of this feature:
% words \emph{immediately following} such a kern (not separated by a space)
% will not be hyphenated, unless you insert the breakpoints manually, \eg, for
% kerning after the apostrophe, `|l'apos\-trophe|'.
%\changes{v2.7}{2016/10/16}{mention that additional kerning does not work in math mode
%                            (discovered by `\contributor Daniel <@\at @>')}
%                           ^^A https://tex.stackexchange.com/questions/332695/microtype-kerning-in-math-mode-with-mathdesign-charter
% Furthermore, additional kerning will not be applied in math mode.
% These restrictions of \pdftex\ will hopefully be lifted some time.
%
%\paragraph{The kerning settings}
% are specified as pairs of \meta{character}\,|=|\,\meta{kerning values}, where
% the latter consist of two values: the kerning added before the character, and
% the kerning appended after the respective character. Once again, either value
% may be omitted, but not the separating comma.
%
%\paragraph{Options:}
%\begin{options}
%  \item[\key{name}, \key{load}, \key{factor}, \key{preset}, \key{inputenc}]
%       These options serve the same function as in the previous configuration
%       commands.
%  \item[\key{unit}] Admissible values are: |space|, |character| and a
%       \meta{dimension}. By default, the values denote thousandths of \EM{1}.
%  \item[\key{context}] When it comes to kerning settings, this option is
%       especially useful, since it allows applying settings depending on the
%       current language.
%      \par
%       For example, you can find the following settings, intended to be used
%       for documents written in French, in the main configuration file:
%\begin{verbatim}[deletekeywords={[1]{unit}}]
%\SetExtraKerning
%   [ name     = french-default,
%     context  = french,
%     unit     = space   ]
%   { encoding = {OT1,T1,LY1} }
%   {
%     :  = {1000,}, % = \fontdimen2
%     ;  = {500, }, % ~ \thinspace
%     !  = {500, },
%     ?  = {500, }
%   }
%\end{verbatim}
%\changes{v2.3}{2007/11/20}{add kerning sample}
%\ifluatex
% \fallbacktext{Since this document was compiled with |luatex| instead of
%   |pdftex|, it does not\\include the sample that the original documentation
%   features.}
%\else
%      \begin{microtypecontext}{kerning=french}
%       What is the result of these settings? If they are active, like in the
%       current paragraph, a thin space will be inserted in front of each
%       question mark, exclamation mark and semicolon; a normal space in front
%       of the colon. Read section~\ref{sec:context} to learn how to activate
%       these settings! This paragraph was input like this:
%      \end{microtypecontext}
%\begin{verbatim}[deletekeywords={[1]{context,activate}}]
%\begin{microtypecontext}{kerning=french}
% What is the result of these settings? If they are active, like in the
% current paragraph, a thin space will be inserted in front of each
% question mark, exclamation mark and semicolon; a normal space in front
% of the colon. Read section~\ref{sec:context} to learn how to activate
% these settings! This paragraph was input like this:
%\end{microtypecontext}
%\end{verbatim}
%\fi
%\end{options}
%
%
%\subsection[Interword spacing]
%           {Interword spacing \requires{\pdftex~1.40}}
%           \label{sub:spacing}
%
%\Describe{Macro}{\SetExtraSpacing}{?options,set of fonts,spacing settings}
% This command allows you to fine tune the interword spacing (also known as
% glue). A preliminary remark on what a `space' is may be in order: between two
% words, \TeX\ will insert a so called glue, which is characterised by three
% parameters -- the normal distance between two words, the maximum amount of
% space that may be added to it, and the maximum amount that may be subtracted.
% The latter two parameters come into effect whenever \TeX\ tries to break a
% paragraph into lines and does not succeed; it can then stretch or shrink the
% spaces between words. These three parameters are specific to each font.
%
% On top of these glue dimensions, \TeX\ has the concept of `space factors'.
% They may be used to increase the space after certain characters, most
% prominently the punctuation characters. \pdftex's additional spacing
% adjustment may be considered as an extension to space factors with much
% finer control: while space factors will influence all three parameters of
% interword space (or glue) by the same amount~-- the kerning, the maximum
% amount that the space may be stretched and the maximum amount that it may be
% shrunk~-- you may modify these parameters independently from one another.
% Furthermore, the values may be set differently for each font. And, probably
% most importantly, the parameters may not only be increased but also decreased.
% Note that when interword spacing adjustment is in effect, space factors are
% ignored.
%
%\paragraph{The spacing settings}
% are declared as pairs of \meta{character}\,|=|\,\meta{spacing factors}, where
% the latter consist of three numbers: first, the additional kern inserted
% after this character if it appears before an interword space, second, the
% additional stretch amount, and third, the additional shrink amount. All
% values may also be negative, in which case the dimensions will be decreased.
% Not all values have to be specified, but the settings must always contain the
% two separating commas.
%
%\paragraph{Options:}
%\begin{options}
%  \item[\key{name}, \key{load}, \key{factor}, \key{preset}, \key{inputenc}, \key{context}]
%       These options serve the same function as in the previous configuration
%       commands.
%  \item[\key{unit}] You can specify the unit by which the specified numbers are
%       measured. Possible values are: |character|, a \meta{dimension} and,
%       additionally, |space|. The latter will measure the values in thousandths
%       of the respective space dimension set by the font. By default, the unit
%       is measured by the space dimensions. For example, with the following
%       (nonsensical) settings:
%\begin{verbatim}
%\SetExtraSpacing
%   [ unit = space  ] % default
%   { font = */*/*/*/* }
%   {
%       .  = {1000,1000,1000},
%   }
%\end{verbatim}
%       the space inserted after a full stop would be doubled (technically
%       speaking: 2\,\texttimes\ \fontdim2), as would the maximum stretch and
%       shrink amounts of the interword space (\fontdim3 and~4). Conversely,
%       setting all three values to \textminus1000 would completely cancel a
%       space after the respective character.
%\end{options}
%
%
%\subsection{Character inheritance}\label{sub:inherit}
%
% \Describe{Macro}{\DeclareCharacterInheritance}
%                 {?features,set of fonts,inheritance lists}
% In most cases, accented characters should inherit the settings 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 (absolute)
% amount as the character A. Using the command \cs{DeclareCharacterInheritance},
% you may declare such classes of characters, so that you then only have to set
% up the respective base character. With the optional argument, which may
% contain a comma-separated list of features, you can confine the scope of the
% list. Additionally, it accepts the \key{inputenc} key to set the input encoding
% for this list. The font set can be declared in the usual way. The inheritance
% lists are declared as pairs of \meta{base character}\,|=|\,\meta{list of
% inheriting characters}. Unless you are using a different encoding or a very
% peculiarly shaped font, there should be no need to change the default
% character inheritance settings.
%
% The situation is different with \luatex\ and \xetex, however: the default
% inheritance settings only contain those glyhps that can safely be assumed to
% exist in any font; but since OpenType fonts may contain many more glyphs for
% different scripts (languages), it is quite probable that font-specific
% settings are necessary, which should be specified in the font's configuration
% file (see next section).
%
%
%
%\subsection{Configuration files}\label{sub:config-file}
%
% The default configuration, consisting of inheritance settings, declarations
% of font sets and alias fonts, and generic protrusion, expansion, spacing and
% kerning settings, will be loaded from the file \file{microtype.cfg}. You may
% extend this file with custom settings (or load a different configuration file
% with the `\opt{config}' option, see section~\ref{sub:options-misc}).
%
% If you embark on creating new settings for a font family, you should
% put them into a separate file, whose name must be: `|mt-|\meta{font
% family}|.cfg|' (\eg, `\file{mt-cmr.cfg}'; any spaces in the font name should
% be removed, \eg, `\file{mt-MinionPro.cfg}'), and may contain all commands
% described in the current section~\ref{sec:fine-tuning}. These files will be
% loaded automatically if you are actually using the respective fonts.
% This package ships with configuration files for a number of font families.
% Table~\ref{tab:fonts} lists them all.
%
%\enlargethispage{\baselineskip} ^^A layout
%\begin{table}[t]\small
%\changes{v1.6a}{2005/02/02}{add table of fonts with tailored protrusion settings}
%\caption{Fonts with tailored protrusion settings}\label{tab:fonts}
%\setlength\fboxsep{4pt}
%\leavevmode\kern-\dimexpr\fboxsep+\fboxrule\relax
%\fcolorbox{theframe}{white}{^^A
%\begin{minipage}{\textwidth}
%\def\arraystretch{1.2}
%\long\def\@makefntext#1{%
%  \leftskip 1em
%  \parindent -1em
%  \everypar{\parindent -1em}%
%  \leavevmode\hbox to 1em{\@thefnmark\hss}#1}
%\let\footnoterule\relax
%\def\fnref#1{\textsuperscript{\itshape\ifpdf\ref*{#1}\else\ref{#1}\fi}}
%\begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}*3l@{}}
%       \footnotesize Font family (<NFSS> code)
%      & \multicolumn{2}{l}{\footnotesize Features}\\
%\cmidrule{2-3}
%      & \footnotesize Encodings [Scripts]
%      & \footnotesize Shapes\\
%\cmidrule{1-1}\cmidrule{2-2}\cmidrule{3-3}
% Generic
%      & <OT1>, <T1>, <T2A>, <LY1>, <QX>, (<TS1>)\footnote{Incomplete\label{fn:incmpl}}
%      & n, (it, sl, sc)\fnref{fn:incmpl} \\
% Computer Modern Roman (|cmr|)\footnote{Aliases: Latin Modern Roman (|lmr|),
%                                        \pkg{ae} (|aer|), \pkg{zefonts} (|zer|),
%                                        \pkg{eco} (|cmor|), \pkg{hfoldsty} (|hfor|)}
%      & <OT1>, <OT4>, <T1>, <T2A>, <T5>, <LY1>, <TS1>
%      & n, it, sl, sc \\
% Bitstream Charter (|bch|)\footnote{Aliases: \pkg{mathdesign}/Charter (|mdbch|),
%                                    MicroPress's \pkg{chmath} (|chr|), \pkg{XCharter}}
%      & <OT1>, <T1>, <T5>, <LY1>, <TS1>
%      & n, it, (sl)\footnote{Settings inherited from italic shape\label{fn:it-sl}}, sc \\
% Adobe Garamond (|pad|, |padx|, |padj|)
%      & <OT1>, <T1>, <LY1>, <TS1>
%      & n, it, (sl)\fnref{fn:it-sl}, sc \\
% <URW> Garamond (|ugm|)\footnote{Aliases: \pkg{mathdesign}/<URW> Garamond (|mdugm|), \pkg{garamondx} (|zgmx|, |zgmj|)}
%      & <OT1>, <T1>, <TS1>
%      & n, it\\
% Bitstream Letter Gothic (|blg|)\footnote{Alias: \pkg{ulgothic} (|ulg|)}
%      & <OT1>, <T1>, <TS1>
%      & n, it \\
% Adobe Minion (|pmnx|, |pmnj|)
%      & <OT1>, <T1>, <T2A>, <LY1>, <TS1>
%      & n, it, (sl)\fnref{fn:it-sl}, sc, si\\
% Palatino (|ppl|, |pplx|, |pplj|)\footnote{Aliases: \pkg{pxfonts} (|pxr|),
%                                           \pkg{qfonts}/QuasiPalatino, \TeX\ Gyre Pagella (|qpl|),
%                                           \pkg{newpx}, <FPL> Neu (|fp9x|, |fp9j|), \pkg{domitian}}
%      & <OT1>, <OT4>, <T1>, <LY1>, (<TS1>)\fnref{fn:incmpl}
%      & n, it, (sl)\fnref{fn:it-sl}, sc \\
% Times (|ptm|, |ptmx|, |ptmj|)\footnote{Aliases: \pkg{txfonts} (|txr|),
%                                        \pkg{qfonts}/QuasiTimes, \TeX\ Gyre Termes (|qtm|),
%                                        \pkg{newtx}, \pkg{tempora}, \pkg{step}, \pkg{stix}/\pkg{stix2}}
%      & <OT1>, <OT4>, <T1>, <LY1>, <QX>, (<TS1>)\fnref{fn:incmpl}
%      & n, it, (sl)\fnref{fn:it-sl}, sc \\
% Latin Modern Roman\footnote{Alias: New Computer Modern}
%      & <EU1>/<2>, <TU> [Latin, Greek]
%      & n, it, (sl)\fnref{fn:it-sl}\\
% Charis <SIL>
%      & <EU1>/<2>, <TU> [Latin, Cyrillic, Greek]
%      & n, it, sc\\
%\iffalse ^^A provided with the EB Garamond package
% <EB> Garamond
%      & <EU1>/<2>, <TU> [Latin, Cyrillic, Greek]
%      & n, it, sc, si\\
%\fi
% Palatino Linotype\footnote{Aliases: \TeX\ Gyre Pagella, Palatino <LT> Std, Palatino, Domitian}
%      & <EU1>/<2>, <TU> [Latin]
%      & n, it, sc\\
% Computer Modern math (|cmsy|, |cmm|)\footnote{Aliases: Latin Modern (|lmsy|, |lmm|)}
%      & <OML>/<OMS>
%      & n/it \\
% <AMS> symbols (|msa|, |msb|)
%      & <U>
%      & n\\
% Euler (|eur|, |eus|, |euf|)\footnote{Alias: \pkg{eulervm} (|zeur|, |zeus|)}
%      & <U>
%      & n\\
% Euro symbols (Adobe, <ITC>, \pkg{marvosym})
%      & <U>/<OT1>
%      & n, it \\
%\bottomrule
%\end{tabular*}^^A
%\end{minipage}^^A
%}\kern-\dimexpr\fboxsep+\fboxrule\relax ^^A end \fcolorbox
%\end{table}
%
%\medskip
%\Describe{Macro}{\DeclareMicrotypeVariants}{list of suffixes}
%\DescribeMacro{\DeclareMicrotypeVariants*}
% On its search for a configuration file, the package will also try to remove
% from the font name a suffix of one or more letters that denotes a `variant'
% of the base font (cf. Karl Berry's \cite{fontname}). It is thus possible to
% put settings for, \eg, the fonts |padx|~(expert set), |padj| (oldstyle
% numerals) and |pad| (plain) into one and the same file \file{mt-pad.cfg}.
% This command expects a comma-separated list of variant suffixes. The starred
% version appends the suffix(es) to the existing list. The default declaration
% in \file{microtype.cfg} is:
%\begin{verbatim}
%\DeclareMicrotypeVariants{x,j,w,a,d,0,1}
%\end{verbatim}
%
%\medskip
%\Describe{Macro}{\DeclareMicrotypeAlias}{font name,alias font}
% This command may be used for fonts that are very similar, or actually the
% same (for instance if you did not stick to the Berry naming scheme when
% installing a font). An example would be the Latin Modern fonts, which are
% derived from Computer Modern, so that it is not necessary 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, along with some others, in the default configuration file.
%
%\medskip
%\Describe{Macro}{\LoadMicrotypeFile}{font name}
% In rare cases, it might be necessary to load a font configuration file
% manually, for instance, from within another configuration file, or to be able
% to extend settings defined in a file that would otherwise not be loaded
% automatically, or would be loaded too late.\footnote{
%    Font package authors might also want to have a look at the hook
%    \cs{Microtype@Hook}, described in the implementation part,
%     section~\ref{sub:hook}.}
% This command will load the file `|mt-|\meta{font name}|.cfg|'.
%
%
%\section{Context-sensitive setup}\label{sec:context}
%
% The \microtype\ package also allows applying different micro-typographic
% settings to the fonts depending on the context in which they occur. This
% opens up the space for infinite possibilities of tweaking the document's
% appearance.
%  ^^A\footnote{
%  ^^A With \luatex, you have to load the fonts with the \cite{fontspec} option
%  ^^A `|Renderer=Basic|'.}  ^^A Otherwise, OpenType feature will be ignored (+smcp being one of them)
%
%\medskip
%\Describe{Macro}{\microtypecontext}{context assignments}
% This command may be used anywhere in the document (also in the preamble) to
% change the micro-typographic context in the current group. To each feature
% (\key{protrusion}, \key{expansion}, (or \key{activate} as a shortcut for both),
% \key{tracking}, \key{spacing} and \key{kerning}), one context may be assigned.
% Consequently, only settings with the corresponding `|context|' keyword will be applied.
%
%\medskip
%\Describe{Env}{microtypecontext}{context assignments}
% Like many \LaTeX\ commands, it is also available in the form of an environment.
%
%\medskip
%\Describe{Macro}{\textmicrotypecontext}{context assignments,general text}
% As another possibility, the command \cs{textmicrotypecontext} sets the
% context(s) for the text given in the second argument.
%
%\changes{v1.9c}{2006/01/25}{add example of how to increase protrusion of footnote markers
%                (suggested by \contributor Georg Verweyen <verweyen\at gmail.com>)}
%                                                     ^^A private mail, 2006/01/25
%\medskip\noindent
% Suppose you want the footnote markers in the text to be protruded by a larger
% amount. You could define settings for the numbers:
%\begin{verbatim}
%\SetProtrusion
%   [ context = footnote ]
%   { font    = */*/*/*/scriptsize } % adapt if necessary
%   { 1 = { ,650}, 2 = { ,400}, 3 = { ,400}, 4 = { ,400}, 5 = { ,400},
%     6 = { ,400}, 7 = { ,500}, 8 = { ,400}, 9 = { ,400}, 0 = { ,400} }
%\end{verbatim}
% and have the context changed in the footnote marker command. This command
% differs among the various classes; for the base classes, \eg, \pkg{article},
% it would be:
%\begin{verbatim}
%\newcommand*\new@makefnmark{\hbox{\@textsuperscript{\normalfont
%   \microtypecontext{protrusion=footnote}\@thefnmark}}}
%\renewcommand*\@footnotemark{%
%   \leavevmode \ifhmode\edef\@x@sf{\the\spacefactor}\nobreak\fi
%   \new@makefnmark \ifhmode\spacefactor\@x@sf\fi \relax}
%\end{verbatim}
% For the \pkg{memoir} class, you would additionally have to disable
% auto-detection of multiple footnotes, which prevents protrusion:
%\begin{verbatim}
%\renewcommand*\@makefnmark{\hbox{\@textsuperscript{\normalfont
%   \microtypecontext{protrusion=footnote}\@thefnmark}}}
%\let\m@mmf@prepare\relax
%\let\m@mmf@check\relax
%\end{verbatim}
% ^^A For other classes, the command would have to be changed in a similar way.
%
%\medskip\noindent
% Another possibility would be to employ contexts for a language-dependent
% setup. For instance, if you are writing a text in French, you could add:
%\begin{verbatim}
%\microtypecontext{kerning=french}
%\end{verbatim}
% to the preamble. This would have the effect that kerning settings for the
% French context would be applied to the document. Should parts of the document
% be in English, you could write:
%\begin{verbatim}
%\textmicrotypecontext{kerning=}{English text!}
%\end{verbatim}
% to reset the context, so that the punctuation characters in these parts will
% not receive any extra kerning.
%
% Instead of adding these commands manually to your document, you may also load
% \microtype\ with the \opt{babel} option (see section~\ref{sub:options-misc}).
% The current language will then be automatically detected and the contexts set
% accordingly.
%
%\medskip
%\Describe{Macro}{\DeclareMicrotypeBabelHook}
%                {list of \pkg{babel} languages,context list}
% Naturally, \microtype\ does not know about the typographic specialties of
% every language. This command is a means of teaching it how to adjust the
% context when a particular language is selected. The main configuration file
% contains among others the following declaration:
%\begin{verbatim}
%\DeclareMicrotypeBabelHook
%   {french,francais,acadian,canadien}
%   {kerning=french, spacing=}
%\end{verbatim}
% Consequently, whenever you switch to the French language, the kerning context
% will be changed to `|french|' and the spacing context will be reset. This
% hook only has an effect if the package was loaded with the \opt{babel} option.
% Currently, \microtype\ supports French and Turkish kerning and English
% spacing (aka. \cmd\nonfrenchspacing). For unknown languages, all contexts
% will be reset.
%
%
%\section[Letterspacing revisited]
%        {Letterspacing revisited \requires{\pdftex~1.40,\luatex~0.62}}
%        \label{sec:lettersp}
%
%\Describe{Macro}{\textls}{?amount,general text}
% While the \opt{tracking} feature, described in section~\ref{sub:tracking},
% will apply to sets of fonts, you may also want to letterspace shorter pieces
% of text, regardless of the font in which they are typeset.\footnote{
%   Letterspacing should be used cautiously; in particular, letterspacing
%   lowercase text is held in abhorrence by honourable typographers. Unless
%   you know what you are doing, you should probably only letterspace
%   capitals or small capitals. Another just cause may be emphasis in texts
%   typeset in Fraktur fonts.}
% For such ad-hoc letterspacing, \microtype\ introduces two commands that can
% be used (independently of whether the |tracking| option is enabled) in the
% same way as \LaTeX's text commands: \cs{textls} -- which also works in math
% mode -- expects the text in the mandatory argument, while
%\DescribeMacro{\lsstyle}
% \cs{lsstyle} will switch on letterspacing for all subsequent fonts until the
% end of the current group.
%\DescribeMacro{\textls*}
% The starred version of \cs{textls} does not add any
% extra kerning before or after the text, which may be useful, \eg, for section
% titles. By default, each character will be spaced out by
% \EM{100/1000}\,=\,\EM{0.1}; this amount may be altered in the optional
% argument to \cs{textls}, using the \cs{SetTracking} command, or globally with
% the \opt{letterspace} package option, with decreasing significance in this
% order.
%
%\pagebreak ^^A layout
%\medskip
%\Describe{Macro}{\lslig}{ligature}
% Since the commands \cs{textls} and \cs{lsstyle} will also evaluate the
% `\texttt{no ligatures}' key for the respective font, you need not worry
% about protecting or breaking ligatures with most fonts. However, in certain
% situations, there may be a conflict of ligatures beginning with the same
% letter, where some of them should be inhibited, while others should not. When
% letterspacing text typeset in Fraktur fonts, for example, the ligatures `ch',
% `ck', `tz' and `sz'~(`\textfrak{sz}') should never be broken up; you also usually
% see the `st'~(`\textfrak{st}') ligature in letterspaced text. Furthermore, at
% least the \pkg{yfonts} package realises the short~s~(`\textfrak{s:}') as the
% ligature~`|s:|'. On the other hand, the `ct'~ligature and the other `long~s'
% ligatures often found in Fraktur fonts should be suppressed. There are two
% ways of solving this problem: either don't disable the `|s|' and/or `|c|'
% ligatures and break those that need to be broken up by inserting
% `|{\kern0pt}|' or \pkg{babel}'s \verb="|= shortcut; or disable them and
% protect those ligatures that need to be protected by enclosing them in the
% \cs{lslig} command. So, the following two solutions have the same result
% (namely, `\textls{\def\!#1{\textcolor{thegreen}{\lslig{#1}}}^^A
%                   \def\?#1{\textcolor{thered}{#1}}^^A
%  \textfrak{Au\!{s:}\?{si}\!{ch}t\!{s:}lo\?{si}gkeit}}',
%  with ligatures shown in green, inhibited ligatures in red).
%
%\begin{verbatim}[morekeywords={[0]{\kern}}]
%\SetTracking[no ligatures={f}]{encoding = LY, family = yfrak}{120}
%\textfrak{\lsstyle Aus:s{\kern0pt}ichts:los{\kern0pt}igkeit}
%\end{verbatim}
%\begin{verbatim}
%\SetTracking[no ligatures={f,s,c}]{encoding = LY, family = yfrak}{120}
%\textfrak{\lsstyle Au\lslig{s:}si\lslig{ch}t\lslig{s:}losigkeit}
%\end{verbatim}
%
%\bigskip\noindent
%\DescribePackage{letterspace}
% These three commands (plus the \opt{letterspace} option, described in
% section~\ref{sub:option-tracking}) are also available with the alternative
% \letterspace\ package, which is in fact a much stripped-down version of
% \microtype, omitting support for all the other extensions (and also omitting
% the possibilities of the \cs{SetTracking} command -- all `|f|' ligatures will
% be disabled, inner and outer spacing and outer kerning will be set to the
% default values described in section~\ref{sub:tracking}). If you prefer to
% forgo \microtype's specialties, you may load the \letterspace\ package
% instead. Both packages should not be used at the same time.
%
% In contrast to \microtype, which requires \LaTeX, the \letterspace\
% package also works with \pkg{eplain} or even only \pkg{miniltx}: for use with
% \pkg{eplain}, load the package with \cmd\usepackage\ inside the
% \cmd\beginpackages~\dots\ \cmd\endpackages\ environment; with \pkg{miniltx}
% (which does not support package options) simply \cmd\input\ \file{letterspace.sty}.
%
%
%\section[Disabling ligatures]
%        {Disabling ligatures \requires{\pdftex~1.30,\luatex~0.30}}
%        \label{sec:disable-ligatures}
%
%\Describe{Macro}{\DisableLigatures}{?characters,set of fonts}
% While completely disabling all ligatures of a font (which will also switch
% off kerning for this font), purposely \textit{lowers} the micro-typographic
% quality instead of raising it, it is especially useful for typewriter fonts,
% so that, \eg, in a <T1> encoded font, `|\texttt{--}|' will indeed be printed
% as `|--|', not as `\texttt{--}'. \cs{DisableLigatures} may be used to
% specify, in the usual way, a set of fonts for which ligatures should be
% disabled, for example, of the typewriter font in <T1> encoding:
%\begin{verbatim}
%\DisableLigatures{encoding = T1, family = tt* }
%\end{verbatim}
% It is also possible to disable selected ligatures only. The optional argument
% may contain a comma-separated list of characters for which the ligature
% mechanism should be inhibited:
%\begin{verbatim}
%\DisableLigatures[?,!]{encoding = T1} % "\ifx\tagcode\undefined\else ^^A
%           \normalfont\color{thegrey}inhibit ?` and !`, but not fi, --, >>, etc.\fi"
%\end{verbatim}
% Only the character that begins the ligature(s) should be specified. This
% command may only be used in the preamble, and only once.\footnote{
%   With \luatex, you have to load the fonts with the \cite{fontspec} option
%   `|Renderer=Basic|'.}
%   ^^A Otherwise, it won't work at all
%
%
%\section{Hints and 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. In particular,
% italic letter shapes may differ wildly in different fonts, hence I have
% decided against providing default protrusion settings for them.
% The file \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 the
% opposite. Expanding the fonts by more than 2\%, \ie, setting a \opt{stretch}
% limit 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\%.
%
%\changes{v2.0}{2006/12/13}{qualify hint about web documents with regard to older \pdftex\ versions}
%\paragraph{Don't use font expansion for web documents (with older \pdftex\ versions).}
% With \pdftex\ versions older than 1.40, each expanded instance of the font
% will be embedded in the <PDF> file, hence 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. With \pdftex\ 1.40 and \luatex, which
% use a different technique of expansion, the increase of file size can be
% neglected.
%
%\changes{v2.2}{2007/07/06}{add hint about extra <TOC> leader dot
%                           (first discovered by \contributor Morten H\o gholm <morten.hoegholm\at latex-project.org>)}
%                                                                                       ^^A private mail, 2006/08/26
%\paragraph{You might want to disable protrusion in the Table of Contents.}
% In unfortunate situations, enabled protrusion might internally alter the line
% length in the <TOC> and similar lists in such a way that an excess leader dot
% will fit in. The solution is to temporarily disable protrusion for the <TOC>:
%\begin{verbatim}
%\microtypesetup{protrusion=false}
%\tableofcontents
%\microtypesetup{protrusion=true}
%\end{verbatim}
%
%\changes{v1.9}{2005/07/10}{add hint about \texttt{verbatim} environment}
%\todo{option to patch \texttt{verbatim}?} ^^A for Karl
%\paragraph{You might want to disable protrusion in \texttt{verbatim} environments.}
% As you know by now, \microtype\ will by default activate character protrusion
% for all fonts contained in the font set `|alltext|'. This also includes the
% typewriter font. Although it does make sense to protrude the typewriter font
% if it appears in running text (like, for example, in this manual), this is
% probably not desirable inside the |verbatim| environment. However,
% \microtype\ has no knowledge about the context that a font appears in but
% will solely decide by examining its attributes. Therefore, you have to take
% care of disabling protrusion in |verbatim| environments for yourself (that
% is, if you don't want to disable protrusion for the typewriter font
% altogether, by activating, say, the font set `|alltext-nott|').
% While the \cs{microtypesetup} command has of course been designed for cases
% like this, you may find it tiresome to repeat it every time if you are
% using the |verbatim| environment frequently. The following line (which requires
% the \pkg{etoolbox} package), added to the document's preamble, would serve the same purpose:
%\changes{v2.3e}{2009/07/21}{suggest to patch \cmd\@verbatim\ instead of \cmd\verbatim}
%\changes{v2.6}{2016/03/07}{suggest to use \pkg{etoolbox} to patch \cmd\verbatim}
%\begin{verbatim}
%\AtBeginEnvironment{verbatim}{\microtypesetup{activate=false}}
%\end{verbatim}
% If you are using the \pkg{fancyvrb} or the \pkg{listings} package, this is
% not necessary, since their implementation of the corresponding environments
% will inhibit protrusion anyway.
%
%\changes{v1.9e}{2006/07/10}{add hint about unknown encodings}
%\paragraph{Settings for Greek/Thai/Armenian etc. encodings are not yet included.}
% The default sets of fonts for which the micro-typographic features will be
% enabled (see table~\ref{tab:predefined-font-sets}) only contain those
% encodings for which configurations exist. Therefore, if you are using any
% other encoding (\eg, <LGR>, <T2B>, etc.), \microtype\ will not apply to these
% fonts. You have to define and activate a new font set including the
% encoding(s) you are using (for details, see section~\ref{sec:font-sets}). For
% protrusion at least, you would also have to create settings for the fonts in
% question (see section~\ref{sub:protrusion}). It goes without saying that
% contributions for these encodings are more than welcome.
%
%\paragraph{Only employ kerning adjustment if it is customary in the language's
%typographic tradition.}
% In contrast to protrusion and expansion, additional kerning does not
% unconditionally improve the micro-typographical quality of your document. You
% should only switch it on if you are writing a document in a language whose
% typographic tradition warrants such kerning. If you are, for example, writing
% an English text, your readers would probably be rather confused by additional
% spaces before the punctuation characters.
%
%\changes{v2.3c}{2008/10/27}{add hint about \opt{spacing} being experimental}
%\paragraph{Adjustment of interword spacing is still experimental.}
% The implementation of this feature in \pdftex\ is not complete, and may not
% yield the positive effects on the typographical quality you might expect --
% in certain situations, there may even be undesired side effects,
%\changes{v2.5}{2011/11/27}{add hint about \opt{spacing} and \pkg{ragged2e}} ^^A (beta:09)
% in particular, when used together with the \pkg{ragged2e} package. Therefore,
% the \opt{spacing} option should not be chosen blindly; it is also recommended
% to experiment with the settings in order to understand the workings of this
% feature.
%
%\changes{v1.7}{2005/03/23}{add hint about compatibility}
%\paragraph{Compatibility and interaction with other packages:}
% The \microtype\ package is supposed to work happily together with all other
% \LaTeX\ packages (except for \pkg{pdfcprot}). However, life isn't perfect, so
% problems are to be expected. Currently, I am aware of the following issues:
%\begin{itemize}
%\changes{v2.7b}{2018/09/18}{update hint about non-7-bit characters
%                            (notified by \contributor Frank Mittelbach <frank.mittelbach\at latex-project.org>)}
%                            ^^A private mail, 2018/08/14
%  \item Even though all configuration files are still provided in legacy (7-bit)
%        format, using multi-byte (Unicode) characters in the settings should run
%        smoothly with an up-to-date \LaTeX\ system.
%        For older systems or documents in legacy encodings, in contrast, this requires
%        loading the \pkg{inputenc} package first.
%        Furthermore, when using multiple input encodings in a document, 8-bit characters in
%        the settings will only work reliably if you specify the |inputenc| key.
%\changes{v2.3a}{2008/02/25}{add hint about \pkg{babel} having to be loaded first}
%  \item When loading the package with the \opt{babel} option, you must load
%        the \pkg{babel} package before \microtype.
%\changes{v2.5}{2012/09/11}{add hint about \luatex\ compatibility}
%  \item Before this package was fully compatible with \luatex, the following
%        method of enabling expansion and protrusion with the \cite{fontspec}
%        package was most often found to be recommended:
%\begin{verbatim}[deletekeywords={[1]{expansion,protrusion}},belowskip=0pt]
%\newfontfeature{Microtype}{protrusion=default;expansion=default}
%\defaultfontfeatures{Microtype}
%\end{verbatim}
%        This code should \emph{not} be used with this package, as it will
%        basically override all of the settings made by \microtype\ -- despite
%        the naming, the above lines have nothing to do with this
%        package.\footnote{^^A
%             They make use of features provided by \cite{luaotfload} (via \cite{fontspec}).}
%\changes{v2.3c}{2008/11/11}{add hint about partial incompatibility with \pkg{CJK}}
%  \item With \pdftex, it is currently not possible to create character-specific settings for
%        Chinese\slash Japanese\slash Korean fonts. Therefore, the only
%        micro-typographic extension that can be made to work with
%        \pkg{CJK} fonts is (non-selected) font expansion.
%\changes{v2.6}{2015/11/03}{add hint about partial incompatibility with \pkg{xeCJK} and \pkg{luatexja}}
%  \item When used with the \pkg{xeCJK} package or the \pkg{luatexja} package,
%        text commands (\eg, |\'A|, |\textless|) in the configuration will not be understood.
%        You therefore have to ensure that \microtype\ will encounter none of them.
%        This requires, firstly, that the glyphs be specified only as single (possibly Unicode)
%        characters, as numbers, or as glyph names (cf. section~\ref{sec:fine-tuning});
%        and secondly, if you are using a font for which pre-defined settings do not exist,
%        that you create these settings yourself (because otherwise, the default settings
%        will be loaded, which do contain text commands). Furthermore, you should
%        load \microtype\ late.
%\end{itemize}
%
%\changes{v1.8}{2005/06/23}{add hint about error messages}
%\paragraph{Possible error messages and how to get rid of them (\textcolor{thegreen}{specs} may differ):}
%\begin{itemize}
%\lstset{deletekeywords={[1]{expansion,auto}},belowskip=-\smallskipamount,frame=none,
%        xleftmargin=0pt,backgroundcolor=,basicstyle=\MacroFont\footnotesize,
%        delim=[is][\itshape\color{thegreen}]{<}{>}}
%\changes{v1.9a}{2005/11/15}{add explanation for error message in <DVI> mode}
%  \item
%\begin{verbatim}
%! Font csnameendcsname=<cmr10+20 at 10.0pt> not loadable: Metric (TFM) file not found.
%\end{verbatim}
% This error message will occur if you are trying to employ font expansion
% while creating <DVI> output. Remember that \emph{automatic} font expansion
% only works when running \pdftex\ or \luatex\ in <PDF> mode. Although expansion is also
% possible in <DVI> mode with \pdftex, it requires that all instances of the expanded fonts
% exist on your \TeX\ system.
%
%\changes{v2.2}{2007/06/13}{add hint about error message with \pdftex\ 1.40}
%  \item
%\begin{verbatim}
%! pdfTeX error (font expansion): auto expansion is only possible with scalable fonts.
%\end{verbatim}
% Automatic font expansion has been improved in \pdftex\ 1.40, in that it now
% not only works with Type\,1 fonts but also with TrueType, OpenType and even
% non-embedded fonts. The above error message indicates either that you are
% trying to apply expansion to a bitmap~(|pk|) font, which is still not
% possible, or that the font isn't found at all, \eg, because of missing map
% entries.
%
%\changes{v2.0}{2006/12/13}{qualify hints about expansion error messages with
%                           regard to older \pdftex\ versions}
%  \item
%\begin{verbatim}
%Warning: pdflatex: font <ptmr8r> cannot be expanded (not an included Type1 font)
%\end{verbatim}
% and the <PDF> viewer complains about a missing font, \eg, Adobe Reader thusly:
%\begin{verbatim}[aboveskip=\smallskipamount]
%Could not find a font in the Resources dictionary - using Helvetica instead.
%\end{verbatim}
% With \pdftex\ versions older than 1.40, font expansion can only be applied if
% the font is actually embedded in the <PDF> file. If you get the above error
% message, your \TeX\ system is not set up to embed (or `download') the base
% PostScript fonts (\eg, Times, Helvetica, Courier). In most \TeX\
% distributions, this can be changed in the file \file{updmap.cfg} by setting
% |pdftexDownloadBase14| to |true|.
%
%\ifcmr\else\pagebreak\fi ^^A layout
%\changes{v1.9a}{2005/11/15}{add explanation for error message with non-Type\,1 fonts}
%  \item
%\begin{verbatim}
%Warning: pdflatex (file <ecrm1000+20>): Font <ecrm1000+20 at 1200> not found
%\end{verbatim}
% Furthermore, \pdftex\ versions older than 1.40 require Type\,1 fonts for
% automatic font expansion. When you receive a message like the above, you are
% probably trying to apply font expansion to a bitmap or TrueType font. With
% older \pdftex\ versions, this is only possible if you manually create
% expanded instances of the fonts.
%
%\changes{v2.0}{2006/11/05}{add hint about how to increase \texttt{font\textunderscore max}
%                            and \texttt{font\textunderscore mem\textunderscore size}}
%  \item
%\begin{verbatim}
%! Font <T1/cmr/m/n/10>=<ecrm1000 at 10.0pt> not loaded: Not enough room left.
%\end{verbatim}
% Memory parameter `|font_mem_size|' too small.
%  \item
%\begin{verbatim}
%! TeX capacity exceeded, sorry [maximum internal font number (font_max)=<2000>].
%\end{verbatim}
% Memory parameter `|font_max|' too small.
%  \item
%\begin{verbatim}
%! TeX capacity exceeded, sorry [PDF memory size (pdf_mem_size)=<65536>].
%\end{verbatim}
% Memory parameter `|pdf_mem_size|' too small (\pdftex\ versions older than 1.30).
%
% When applying micro-typographic enhancement to a large document with a lot of
% fonts, \pdftex\ may be running out of some kind of memory. It can be
% increased by setting the respective parameter to a larger value. For
% web2c-based systems, \eg, \texlive, change the settings in \file{texmf.cnf},
% for \miktex, in the file \file{miktex.ini} (2.4 or older) resp.
% \file{pdflatex.ini} (2.5 or newer).
%
%\changes{v2.0}{2007/01/05}{add hint about warning when tracking \emph{and}
%                           expansion is applied to a font}
%  \item
%\begin{verbatim}[deletekeywords={[1]{expansion}}]
%pdfTeX warning (font expansion): font should be expanded before its first use
%\end{verbatim}
% This warning will occur with \pdftex\ versions older than 1.40.4, if tracking
% \emph{and} expansion is applied to a font. It is harmless and can be ignored.
%\end{itemize}
%
%\changes{v2.5}{2012/07/17}{add hint about \texttt{dtx} source code}
% \paragraph{The source code of this document is freely available.}
% If you wonder how this document was created, just have a look at the source
% code in \file{microtype.dtx}, which is either already included in your \TeX\
% distribution, or else can be downloaded from
% \href{http://mirror.ctan.org/macros/latex/contrib/microtype/}
%      {\acronym{CTAN}}.
% For the source code of the logo on the title page and of the letterspacing
% sample from section~\ref{sub:tracking}, see the appendices~\ref{sec:title-logo}
% and \ref{sec:letterspace-ill}.
%\changes{v2.5a}{2013/05/23}{add notes on typesetting the documentation}
% If you want to re-typeset the documentation, read the comments at the end of
% \file{microtype.dtx}.
%
%
%\section{Contributions}
%
% I would be glad to include configuration files for more fonts. Preparing such
% configurations is quite a time-consuming task and requires a lot of patience.
% To alleviate this process, this package also includes a test file that can be
% used to check at least the protrusion settings (\file{test-microtype.tex}).
%^^A
% 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.
%\iffalse\footnote{^^A ... OK, so nobody has any ...
%    Should you have lots of \pkg{pdfcprot} configuration files lying around,
%    I can also provide you with a \TeX\ conversion script. Just ask me.}
%\fi
%
%
%\section{Acknowledgments}
%
% This package would be pointless if
%  \contributor H\`an \thanhthe{} Th\`anh <thanh\at pdftex.org>
% hadn't created the \pdftex\ programme 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, and not
% least for promoting it in \cite{ThanhPracTeX}, \cite{ThanhEuroTeX07} and ^^A comma, to avoid the Three Ands Falls
% elsewhere. I also thank him and the rest of the \pdftex\ team, and more
% recently also the \luatex\ and \xetex\ teams, for refuting the idea that
% \TeX\ is dead, and for fixing the bugs I find.
%
%  \contributor Harald Harders <h.harders\at 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.
%  \contributor Andreas B\"uhmann <andreas.buehmann\at web.de>
% has suggested the possibility to specify ranges of font sizes, and
% resourcefully assisted in implementing this. He also came up with some good
% ideas for the management of complex configurations.
%  \contributor Ulrich Dirr <ud\at art-satz.de>
% has made numerous suggestion, especially concerning the new extensions of
% interword spacing adjustment and additional character kerning.
%  \contributor Georg Duffner <g.duffner\at gmail.com> has patiently tested
% \microtype\ under \xetex\ and \luatex\ with his beautiful OpenType font
% <EB>~Garamond\footnote{\ctanpkgurl{ebgaramond}, including configuration
%   files for \microtype.}.
% My thanks also go to
%  \contributor Maciej Eder <maciej_eder\at poczta.onet.pl>
% for contributing settings for the <QX> encoding, as well as to
%  \contributor Karl Karlsson <karl-karlsson\at yandex.ru>
% for providing settings for the Cyrillic <T2A> encoding, and to
%  \contributor Hendrik Vogt <hendrik.vogt\at tu-dresden.de>,
% who made substantial improvements to the Computer Modern Roman italic settings.
% I thank
%  \contributor Loren~B. Davis <davislo\at eecs.oregonstate.edu>
% for providing protrusion settings for OpenType versions of Palatino Linotype.
% I am also very much indebted to
%  \contributor \'Elie Roux <elie.roux\at telecom-bretagne.eu>,
% who not only contributed the |lua| module in the first place, but also,
% together with
%  \contributor Philipp Gesang <philipp.gesang\at alumni.uni-heidelberg.de>,
% took care of updating it for the developments in \luatex\ land.
%
% I thank
%  \contributor Philipp Lehman <plehman\at gmx.net>
% for adding to his \pkg{csquotes} package the possibility to restore the
% original meanings of all activated characters, thus allowing for these
% characters to be used in the configuration files.
%  \contributor Peter Wilson <herries.press\at earthlink.net>
% kindly provided a hook in his \pkg{ledmac}/\pkg{ledpar} packages, so that
% critical editions can finally also benefit from character protrusion.
% Likewise,
%  \contributor Donald Arseneau <asnd\at triumf.ca>
% patched his \pkg{shapepar} package to accommodate protrusion.
%
% Additionally, the following people have reported bugs, made suggestions or
% helped otherwise (in chronological order, quotes indicate
%    \href{https://tex.stackexchange.com/users/}{TeX.SX} user names):\linebreak
%  \contributor Tom Kink          <kink\at hia.rwth-aachen.de>,
%  \contributor Herb Schulz       <herbs\at wideopenwest.com>,
%  \contributor Michael Hoppe     <mh\at michael-hoppe.de>,
%  \contributor Gary~L. Gray      <gray\at engr.psu.edu>,
%  \contributor Georg Verweyen    <verweyen\at gmail.com>,
%  \contributor Christoph Bier    <christoph.bier\at web.de>,
%  \contributor Peter Muthesius   <Pemu\at gmx.de>,
%  \contributor Bernard Gaulle    <gaulle\at idris.fr>, ^^A\,\textdagger,
%  \contributor Adam Kucharczyk   <adamk\at ijp-pan.krakow.pl>,
%  \contributor Mark Rossi        <mark.rossi\at de.bosch.com>,
%  \contributor Stephan Hennig    <stephanhennig\at arcor.de>,
%  \contributor Michael Zedler    <Michael.Zedler\at tum.de>,
%  \contributor Herbert Vo\ss{}   <Herbert.Voss\at gmx.net>,
%  \contributor Ralf Stubner      <ralf.stubner\at physik.uni-erlangen.de>,
%  \contributor Holger Uhr        <huhr\at uni-paderborn.de>,
%  \contributor Peter Dyballa     <Peter_Dyballa\at Web.DE>,
%  \contributor Morten H\o gholm  <morten.hoegholm\at latex-project.org>,
%  \contributor Steven Bath       <steven128\at iname.com>,
%  \contributor Daniel Flipo      <daniel.flipo\at univ-lille1.fr>,
%  \contributor Michalis Miatidis <miatidis\at informatik.rwth-aachen.de>,
%  \contributor Sven Naumann      <svenau\at gmx.net>,
%  \contributor Ross Hetherington <ross\at heth.eclipse.co.uk>,
%  \contributor Wiebke Petersen   <petersew\at uni-duesseldorf.de>,
%  \contributor Geoff Vallis      <gkv\at Princeton.EDU>,
%  \contributor Steven~E. Harris  <seh\at panix.com>,
%  \contributor Karl Berry        <karl\at freefriends.org>,
%  \contributor Peter Meier       <Peter.Meier998\at gmx.de>,
%  \contributor Nathan Rosenblum  <nater\at cs.wisc.edu>,
%  \contributor Wolfram Schaalo   <schaalo\at gmx.net>,
%  \contributor Vasile Gaburici   <vgaburici\at gmail.com>,
%  \contributor Sveinung Heggen   <sveinung.heggen\at orkla.no>,
%  \contributor Axel Berger       <Axel_Berger\at b.maus.de>,
%  \contributor Colin Rourke      <gt\at msp.warwick.ac.uk>,
%  \contributor Maverick Woo      <maverick\at cs.cmu.edu>,
%  \contributor Silas~S. Brown    <ssb22\at cam.ac.uk>,
%  \contributor Lars R\"onnb\"ack <lars.ronnback\at affecto.com>,
%  \contributor Christian Stark   <cstark\at gmx.de>,
%  \contributor Leo               <sdl.web\at gmail.com>,
%  \contributor Marcin Borkowski  <mbork\at atos.wmid.amu.edu.pl>,
%  \contributor hscm              <henkmetselaar\at gmail.com>,
%  \contributor George Gratzer    <gratzer\at me.com>,
%  \contributor Josep Maria Font  <jmfont\at ub.edu>,
%  \contributor Juan Acevedo      <juan.acevedo.juan\at gmail.com>,
%  \contributor Heiko Oberdiek    <heiko.oberdiek\at googlemail.com>,
%  \contributor Till~A. Heilmann  <till.heilmann\at unibas.ch>,
%  \contributor Rolf Dieterich    <rolf.dieterich\at gmx.de>,
%  \contributor Seamus Bradley    <@\at @>, ^^A https://tex.stackexchange.com/users/215/seamus
%  \contributor Meho~R            <meho.2005\at gmail.com>,
%  \contributor Steffen Hoffmann  <speraviro-delenda\at expires-2011-11-30.arcornews.de>,
%  \contributor Scott Pakin       <scott\at pakin.org>,
%  \contributor Ma\"ieul Rouquette <maieul\at maieul.net>,
%  \contributor Jonas Hogstrom    <hjb981\at gmail.com>,
%  \contributor Gabriel Kerneis   <gabriel\at kerneis.info>,
% `\contributor RazorXsr          <@\at @>', ^^A https://tex.stackexchange.com/users/17609/razorxsr
%  \contributor Sebastian Schubert <schubert.seb\at googlemail.com>,
% `\contributor Dave              <@\at @>', ^^A https://tex.stackexchange.com/users/15562/dave
%  \contributor Giuseppe Palma    <pippi.palma\at gmail.com>,
%  \contributor Stephan Stiller   <stephan.stiller\at gmail.com>,
%  \contributor Christopher Schramm <debian\at shakaweb.org>,
% `\contributor uli               <@\at @>',  ^^A https://tex.stackexchange.com/users/9391/uli
%  \contributor Sam Mason         <sam\at samason.me.uk>, ^^A https://tex.stackexchange.com/users/16433/sam-mason
% `\contributor kleenstar         <@\at @>', ^^A https://tex.stackexchange.com/users/56468/kleenstar
% `\contributor Henning           <@\at @>', ^^A https://tex.stackexchange.com/users/64603/henning
%  \contributor Ronnie Marksch    <Ronnie.Marksch\at yahoo.de>,
%  \contributor David Carlisle    <d.p.carlisle\at gmail.com>,
% `\contributor Max               <@\at @>', ^^A https://tex.stackexchange.com/users/16809/max
% `\contributor HcN               <@\at @>', ^^A https://tex.stackexchange.com/users/87090/hcn
%  \contributor Will Robertson    <will\at wspr.io>,
% `\contributor user11126         <@\at @>', ^^A https://tex.stackexchange.com/users/1000/user11126
%  \contributor Ulrike Fischer    <fischer\at troubleshooting-tex.de>,
% `\contributor Daniel            <@\at @>', ^^A https://tex.stackexchange.com/users/113787/daniel
% `\contributor ltcomdata         <@\at @>', ^^A https://tex.stackexchange.com/users/17061/ltcomdata
%  \contributor Reinhard Kotucha  <reinhard.kotucha\at web.de>,
% `\contributor jcr               <@\at @>', ^^A https://tex.stackexchange.com/users/56514/jcr
%  \contributor Nils Anders Danielsson <nad\at cse.gu.se>,
%  \contributor Paolo Ney         <@\at @>,  ^^A https://tex.stackexchange.com/users/29161/paulo-ney
%  \contributor Frank Mittelbach  <frank.mittelbach\at latex-project.org>,
%  \contributor Franz Wexler      <@\at @>,  ^^A https://tex.stackexchange.com/users/182307/franz-wexler
%  \contributor Moritz Wemheuer   <moritz.wemheuer\at gmail.com>,
% `\contributor Andy N            <@\at @>', ^^A https://tex.stackexchange.com/users/182462/andy-n
%  \contributor Phelype Oleinik   <phe.h.o1\at gmail.com>,
%  \contributor Falk Hanisch      <falk.hanisch\at tu-dresden.de>,
%  \contributor Markus Kohm       <komascript\at gmx.info>,
%  \contributor Paolo Polesana    <@\at @>,  ^^A https://tex.stackexchange.com/users/95083/paolo-polesana
%  \contributor Oliver Kopp       <koppdev\at gmail.com>,
%  \contributor Hironori Kitagawa <h_kitagawa2001\at yahoo.co.jp>,
% `\contributor d909              <@\at @>', ^^A https://tex.stackexchange.com/users/176404/d909
%  \contributor Daniel Benjamin Miller <dbmiller\at dbmiller.org>,
%  \contributor Md Ayquassar      <mdayq0\at lenta.ru>
% and
%  \contributor Marcel Kr\"uger   <tex\at 2krueger.de>.
%
%
%\iffalse
%\section{History of micro-typography} ^^A some time ...
% Both these features have been lacking a simple \LaTeX\ user interface for
% quite some time. Then, the \cite{pdfcprot} package was released, which
% allowed \LaTeX\ users to employ character protrusion without having to mess
% much with the internals.
%
% Font expansion, however, was still most difficult to utilise, since it
% required that the font metrics are available for all levels of expansion.
% Therefore, anybody who wanted to make use of this feature had to create
% multiple instances of the fonts in advance. Shell scripts to partly 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 has proven as a
% major facilitation for \TeX\ and \LaTeX\ users: font expansion can now take
% place automatically. That is, \pdftex\ no longer needs the expanded font
% metrics but will calculate them at run-time and completely in memory.
%
% After this great leap in usability had been taken, the development did not
% stop. On the contrary, \pdftex\ was extended with even more features: version
% 1.30 introduced the possibility to \emph{disable all ligatures}, version 1.40
% a robust \emph{letterspacing} command, the possibility to specify
% \emph{additional character kerning}, and the \emph{adjustment of interword
% spacing}.
%\fi
%
%
%\begin{thebibliography}{}
% \bibitem[Th\`anh 2000]{ThanhThesis}
%   \thanh, `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})
%
%\iffalse ^^A obsolete
% \bibitem[Th\`anh 2001]{ThanhTUG}
%   \thanh, `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})
%\fi
%
% \bibitem[Th\`anh 2004]{ThanhPracTeX}
%   \thanh, `Micro-typographic extensions of \pdftex\ in practice',
%   \newblock in: \textit{TUGBoat}, vol.~25 (2004), no.~1:
%             `Proceedings of the Practical \TeX\ 2004 Conference', pp.~35--38.
%   \newblock (Online at \url{http://www.tug.org/TUGboat/Articles/tb25-1/thanh.pdf})
%
%\iffalse
% \bibitem[Th\`anh 2005]{ThanhEuroTeX05}
%   \thanh, `Experiences with micro-typographic extensions of \pdftex\ in practice',
%   \newblock in: Euro\TeX\ 2005 Proceedings
%             ^^A 15th~Annual Meeting of the European \TeX\ Users,
%             ^^A March~7 -- March~11, 2005, Abbaye des Pr\'emontr\'es, Pont-\`a-Mousson,
%             [=~\textit{TUGBoat}, vol.~27 (2006), no.~0],
%             pp.~159--164.
%   \newblock (Online at \url{http://www.tug.org/TUGboat/Articles/tb27-0/thanh.pdf})
%                  ^^A = \url{http://www.dante.de/dante/events/eurotex/papers/TUT07.pdf}
%\fi
%
% \bibitem[Th\`anh 2008]{ThanhEuroTeX07}
%   \thanh, `Font-specific issues in \pdftex',
%   \newblock in: \textit{TUGBoat}, vol.~29 (2008), no.~1:
%             `EuroBacho\TeX\ 2007 Proceedings', pp.~36--41.
%   \newblock (Online at \url{http://www.tug.org/TUGboat/Articles/tb29-1/tb91thanh-fonts.pdf})
%
% \bibitem[\pdftex\ manual]{pdftexman}
%   \thanh, Sebastian Rahtz, Hans Hagen, Hartmut Henkel, Pawe\l\ Jackowski, Martin Schr\"oder, Karl Berry,
%   \emph{The \pdftex\ user manual},
%   \newblock 2~March 2020.
%   \newblock (\ctanurl{systems/doc/pdftex/manual/pdftex-a.pdf})
%             ^^A latest version at \url{http://sarovar.org/projects/pdftex/}
%             ^^A or even \url{http://foundry.supelec.fr/scm/?group_id=23}
%
% \bibitem[Fontname]{fontname}
%   Karl Berry, \emph{Fontname: Filenames for \TeX\ fonts},
%   \newblock July 2009.
%   \newblock (\ctanurl{info/fontname/fontname.pdf})
%
% \bibitem[\LaTeXe\ font selection]{fntguide}
%   \LaTeX3 Project Team, \emph{\LaTeXe\ font selection},
%   \newblock July 2020.
%   \newblock (\ctanurl{macros/latex/base/fntguide.pdf})
%
% \bibitem[\pkg{fontspec}]{fontspec}
%   Will Robertson,
%    \emph{The \pkg{fontspec} package: Font selection for \xe\LaTeX\ and Lua\LaTeX},
%    \newblock 21~February 2020.
%    \newblock (\ctanpkgurl{fontspec})
%
% \bibitem[\pkg{luaotfload}]{luaotfload}
%   \'Elie Roux, Khaled Hosny, Philipp Gesang, Ulrike Fischer, Marcel Kr\"uger,
%    \emph{The \pkg{luaotfload} package},
%    \newblock 2~September 2020.
%    \newblock (\ctanpkgurl{luaotfload})
%
% \bibitem[\pkg{pdfcprot}]{pdfcprot}
%   Carsten Schurig, Tobias Schlemmer, \emph{The \pkg{pdfcprot}|.sty| package},
%   \newblock 10 June 2005.
%   \newblock (\ctanpkgurl{pdfcprot})
%
% \bibitem[\pkg{soul}]{soul}
%   Melchior Franz, \emph{The \pkg{soul} package},
%   \newblock 17 November 2003.
%   \newblock (\ctanpkgurl{soul}).
%\changes{v2.3a}{2008/01/06}{mention \pkg{soulutf8}}
%   \newblock See also Heiko Oberdiek's extension of this package,
%             \pkg{soulutf8}, which adds Unicode support.
%   \newblock (\ctanpkgurl{soulutf8})
%
%\end{thebibliography}
%
%
%\section{Short history}
%\changes{v1.5}{2004/12/11}{add `Short history'}
%
% The comprehensive list of changes can be
% \expandafter\ifx\csname r@sec:changes\endcsname\relax
%     obtained by running `\texttt{makeindex \mbox{-s gglo.ist}
%                                  \mbox{-o microtype.gls} microtype.glo}'\else
%     found in appendix~\ref{sec:changes}\fi.
% The following is a list of all changes relevant in the user land; bug and
% compatibility fixes are swept under the rug. Numbers in brackets indicate
% the relevant section in this manual.
%
%\newenvironment{History}
%  {\list\labelitemi
%   {\leftmargin 0pt
%    \parsep 0pt
%    \def\refsection##1{[##1]}
%    \def\makelabel##1{\hss\llap{\color{sectioning}##1}}}}
%  {\endlist}
%\newcommand\Version[2]{
%  \VersionDate{#1}{#2}
%  \vskip\topsep
%  \pagebreak[2]
%  \item[\textsf{\bfseries\color{sectioning}#1}]\textsf{\bfseries\color{sectioning}(#2)}
%  \vskip\topsep
%  \nopagebreak}
%\newcommand\VersionDate[2]{^^A needed in the Change history
%  \global\expandafter\def\csname MTversiondate#1\endcsname{#2}}
%
%\begin{History}
%
%\Version{\expandafter\@gobble\fileversion}{\filedate}
%  \item New default font sets for expansion and spacing: `|alltext-nott|'
%        \refsection{\ref{sec:font-sets}, table~\ref{tab:predefined-font-sets}}
%
%\VersionDate{2.7d}{2019/11/18}
%
%\VersionDate{2.7c}{2019/10/10}
%
%\VersionDate{2.7b}{2019/02/28}
%
%\VersionDate{2.7a}{2018/01/14}
%
%\Version{2.7}{2017/07/07}
%  \item Allow automatic expansion and letterspacing with \luatex\ in <DVI> mode
%        (aka. \texttt{dvilualatex})
%        \refsection{\ref{sub:options-microtype}, \ref{sub:options-expansion}, table~\ref{tab:available-features}}
%  \item Compatibility with \LaTeX\ 2017/01/01 (fix warnings)
%
%\VersionDate{2.6a}{2016/05/14}
%
%\Version{2.6}{2016/05/01}
%  \item Support for \luatex\ $\geq$ 0.85
%  \item Improvements for tracking/letterspacing with \luatex\
%        (|Renderer=Basic| no longer required)
%  \item New font sets: `|alltext-nott|', `|allmath-nott|'
%        \refsection{\ref{sec:font-sets}, table~\ref{tab:predefined-font-sets}}
%
%\VersionDate{2.5a}{2013/05/23}
%
%\Version{2.5}{2013/03/13}
%  \item Support for the \cite{fontspec} package, viz.
%        for OpenType fonts with \luatex\ and \xetex
%  \item Support for protrusion with \xetex\ $\geq$ 0.9997
%  \item Support for tracking/letterspacing with \luatex\ $\geq$ 0.62
%  \item Allow context-sensitive setup with \luatex
%  \item Info if protrusion settings are generic
%  \item Protrusion settings for Latin Modern Roman (OpenType)
%  \item Protrusion settings for Charis SIL (OpenType)
%  \item Protrusion settings for Palatino Linotype (OpenType)
%
%\Version{2.4}{2010/01/10}
% ^^A \item |lua| functions moved to a dedicated file
%  \item Protrusion settings for <T2A> encoded Minion
%
%\Version{2.3e}{2009/11/09}
%  \item Support for the Cyrillic <T2A> encoding (protrusion, expansion, spacing)
%
%\Version{2.3d}{2009/03/27}
%  \item New default for expansion option `\opt{step}': 1, if \pdftex\ $\geq$ 1.40
%        \refsection{\ref{sub:options-expansion}}
%
%\Version{2.3c}{2008/11/11}
%  \item Support for \luatex\ enabled by default
%
%\VersionDate{2.3b}{2008/06/04}
%
%\VersionDate{2.3a}{2008/02/29}
%
%\Version{2.3}{2007/12/23}
%  \item New key `|outer kerning|' for \cs{SetTracking} to customise outer kerning
%        \refsection{\ref{sub:tracking}}
%  \item Adjust protrusion settings for tracking even if protrusion is not enabled
%  \item New option `\opt{verbose}|=silent|' to turn all warnings into mere messages
%        \refsection{\ref{sub:options-misc}}
%  \item The \letterspace\ package also works with \pkg{eplain} or \pkg{miniltx}
%        \refsection{\ref{sec:lettersp}}
%
%\Version{2.2}{2007/07/14}
%  \item Improvements to tracking/letterspacing: retain kerning (\pdftex\ $\geq$ 1.40.4);
%        automatically adjust protrusion settings
%  \item New key `|no ligatures|' for \cs{SetTracking} to disable selected or
%        all ligatures (\pdftex\ $\geq$ 1.40.4)
%        \refsection{\ref{sub:tracking}}
%  \item New keys `|spacing|' and `|outer spacing|' for \cs{SetTracking} to
%        customise interword spacing
%        \refsection{\ref{sub:tracking}}
%  \item Possibility to expand a font with different parameters (\pdftex\ $\geq$ 1.40.4)
%    ^^A ; new option `\opt{copyfonts}'
%        \refsection{\ref{sub:expansion}}
%  \item New optional argument for \cs{DisableLigatures} to disable selected ligatures
%        \refsection{\ref{sec:disable-ligatures}}
%  \item New command \cs{DeclareMicrotypeVariants} to specify variant suffixes
%        \refsection{\ref{sub:config-file}}
%  \item New command \cs{textmicrotypecontext} as a wrapper for \cs{microtypecontext}
%        \refsection{\ref{sec:context}}
%  \item Protrusion settings for Bitstream Letter Gothic
%^^A  \item Basic support for \luatex\ (if generated with the |lua| option)
%
%\Version{2.1}{2007/01/21}
%  \item New command \cs{lslig} to protect ligatures in letterspaced text
%        \refsection{\ref{sec:lettersp}}
%
%\Version{2.0}{2007/01/14}
%  \item Support for the new extensions of \pdftex\ $\geq$ 1.40:
%        tracking/letterspacing, additional kerning, and adjustment of
%        interword spacing (glue)
%        (new commands \cs{SetTracking}, \cs{SetExtraKerning}, \cs{SetExtraSpacing};
%         new options `\opt{tracking}', `\opt{kerning}', `\opt{spacing}')
%        \refsection{\ref{sub:tracking}, \ref{sub:kerning}, \ref{sub:spacing}}
%  \item New commands \cs{textls} and \cs{lsstyle} for letterspacing,
%        new option `\opt{letterspace}'
%        \refsection{\ref{sub:option-tracking}, \ref{sec:lettersp}}
%  \item New option `\opt{babel}' for automatic micro-typographic adjustment to
%        the selected language
%        \refsection{\ref{sub:options-misc}, \ref{sec:context}}
%  \item New font sets: `|smallcaps|', `|footnotesize|', `|scriptsize|'
%        \refsection{\ref{sec:font-sets}, table~\ref{tab:predefined-font-sets}}
%  \item New package `\letterspace' providing the commands for robust and
%        hyphenatable letterspacing
%        \refsection{\ref{sec:lettersp}}
%
%\VersionDate{1.9f}{2006/09/09}
%
%\Version{1.9e}{2006/07/28}
%  \item New key `|inputenc|' to specify the lists' input encodings
%        \refsection{\ref{sec:fine-tuning}}
%  \item Protrusion settings for Euler math fonts
%
%\Version{1.9d}{2006/05/05}
%  \item Support for the Central European <QX> encoding
%        (protrusion, inheritance)
%  \item Protrusion settings for various Euro symbol fonts (Adobe, <ITC>, \pkg{marvosym})
%  \item Support for Unicode input in the configuration (\pkg{inputenc}/|utf8|)
%
%\Version{1.9c}{2006/02/02}
%  \item Protrusion settings for <URW> Garamond
%
%\VersionDate{1.9b}{2006/01/20}
%
%\Version{1.9a}{2005/12/05}
%  \item Defer setup until the end of the preamble
%   ^^A ; consequently, no need to
%   ^^A   change font defaults before loading \microtype, or to put it the other
%   ^^A   way round, \microtype\ may now be loaded at any time
%   ^^A ; new option `\opt{defersetup}'
%  \item Inside the preamble, \cs{microtypesetup} accepts all package options
%        \refsection{\ref{sub:options-cmd}}
%  \item Protrusion settings for <T5> encoded Charter
%
%\Version{1.9}{2005/10/28}
%  \item New command \cs{DisableLigatures} to disable ligatures
%        (\pdftex\ $\geq$ 1.30)
%        \refsection{\ref{sec:disable-ligatures}}
%  \item New command \cs{microtypecontext} to change the configuration context;
%        new key `|context|' for the configuration commands
%        \refsection{\ref{sec:context}}
%  \item New key `|font|' to add single fonts to the font sets
%        \refsection{\ref{sec:font-sets}}
%  \item New key `|preset|' to set all characters to the specified value before
%        loading the lists
%  \item Value `|relative|' renamed to `|character|' for `|unit|' keys
%  \item Support for the Polish <OT4> encoding (protrusion, expansion, inheritance)
%  \item Support for the Vietnamese <T5> encoding (protrusion, expansion, inheritance)
%^^A  \item `\opt{DVIoutput}' option will work with \texlive\ 2004
%
%\Version{1.8}{2005/06/23}
%^^A  \item If font substitution has occurred, the settings for the substitute will
%^^A        be used instead of those for the selected font
%  \item New command \cs{DeclareMicrotypeSetDefault} to declare the default font sets
%        \refsection{\ref{sec:font-sets}}
%  \item New option `\opt{config}' to load a different configuration file
%        \refsection{\ref{sub:options-misc}}
%  \item New option `\opt{unit}' to measure protrusion factors relative to a
%        dimension instead of the character width
%        \refsection{\ref{sub:protrusion}}
%  \item Renamed commands from \cs{..MicroType..} to \cs{..Microtype..}
%  \item Protrusion settings for <AMS> math fonts
%  \item Protrusion settings for Times in <LY1> encoding completed
%  \item The `|allmath|' font set also includes <U> encoding
%^^A  \item 8-bit characters in the configuration finally work as advertised,
%^^A        even if made active by the \pkg{csquotes} package
%  \item Support for protrusion with the \pkg{ledmac} package (\pdftex\ $\geq$ 1.30)
%
%\Version{1.7}{2005/03/23}
%  \item Possibility to specify ranges of font sizes in the set declarations
%        \refsection{\ref{sec:font-sets}, \ref{sec:fine-tuning}}
%^^A  \item Always take font size into account when trying to find protrusion resp.
%^^A        expansion settings for a given font
%^^A        \refsection{\ref{sec:fine-tuning}}
%  \item New command \cs{LoadMicrotypeFile} to load a configuration file manually
%        \refsection{\ref{sub:config-file}}
%  \item New command \cs{Microtype@Hook} for font package authors
%        \refsection{\ref{sub:hook}}
%  \item New option `\opt{verbose}|=errors|' to turn all warnings into errors
%^^A  \item Disable expansion inside \cmd\showhyphens
%  \item Warning when running in draft mode
%
%\VersionDate{1.6a}{2005/02/02}
%
%\Version{1.6}{2005/01/24}
%  \item New option `\opt{factor}' to influence protrusion resp. expansion of
%        all characters of a font or font set
%        \refsection{\ref{sub:options-protrusion}, \ref{sec:fine-tuning}}
%  \item When \pdftex\ is too old to expand fonts automatically, expansion
%        has to be enabled explicitly, automatic expansion will be disabled
%        \refsection{\ref{sub:options-microtype}}
%^^A  \item Protrusion settings of digits improved
%  \item Use \etex\ extensions, if available
%
%\Version{1.5}{2004/12/15}
%  \item When output mode is <DVI>, font expansion has to be enabled explicitly,
%        automatic expansion will be disabled
%        \refsection{\ref{sub:options-microtype}}
%  \item New option `\opt{selected}' to enable selected expansion,
%        default: |false|
%        \refsection{\ref{sub:options-expansion}, \ref{sub:expansion}}
%  \item New default for expansion option `\opt{step}': 4 (min(\opt{stretch},\opt{shrink})/5)
%        \refsection{\ref{sub:options-expansion}}
%  \item Protrusion settings for Bitstream Charter
%
%\VersionDate{1.4b}{2004/11/26}
%^^A\Version{1.4b}{2004/11/26}
%^^A  \item \cs{UseMicrotypeSet} requires the set to be declared
%^^A        \refsection{\ref{sec:font-sets}}
%
%\VersionDate{1.4a}{2004/11/17}
%
%\Version{1.4}{2004/11/12}
%  \item Set up fonts independently from \LaTeX\ font loading
%^^A        (therefore, no risk of overlooking fonts anymore, and the package may
%^^A        be loaded at any time)
%^^A  \item \cs{microtypesetup} now sets the correct level of protrusion
%^^A        \refsection{\ref{sub:options-cmd}}
%  \item New option: `\opt{final}'
%        \refsection{\ref{sub:options-misc}}
%
%\VersionDate{1.3}{2004/10/27}
%
%\Version{1.2}{2004/10/03}
%  \item New font sets: `|allmath|' and `|basicmath|'
%        \refsection{\ref{sec:font-sets}, table~\ref{tab:predefined-font-sets}}
%  \item Protrusion settings for Computer Modern Roman math symbols
%  \item Protrusion settings for <TS1> encoding completed for Computer Modern
%        Roman and Adobe Garamond
%^^A  \item If an alias font name is specified, it will be used as an alternative,
%^^A        not as a replacement \refsection{\ref{sub:config-file}}
%
%\Version{1.1}{2004/09/21}
%  \item Protrusion settings for Adobe Minion
%  \item New command: \cs{DeclareCharacterInheritance}
%        \refsection{\ref{sub:inherit}}
%  \item Characters may also be specified as octal or hexadecimal numbers
%        \refsection{\ref{sec:fine-tuning}}
%^^A  \item Configuration file names in lowercase [\ref{sub:config-file}]
%
%\Version{1.0}{2004/09/11}
%  \item First <CTAN> release
%\end{History}
%
%
%\def\AppendixSettings{
%  \addtolength\textwidth{50pt}
%  \addtolength{\oddsidemargin}{-50pt}
%  \setlength{\columnwidth}{\textwidth}
%  \setlength{\hsize}{\textwidth}
%  \setlength{\linewidth}{\textwidth}
%  \footnotesize
%}
%
%\def\LPPLSettings{
%\changes{v1.9e}{2006/06/13}{include <LPPL>}
%  \let\LPPLicense\empty
%  \def\endLPPLicense{\endmulticols\endgroup}
%  \def\LPPLsection##1{\begin{multicols}{2}[\section{##1}][12\baselineskip]}
%  \def\LPPLsubsection##1{\end{multicols}\begin{multicols}{2}[\subsection*{##1}][6\baselineskip]}
%  \def\LPPLsubsubsection{\subsubsection*}
%  \let\LPPLparagraph\textit
%  \let\LPPLfile\file
%  \def\textsc##1{\acronym{\MakeUppercase{##1}}}
%  \lstset{gobble=2,basicstyle=\MacroFont\tiny,commentstyle=,aboveskip=\smallskipamount}
%  \let\oldmakeatletter\makeatletter
%  \long\def\makeatletter##1\makeatother{\let\makeatletter\oldmakeatletter}
%  \MakePercentComment
%}
%
%\StopEventually{
%  \GeneralChanges{Documentation}
%  \ifx\Finale\relax
%    \newpage
%    \appendix
%    \AppendixSettings
%  \fi
%  \PrintIndex
%  \InputIfFileExists{lppl.tex}\LPPLSettings\relax
%}
%
% \GeneralChanges*
%
% ^^A =========================================================================
%
% ^^A Heiko Oberdiek's fix from latexbugs (latex/3540):
%\begingroup
%  \def\x\begingroup#1\@nil{\endgroup
%    \def\DoNotIndex{\begingroup
%      \@tfor\@tempa:=\#\$\&\^\_\|\~\ \<\do{\expandafter\@makeother\@tempa}#1}}
%\expandafter\x\DoNotIndex\@nil
%\def\PercentIndex{}\def\LeftBraceIndex{}\def\RightBraceIndex{}
% ^^A also index new ifs:
%\def\@newif{newif}\newif\if@newif
%\def\macro@finish{\macro@namepart
%  \ifx\macro@namepart\@newif\@tempswatrue\else\@tempswafalse\fi
%  \ifnot@excluded
%    \edef\@tempa{\noexpand\SpecialIndex{\bslash\macro@namepart}}\@tempa
%  \fi
%  \if@newif
%    \edef\@tempa{\noexpand\SpecialMainIndex
%       {\bslash\expandafter\@gobbletwo\macro@namepart true}}\@tempa
%    \edef\@tempa{\noexpand\SpecialMainIndex
%       {\bslash\expandafter\@gobbletwo\macro@namepart false}}\@tempa
%  \fi
%  \if@tempswa\@newiftrue\else\@newiffalse\fi
%}
%
%\DoNotIndex{\!,\",\',\(,\),\*,\+,\,,\-,\.,\/,\:,\;,\<,\=,\>,\?,\[,\\,\],\`,
%  \#,\$,\&,\^,\_,\|,\~,\ ,
%  \advance,\afterassignment,\aftergroup,\begingroup,\bgroup,\catcode,\char,
%  \chardef,\csname,\def,\divide,\edef,\egroup,\else,\endcsname,\endgroup,
%  \endinput,\escapechar,\everypar,\expandafter,\fi,\futurelet,\gdef,\global,
%  \hbadness,\hbox,\hsize,\hskip,\if,\ifcase,\ifcat,\ifdim,\iffalse,\ifhbox,
%  \ifhmode,\ifmmode,\ifnum,\iftrue,\ifx,\immediate,\input,\inputlineno,\jobname,
%  \kern,\lastkern,\lastskip,\let,\lowercase,\maxdimen,\meaning,\multiply,
%  \newlinechar,\noexpand,\number,\or,\parfillskip,\pretolerance,\relax,\setbox,
%  \showboxdepth,\string,\the,\tolerance,\unkern,\unskip,\uppercase,\vbox,\wd,
%  \write,\xdef}
%^^A\DoNotIndex{\font,\fontdimen,\nullfont,\sfcode,\spacefactor,\spaceskip,
%^^A  \xspaceskip}                                                           ^^A tex
%\DoNotIndex{\currentgrouplevel,\currentgrouptype,\detokenize,\dimexpr,
%  \eTeXversion,\ifcsname,\ifdefined,\numexpr}
%^^A\DoNotIndex{\fontcharwd,\iffontchar}                                     ^^A e-tex
%\DoNotIndex{\pdfannot,\pdfescapestring,\pdfmatch,\pdfoutput,\pdfstrcmp,
%  \pdftexrevision,\pdftexversion}
%^^A\DoNotIndex{\(ef,lp,rp,kn(ac,bc),(kn,sh,st)bs)code,\(left,right)marginkern,
%^^A  \tagcode,\letterspacefont,\pdfcopyfont,\pdffontexpand,\pdfnoligatures,
%^^A  \pdfprotrudechars,\pdfadjust(interwordglue,spacing),\pdf(ap,pre)pendkern,
%^^A  \pdftracingfonts}                                                      ^^A pdftex
%\DoNotIndex{\XeTeXversion,\XeTeXrevision,\strcmp}                           ^^A xetex
%^^A\DoNotIndex{\XeTeXcharglyph,\XeTeXfonttype,\XeTeXglyph,\XeTeXglyphindex,
%^^A  \XeTeXglyphname,\XeTeXlastfontchar,\XeTeXprotrudechars}
%\DoNotIndex{\directlua,\luatexversion}                                      ^^A luatex
%^^A\DoNotIndex{\adjustspacing,\copyfont,\expandglyphsinfont,
%^^A  \ignoreligaturesinfont,\outputmode,\protrudechars,\tracingfonts}
%\DoNotIndex{\eplain,\usepkg@pkg}                                            ^^A eplain
%\DoNotIndex{\@backslashchar,\@cclv,\@cclvi,\@classoptionslist,\@currext,
%  \@currname,\@defaultunits,\@empty,\@expandtwoargs,\@firstofone,\@firstoftwo,
%  \@gobble,\@gobbletwo,\@ifclassloaded,\@ifl@t@r,\@ifl@aded,\@ifpackagelater,
%  \@ifpackageloaded,\@ifstar,\@ifundefined,\@let@token,\@m,\@makeother,
%  \@minus,\@nameuse,\@ne,\@nil,\@nnil,\@onelevel@sanitize,\@onlypreamble,
%  \@percentchar,\@pkgextension,\@plus,\@ptionlist,\@removeelement,\@secondoftwo,
%  \@spaces,\@sptoken,\@tempa,\@tempb,\@tempc,\@tempcnta,\@tempcntb,\@tempdima,
%  \@typeset@protect,\@undefined,\@unprocessedoptions,\@unusedoptionlist,
%  \@xobeysp,\check@icr,\color@begingroup,\color@endgroup,\g@addto@macro,
%  \hmode@bgroup,\m@ne,\maybe@ic,\maybe@ic@,\nfss@text,\not@math@alphabet,
%  \on@line,\p@,\set@display@protect,\strip@prefix,\strip@pt,\tw@,\z@,\z@skip,
%  \zap@space,\active,\documentclass,\fmtversion,\leavevmode,\makeatletter,
%  \mbox,\newcommand,\newcount,\newdimen,\newif,\newskip,\newtoks,\nobreak,
%  \nonfrenchspacing,\normalsize,\renewcommand,\space,\AtBeginDocument,
%  \AtEndOfPackage,\CheckCommand,\CurrentOption,\DeclareRobustCommand,\IfFileExists,
%  \InputIfFileExists,\MessageBreak,\PackageError,\PackageInfo,\PackageWarning,
%  \RequirePackage,\@@enc@update,\cf@encoding,\f@encoding}
%^^A\DoNotIndex{\add@accent,\curr@fontshape,\define@newfont,\do@subst@correction,
%^^A  \every@math@size,\f@size,\font@name,\glb@currsize,\glb@settings,\normalfont,
%^^A  \pickup@font,\remove@tlig,\selectfont,\set@fontsize,\showhyphens}      ^^A latex
%\DoNotIndex{\normalpdfoutput,\normalpdftexversion,\normalpdftexrevision}    ^^A tex live 2004
%\DoNotIndex{\foreign@language,\languagename,\select@language,\shorthandoff} ^^A babel
%\DoNotIndex{\percentsign}                                                   ^^A babel/spanish,galician,mexican
%\DoNotIndex{\CJK@ifundefined,\CJK@plane,\CJK@temp,\CJK@addcmap}             ^^A CJK,CJKutf8
%\DoNotIndex{\@disablequotes}                                                ^^A csquotes
%\DoNotIndex{\pdfstringdefDisableCommands,\pdfstringdefWarn}                 ^^A hyperref
%\DoNotIndex{\ifpdf}                                                         ^^A ifpdf
%\DoNotIndex{\@inpenc@undefined@,\IeC,\inputencoding,\inputencodingname}     ^^A inputenc
%\DoNotIndex{\UTFviii@defined}                                               ^^A inputenc/utf8
%\DoNotIndex{\PrerenderUnicode,\unicode@charfilter}                          ^^A inputenc/utf8x
%\DoNotIndex{\define@key,\KV@@sp@def,\setkeys}                               ^^A keyval
%\DoNotIndex{\l@dunhbox@line}                                                ^^A ((r)e)ledmac,((r)e)ledpar
%\DoNotIndex{\lst@ProcessLetter}                                             ^^A listings
%\DoNotIndex{\RequireLuaModule}                                              ^^A luatexbase
%\DoNotIndex{\pdf@escapestring}                                              ^^A pdftexcmds
%\DoNotIndex{\py@macron}                                                     ^^A pinyin
%\DoNotIndex{\SOUL@,\SOUL@doword,\soulregister}                              ^^A soul
%\DoNotIndex{\tikz@expandcount}                                              ^^A tikz
%\DoNotIndex{\conditionally@traceoff}                                        ^^A trace
%\DoNotIndex{\@xspace,\@xspace@firsttrue}                                    ^^A xspace
%\DoNotIndex{\x,\MT@dinfo,\MT@dinfo@nl,\tracingmicrotype,\tracingmicrotypeinpdf,
%  \ifMT@inannot,\MT@inannottrue,\MT@inannotfalse,\MT@addto@annot,\MT@pdf@annot,
%  \MT@show@pdfannot,\iftracingmicrotypeinpdfall,\tracingmicrotypeinpdfalltrue,
%  \tracingmicrotypeinpdfallfalse,\DeclareMicroTypeSet,\DeclareMicroTypeAlias,
%  \UseMicroTypeSet,\LoadMicroTypeFile,\MicroType@Hook}                      ^^A microtype
%
% ^^A -------------------------------------------------------------------------
%
%\newpage
%\ImplementationSettings
%\ifpdf\hypersetup{bookmarksopen=false}\fi
%
%\section{Implementation}
%
% The \pkg{docstrip} modules in this file are:
% \begin{description}
%  \item[|driver|]  The documentation driver, only visible in the \file{dtx} file.
%  \item[|package|] The code for the \microtype\ package (\file{microtype.sty}).
%  \item[|pdftex-def|] Definitions specific to \pdftex\ (\file{microtype-pdftex.def}).
%  \item[|xetex-def|] Definitions specific to \xetex\ (\file{microtype-xetex.def}).
%  \item[|luatex-def|] Definitions specific to \luatex\ (\file{microtype-luatex.def}).
%  \item[|letterspace|] The code for the \letterspace\ package (\file{letterspace.sty}).
%   \begin{description}
%    \item[|plain|]  Code for \pkg{eplain}, \pkg{miniltx} (\letterspace\ only).
%   \end{description}
%  \item[|debug|]  Code for additional output in the log file.
%                 \\Used for -- surprise! -- debugging purposes.
%  \item[|luafile|] Lua functions (\file{microtype.lua}).
%  \item[|config|]  Surrounds all configuration modules.
%   \begin{description}
%    \item[|cfg-t|]  Surrounds (Latin) text configurations.
%     \begin{description}
%      \item[|m-t|]   The main configuration file (\file{microtype.cfg}).
%      \item[|bch|]   Settings for Bitstream Charter (\file{mt-bch.cfg}).
%      \item[|blg|]   Settings for Bitstream Letter Gothic (\file{mt-blg.cfg}).
%      \item[|cmr|]   Settings for Computer Modern Roman (\file{mt-cmr.cfg}).
%      \item[|pad|]   Settings for Adobe Garamond (\file{mt-pad.cfg}).
%      \item[|ppl|]   Settings for Palatino (\file{mt-ppl.cfg}).
%      \item[|ptm|]   Settings for Times (\file{mt-ptm.cfg}).
%      \item[|pmn|]   Settings for Adobe Minion (\file{mt-pmn.cfg}).
%                    \\Contributed by \contributor Harald Harders <h.harders\at tu-bs.de>.
%      \item[|ugm|]   Settings for <URW> Garamond (\file{mt-ugm.cfg}).
%     \end{description}
%    \item[|cfg-u|]  Surrounds non-text configurations (<U> encoding).
%     \begin{description}
%      \item[|msa|]   Settings for <AMS> `a' symbol font (\file{mt-msa.cfg}).
%      \item[|msb|]   Settings for <AMS> `b' symbol font (\file{mt-msb.cfg}).
%      \item[|euf|]   Settings for Euler Fraktur font (\file{mt-euf.cfg}).
%      \item[|eur|]   Settings for Euler Roman font (\file{mt-eur.cfg}).
%      \item[|eus|]   Settings for Euler Script font (\file{mt-eus.cfg}).
%     \end{description}
%    \item[|cfg-e|]  Surrounds Euro symbol configurations.
%     \begin{description}
%      \item[|zpeu|]  Settings for Adobe Euro symbol fonts (\file{mt-zpeu.cfg}).
%      \item[|euroitc|] Settings for <ITC> Euro symbol fonts (\file{mt-euroitc.cfg}).
%      \item[|mvs|]   Settings for \pkg{marvosym} Euro symbol (\file{mt-mvs.cfg}).
%     \end{description}
%   \end{description}
%  \item[|test|]    A helper file that may be used to create and test
%                    protrusion settings\\(\file{test-microtype.tex}).
% \end{description}
% And now for something completely different.
%
%    \begin{macrocode}
%<*package|letterspace>
%    \end{macrocode}
%
%\subsection{Preliminaries}
%
%\begin{macro}{\MT@MT}
% This is us.
%    \begin{macrocode}
\def\MT@MT
%<package>  {microtype}
%<letterspace>  {letterspace}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@fix@catcode}
%\changes{v1.3}{2004/10/27}{check some category codes (compatibility with \pkg{german})}
%\changes{v1.5}{2004/12/03}{reset catcode of `\texttt{\^}' (compatibility with \pkg{chemsym})}
%\changes{v2.3a}{2007/12/29}{fix catcodes earlier, and also for the \letterspace\ package}
% 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{macro}{\MT@restore@catcodes}
% Polite as we are, we'll restore them afterwards.
%    \begin{macrocode}
\let\MT@restore@catcodes\@empty
%    \end{macrocode}
%\end{macro}
%    \begin{macrocode}
\def\MT@fix@catcode#1#2{%
  \edef\MT@restore@catcodes{%
    \MT@restore@catcodes
    \catcode#1=\the\catcode#1\relax
  }%
  \catcode#1=#2\relax
}
\MT@fix@catcode{17}{14}% ^^Q (comment)
\MT@fix@catcode{24} {9}% ^^X (ignore)
%<package>\MT@fix@catcode{33}{12}% !
%<package>\MT@fix@catcode{34}{12}% "
\MT@fix@catcode{36} {3}% $ (math shift)
\MT@fix@catcode{39}{12}% '
\MT@fix@catcode{42}{12}% *
\MT@fix@catcode{43}{12}% +
\MT@fix@catcode{44}{12}% ,
\MT@fix@catcode{45}{12}% -
\MT@fix@catcode{58}{12}% :
\MT@fix@catcode{60}{12}% <
\MT@fix@catcode{61}{12}% =
\MT@fix@catcode{62}{12}% >
%<package>\MT@fix@catcode{63}{12}% ?
\MT@fix@catcode{94} {7}% ^ (superscript)
\MT@fix@catcode{96}{12}% `
%<package>\MT@fix@catcode{124}{12}% |
%    \end{macrocode}
%\end{macro}
% These are all commands for the outside world. We define them here as blank
% commands, so that they won't generate an error if we are not running \pdftex.
%    \begin{macrocode}
%<*package>
\newcommand*\DeclareMicrotypeSet[3][]{}
\newcommand*\UseMicrotypeSet[2][]{}
\newcommand*\DeclareMicrotypeSetDefault[2][]{}
\newcommand*\SetProtrusion[3][]{}
\newcommand*\SetExpansion[3][]{}
\newcommand*\SetTracking[3][]{}
\newcommand*\SetExtraKerning[3][]{}
\newcommand*\SetExtraSpacing[3][]{}
\newcommand*\DisableLigatures[2][]{}
\newcommand*\DeclareCharacterInheritance[3][]{}
\newcommand*\DeclareMicrotypeVariants[1]{}
\newcommand*\DeclareMicrotypeAlias[2]{}
\newcommand*\LoadMicrotypeFile[1]{}
\newcommand*\DeclareMicrotypeBabelHook[2]{}
\newcommand*\microtypesetup[1]{}
\newcommand*\microtypecontext[1]{}
\newcommand*\textmicrotypecontext[2]{#2}
\@ifpackageloaded{letterspace}{\let\MT@textls\relax}{%
%</package>
\newcommand*\lsstyle{}
\newcommand\textls[2][]{}
\def\textls#1#{}
\newcommand*\lslig[1]{#1}
%<*package>
}
%    \end{macrocode}
% These commands also have a starred version.
%    \begin{macrocode}
\def\DeclareMicrotypeSet#1#{\@gobbletwo}
\def\DeclareMicrotypeVariants#1#{\@gobble}
%    \end{macrocode}
% Set declarations are only allowed in the preamble (resp. the main
% configuration file). The configuration commands, on the other hand, must be
% allowed in the document, too, since they may be called inside font
% configuration files, which, in principle, may be loaded at any time.
%    \begin{macrocode}
\@onlypreamble\DeclareMicrotypeSet
\@onlypreamble\UseMicrotypeSet
\@onlypreamble\DeclareMicrotypeSetDefault
\@onlypreamble\DisableLigatures
\@onlypreamble\DeclareMicrotypeVariants
\@onlypreamble\DeclareMicrotypeBabelHook
%    \end{macrocode}
% Don't load \letterspace.
%    \begin{macrocode}
\expandafter\let\csname ver@letterspace.sty\endcsname\@empty
%    \end{macrocode}
%\begin{macro}{\MT@old@cmd}
% The old command names had one more hunch.
%\changes{v1.8}{2005/04/28}{renamed commands from \cs{..MicroType..} to \cs{..Microtype..}}
%    \begin{macrocode}
\def\MT@old@cmd#1#2{%
  \newcommand*#1{\MT@warning{%
    \string#1 is deprecated. Please use\MessageBreak
    \string#2 instead}%
    \let #1#2#2}}
%    \end{macrocode}
%\end{macro}
%    \begin{macrocode}
\MT@old@cmd\DeclareMicroTypeAlias\DeclareMicrotypeAlias
\MT@old@cmd\DeclareMicroTypeSet  \DeclareMicrotypeSet
\MT@old@cmd\UseMicroTypeSet      \UseMicrotypeSet
\MT@old@cmd\LoadMicroTypeFile    \LoadMicrotypeFile
%</package>
%    \end{macrocode}
%\begin{macro}{\MT@warning}
%\begin{macro}{\MT@warning@nl}
%\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@error}
%\begin{macro}{\MT@warn@err}
%\changes{v1.7}{2005/03/16}{new macro: for \opt{verbose}\texttt{\quotechar=errors}}
% Communicate.
%    \begin{macrocode}
\def\MT@warning{\PackageWarning\MT@MT}
\def\MT@warning@nl#1{\MT@warning{#1\@gobble}}
%<*package>
\def\MT@info{\PackageInfo\MT@MT}
\def\MT@info@nl#1{\MT@info{#1\@gobble}}
\let\MT@vinfo\@gobble
\def\MT@error{\PackageError\MT@MT}
\def\MT@warn@err#1{\MT@error{#1}{%
  This error message appears because you loaded the `\MT@MT'\MessageBreak
  package with the option `verbose=errors'. Consult the documentation\MessageBreak
  in \MT@MT.pdf to find out what went wrong.}}
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%
%\subsubsection{Debugging}
%
%\begin{macro}{\tracingmicrotype}
%\begin{macro}{\MT@dinfo}
%\begin{macro}{\MT@dinfo@nl}
% Cases for \cs{tracingmicrotype}:
%\begin{enum}
%  \item almost none
%  \item + sets \& lists
%  \item + heirs
%  \item + slots
%  \item + factors
%\end{enum}
%    \begin{macrocode}
%<*debug>
\MT@warning@nl{This is the debug version}
\newcount\tracingmicrotype
\tracingmicrotype=2
\def\MT@info#1{\PackageInfo\MT@MT{#1}\MT@addto@annot{#1}}
\def\MT@info@nl#1{\PackageInfo\MT@MT{#1\@gobble}\MT@addto@annot{#1}}
\let\MT@vinfo\MT@info@nl
\def\MT@warning#1{\PackageWarning\MT@MT{#1}\MT@addto@annot{Warning: #1}}
\def\MT@warning@nl#1{\PackageWarning\MT@MT{#1\@gobble}\MT@addto@annot{Warning: #1}}
\def\MT@dinfo#1#2{\ifnum\tracingmicrotype<#1 \else\MT@info{#2}\fi}
\def\MT@dinfo@nl#1#2{\ifnum\tracingmicrotype<#1 \else\MT@info@nl{#2}\fi}
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\end{macro}
%\begin{macro}{\tracingmicrotypeinpdf}
%\changes{v2.0}{2006/09/21}{new debug method: mark all fonts with <PDF> annotations}
% Another debug method: font switches can be marked in the <PDF> file with a
% small caret, an accompanying popup text box displaying all debug messages.
%
% Cases for \cs{tracingmicrotypeinpdf}:
%\begin{enum}[1]
%  \item show new fonts
%  \item + show known fonts
%\end{enum}
%    \begin{macrocode}
\newcount\tracingmicrotypeinpdf
%    \end{macrocode}
%\end{macro}
%\ifpdf\ifx\tracingmicrotypeinpdf\undefined
% \fallbacktext{If \file{microtype.sty} had been generated with the `|debug|'
%   option,\\this method would be demonstrated here.}
%\else
% Let's see how it works~\dots\ (if you don't see anything special on this page,
% your <PDF> viewer doesn't support annotations).
%\begin{verbatim}
%\tracingmicrotypeinpdf=2
%\end{verbatim}
%\tracingmicrotypeinpdf=2
%\fi\fi
%\begin{macro}{\MT@pdf@annot}
%\begin{macro}{\MT@addto@annot}
%\begin{macro}{\ifMT@inannot}
% During font setup, we save the text for the popup in \cs{MT@pdf@annot}.
% (This requires \pdftex\ $\geq$~1.30.)
% The \pkg{pdftexcmds} package provides \pdftex's utility commands in \luatex, too.
%\changes{v2.3d}{2009/02/27}{use \pkg{pdftexcmds} for debugging}
%    \begin{macrocode}
\RequirePackage{pdftexcmds}
\newif\ifMT@inannot \MT@inannottrue
\let\MT@pdf@annot\@empty
\def\MT@addto@annot#1{\ifnum\tracingmicrotypeinpdf>\z@ \ifMT@inannot
  {\def\MessageBreak{^^J\@spaces}%
   \MT@xadd\MT@pdf@annot{\pdf@escapestring{#1^^J}}}\fi\fi}
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\end{macro}
%\begin{macro}{\iftracingmicrotypeinpdfall}
% With \cs{tracingmicrotypeinpdfallfalse}, the <PDF> output is (hopefully)
% identical, but some font switches will not be displayed; otherwise the output
% is affected, but \emph{all} font switches are visible. In the latter case, we
% also insert a small kern so that multiple font switches are discernable.
%    \begin{macrocode}
\newif\iftracingmicrotypeinpdfall
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@show@pdfannot}
% A red caret is shown for fonts which are actually set up by
% {\ifpdf\ifx\tracingmicrotypeinpdf\undefined\else\fontfamily{pzc}\itshape\fi\fi
%  Microtype},
% a green one marks fonts that we have already seen. The |/Caret| annotation
% requires a viewer for <PDF> version 1.5 (you could use |/Text| if you're
% using an older <PDF> viewer).
%    \begin{macrocode}
\def\MT@show@pdfannot#1{%
  \ifnum\tracingmicrotypeinpdf<#1 \else
    \iftracingmicrotypeinpdfall\leavevmode\fi
    \pdfannot height 4pt width 4pt depth 2pt {%
      /Subtype/Caret
      /T(\expandafter\string\font@name)
      \ifcase#1\or
      /Subj(New font)/C[1 0 0]
      \else
      /Subj(Known font)/C[0 1 0]
      \fi
      /Contents(\MT@pdf@annot)
    }%
    \iftracingmicrotypeinpdfall\kern1pt \fi
    \global\MT@inannotfalse
  \fi
}
%</debug>
%</package>
%    \end{macrocode}
%\end{macro}
%\ifpdf\ifx\tracingmicrotypeinpdf\undefined\else
% \tracingmicrotypeinpdf0
% \tracingmicrotype0
%\fi\fi
%
%\subsubsection{Requirements}
%
%\begin{macro}{\MT@plain}
% The \letterspace\ package works with:
%\begin{enum}
%\changes{v2.3}{2007/11/07}{\letterspace: support for \pkg{eplain}/\pkg{miniltx}}
%  \item \pkg{miniltx}
%  \item \pkg{eplain} ^^A tested with eplain v3.1, 2006/12/03; v3.2, 2007/11/26; v3.3, 2009/07/21
%  \item \LaTeX
%\end{enum}
% For plain usage, we have to copy some commands from \file{latex.ltx}.
%    \begin{macrocode}
%<*plain>
\def\MT@plain{2}
\ifx\documentclass\@undefined
  \def\MT@plain{1}
  \def\hmode@bgroup{\leavevmode\bgroup}
  \def\nfss@text#1{{\mbox{#1}}}
  \let\@typeset@protect\relax
  \ifx\eplain\@undefined
    \def\MT@plain{0}
    \def\PackageWarning#1#2{%
      \begingroup
        \newlinechar=10 %
        \def\MessageBreak{^^J(#1)\@spaces\@spaces\@spaces\@spaces}%
        \immediate\write16{^^JPackage #1 Warning: #2\on@line.^^J}%
      \endgroup
    }
    \def\on@line{ on input line \the\inputlineno}
    \def\@spaces{\space\space\space\space}
  \fi
\fi
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@requires@latex}
%\changes{v2.3b}{2008/05/26}{new macro}
% Better use groups than plain ifs.
%    \begin{macrocode}
\def\MT@requires@latex#1{%
  \ifnum\MT@plain<#1 \expandafter\@secondoftwo\else\expandafter\@firstoftwo\fi
}
%</plain>
%    \end{macrocode}
%\end{macro}
%\changes{v2.2}{2007/05/01}{use catcode trickery for \etex\ test}
%^^A\changes{v2.3a}{2007/12/29}{removed} ^^A \MT@maybe@etex
%\changes{v2.8}{2020/05/26}{\letterspace\ works with \etex\ only}
% For definitions that depend on \etex\ features.
%    \begin{macrocode}
\ifcase 0%
  \ifx\eTeXversion\@undefined 1\else
    \ifx\eTeXversion\relax    1\else
      \ifcase\eTeXversion     1\fi
    \fi
  \fi
\else
  \catcode`\^^Q=9 \catcode`\^^X=14
\fi
%<letterspace>^^Q\MT@warning@nl{This package requires the etex extensions.
%<letterspace>^^Q               \MessageBreak Exiting}\MT@restore@catcodes\endinput
%<debug>\MT@dinfo@nl{0}{this is
%<debug>^^Q not
%<debug>  etex}
%    \end{macrocode}
%\changes{v2.5}{2010/05/05}{new files: \file{microtype-pdftex.def}, \file{microtype-xetex.def}, \file{microtype-luatex.def},
%                           containing engine-specific definitions}
% We check whether we are running \pdftex, \xetex, or \luatex, and
% load the appropriate definition file.
%\begin{macro}{\MT@clear@options}
% If we are using neither of these engines, we disable everything and exit.
%    \begin{macrocode}
\def\MT@clear@options{%
%<plain>  \MT@requires@latex1{%
  \AtEndOfPackage{\let\@unprocessedoptions\relax\MT@restore@catcodes}%
  \let\CurrentOption\@empty
%<package>  \let\MT@endinput\endinput
%<plain>  }\relax
}
%    \end{macrocode}
%\end{macro}
%\changes{v1.9}{2005/08/29}{compatibility with \texlive\ hack
%               (reported by \contributor Herbert Vo\ss{} <Herbert.Voss\at gmx.net>)}
%                                      ^^A MID: <deprh8$c69$00$1@news.t-online.com>
% A hack circumventing the \texlive\ 2004 hack which undefines the \pdftex\
% primitives in the format in order to hide the fact that \pdftex\ is being run
% from the user. This has been \emph{fixed} in \texlive\ 2005.
%    \begin{macrocode}
\ifx\normalpdftexversion\@undefined \else
  \let\pdftexversion \normalpdftexversion
  \let\pdftexrevision\normalpdftexrevision
  \let\pdfoutput     \normalpdfoutput
\fi
%    \end{macrocode}
%\begin{macro}{\MT@engine}
%\changes{v2.6}{2016/03/25}{fix test with \luatex\ 0.85}
%\begin{macro}{\MT@engine@tooold}
% Old packages might have let \cmd\pdftexversion\ to \cmd\relax.
%    \begin{macrocode}
\let\MT@engine\relax
%<letterspace>\def\MT@engine@tooold{0}
\ifx\pdftexversion\@undefined \else
  \ifx\pdftexversion\relax \else
    \def\MT@engine{pdf}
%<letterspace>    \let\MT@pdf@or@lua\@firstoftwo
%<letterspace>    \ifnum\pdftexversion > 139 \def\MT@engine@tooold{1}\fi
  \fi
\fi
\ifx\directlua\@undefined \else
  \ifx\directlua\relax \else
    \def\MT@engine{lua}
%    \end{macrocode}
% Since approx. \luatex\ 0.80, \cmd\pdftexversion\ is let to \cmd\luatexversion,
% so that we would be fooled to think that \pdftex\ is too old.
%    \begin{macrocode}
%<*letterspace>
    \let\MT@pdf@or@lua\@secondoftwo
    \ifnum\luatexversion < 62 \def\MT@engine@tooold{0}
    \else
      \def\MT@engine@tooold{1}
      \let\MT@lua\directlua
      \ifnum\luatexversion > 84
        \let\pdfoutput\outputmode
        \let\pdfprotrudechars\protrudechars
        \let\pdfadjustspacing\adjustspacing
      \fi
    \fi
%</letterspace>
  \fi
\fi
%<*package>
\ifx\MT@engine\relax
  \ifx\XeTeXversion\@undefined \else
    \ifx\XeTeXversion\relax \else
      \def\MT@engine{xe}
    \fi
  \fi
\fi
%</package>
%</package|letterspace>
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\begin{macro}{\MT@pdftex@no}
%\changes{v1.6a}{2005/02/02}{new macro}
% \pdftex's features for which we provide an interface here haven't always been
% available, and some specifics have changed over time. Therefore, we have to
% test which \pdftex\ we're using, if any. \cs{MT@pdftex@no} will be used
% throughout the package to respectively do the right thing.
%
% Currently, we have to distinguish seven cases for \pdftex:
%\begin{enum}
%  \item not running \pdftex
%  \item \pdftex\ ($\less$~0.14f)
%  \item + micro-typographic extensions (0.14f,g)
%  \item + protrusion relative to \EM{1} ($\geq$~0.14h)
%  \item + automatic font expansion;
%          protrusion no longer has to be set up first;
%          scale factor fixed to 1000;
%          default \cmd\efcode\,=\,1000 ($\geq$~1.20)
%\changes{v1.8}{2005/04/15}{case 5: \pdftex\ 1.30}
%  \item + \cmd{\(left,right)marginkern};
%          \cmd\pdfnoligatures;
%          \cmd\pdfstrcmp;
%          \cmd\pdfescapestring\ ($\geq$~1.30)
%\changes{v2.0}{2005/08/20}{case 6: \pdftex\ 1.40} ^^A (beta:1)
%  \item + adjustment of interword spacing;
%          extra kerning;
%          \cmd\letterspacefont;
%          \cmd\pdfmatch\footnote{This command was actually introduced
%           in 1.30, but failed on strings longer than 1023 bytes.};
%          \cmd\pdftracingfonts;
%          always \etex\
%          ($\geq$~1.40)
%\changes{v2.2}{2007/02/23}{case 7: \pdftex\ 1.40.4}
%  \item + \cmd\letterspacefont\ doesn't disable ligatures and kerns;
%          \cmd\pdfcopyfont\
%          ($\geq$~1.40.4)
%\end{enum}
%\changes{v1.1}{2004/09/13}{fix: version check
%               (reported by \contributor Harald Harders <h.harders\at tu-bs.de>)}
%                                                   ^^A private mail, 2004/09/13
%    \begin{macrocode}
%<*pdftex-def>
%<debug>\MT@dinfo@nl{0}{this is pdftex \the\pdftexversion(\pdftexrevision)}
\def\MT@pdftex@no{7}
\ifnum\pdftexversion = 140
  \ifnum\pdftexrevision < 4
    \def\MT@pdftex@no{6}
  \fi
\else
  \ifnum\pdftexversion < 140
    \def\MT@pdftex@no{5}
    \ifnum\pdftexversion < 130
      \def\MT@pdftex@no{4}
      \ifnum\pdftexversion < 120
        \def\MT@pdftex@no{3}
        \ifnum\pdftexversion = 14
          \ifnum \expandafter`\pdftexrevision < `h
            \def\MT@pdftex@no{2}
            \ifnum \expandafter`\pdftexrevision < `f
              \def\MT@pdftex@no{1}
            \fi
          \fi
        \else
          \ifnum\pdftexversion < 14
            \def\MT@pdftex@no{1}
          \fi
        \fi
      \fi
    \fi
  \fi
\fi
%<debug>\MT@dinfo@nl{0}{pdftex no.: \MT@pdftex@no}
%</pdftex-def>
%    \end{macrocode}
%\end{macro}
%\changes{v2.5}{2010/05/05}{protrusion with \xetex}
%\begin{macro}{\MT@xetex@no}
% \xetex\ supports character protrusion since version 0.9997.
%    \begin{macrocode}
%<*xetex-def>
%<debug>\MT@dinfo@nl{0}{this is xetex (\the\XeTeXversion\XeTeXrevision)}
\ifdim 0\XeTeXrevision pt < 0.9997pt
  \def\MT@xetex@no{1}
\else
  \def\MT@xetex@no{2}
\fi
%<debug>\MT@dinfo@nl{0}{xetex no.: \MT@xetex@no}
%</xetex-def>
%    \end{macrocode}
%\end{macro}
%\changes{v2.3c}{2008/09/09}{\luatex\ supported by default}
%\begin{macro}{\MT@luatex@no}
% Cases for \luatex\
% (\cmd\luatexversion\ ought to have been enabled by the format):
%\begin{enum}
% \item N/A
% \item \luatex\ ($\less$~0.36)
% \item + \cmd\directlua\ without state number ($\geq$~0.36)
% \item + \cmd\letterspacefont; non-automatic expansion doesn't work anymore,
%         and automatic expansion in <DVI> mode is realised by modifying the tracking,
%         not the glyphs\footnote{This may have been changed earlier, but I'm no longer able
%               to find out when (the last version that actually works for me is 0.40).}
%         ($\geq$~0.62)
% \item + almost all of the \pdftex\ primitives have been renamed ($\geq$~0.85)
% \item + default \cmd\efcode\,=\,1000;
%         \cmd\protrusionboundary\ [not yet supported] ($\geq$~0.90)
%\todo{interface for \cmd\protrusionboundary}
%\end{enum}
%\changes{v2.6}{2016/04/22}{update for \luatex\ 0.85 (renamed primitives)}
% Also, sometime between 1.0.4 and 1.0.7, the function |font.setexpansion|
% has been introduced, but we'll test this directly later.
%    \begin{macrocode}
%<*luatex-def>
%<debug>\MT@dinfo@nl0{this is luatex (\the\luatexversion)}
%    \end{macrocode}
%\begin{macro}{\MT@lua}
% Communicate with |lua|.
%\changes{v2.2}{2007/05/10}{(basic) support for \luatex}
% Beginning with \luatex\ 0.36, \cmd\directlua\ no longer requires a state
% number.
%\changes{v2.3d}{2009/03/25}{update for \luatex\ 0.36}
%    \begin{macrocode}
\let\MT@lua\directlua
\def\MT@luatex@no{5}
\ifnum\luatexversion<90
  \def\MT@luatex@no{4}
  \ifnum\luatexversion<85
    \def\MT@luatex@no{3}
    \ifnum\luatexversion<62
      \def\MT@luatex@no{2}
      \ifnum\luatexversion<36
        \def\MT@lua{\directlua0}
        \def\MT@luatex@no{1}
      \fi
    \fi
  \fi
\fi
%    \end{macrocode}
%\end{macro}
%    \begin{macrocode}
%<debug>\MT@dinfo@nl{0}{luatex no.: \MT@luatex@no}
%</luatex-def>
%    \end{macrocode}
%\end{macro}
%    \begin{macrocode}
%<*pdftex-def|xetex-def|letterspace>
\ifnum
%<pdftex-def|xetex-def>  \csname MT@\MT@engine tex@no\endcsname < 2
%<letterspace>  \MT@engine@tooold=\z@
  \MT@warning@nl{You
%<*letterspace>
    \ifx\MT@engine\relax
      don't seem to be using pdftex or luatex.\MessageBreak
      Try running `pdftex' or `luatex' instead of\MessageBreak
        `\ifx\XeTeXversion\@undefined\else xe\fi tex'%
    \else
%</letterspace>
      are using a \MT@engine tex version older than
%<pdftex-def>      0.14f%
%<xetex-def>      0.9997%
%<letterspace>        \MT@pdf@or@lua{1.40}{0.62}%
      .\MessageBreak
      `\MT@MT' does not work with this version.\MessageBreak
      Please install a newer version of \MT@engine tex%
%<letterspace>    \fi
      .\MessageBreak I will quit now}
  \MT@clear@options
\endinput\fi
%</pdftex-def|xetex-def|letterspace>
%    \end{macrocode}
% Still there? Then we can begin:
% We need the \pkg{keyval} package, including the `new' \cmd\KV@@sp@def\
% implementation.
%\changes{v2.1}{2007/01/15}{fix: \letterspace\ package forgot to load \pkg{keyval}}
%    \begin{macrocode}
%<*package|letterspace>
\RequirePackage{keyval}[1997/11/10]
%<*package>
%    \end{macrocode}
%\begin{macro}{\MT@toks}
% We need a token register.
%\changes{v1.9}{2005/09/28}{use instead of \cmd\toks@}
%    \begin{macrocode}
\newtoks\MT@toks
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\ifMT@if@}
% A scratch if.
%    \begin{macrocode}
\newif\ifMT@if@
%    \end{macrocode}
%\end{macro}
%
%\subsubsection{Declarations}
%
%\begin{macro}{\ifMT@protrusion}
%\begin{macro}{\ifMT@expansion}
%\begin{macro}{\ifMT@auto}
%\begin{macro}{\ifMT@selected}
%\begin{macro}{\ifMT@noligatures}
%\begin{macro}{\ifMT@draft}
%\begin{macro}{\ifMT@spacing}
%\begin{macro}{\ifMT@kerning}
%\begin{macro}{\ifMT@tracking}
%\begin{macro}{\ifMT@babel}
% These are the global switches~\dots
%    \begin{macrocode}
\newif\ifMT@protrusion
\newif\ifMT@expansion
\newif\ifMT@auto
\newif\ifMT@selected
\newif\ifMT@noligatures
\newif\ifMT@draft
\newif\ifMT@spacing
\newif\ifMT@kerning
\newif\ifMT@tracking
\newif\ifMT@babel
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
% [This line intentionally left blank.]
%\begin{macro}{\MT@pr@level}
%\begin{macro}{\MT@ex@level}
%\begin{macro}{\MT@pr@factor}
%\begin{macro}{\MT@ex@factor}
%\begin{macro}{\MT@sp@factor}
%\begin{macro}{\MT@kn@factor}
% \dots~and numbers.
%    \begin{macrocode}
\let\MT@pr@level\tw@
\let\MT@ex@level\tw@
\let\MT@pr@factor\@m
\let\MT@ex@factor\@m
\let\MT@sp@factor\@m
\let\MT@kn@factor\@m
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\begin{macro}{\MT@pr@unit}
%\begin{macro}{\MT@sp@unit}
%\begin{macro}{\MT@kn@unit}
% Default unit for protrusion settings is character width, for spacing
% |space|, for kerning (and tracking) \EM{1}.
%    \begin{macrocode}
\let\MT@pr@unit\@empty
\let\MT@sp@unit\m@ne
\def\MT@kn@unit{1em}
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\end{macro}
%\begin{macro}{\MT@stretch}
%\begin{macro}{\MT@shrink}
%\begin{macro}{\MT@step}
% Expansion settings.
%    \begin{macrocode}
\let\MT@stretch\m@ne
\let\MT@shrink \m@ne
\let\MT@step   \m@ne
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\end{macro}
%\begin{macro}{\MT@pr@min}
%\begin{macro}{\MT@pr@max}
%\begin{macro}{\MT@ex@min}
%\begin{macro}{\MT@ex@max}
%\begin{macro}{\MT@sp@min}
%\begin{macro}{\MT@sp@max}
%\begin{macro}{\MT@kn@min}
%\begin{macro}{\MT@kn@max}
%\begin{macro}{\MT@tr@min}
%\begin{macro}{\MT@tr@max}
% Minimum and maximum values allowed by \pdftex.
%    \begin{macrocode}
\def\MT@pr@min{-\@m}
\let\MT@pr@max\@m
\let\MT@ex@min\z@
\let\MT@ex@max\@m
\def\MT@sp@min{-\@m}
\let\MT@sp@max\@m
\def\MT@kn@min{-\@m}
\let\MT@kn@max\@m
%</package>
\def\MT@tr@min{-\@m}
\let\MT@tr@max\@m
%<*package>
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\begin{macro}{\MT@factor@default}
% Default factor.
%    \begin{macrocode}
\def\MT@factor@default{1000 }
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@stretch@default}
%\begin{macro}{\MT@shrink@default}
% Default values for expansion.
%    \begin{macrocode}
\def\MT@stretch@default{20 }
\def\MT@shrink@default{20 }
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\begin{macro}{\MT@letterspace}
%\begin{macro}{\MT@letterspace@default}
% Default value for letterspacing (in thousandths of \EM{1}).
%    \begin{macrocode}
%</package>
\let\MT@letterspace\m@ne
\def\MT@letterspace@default{100}
%<*package>
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\begin{macro}{\ifMT@document}
% Our private test whether we're still in the preamble.
%    \begin{macrocode}
\newif\ifMT@document
%</package>
%</package|letterspace>
%    \end{macrocode}
%\end{macro}
%
%\subsubsection{Auxiliary macros}
%
%\begin{macro}{\MT@requires@pdftex}
%\begin{macro}{\MT@requires@luatex}
% For definitions that depend on a particular \pdftex\ resp. \luatex\ version.
%    \begin{macrocode}
%<*pdftex-def|luatex-def>
\def
%<pdftex-def>  \MT@requires@pdftex%
%<luatex-def>  \MT@requires@luatex%
  #1{\ifnum
%<pdftex-def>  \MT@pdftex@no
%<luatex-def>  \MT@luatex@no
    <#1 \expandafter\@secondoftwo\else\expandafter\@firstoftwo\fi}
%<luatex-def&debug>\MT@requires@luatex4{\MT@lua{tex.enableprimitives('pdf',{'tracingfonts'})}}\relax
%<pdftex-def&debug>\MT@requires@pdftex6{
%<debug>\pdftracingfonts=1
%<pdftex-def&debug>}\relax
%</pdftex-def|luatex-def>
%    \end{macrocode}
%\end{macro}
%\end{macro}
% Some functions are loaded from a dedicated |lua| file. This avoids character
% escaping problems and incompatibilities between versions of \luatex.
%\changes{v2.5a}{2013/04/19}{use \pkg{luatexbase} instead of \pkg{luatextra}
%                            (contributed by \contributor \'Elie Roux <elie.roux\at telecom-bretagne.eu>)}
%                            ^^A MID: <516AAF6B.8040605@telecom-bretagne.eu>
% Unless running a recent \LaTeX,
%\changes{v2.7}{2017/02/08}{drop \pkg{luatexbase} with recent \LaTeX}
% we load the \pkg{luatexbase} package.
%    \begin{macrocode}
%<*luatex-def>
\@ifl@t@r\fmtversion{2016/01/01}\relax{\RequirePackage{luatexbase}}
%    \end{macrocode}
% We load \pkg{luaotfload}, because some of its functions are
% required in \file{microtype.lua}. This eliminates the need for the user to
% load \pkg{fontspec} before \microtype.
% There will hardly be any \luatex\ documents that don't load this package, anyway.
%\changes{v2.6}{2013/06/19}{load \pkg{luaotfload} with \luatex}
% Since 2017/01/01, it is already loaded in the format.
%    \begin{macrocode}
\@ifl@t@r\fmtversion{2017/01/01}\relax{\RequirePackage{luaotfload}}
\MT@lua{require("microtype")}
%</luatex-def>
%    \end{macrocode}
% Here it begins. The module was contributed by \'Elie Roux.
%\changes{v2.4}{2009/11/12}{new file \file{microtype.lua} containing the \texttt{lua} functions
%                           (contributed by \contributor \'Elie Roux <elie.roux\at telecom-bretagne.eu>)}
%\changes{v2.7b}{2019/02/28}{update lua function \texttt{microtype.info} after changes in \pkg{luaotfload}
%                            (reported by \contributor Moritz Wemheuer <moritz.wemheuer\at gmail.com> and
%                             \contributor Ulrike Fischer <news3\at nililand.de>)}
%                            ^^A private mail, 2019/02/19
%                            ^^A private mail, 2019/02/26
%\changes{v2.8}{2020/05/26}{fix for \pkg{luatexbase}}
%    \begin{macrocode}
%<*luafile>

function microtype.info(...)
  luatexbase.module_info("microtype",...)
end

local find       = string.find
local match      = string.match
local tex_write  = tex.write

local catpackage
if luatexbase.registernumber then
  catpackage = luatexbase.registernumber("catcodetable@atletter") -- LaTeX
else
  catpackage = luatexbase.catcodetables.CatcodeTableLaTeXAtLetter -- luatexbase
end
function microtype.sprint (...)
  tex.sprint(catpackage, ...)
end

%</luafile>
%    \end{macrocode}
% To be continued, but first back to primitives.
%\begin{macro}{\MT@glet}
%\changes{v1.9f}{2006/08/09}{new macro}
% Here's the forgotten one.
%    \begin{macrocode}
%<*package|letterspace>
\def\MT@glet{\global\let}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@exp@cs}
%\begin{macro}{\MT@exp@gcs}
%\changes{v2.3b}{2008/03/07}{new macro: reduce save stack size}
% Commands to create command sequences. Those that are going to be defined
% globally should be created inside a group so that the save stack won't
% explode.
%    \begin{macrocode}
\def\MT@exp@cs#1#2{\expandafter#1\csname#2\endcsname}
%<*package>
\def\MT@exp@gcs#1#2{\begingroup\expandafter\endgroup\expandafter#1\csname#2\endcsname}
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\changes{v1.4b}{2004/11/21}{optimisation: use less \cmd\expandafter s and \cmd\csname s}
%\begin{macro}{\MT@def@n}
%\begin{macro}{\MT@gdef@n}
%\changes{v1.9f}{2006/08/09}{new macros: global variants}
% This is \cmd\@namedef\ and global.
%    \begin{macrocode}
\def\MT@def@n{\MT@exp@cs\def}
\def\MT@gdef@n{\MT@exp@gcs\gdef}
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\begin{macro}{\MT@edef@n}
%\begin{macro}{\MT@xdef@n}
% Its expanding versions.
%    \begin{macrocode}
%</package>
\def\MT@edef@n{\MT@exp@cs\edef}
%<*package>
\def\MT@xdef@n{\MT@exp@gcs\xdef}
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\begin{macro}{\MT@let@nc}
%\begin{macro}{\MT@glet@nc}
% \cmd\let\ a \cmd\csname\ sequence to a command.
%    \begin{macrocode}
\def\MT@let@nc{\MT@exp@cs\let}
\def\MT@glet@nc{\MT@exp@gcs\MT@glet}
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\begin{macro}{\MT@let@cn}
% \cmd\let\ a command to a \cmd\csname\ sequence.
%    \begin{macrocode}
%</package>
\def\MT@let@cn#1#2{\expandafter\let\expandafter#1\csname #2\endcsname}
%<*package>
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@let@nn}
%\begin{macro}{\MT@glet@nn}
% \cmd\let\ a \cmd\csname\ sequence to a \cmd\csname\ sequence.
%    \begin{macrocode}
\def\MT@let@nn{\MT@exp@cs\MT@let@cn}
\def\MT@glet@nn{\MT@exp@gcs{\global\expandafter\MT@let@cn}}
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\begin{macro}{\MT@@font}
% Remove trailing space from the font name.
%    \begin{macrocode}
\def\MT@@font{\expandafter\string\MT@font}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@exp@one@n}
% Expand the second token once and enclose it in braces.
%    \begin{macrocode}
%</package>
\def\MT@exp@one@n#1#2{\expandafter#1\expandafter{#2}}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@exp@two@c}
% Expand the next two tokens after \meta{\#1} once.
%    \begin{macrocode}
\def\MT@exp@two@c#1{\expandafter\expandafter\expandafter#1\expandafter}
%<*package>
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@exp@two@n}
%\changes{v1.9}{2005/09/28}{new macros: less \cmd\expandafter s}
% Expand the next two tokens after \meta{\#1} once and enclose them in braces.
%    \begin{macrocode}
\def\MT@exp@two@n#1#2#3{%
  \expandafter\expandafter\expandafter
    #1\expandafter\expandafter\expandafter
      {\expandafter#2\expandafter}\expandafter{#3}}
%    \end{macrocode}
%\end{macro}
% You do not wonder why |\MT@exp@one@c| doesn't exist, do you?
%\changes{v1.6}{2005/01/19}{use \etex's \cs{ifcsname} and \cs{ifdefined} if defined}
%\begin{macro}{\MT@ifdefined@c@T}
%\changes{v1.9a}{2005/11/08}{new macros: true case only}
%\begin{macro}{\MT@ifdefined@c@TF}
%\begin{macro}{\MT@ifdefined@n@T}
%\begin{macro}{\MT@ifdefined@n@TF}
% Wrapper for testing whether command resp. \cmd\csname\ sequence is defined.
% If we are running \etex, we will use its primitives \cs{ifdefined} and
% \cs{ifcsname}, which decreases memory use substantially.
%    \begin{macrocode}
\def\MT@ifdefined@c@T#1{%
^^X  \ifdefined#1\expandafter\@firstofone\else\expandafter\@gobble\fi
^^Q  \ifx#1\@undefined\expandafter\@gobble\else\expandafter\@firstofone\fi
}
%</package>
\def\MT@ifdefined@c@TF#1{%
^^X  \ifdefined#1\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi
%<package>^^Q  \ifx#1\@undefined
%<package>^^Q    \expandafter\@secondoftwo\else\expandafter\@firstoftwo\fi
}
\def\MT@ifdefined@n@T#1{%
^^X  \ifcsname#1\endcsname\expandafter\@firstofone\else\expandafter\@gobble\fi
%<package>^^Q  \begingroup\MT@exp@two@c\endgroup\ifx\csname #1\endcsname\relax
%<package>^^Q    \expandafter\@gobble\else\expandafter\@firstofone\fi
}
\def\MT@ifdefined@n@TF#1{%
^^X  \ifcsname#1\endcsname\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi
%<package>^^Q  \begingroup\MT@exp@two@c\endgroup\ifx\csname #1\endcsname\relax
%<package>^^Q    \expandafter\@secondoftwo\else\expandafter\@firstoftwo\fi
}
%<*package>
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\begin{macro}{\MT@detokenize@n}
%\changes{v1.9d}{2006/03/08}{new macro: use \cmd\detokenize\ if available}
%\begin{macro}{\MT@detokenize@c}
%\changes{v1.9}{2005/08/17}{fix the \nonetex\ version}
%\changes{v2.3c}{2008/08/23}{fix: remove last space only
%                            (reported by \contributor Ulrich Dirr <ud\at mucschach.de>)}
%                                                         ^^A private mail, 2008/08/22
%\begin{macro}{\MT@rem@last@space}
% Translate a macro into a token list. With \etex, we can use \cmd\detokenize.
% We also need to remove the last trailing space; and only the last one --
% therefore the fiddling (and the \cmd\string\ isn't perfect, of course).
%    \begin{macrocode}
\def\MT@detokenize@n#1{%
^^X  \expandafter\MT@rem@last@space\detokenize{#1} \@nil
^^Q  \string#1%
}
\def\MT@detokenize@c#1{%
^^X  \MT@exp@one@n\MT@detokenize@n#1%
^^Q  \MT@exp@two@c\MT@rem@last@space\strip@prefix\meaning#1 \@nil
}
\def\MT@rem@last@space#1 #2{#1%
  \ifx\@nil#2\else \space
  \expandafter\MT@rem@last@space\expandafter#2\fi
}
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\end{macro}
%\begin{macro}{\MT@ifempty}
% Test whether argument is empty.
%\changes{v1.1}{2004/09/15}{fix: use category code 12 for the percent character
%               (reported by \contributor Tom Kink <kink\at hia.rwth-aachen.de>)}
%                                      ^^A MID: <2qrkp9F134l6lU1@uni-berlin.de>
%    \begin{macrocode}
%</package>
\begingroup
\catcode`\%=12
\catcode`\&=14
\gdef\MT@ifempty#1{&
  \if %#1%&
    \expandafter\@firstoftwo
  \else
    \expandafter\@secondoftwo
  \fi
}
\endgroup
%<*package>
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@ifint}
% Test whether argument is an integer, using an old trick by Mr. Arseneau,
%\changes{v1.9a}{2005/11/03}{use \cmd\pdfmatch\ if available}
% or the latest and greatest from \pdftex\
%\changes{v2.2}{2007/05/10}{employ \luatex\ features if available}
% or \luatex\ (which also allows negative numbers, as required by the
% \opt{letterspace} option).
%    \begin{macrocode}
%</package>
%</package|letterspace>
%<pdftex-def>\MT@requires@pdftex6{
%<letterspace>\MT@pdf@or@lua{
%<*pdftex-def|letterspace>
\def\MT@ifint#1{%
  \ifcase\pdfmatch{^-*[0-9]+ *$}{#1}\relax
    \expandafter\@secondoftwo
  \else
    \expandafter\@firstoftwo
  \fi
}
}{
%</pdftex-def|letterspace>
%<*pdftex-def|xetex-def|letterspace>
\def\MT@ifint#1{%
  \if!\ifnum9<1#1!\else?\fi
    \expandafter\@firstoftwo
  \else
    \expandafter\@secondoftwo
  \fi
}
%</pdftex-def|xetex-def|letterspace>
%<pdftex-def|letterspace>}
%<luatex-def>\def\MT@ifint#1{\csname\MT@lua{microtype.if_int([[#1]])}\endcsname}
%<*luafile>
local function if_int(s)
  if find(s,"^-*[0-9]+ *$") then
    tex_write("@firstoftwo")
  else
    tex_write("@secondoftwo")
  end
end
microtype.if_int = if_int

%</luafile>
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@ifdimen}
% Test whether argument is dimension (or number).
%\changes{v1.4b}{2004/11/22}{don't set \cs{MT@count} globally (save stack problem)}
%\changes{v1.7}{2005/03/15}{comparison with 1 to allow size smaller than 1
%               (suggested by \contributor Andreas B\"uhmann <andreas.buehmann\at web.de>)}
%                                                            ^^A private mail, 2005/03/15
%\changes{v1.9b}{2006/01/05}{use \cmd\pdfmatch\ if available}
% (|nd| and |nc| are new Didot resp. Cicero, added in \pdftex\ 1.30; |px| is a pixel.)
%\changes{v2.2}{2007/05/10}{employ \luatex\ features if available}
%\todo{fix \texttt{lua} expression}
%    \begin{macrocode}
%<*pdftex-def>
\MT@requires@pdftex6{
\def\MT@ifdimen#1{%
  \ifcase\pdfmatch{^([0-9]+([.,][0-9]+)?|[.,][0-9]+)%
                    (em|ex|cm|mm|in|pc|pt|dd|cc|bp|sp|nd|nc|px)? *$}{#1}\relax
    \expandafter\@secondoftwo
  \else
    \expandafter\@firstoftwo
  \fi
}
}{
%</pdftex-def>
%<*pdftex-def|xetex-def>
\def\MT@ifdimen#1{%
  \setbox\z@=\hbox{%
    \MT@count=1#1\relax
    \ifnum\MT@count=\@ne
      \aftergroup\@secondoftwo
    \else
      \aftergroup\@firstoftwo
    \fi
  }%
}
%</pdftex-def|xetex-def>
%<pdftex-def>}
%<luatex-def>\def\MT@ifdimen#1{\csname\MT@lua{microtype.if_dimen([[#1]])}\endcsname}
%<*luafile>
local function if_dimen(s)
  if (find(s, "^-*[0-9]+(%a*) *$") or
      find(s, "^-*[0-9]*[.,][0-9]+(%a*) *$")) then
    tex_write("@firstoftwo")
  else
    tex_write("@secondoftwo")
  end
end
microtype.if_dimen = if_dimen

%</luafile>
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@ifdim}
% Compare floating point numbers.
%    \begin{macrocode}
%<*package>
\def\MT@ifdim#1#2#3{%
  \ifdim #1\p@ #2 #3\p@
    \expandafter\@firstoftwo
  \else
    \expandafter\@secondoftwo
  \fi
}
%</package>
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@ifstreq}
% Test whether two strings (fully expanded) are equal.
%\changes{v1.9a}{2005/11/03}{use \cmd\pdfstrcmp\ if available}
%\changes{v2.2}{2007/03/07}{fix: \nonetex\ version shouldn't use \cmd\x\ and \cmd\y\
%                           (found by \contributor Wiebke Petersen <petersew\at uni-duesseldorf.de>)}
%                                               ^^A MID: <esmd6k$954$1@news1.rz.uni-duesseldorf.de>
%\changes{v2.2}{2007/05/10}{employ \luatex\ features if available}
%\changes{v2.8}{2020/06/18}{use \xetex's \cmd\stringcmp}
%    \begin{macrocode}
%<*pdftex-def|xetex-def>
%<pdftex-def>\MT@requires@pdftex5{
\def\MT@ifstreq#1#2{%
%<pdftex-def>  \ifnum\pdfstrcmp{#1}{#2}=\z@
%<xetex-def>  \ifnum\strcmp{#1}{#2}=\z@
    \expandafter\@firstoftwo
  \else
    \expandafter\@secondoftwo
  \fi
}
%</pdftex-def|xetex-def>
%<*pdftex-def>
}{
\def\MT@ifstreq#1#2{%
  \edef\MT@res@a{#1}%
  \edef\MT@res@b{#2}%
  \ifx\MT@res@a\MT@res@b
    \expandafter\@firstoftwo
  \else
    \expandafter\@secondoftwo
  \fi
}
}
%</pdftex-def>
%<luatex-def>\def\MT@ifstreq#1#2{\csname\MT@lua{microtype.if_str_eq([[#1]],[[#2]])}\endcsname}
%<*luafile>
local function if_str_eq(s1, s2)
  if s1 == s2 then
    tex_write("@firstoftwo")
  else
    tex_write("@secondoftwo")
  end
end
microtype.if_str_eq = if_str_eq

%</luafile>
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@xadd}
%\changes{v1.8}{2005/04/17}{simplified}
% Add item to a list.
%    \begin{macrocode}
%<*package>
\def\MT@xadd#1#2{%
  \ifx#1\relax
    \xdef#1{#2}%
  \else
    \xdef#1{#1#2}%
  \fi
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@xaddb}
% Add item to the beginning.
%    \begin{macrocode}
\def\MT@xaddb#1#2{%
  \ifx#1\relax
    \xdef#1{#2}%
  \else
    \xdef#1{#2#1}%
  \fi
}
%</package>
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@map@clist@n}
%\changes{v1.8}{2005/04/17}{new macro: used instead of \cmd\@for}
%\changes{v1.9a}{2005/11/03}{following \LaTeX3}
%\begin{macro}{\MT@map@clist@c}
%\begin{macro}{\MT@map@clist@}
%\begin{macro}{\MT@clist@function}
%\begin{macro}{\MT@clist@break}
% Run \meta{\#2} on all elements of the comma list \meta{\#1}. This and the
% following is modelled after \LaTeX3 commands.
%    \begin{macrocode}
%<*package|letterspace>
\def\MT@map@clist@n#1#2{%
  \ifx\@empty#1\else
    \def\MT@clist@function##1{#2}%
    \MT@map@clist@#1,\@nil,\@nnil
  \fi
}
%    \end{macrocode}
%\todo{think \cs{@nil} should be defined as itself}
%    \begin{macrocode}
\def\MT@map@clist@c#1{\MT@exp@one@n\MT@map@clist@n#1}
\def\MT@map@clist@#1,{%
  \ifx\@nil#1%
    \expandafter\MT@clist@break
  \fi
  \MT@clist@function{#1}%
  \MT@map@clist@
}
\let\MT@clist@function\@gobble
\def\MT@clist@break#1\@nnil{}
%<*package>
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\begin{macro}{\MT@map@tlist@n}
%\changes{v1.8}{2005/04/16}{new macro: used instead of \cmd\@tfor}
%\begin{macro}{\MT@map@tlist@c}
%\begin{macro}{\MT@map@tlist@}
%\begin{macro}{\MT@tlist@break}
% Execute \meta{\#2} on all elements of the token list \meta{\#1}.
% \cs{MT@tlist@break} can be used to jump out of the loop.
%    \begin{macrocode}
\def\MT@map@tlist@n#1#2{\MT@map@tlist@#2#1\@nnil}
\def\MT@map@tlist@c#1#2{\expandafter\MT@map@tlist@\expandafter#2#1\@nnil}
\def\MT@map@tlist@#1#2{%
  \ifx\@nnil#2\else
    #1{#2}%
    \expandafter\MT@map@tlist@
    \expandafter#1%
  \fi
}
\def\MT@tlist@break#1\@nnil{\fi}
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\begin{macro}{\ifMT@inlist@}
%\begin{macro}{\MT@in@clist}
% Test whether item \meta{\#1} is in comma list \meta{\#2}.
%^^A\changes{v1.4b}{2004/11/22}{fix: compare with \cmd\\ instead of \cmd\relax\
%^^A                (discovered by \contributor Herb Schulz <herbs\at wideopenwest.com>)}
%^^A                                    ^^A MID: <BDBFA967.C01F%herbs@wideopenwest.com>
% Using \cmd\pdfmatch\ would be slower.
%\changes{v1.9a}{2005/11/03}{fix}
%\changes{v2.3}{2007/11/14}{don't use \cmd\x\
%                           (reported by \contributor Peter Meier <Peter.Meier998\at gmx.de>)}
%                                                                ^^A private mail, 2007/11/12
%    \begin{macrocode}
\newif\ifMT@inlist@
\def\MT@in@clist#1#2{%
  \def\MT@res@a##1,#1,##2##3\@nnil{%
    \ifx##2\@empty
      \MT@inlist@false
    \else
      \MT@inlist@true
    \fi
  }%
  \expandafter\MT@res@a\expandafter,#2,#1,\@empty\@nnil
}
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\begin{macro}{\MT@rem@from@clist}
% Remove item \meta{\#1} from comma list \meta{\#2}. This is basically
% \cmd\@removeelement\ from \file{ltcntrl.dtx}.
%\changes{v1.9}{2005/10/28}{new macro: remove an item from a comma list}
%\changes{v1.9a}{2005/11/03}{fix}
%\changes{v1.9e}{2006/07/26}{model after \cmd\@removeelement}
% Using \cmd\pdfmatch\ and \cmd\pdflastmatch\ here would be really slow!
%    \begin{macrocode}
\def\MT@rem@from@clist#1#2{%
  \def\MT@res@a##1,#1,##2\MT@res@a{##1,##2\MT@res@b}%
  \def\MT@res@b##1,\MT@res@b##2\MT@res@b{\ifx,##1\@empty\else##1\fi}%
  \xdef#2{\MT@exp@two@c\MT@res@b\MT@res@a\expandafter,#2,\MT@res@b,#1,\MT@res@a}%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@in@tlist}
%\begin{macro}{\MT@in@tlist@}
% Test whether item is in token list. Since this isn't too elegant, I thought
% that at least here, \cmd\pdfmatch\ would be more efficient -- however, it
% turned out to be even slower than this solution.
%    \begin{macrocode}
\def\MT@in@tlist#1#2{%
  \MT@inlist@false
  \def\MT@res@a{#1}%
  \MT@map@tlist@c#2\MT@in@tlist@
}
\def\MT@in@tlist@#1{%
  \edef\MT@res@b{#1}%
  \ifx\MT@res@a\MT@res@b
    \MT@inlist@true
    \expandafter\MT@tlist@break
  \fi
}
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\begin{macro}{\MT@in@rlist}
%\changes{v1.8}{2005/04/20}{made recursive}
%\begin{macro}{\MT@in@rlist@}
%\begin{macro}{\MT@in@rlist@@}
%\begin{macro}{\MT@size@name}
% Test whether size \cs{MT@size} is in a list of ranges. Store the name of the
% list in \cs{MT@size@name}
%    \begin{macrocode}
\def\MT@in@rlist#1{%
  \MT@inlist@false
  \MT@map@tlist@c#1\MT@in@rlist@
}
\def\MT@in@rlist@#1{\expandafter\MT@in@rlist@@#1}
\def\MT@in@rlist@@#1#2#3{%
  \MT@ifdim{#2}=\m@ne{%
    \MT@ifdim{#1}=\MT@size
      \MT@inlist@true
      \relax
  }{%
    \MT@ifdim\MT@size<{#1}\relax{%
      \MT@ifdim\MT@size<{#2}%
        \MT@inlist@true
        \relax
    }%
  }%
  \ifMT@inlist@
    \def\MT@size@name{#3}%
    \expandafter\MT@tlist@break
  \fi
}
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\begin{macro}{\MT@loop}
%\changes{v1.2}{2004/09/23}{fix: new macro, used instead of \cmd\loop}
%\begin{macro}{\MT@iterate}
%\begin{macro}{\MT@repeat}
% This is the same as \LaTeX's \cmd\loop, which we mustn't use, since this
% could confuse an outer \cmd\loop\ in the document.
%    \begin{macrocode}
%</package>
\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}
%\end{macro}
%\begin{macro}{\MT@while@num}
% Execute \meta{\#3} from \meta{\#1} up to (excluding) \meta{\#2} (much faster
% than \LaTeX's \cmd\@whilenum).
%    \begin{macrocode}
\def\MT@while@num#1#2#3{%
  \@tempcnta#1\relax
  \MT@loop #3%
    \advance\@tempcnta \@ne
    \ifnum\@tempcnta < #2\MT@repeat
}
%</package|letterspace>
%    \end{macrocode}
%\end{macro}
%\changes{v2.6a}{2016/05/03}{fixes for \letterspace\ package with \luatex}
%\begin{macro}{\MT@if@luaotf@font}
%\changes{v2.8}{2019/11/27}{use \texttt{lua} function}
% For fonts loaded by \pkg{luaotfload} we query the font's table.
%    \begin{macrocode}
%<letterspace>\MT@pdf@or@lua{\let\MT@if@luaotf@font\@secondoftwo}{
%<luatex-def|letterspace>\def\MT@if@luaotf@font{\csname\MT@lua{%
%<luatex-def>  microtype.if_luaotf_font()
%<*luafile|letterspace>
%<luafile>local function if_luaotf_font()
  local thefont = font.getfont(font.current())
  if thefont and ( thefont.format == "opentype" or thefont.format == "truetype" )
    then tex.write("@firstoftwo")
    else tex.write("@secondoftwo")
  end
%<luafile>end
%<luafile>microtype.if_luaotf_font = if_luaotf_font
%<luafile>
%</luafile|letterspace>
%<luatex-def|letterspace> }\endcsname
%<luatex-def|letterspace>}
%<letterspace>}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@do@font}
% Execute \meta{\#1} 256 times,
%    \begin{macrocode}
%<pdftex-def|letterspace>\def\MT@do@font{\MT@while@num\z@\@cclvi}
%    \end{macrocode}
% resp. for the whole font for \luatex, if it's a Unicode font.
%\changes{v2.5}{2010/08/14}{adapt for \luatex}
%\changes{v2.6}{2013/07/14}{speed up for \luatex}
%\changes{v2.6a}{2015/05/10}{fix \texttt{lua} function
%                            (reported by \contributor Herbert Vo\ss{} <Herbert.Voss\at FU-Berlin.DE>)}
%                             ^^A private mail, 2016/05/10
%\changes{v2.8}{2020/06/20}{simplify \texttt{lua} function}
%    \begin{macrocode}
%<*luatex-def>
\def\MT@do@font#1{%
  \MT@if@luaotf@font{%
    \def\MT@dofont@function{#1}%
    \MT@lua{microtype.do_font()}%
  }{\MT@while@num\z@\@cclvi{#1}}%
}
%</luatex-def>
%    \end{macrocode}
% This is the |lua| function, which is much faster than looping through all glyphs
% in \TeX. Legacy fonts (which this function should never work on) don't contain a |v.index| field.
%    \begin{macrocode}
%<*luafile>
local function do_font()
  local thefont = font.getfont(font.current())
  if thefont then
    for i,v in next,thefont.characters do
      if v.index == nil or v.index > 0 then
        microtype.sprint([[\@tempcnta=]]..i..[[\relax\MT@dofont@function]])
      end
    end
  end
end
microtype.do_font = do_font

%</luafile>
%    \end{macrocode}
% The \xetex\ variant (it's slow~\dots!).
%\changes{v2.5}{2010/05/18}{adapt for \xetex}
%\changes{v2.8}{2020/02/06}{fix for \xetex}
%    \begin{macrocode}
%<*xetex-def>
\def\MT@do@font#1{%
  \@tempcnta=\z@
  \MT@loop
    \iffontchar\MT@font\@tempcnta #1\fi
    \advance\@tempcnta\@ne
    \ifnum\@tempcnta < \XeTeXlastfontchar\MT@font \MT@repeat
}
%</xetex-def>
%<*package>
%    \end{macrocode}
%\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.
%\changes{v1.7}{2005/03/07}{use \etex's \cmd\numexpr\ if available}
% The \etex\ way is slightly faster.
%    \begin{macrocode}
\newcount\MT@count
\def\MT@increment#1{%
^^X  \edef#1{\number\numexpr #1 + 1\relax}%
^^Q  \MT@count=#1\relax
^^Q  \advance\MT@count \@ne
^^Q  \edef#1{\number\MT@count}%
}
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\begin{macro}{\MT@scale}
%\changes{v1.7}{2005/02/12}{new macro: use \etex's \cs{numexpr} if available}
%\changes{v1.8}{2005/03/30}{fix: remove spaces in \nonetex\ variant
%               (reported by \contributor Mark Rossi <mark.rossi\at de.bosch.com>)}
%                               ^^A MID: <d6uhag$qoi$1@ns2.fe.internet.bosch.com>
% Multiply and divide a counter. If we are using \etex, we will use its
% \cmd\numexpr\ primitive. This has the advantage that it is less likely to
% run into arithmetic overflow. The result of the division will be rounded
% instead of truncated. Therefore, we'll get a different (more accurate)
% result in about half of the cases.
%    \begin{macrocode}
\def\MT@scale#1#2#3{%
^^Q  \multiply #1 #2\relax
  \ifnum #3 = \z@
^^X    #1=\numexpr #1 * #2\relax
  \else
^^X    #1=\numexpr #1 * #2 / #3\relax
^^Q    \divide #1 #3\relax
  \fi
}
%    \end{macrocode}
%\end{macro}
%\changes{v1.7}{2005/03/07}{shorter command names}
%\begin{macro}{\MT@abbr@pr}
%\begin{macro}{\MT@abbr@ex}
%\begin{macro}{\MT@abbr@pr@c}
%\begin{macro}{\MT@abbr@ex@c}
%\begin{macro}{\MT@abbr@pr@inh}
%\begin{macro}{\MT@abbr@ex@inh}
%\begin{macro}{\MT@abbr@nl}
%\begin{macro}{\MT@abbr@sp}
%\begin{macro}{\MT@abbr@sp@c}
%\begin{macro}{\MT@abbr@sp@inh}
%\begin{macro}{\MT@abbr@kn}
%\begin{macro}{\MT@abbr@kn@c}
%\begin{macro}{\MT@abbr@kn@inh}
%\begin{macro}{\MT@abbr@tr}
%\begin{macro}{\MT@abbr@tr@c}
% Some abbreviations. Thus, we can have short command names but full-length
% log output.
%    \begin{macrocode}
\def\MT@abbr@pr{protrusion}
\def\MT@abbr@ex{expansion}
\def\MT@abbr@pr@c{protrusion codes}
\def\MT@abbr@ex@c{expansion codes}
\def\MT@abbr@pr@inh{protrusion inheritance}
\def\MT@abbr@ex@inh{expansion inheritance}
\def\MT@abbr@nl{noligatures}
\def\MT@abbr@sp{spacing}
\def\MT@abbr@sp@c{interword spacing codes}
\def\MT@abbr@sp@inh{interword spacing inheritance}
\def\MT@abbr@kn{kerning}
\def\MT@abbr@kn@c{kerning codes}
\def\MT@abbr@kn@inh{kerning inheritance}
\def\MT@abbr@tr{tracking}
\def\MT@abbr@tr@c{tracking amount}
%    \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}
%\end{macro}
%\end{macro}
%\end{macro}
%\begin{macro}{\MT@rbba@protrusion}
%\begin{macro}{\MT@rbba@expansion}
%\begin{macro}{\MT@rbba@spacing}
%\begin{macro}{\MT@rbba@kerning}
%\begin{macro}{\MT@rbba@tracking}
% These we also need the other way round.
%    \begin{macrocode}
\def\MT@rbba@protrusion{pr}
\def\MT@rbba@expansion{ex}
\def\MT@rbba@spacing{sp}
\def\MT@rbba@kerning{kn}
\def\MT@rbba@tracking{tr}
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\begin{macro}{\MT@features}
%\changes{v1.9b}{2006/01/17}{use throughout the package to adjust to beta-ness}
%\begin{macro}{\MT@features@long}
% We can work on these lists to save some guards in the \file{dtx} file.
%    \begin{macrocode}
\def\MT@features{pr,ex,sp,kn,tr}
\def\MT@features@long{protrusion,expansion,spacing,kerning,tracking}
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\begin{macro}{\MT@is@feature}
%\changes{v1.9a}{2005/11/03}{new macro: check for \pdftex\ feature}
% Whenever an optional argument accepts a list of features, we can use this
% command to check whether a feature exists in order to prevent a rather
% confusing `|Missing \endcsname inserted|' error message. The feature (long
% form) must be in \meta{\#1}, the type of list to ignore in \meta{\#2},
% then comes the action.
%    \begin{macrocode}
\def\MT@is@feature#1#2{%
  \MT@in@clist{#1}\MT@features@long
  \ifMT@inlist@
    \expandafter\@firstofone
  \else
    \MT@error{`#1' is not an available micro-typographic\MessageBreak
      feature. Ignoring #2}{Available features are: `\MT@features@long'.}%
    \expandafter\@gobble
  \fi
}
%    \end{macrocode}
%\end{macro}
%
%\subsubsection{Compatibility}\label{sub:compatibility}
%
% For the record, the following \LaTeX\ kernel commands will be modified by
% \microtype:
%\begin{itemize}
%  \item \cmd\pickup@font
%  \item \cmd\do@subst@correction
%  \item \cmd\add@accent\ (all in section~\ref{sssec:impl.hook})
%  \item \cmd\showhyphens\ (in section~\ref{sssec:impl.options})
%\end{itemize}
%
% The \pkg{wordcount} package redefines the font-switching commands, which will
% break \microtype. Since \microtype\ doesn't have an effect on the number of
% words in the document anyway, we will simply disable ourselves.
%\changes{v2.2}{2007/02/11}{disable \microtype\ if \pkg{wordcount} is loaded
%                           (reported by \contributor Ross Hetherington <ross\at heth.eclipse.co.uk>)}
%                                         ^^A MID: <A9-dnaHX5LxN01LYnZ2dnUVZ8tqqnZ2d@eclipse.net.uk>
%    \begin{macrocode}
\@ifl@aded{tex}{wordcount}{%
  \MT@warning@nl{Detected the `wordcount' utility.\MessageBreak
    Disabling `\MT@MT', since it wouldn't work}%
  \MT@clear@options\endinput}\relax
%    \end{macrocode}
% The \pkg{minimal} class doesn't define any size commands other than
% \cmd\normalsize, which will result in lots of warnings. Therefore we
% issue a warning about the warnings.
%\changes{v2.7}{2016/05/18}{warning with \pkg{minimal} class}
%    \begin{macrocode}
\@ifclassloaded{minimal}{%
  \MT@warning@nl{Detected the `minimal' class.\MessageBreak
    Expect lots of warnings and some malfunctions.\MessageBreak
    You might want to use a proper class instead}%
}\relax
%    \end{macrocode}
%\begin{macro}{\MT@setup@}
%\changes{v1.9a}{2005/11/21}{defer setup until the end of the preamble}
%\changes{v1.9e}{2006/07/06}{empty \cs{MT@setup@} after use
%                            (compatibility with the \pkg{combine} class)}
%\changes{v2.3e}{2009/08/31}{make space-unaware
%                            (requested by \contributor Marcin Borkowski <mbork\at atos.wmid.amu.edu.pl>)}
%                               ^^A private mail, 2009/08/31
% The setup is deferred until the end of the preamble. This has a couple of
% advantages: \cs{microtypesetup} can be used to change options later on in the
% preamble, and fonts don't have to be set up before \microtype.
%    \begin{macrocode}
%</package>
%<*package|letterspace>
%<plain>\MT@requires@latex1{
\let\MT@setup@\@empty
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@addto@setup}
% We use our private hook to have better control over the timing.
% This will also work with \pkg{eplain}, but not with \pkg{miniltx} alone.
%    \begin{macrocode}
\def\MT@addto@setup{\g@addto@macro\MT@setup@}
%    \end{macrocode}
%\end{macro}
% Don't hesitate with \pkg{miniltx}.
%    \begin{macrocode}
%<plain>}{\let\MT@addto@setup\@firstofone}
%    \end{macrocode}
%\begin{macro}{\MT@with@package@T}
% We almost never do anything if a package is not loaded.
%    \begin{macrocode}
\def\MT@with@package@T#1{\@ifpackageloaded{#1}\@firstofone\@gobble}
%</package|letterspace>
%<*package>
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@with@babel@and@T}
%\changes{v2.2}{2007/05/25}{also inspect class options}
% \LaTeX's \cmd\@ifpackagewith\ ignores the class options.
%    \begin{macrocode}
\def\MT@with@babel@and@T#1{%
  \MT@ifdefined@n@T{opt@babel.\@pkgextension}{%
    \@expandtwoargs\MT@in@clist{#1}
      {\csname opt@babel.\@pkgextension\endcsname,\@classoptionslist}%
    \ifMT@inlist@\expandafter\@gobble\fi
  }\@gobble
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@ledmac@setup}
% The \pkg{ledmac} package first saves each paragraph in a box, from which it
% then splits off the lines one by one. This will destroy character protrusion.
% (There aren't any problems with the \pkg{lineno} package, since it takes a
% different approach.)
%\iffalse
% We issue a warning, so that nobody can say they didn't know.
%\changes{v1.6}{2004/12/29}{warning when using the \pkg{ledmac} package}
% --- This is fixed in \pdftex\ 1.21a, so we no longer warn.
%\changes{v1.6a}{2005/02/02}{no warning when using the \pkg{ledmac} package}
% --- Actually, it was completely broken in 1.21a, but 1.21b provides a work-around.
%\fi
% ---~\dots~---
%\changes{v1.8}{2005/04/15}{character protrusion with \pkg{ledmac}}
% After much to and fro, the situation has finally settled and there is a fix.
% Beginning with \pdftex\ version 1.21b together with \file{ledpatch.sty} as of
% 2005/06/02 (v0.4), character protrusion will work at last.
%
% \contributor Peter Wilson <herries.press\at earthlink.net> was so kind to provide the \cmd\l@dunhbox@line\ hook in
% \pkg{ledmac} to allow for protrusion. \cmd\leftmarginkern\ and
% \cmd\rightmarginkern\ are new primitives of \pdftex\ 1.21b (aka. 1.30.0).
%\changes{v2.5}{2012/07/02}{fix to work with \xetex\
%                           (reported by \contributor Ma\"ieul Rouquette <maieul\at maieul.net>)}
%                           ^^A private mail, 2012/06/30
% They are also part of recent \xetex.
%\changes{v2.5a}{2013/03/25}{support for \pkg{eledmac}}
%\changes{v2.6}{2015/08/10}{support for \pkg{reledmac}}
% The successor packages \pkg{eledmac} and \pkg{reledmac} are also supported.
%    \begin{macrocode}
%</package>
%<pdftex-def>\MT@requires@pdftex5{
%<*pdftex-def|luatex-def|xetex-def>
  \def\MT@ledmac@setup{%
    \ifMT@protrusion
      \MT@ifdefined@c@TF\l@dunhbox@line{%
%    \end{macrocode}
%\begin{macro}{\MT@led@unhbox@line}
% Hook.
%\changes{v2.5a}{2013/03/27}{simplified}
%    \begin{macrocode}
        \MT@info@nl{Patching ((r)e)ledmac to enable character protrusion}%
        \let\MT@led@unhbox@line\l@dunhbox@line
        \renewcommand*{\l@dunhbox@line}[1]{%
          \ifhbox##1%
            \kern\leftmarginkern##1%
            \expandafter\MT@led@unhbox@line\expandafter##1\expandafter
            \kern\rightmarginkern##1%
          \fi
        }%
%    \end{macrocode}
%\end{macro}
%    \begin{macrocode}
      }{%
        \MT@warning@nl{%
          Character protrusion in paragraphs with line\MessageBreak
          numbering will only work if you update ledmac,\MessageBreak
          or use one of its successors, eledmac or reledmac}%
      }%
    \fi
  }
%</pdftex-def|luatex-def|xetex-def>
%<*pdftex-def>
}{
  \def\MT@ledmac@setup{%
    \ifMT@protrusion
      \MT@warning@nl{%
        The pdftex version you are using does not allow\MessageBreak
        character protrusion in paragraphs with line\MessageBreak
        numbering by the `((r)e)ledmac' package.\MessageBreak
        Upgrade pdftex to version 1.30 or later}%
    \fi
  }
}
%</pdftex-def>
%    \end{macrocode}
%\end{macro}
% The \pkg{shapepar} package (v2.2) fixes this in a similar manner by itself,
% so we don't have to bother.
% ^^A missing protrusion with \pkg{shapepar} (reported by \contributor Giuseppe Palma <pippi.palma\at gmail.com>)}
% ^^A                                     ^^A private mail, 2013/03/22
% ^^A fixed in shapepar v2.2 (Mar 2013)
%\begin{macro}{\MT@restore@p@h}
% Restore meaning of \cmd\% and \cmd\#.
%    \begin{macrocode}
%<*package|letterspace>
%<*package>
\def\MT@restore@p@h{\chardef\%`\% \chardef\#`\# }
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\ifMT@xunicode}
%\begin{macro}{\ifMT@fontspec}
% Two new conditionals for use with \xetex\ or \luatex.
%    \begin{macrocode}
\newif\ifMT@xunicode
\MT@with@package@T{xunicode}\MT@xunicodetrue
\newif\ifMT@fontspec
\MT@with@package@T{fontspec}\MT@fontspectrue
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\begin{macro}{\MT@maybe@gobble@with@tikz}
%\begin{macro}{\MT@tikz@setup}
%\changes{v2.3e}{2009/11/02}{compatibility with \pkg{tikz} (first reported by
%                           \contributor Christian Stark <cstark\at gmx.de>)}       ^^A MID: <7d81lgF2ad3ckU1@mid.dfncis.de>, 2009/07/28
%^^A                  Also: \contributor Karl Karlsson <karl-karlsson\at yandex.ru> ^^A private mail, 2009/10/29
%^^A                        \contributor hscm <henkmetselaar\at gmail.com>          ^^A MID: <6a24e972-b1a7-4172-a5a0-d2707e016301@12g2000pri.googlegroups.com>, 2009/11/02
%\changes{v2.7}{2016/06/08}{compatibility with \pkg{tikz} (again)}
% If \cmd\tikz@expandcount\ is greater than zero, we're inside or at the end of
% a \pkg{tikz} node, where we don't want to adjust spacing after letterspacing,
% lest we disturb \pkg{tikz}. This is used in \cs{MT@afteraftergroup}, and we
% don't need it for \letterspace.
%    \begin{macrocode}
\let\MT@maybe@gobble@with@tikz\@firstofone
\def\MT@tikz@setup{%
  \def\MT@maybe@gobble@with@tikz{%
    \ifnum\tikz@expandcount>\z@
      \expandafter\@gobble
    \else
      \expandafter\@firstofone
    \fi}}
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\begin{macro}{\MT@setupfont@hook}
% This hook will be executed every time a font is set up (inside a group).
%
% In the preamble, we check for the packages each time a font is set up.
% Thus, it will work regardless when the packages are loaded.
%
% Even for packages that don't activate any characters in the preamble (like
% \pkg{babel} and \pkg{csquotes}), we have to check here, too, in case they were
% loaded before \microtype, and a font is loaded \cmd\AtBeginDocument, before
% \microtype.
% (This is no longer needed, since the complete setup is now deferred until the
% end of the preamble. However, it is still necessary for \opt{defersetup}|=false|.)
%    \begin{macrocode}
\def\MT@setupfont@hook{%
%    \end{macrocode}
%\iffalse
%\changes{v1.7}{2005/02/06}{compatibility with the \pkg{chemsym} package}
% The \pkg{chemsym} package redefines, among other commands, the Hungarian
% umlaut \cmd\H\ in a way that cannot be parsed by \microtype. As a work-around,
% we restore the usual definition of \cmd\H\ before setting up the font (which
% will be done inside a group).
%\changes{v1.8}{2005/03/24}{remove superfluous \pkg{chemsym} hook}
% --- Since version 1.7, this is no longer needed, since our character parsing
% is robust enough now.
%
%\changes{v1.7}{2005/03/10}{compatibility with the \pkg{statex} package}
% Same for \pkg{statex}.
%\changes{v1.8}{2005/03/24}{remove superfluous \pkg{statex} hook}
% --- No longer needed, either.
%\fi
%\changes{v1.8}{2005/03/30}{restore percent character if Spanish \pkg{babel} is loaded}
%\changes{v2.2}{2007/02/02}{restore percent character if Galician \pkg{babel} is loaded}
%\changes{v2.3a}{2008/01/29}{restore percent character if Mexican \pkg{babel} is loaded}
% Spanish (as well as Galician and Mexican) \pkg{babel} modify \cmd\%, storing
% the original meaning in \cmd\percentsign.
%    \begin{macrocode}
  \MT@if@false
  \MT@with@babel@and@T{spanish} \MT@if@true
  \MT@with@babel@and@T{galician}\MT@if@true
  \MT@with@babel@and@T{mexican} \MT@if@true
  \ifMT@if@\MT@ifdefined@c@T\percentsign{\let\%\percentsign}\fi
%    \end{macrocode}
%\changes{v1.8}{2005/04/22}{restore \pkg{csquotes}'s active characters}
% Using \cmd\@disablequotes, we can restore the original meaning of all
% characters made active by \pkg{csquotes}.
% (It would be doable for older versions, too, but we won't bother.)
%    \begin{macrocode}
  \MT@with@package@T{csquotes}{%
    \@ifpackagelater{csquotes}{2005/05/11}\@disablequotes\relax}%
%    \end{macrocode}
% \pkg{hyperref} redefines \cmd\% and \cmd\# inside a \cmd\url. We restore
% the original meanings (which we can only hope are correct).
%\changes{v1.8}{2005/05/20}{restore \cmd\% and \cmd\# when \pkg{hyperref} is loaded}
% Same for \pkg{tex4ht}
%\changes{v1.9d}{2006/02/27}{restore \cmd\% and \cmd\# when \pkg{tex4ht} is loaded
%                            (reported by \contributor Peter Dyballa <Peter_Dyballa\at Web.DE>)}
%                                                                  ^^A private mail, 2006/02/26
% and \pkg{mathastext}.
%\changes{v2.5}{2011/07/29}{restore \cmd\% and \cmd\# when \pkg{mathastext} is loaded
%                           (found by \contributor Seamus Bradley <@\at @>)}
%                           ^^A https://tex.stackexchange.com/questions/24248
%                           ^^A (beta:07)
%    \begin{macrocode}
  \MT@if@false
  \MT@with@package@T{hyperref}  \MT@if@true
  \MT@with@package@T{tex4ht}    \MT@if@true
  \MT@with@package@T{mathastext}\MT@if@true
  \ifMT@if@\MT@restore@p@h\fi
  \MT@with@package@T{tikz}\MT@tikz@setup
}
%    \end{macrocode}
%\end{macro}
% Check again at the end of the preamble.
%    \begin{macrocode}
%</package>
\MT@addto@setup{%
%<*package>
%    \end{macrocode}
%\changes{v1.4}{2004/11/04}{check for \pkg{pdfcprot}}
% Our competitor, the \pkg{pdfcprot} package, must not be tolerated!
%    \begin{macrocode}
  \MT@with@package@T{pdfcprot}{%
    \MT@error{Detected the `pdfcprot' package!\MessageBreak
              `\MT@MT' and `pdfcprot' may not be used together}{%
The `pdfcprot' package provides an interface to character protrusion.\MessageBreak
So does the `\MT@MT' package. Using both packages at the same\MessageBreak
time will almost certainly lead to undesired results. Have your choice!}%
  }%
  \MT@with@package@T  {ledmac}\MT@ledmac@setup
  \MT@with@package@T {eledmac}\MT@ledmac@setup
  \MT@with@package@T{reledmac}\MT@ledmac@setup
  \MT@with@package@T{xunicode}\MT@xunicodetrue
  \MT@with@package@T{fontspec}\MT@fontspectrue
%    \end{macrocode}
% We can clean up \cs{MT@setupfont@hook} now.
%\changes{v2.6}{2014/03/17}{redefine \cs{MT@setupfont@hook} globally
%                           for problem with \pkg{tikzposter}
%                           (reported by \contributor Sam Mason <sam\at samason.me.uk>)}
%                           ^^A https://tex.stackexchange.com/questions/165846/
%    \begin{macrocode}
  \MT@glet\MT@setupfont@hook\@empty
  \MT@if@false
  \MT@with@babel@and@T{spanish} \MT@if@true
  \MT@with@babel@and@T{galician}\MT@if@true
  \MT@with@babel@and@T{mexican} \MT@if@true
  \ifMT@if@
    \g@addto@macro\MT@setupfont@hook{%
      \MT@ifdefined@c@T\percentsign{\let\%\percentsign}}%
  \fi
  \MT@with@package@T{csquotes}{%
    \@ifpackagelater{csquotes}{2005/05/11}{%
      \g@addto@macro\MT@setupfont@hook\@disablequotes
    }{%
      \MT@warning@nl{%
        Should you receive warnings about unknown slot\MessageBreak
        numbers, try upgrading the `csquotes' package}%
    }%
  }%
%    \end{macrocode}
% We disable \microtype's additions inside \pkg{hyperref}'s \cmd\pdfstringdef,
% which redefines lots of commands.
%\changes{v1.9}{2005/09/10}{disable \microtype\ setup inside \pkg{hyperref}'s \cmd\pdfstringdef\
%               (reported by \contributor H\`an \thanhthe{} Th\`anh <hanthethanh\at gmail.com>)}
%                                                  ^^A private mail, 2005/09/10
%\changes{v2.3}{2007/11/11}{disable \cs{microtypecontext} in \pkg{hyperref}'s \cmd\pdfstringdef}
% \pkg{hyperref} doesn't work with plain \TeX, so in that case we don't bother.
%    \begin{macrocode}
  \MT@if@false
%</package>
%<plain>  \MT@requires@latex2{
  \MT@with@package@T{hyperref}{%
    \pdfstringdefDisableCommands{%
%<*package>
      \MT@ltx@pickupfont
      \let\textmicrotypecontext\@secondoftwo
      \let\microtypecontext\@gobble
%</package>
      \def\lsstyle{\pdfstringdefWarn\lsstyle}%
      \def\textls#1#{\pdfstringdefWarn\textls}%
    }%
%<package>    \MT@if@true
  }%
%<plain>  }\relax
%<*package>
  \MT@with@package@T{tex4ht}\MT@if@true
  \MT@with@package@T{mathastext}\MT@if@true
  \ifMT@if@\g@addto@macro\MT@setupfont@hook\MT@restore@p@h\fi
%    \end{macrocode}
%\changes{v1.9b}{2005/12/19}{compatibility with \pkg{listings}: sanitise more catcodes
%                            (reported by \contributor Holger Uhr <huhr\at uni-paderborn.de>)}
%                                               ^^A MID: <do4gvo$tv$1@news.uni-paderborn.de>
% The \pkg{listings} package makes numbers and letters active,
%    \begin{macrocode}
  \MT@with@package@T{listings}{%
    \g@addto@macro\MT@cfg@catcodes{%
      \MT@while@num{"30}{"3A}{\catcode\@tempcnta=12\relax}%
      \MT@while@num{"41}{"5B}{\catcode\@tempcnta=11\relax}%
      \MT@while@num{"61}{"7B}{\catcode\@tempcnta=11\relax}%
    }%
%    \end{macrocode}
% \dots~and the backslash (which would lead to problems in \cs{MT@get@slot}).
%\changes{v2.0}{2006/09/15}{compatibility with \pkg{listings}: set catcode of backslash to zero
%                           (reported by \contributor Steven Bath <steven128\at iname.com>)}
%                                                     ^^A private mail, 2006/09/15
%    \begin{macrocode}
    \g@addto@macro\MT@setupfont@hook{%
      \catcode`\\=\z@
%    \end{macrocode}
% Inside a listing, \cmd\space\ is redefined.
%\changes{v2.5}{2011/05/03}{restore \cmd\space\ inside \pkg{listings}
%                           (reported by \contributor Rolf Dieterich <rolf.dieterich\at gmx.de>)}
%                           ^^A private mail, 2011/04/30
%                           ^^A (beta:07)
%    \begin{macrocode}
      \def\space{ }%
%    \end{macrocode}
%\changes{v1.9b}{2005/12/23}{compatibility with the \texttt{extendedchar} option of
%                            the \pkg{listings} package}
% When loaded with the |extendedchar| option, \pkg{listings} will also redefine
% 8-bit active characters (\pkg{inputenc}). Luckily, this simple redefinition
% will make them expand to their original definition, so that they could be used
% in the configuration.
%    \begin{macrocode}
      \let\lst@ProcessLetter\@empty
    }%
  }%
%    \end{macrocode}
%\changes{v2.0}{2005/12/21}{compatibility with \pkg{soul}: register \cs{textls} and \cs{lsstyle}} ^^A (beta:3)
% Of course, using both \pkg{soul}'s and \microtype's letterspacing mechanisms
% at the same time doesn't make much sense. But \pkg{soul} can do more, \eg,
% underlining. The optional argument to \cs{textls} may not be used.
%\changes{v2.8}{2020/04/11}{compatibility with \pkg{soul}: patch for font change
%                           (reported by \contributor Md Ayquassar <mdayq0\at lenta.ru>)}
%                           ^^A https://github.com/latex3/babel/issues/53#issuecomment-598307655
% Also, we have to disable expansion within \pkg{soul}'s trial run.
%\changes{v2.3a}{2008/01/06}{fix test for \pkg{soul} under plain \TeX}
% Under plain \TeX, \pkg{soul} doesn't register itself the \LaTeX\ way, so
% we just test for its main command.
%    \begin{macrocode}
%</package>
  \ifx\SOUL@\@undefined\else
    \soulregister\lsstyle 0%
    \soulregister\textls  1%
    \ifx\XeTeXrevision\@undefined
      \let\MT@SOUL@doword\SOUL@doword
      \def\SOUL@doword{\pdfadjustspacing=\z@ \MT@SOUL@doword}%
    \fi
  \fi
%<*package>
  \MT@with@package@T{tikz}\MT@tikz@setup
%    \end{macrocode}
%\changes{v2.1}{2007/01/15}{compatibility with \pkg{pinyin}: disable \microtype\ in \cmd\py@macron\
%                           (reported by \contributor Sven Naumann <svenau\at gmx.net>)}
%                                                 ^^A MID: <87d55hxxdd.fsf@linux.site>
% Compatibility with the \pkg{pinyin} package (from \pkg{CJK}): disable
% \microtype\ in \cmd\py@macron, which loads a different font for the accent.
% In older versions of \pkg{pinyin} (pre-4.6.0),
%\changes{v2.3d}{2009/03/19}{fix \pkg{pinyin} compatibility check
%                            (reported by \contributor Silas~S. Brown <ssb22\at cam.ac.uk>)}
%                                                            ^^A private mail, 2009/03/19
% \cmd\py@macron\ had only one argument.
%    \begin{macrocode}
  \MT@with@package@T{pinyin}{%
    \let\MT@orig@py@macron\py@macron
    \@ifpackagelater{pinyin}{2005/08/11}{% 4.6.0
      \def\py@macron#1#2{%
        \MT@ltx@pickupfont
        \MT@orig@py@macron{#1}{#2}%
        \MT@MT@pickupfont}%
    }{%
      \def\py@macron#1{%
        \MT@ltx@pickupfont
        \MT@orig@py@macron{#1}%
        \MT@MT@pickupfont}%
    }%
  }%
%</package>
}
%</package|letterspace>
%    \end{macrocode}
%\changes{v1.6}{2005/01/19}{load a font if none is selected}
% We need a font (the \pkg{minimal} class doesn't load one).
%    \begin{macrocode}
%<package>\expandafter\ifx\the\font\nullfont\normalfont\fi
%    \end{macrocode}
%
%\subsection{Font setup}\label{ssec:font-setup}
%
%\begin{macro}{\MT@setupfont}
% Setting up a font entails checking for each feature whether it should be
% applied to the current font (\cs{MT@font}).
%    \begin{macrocode}
%<*pdftex-def|xetex-def|luatex-def>
\def\MT@setupfont{%
%    \end{macrocode}
%\changes{v2.5}{2012/08/22}{select font with \pkg{fontspec} (found by \contributor Georg Duffner <g.duffner\at gmail.com>)}
%                           ^^A private mail, 2012/08/17
%\changes{v2.7b}{2018/02/21}{always select current font with \xetex\ and \luatex\ (reported by \contributor Paolo Ney <@\at @>,
%                            solution by \contributor Ulrike Fischer <news3\at nililand.de>)}
%                            ^^A (1) https://tex.stackexchange.com/questions/416310/problem-of-amsart-and-microtype-under-xelatex
%                            ^^A (2) private mail, 2018/02/20
% With \xetex\ and \luatex\ the font may not be actually loaded,
% hence we might see a wrong font (in \cs{MT@get@slot}).
% Therefore, we first load the current font.
%    \begin{macrocode}
%<xetex-def|luatex-def>  \MT@font
%    \end{macrocode}
% We might have to disable stuff when used together with adventurous
% packages.
%    \begin{macrocode}
  \MT@setupfont@hook}
%    \end{macrocode}
% This will use a copy of the font (allowing for expansion parameter variation
% and the use of more than one set of protrusion factors for a font within one
% paragraph).
%    \begin{macrocode}
%<pdftex-def>\MT@requires@pdftex7{
%<pdftex-def|luatex-def>\g@addto@macro\MT@setupfont\MT@copy@font
%<pdftex-def>}\relax
%    \end{macrocode}
% The font properties must be extracted from \cs{MT@font}, since the current
% value of \cmd\f@encoding\ and friends may be wrong!
%    \begin{macrocode}
\g@addto@macro\MT@setupfont{%
  \MT@exp@two@c\MT@split@name\string\MT@font/\@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@exp@one@n\MT@find@file\MT@family
  \ifx\MT@familyalias\@empty \else
    \MT@exp@one@n\MT@find@file\MT@familyalias\fi
%    \end{macrocode}
%\changes{v1.2}{2004/09/26}{fix: call \cmd\@@enc@update\ if necessary}
% We have to make sure that \cmd\cf@encoding\ expands to the correct value (for
% later, in \cs{MT@get@slot}), which isn't the case when \cmd\selectfont\
% chooses a new encoding (this would be done a second later in
% \cmd\selectfont, anyway -- three lines, to be exact).
% (I think, I do not need this anymore -- however, I'm too afraid to remove it.
% \dots\ Oops, I did it. Let's see whether anybody complains.)
%\changes{v2.2}{2007/04/15}{don't call \cmd\@@enc@update\ anymore}
%    \begin{macrocode}
% \ifx\f@encoding\cf@encoding\else\@@enc@update\fi
}
%    \end{macrocode}
% Tracking has to come first, since it means actually loading a different font.
%\changes{v2.2}{2007/04/15}{only add features that are available with the respective \pdftex}
%    \begin{macrocode}
%<pdftex-def>\MT@requires@pdftex6
%<luatex-def>\MT@requires@luatex3
%<pdftex-def|luatex-def>  {\g@addto@macro\MT@setupfont\MT@tracking}\relax
\g@addto@macro\MT@setupfont{%
  \MT@check@font
  \ifMT@inlist@
%<debug>\MT@show@pdfannot2%
  \else
    \MT@vinfo{Setting up font `\MT@@font'\on@line}%
    \MT@info@notracking
%    \end{macrocode}
% Now we can begin setting up the font for all features that the current
% \pdftex\ provides. The following commands are \cmd\let\ to \cmd\relax\ if the
% respective feature is disabled via package options.
%
% For versions older than 1.20, protrusion has to be set up first, beginning
% with 1.20, the order doesn't matter.
%    \begin{macrocode}
  \MT@protrusion
%<pdftex-def|luatex-def>  \MT@expansion
}
%    \end{macrocode}
% Interword spacing and kerning (\pdftex\ 1.40).
%    \begin{macrocode}
%<*pdftex-def>
\MT@requires@pdftex6{
\g@addto@macro\MT@setupfont{\MT@spacing\MT@kerning}
}\relax
%</pdftex-def>
%    \end{macrocode}
% Disable ligatures (\pdftex\ 1.30).
%    \begin{macrocode}
%<pdftex-def>\MT@requires@pdftex5{
%<pdftex-def|luatex-def>\g@addto@macro\MT@setupfont\MT@noligatures
%<pdftex-def>}\relax
\g@addto@macro\MT@setupfont{%
%    \end{macrocode}
% Debugging.
%    \begin{macrocode}
%<debug>\MT@show@pdfannot1%
%    \end{macrocode}
% Finally, register the font so that we don't set it up anew each time.
%    \begin{macrocode}
    \MT@register@font
  \fi
}
%</pdftex-def|xetex-def|luatex-def>
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@copy@font}
%\changes{v2.2}{2007/07/03}{optionally work on copies of fonts}
%\begin{macro}{\MT@copy@font@}
% The new (1.40.4) \cmd\pdfcopyfont\ command allows expanding a font with
% different parameters, or to use more than one set of protrusion factors for a
% given font within one paragraph. It will be used when we find a context for
% \cs{SetProtrusion} or \cs{SetExpansion} in the preamble, or when the package
% has been loaded with the \opt{copyfonts} option.
%    \begin{macrocode}
%<*pdftex-def|luatex-def>
\let\MT@copy@font\relax
%<pdftex-def>\MT@requires@pdftex7{
\def\MT@copy@font@{%
%    \end{macrocode}
%\begin{macro}{\MT@font@copy}
% For every new protrusion and expansion context, we create a new copy.
%\changes{v2.3b}{2008/04/15}{enable font copies also with protrusion contexts
%                            (reported by \contributor Nathan Rosenblum <nater\at cs.wisc.edu>)}
%                                                               ^^A private mail, 2008/04/14
%    \begin{macrocode}
  \xdef\MT@font@copy{\csname\MT@@font/\MT@pr@context/\MT@ex@context\endcsname}%
  \expandafter\ifx\MT@font@copy\relax
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@font@orig}
% \pdftex\ doesn't allow copying a font that has already been copied and
% expanded\slash letterspaced. Hence, we have to get the original.
%    \begin{macrocode}
    \edef\MT@font@orig{\csname\expandafter\string\font@name @orig\endcsname}%
    \expandafter\ifx\MT@font@orig\relax
      \MT@exp@two@c\MT@glet\MT@font@orig\font@name
    \else
      \MT@exp@two@c\let\font@name\MT@font@orig
    \fi
%<pdftex-def>    \global\MT@exp@two@c\pdfcopyfont\MT@font@copy\font@name
%    \end{macrocode}
%\end{macro}
% Even though \luatex\ also provides the primitive from \pdftex\ (even renamed to
% \cmd\copyfont, that is, `promoted' as per the \luatex\ manual), it is seriously
% crippled in that OpenType features will be lost. ^^A see https://mailman.ntg.nl/pipermail/ntg-context/2016/087541.html seqq.
%\changes{v2.7d}{2019/11/17}{in \luatex, don't use the \cmd\copyfont\ primitive, but load the font anew
%                            (reported by \contributor Paolo Polesana <@\at @> and
%                                         \contributor Oliver Kopp <koppdev\at gmail.com>)}
%                                          ^^A https://tex.stackexchange.com/questions/338942/cancellation-of-color-fontspec-font-settings-while-defining-microtype-context
%                                          ^^A https://tex.stackexchange.com/questions/419288/microtypecontext-with-lualatex
% Therefore, we do not copy the font but load it anew.
%    \begin{macrocode}
%<luatex-def>    \MT@exp@two@c\MT@lua@copyfont\meaning\font@name\@nil
%<debug>\MT@dinfo1{creating new copy: \MT@font@copy}%
%    \end{macrocode}
% Since it's a new font, we have to remove it from the context lists.
%    \begin{macrocode}
    \MT@map@clist@c\MT@active@features{%
      \MT@exp@cs\ifx{MT@\@nameuse{MT@abbr@##1}}\relax\else
        \def\@tempa{##1}%
        \MT@exp@cs\MT@map@tlist@c{MT@##1@doc@contexts}\MT@rem@from@list
      \fi
    }%
  \fi
  \MT@exp@two@c\let\MT@font\MT@font@copy
%    \end{macrocode}
% We only need the font identifier for letterspacing.
%    \begin{macrocode}
  \let\font@name\MT@font@copy
%    \end{macrocode}
% But we have to properly substitute the font after we're done.
%    \begin{macrocode}
  \aftergroup\let\aftergroup\font@name\aftergroup\MT@font@copy
}
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\begin{macro}{\MT@rem@from@list}
%    \begin{macrocode}
\def\MT@rem@from@list#1{%
  \MT@exp@cs\ifx{MT@\@tempa @#1font@list}\relax\else
    \expandafter\MT@exp@one@n\expandafter\MT@rem@from@clist\expandafter
       \MT@font \csname MT@\@tempa @#1font@list\endcsname
  \fi
}
%<pdftex-def>}\relax
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@lua@copy@font}
% \meta{\#1} and \meta{\#2} are `|select|' and `|font|', respectively,
% \meta{\#3} is the font spec.
%    \begin{macrocode}
%<luatex-def>\def\MT@lua@copyfont #1 #2 #3\@nil{%
%<luatex-def>  \global\expandafter\font\MT@font@copy=#3\relax}
%</pdftex-def|luatex-def>
%    \end{macrocode}
%\end{macro}
%\ifpdf\phantomsection\fi\label{exp-hack}
%\paragraph{Here's the promised dirty trick}
% for users of older \pdftex\ versions, which works around the problem that the
% use of the same font with different expansion parameters is prohibited. If
% you do not want to create a clone of the font setup (this would require
% duplicating the \file{tfm}/\file{vf} files under a new name, and writing new
% \file{fd} files and \file{map} entries), you can load a minimally larger font
% for the paragraph in question. E.g., for a document typeset in 10\,pt:
%\begin{verbatim}[gobble=2,morekeywords={[0]{\expandpar}}]
% \SetExpansion
%    [ stretch = 30,
%      shrink  = 60,
%      step    =  5 ]
%    { encoding = *,
%      size = 10.001 }
%    { }
% \newcommand{\expandpar}[1]{{%
%    \fontsize{10.001}{\baselineskip}\selectfont #1\par}}
% % ...
% \expandpar{This paragraph contains an `unnecessary' widow.}
%\end{verbatim}
% Note that the \cmd\expandpar\ command can only be applied to complete
% paragraphs. If you are using Computer Modern Roman, you have to load the
% \pkg{fix-cm} package to be able to select fonts in arbitrary sizes. Finally,
% the reason I suggest to use a larger font, and not a smaller one, is to
% prevent a different design size being selected.
%
%\bigskip
%\begin{macro}{\MT@fix@fontdimen@six}
%\changes{v1.8}{2005/05/03}{new macro: test whether \fontdim6 is defined}
%\changes{v2.3e}{2009/08/31}{fix: gobbling settings with tracking failed
%                            (reported by \contributor Leo <sdl.web\at gmail.com>)}
%                                             ^^A MID: <m0vdk4g8t2.fsf@cam.ac.uk>
%\changes{v2.8}{2020/05/25}{try to fix zero \fontdim6}
%\begin{macro}{\MT@dimen@six}
% If \fontdim6 is zero, character protrusion, spacing, kerning and tracking
% won't work, and we could skip the settings (for example, the \pkg{dsfont}
% fonts don't specify this dimension; this is probably a bug -- the \pkg{fourier}
% and \pkg{newpx}/\pkg{newtx} packages have been fixed in the meantime).
% However, we can fix it ourselves -- only tracking still doesn't work (it seems
% that \cmd\letterspacefont\ uses the \fontdim6 from the original font).
% \xetex\ doesn't provide an equivalent to \cmd\pdffontsize, so we use the
% nominal size instead.
%    \begin{macrocode}
%<*pdftex-def|luatex-def|xetex-def>
\def\MT@fix@fontdimen@six{%
  \ifnum\fontdimen6\MT@font=\z@
    \fontdimen6\MT@font=%
%<pdftex-def>      \pdffontsize\MT@font
%<luatex-def>      \MT@requires@luatex4{\pdffeedback fontsize}{\pdffontsize}\MT@font
%<xetex-def>      \MT@size pt
    \MT@info{Fixing zero \string\fontdimen 6 for font `\MT@@font'\MessageBreak
             (new value: \the\fontdimen6\MT@font)}%
    \MT@glet@nc{\MT@@font-fake6}\@empty
  \fi
  \edef\MT@dimen@six{\number\fontdimen6\MT@font}%
}
%</pdftex-def|luatex-def|xetex-def>
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\begin{macro}{\MT@split@name}
%\changes{v1.7}{2005/02/27}{don't define \cs{MT@encoding} \&c. \cmd\global ly}
%\changes{v2.0}{2006/12/19}{adjust to possible letterspacing}
%\begin{macro}{\MT@encoding}
%\begin{macro}{\MT@family}
%\begin{macro}{\MT@series}
%\begin{macro}{\MT@shape}
%\begin{macro}{\MT@size}
% Split up the font name (\meta{\#6} may be a protrusion\slash expansion
% context and/or a letterspacing amount). ^^A really?
% With \pkg{fontspec} we also need to remove its internal instance counter.
%    \begin{macrocode}
%<*package>
\def\MT@split@name#1/#2/#3/#4/#5/#6\@nil{%
  \def\MT@encoding{#1}%
  \ifMT@fontspec
    \edef\MT@family{\MT@scrubfeature#2()\relax}%
  \else
    \def\MT@family{#2}%
  \fi
  \def\MT@series  {#3}%
  \def\MT@shape   {#4}%
  \def\MT@size    {#5}%
  \MT@fix@fontdimen@six
%    \end{macrocode}
%\begin{macro}{\MT@familyalias}
% Alias family?
%\changes{v1.2}{2004/09/29}{define alias font name as an alternative, not
%                          as a replacement}
%    \begin{macrocode}
  \MT@ifdefined@n@TF{MT@\MT@family @alias}%
    {\MT@let@cn\MT@familyalias{MT@\MT@family @alias}}%
    {\let\MT@familyalias\@empty}%
}
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\begin{macro}{\MT@scrubfeature}
%\begin{macro}{\MT@scrubfeatures}
% Remove one resp. all feature counters (\pkg{fontspec}).
%\changes{v2.5}{2010/02/27}{compatibility with \pkg{fontspec}: remove its internal counter}
%    \begin{macrocode}
\def\MT@scrubfeature#1(#2)#3\relax{#1}
\def\MT@scrubfeatures#1(#2)#3\relax{%
  #1%
  \ifx\relax#3\relax\else
    \MT@scrubfeatures#3\relax
  \fi
}
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\begin{macro}{\ifMT@do}
%\begin{macro}{\MT@feat}
%\begin{macro}{\MT@maybe@do}
% We check all features of the current font against the lists of the currently
% active font set, and set \cs{ifMT@do} accordingly.
%\changes{v1.2}{2004/09/29}{also check for alias font name}
%\changes{v1.9}{2005/09/28}{redone}
%    \begin{macrocode}
\newif\ifMT@do
\def\MT@maybe@do#1{%
%    \end{macrocode}
% (but only if the feature isn't globally set to false)
%    \begin{macrocode}
  \csname ifMT@\csname MT@abbr@#1\endcsname\endcsname
%    \end{macrocode}
% Begin with setting micro-typography to true for this font. The
% \cs{MT@checklist@...} tests will set it to false if the property is not in
% the list. The first non-empty list that does not contain a match will stop us
% (except for |font|).
%    \begin{macrocode}
    \MT@dotrue
    \edef\@tempa{\csname MT@#1@setname\endcsname}%
    \MT@map@clist@n{font,encoding,family,series,shape,size}{%
      \MT@ifdefined@n@TF{MT@checklist@##1}%
        {\csname MT@checklist@##1\endcsname}%
        {\MT@checklist@{##1}}%
      {#1}%
    }%
  \else
    \MT@dofalse
  \fi
  \ifMT@do
%    \end{macrocode}
% \cs{MT@feat} stores the current feature.
%    \begin{macrocode}
    \def\MT@feat{#1}%
    \csname MT@set@#1@codes\endcsname
  \else
    \MT@ifstreq{#1}{tr}%
      {\let\MT@info@notracking\MT@info@notracking@}%
      {\MT@vinfo{... No \@nameuse{MT@abbr@#1}}}%
  \fi
}
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\end{macro}
%\begin{macro}{\MT@info@notracking}
%\begin{macro}{\MT@info@notracking@}
%\changes{v2.7a}{2017/11/17}{defer `No tracking' message}
% To defer the message to after the font has actually been logged.
%    \begin{macrocode}
\let\MT@info@notracking\relax
\def\MT@info@notracking@{\MT@vinfo{... No tracking}}
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\begin{macro}{\MT@dinfo@list}
%    \begin{macrocode}
%<debug>\def\MT@dinfo@list#1#2#3{\MT@dinfo@nl{1}{\@nameuse{MT@abbr@#1}: #2
%<debug>  \ifx\\#3\\list empty\else `\@nameuse{MT@#2}' #3 list\fi}}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@checklist@}
% The generic test (\meta{\#1} is the axis, \meta{\#2} the feature, \cmd\@tempa\
% contains the set name).
%    \begin{macrocode}
\def\MT@checklist@#1#2{%
%<!debug>  \MT@ifdefined@n@T
%<debug>  \MT@ifdefined@n@TF
      {MT@#2list@#1@\@tempa}{%
%    \end{macrocode}
% Begin a (neatly masqueraded) \cmd\expandafter\ orgy to test whether the font
% attribute is in the list.
%    \begin{macrocode}
    \expandafter\MT@exp@one@n\expandafter\MT@in@clist
      \csname MT@#1\expandafter\endcsname
      \csname MT@#2list@#1@\@tempa\endcsname
    \ifMT@inlist@
%<debug>\MT@dinfo@list{#2}{#1}{in}%
      \MT@dotrue
    \else
%<debug>\MT@dinfo@list{#2}{#1}{not in}%
      \MT@dofalse
      \expandafter\MT@clist@break
    \fi
  }%
%    \end{macrocode}
% If no limitations have been specified, \ie, the list for a font attribute
% has not been defined at all, the font should be set up.
%    \begin{macrocode}
%<debug>  {\MT@dinfo@list{#2}{#1}{}}%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@checklist@family}
% Also test for the alias font, if the original font is not in the list.
%\changes{v1.4b}{2004/11/22}{fix: don't try alias family name if encoding failed}
%\changes{v1.9}{2005/07/12}{fix: add two missing \cmd\expandafter s}
%    \begin{macrocode}
\def\MT@checklist@family#1{%
%<!debug>  \MT@ifdefined@n@T
%<debug>  \MT@ifdefined@n@TF
      {MT@#1list@family@\@tempa}{%
    \MT@exp@two@n\MT@in@clist
        \MT@family{\csname MT@#1list@family@\@tempa\endcsname}%
    \ifMT@inlist@
%<debug>\MT@dinfo@list{#1}{family}{in}%
      \MT@dotrue
    \else
%<debug>\MT@dinfo@list{#1}{family}{not in}%
      \MT@dofalse
      \ifx\MT@familyalias\@empty \else
        \MT@exp@two@n\MT@in@clist
            \MT@familyalias{\csname MT@#1list@family@\@tempa\endcsname}%
        \ifMT@inlist@
%<debug>  \MT@dinfo@list{#1}{family alias}{in}%
          \MT@dotrue
%<debug>\else\MT@dinfo@list{#1}{family alias}{not in}%
        \fi
      \fi
    \fi
    \ifMT@do \else
      \expandafter\MT@clist@break
    \fi
  }%
%<debug>  {\MT@dinfo@list{#1}{family}{}}%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@checklist@size}
% Test whether font size is in list of size ranges.
%    \begin{macrocode}
\def\MT@checklist@size#1{%
%<!debug>  \MT@ifdefined@n@T
%<debug>  \MT@ifdefined@n@TF
      {MT@#1list@size@\@tempa}{%
    \MT@exp@cs\MT@in@rlist{MT@#1list@size@\@tempa}%
    \ifMT@inlist@
%<debug>\MT@dinfo@list{#1}{size}{in}%
      \MT@dotrue
    \else
%<debug>\MT@dinfo@list{#1}{size}{not in}%
      \MT@dofalse
      \expandafter\MT@clist@break
    \fi
  }%
%<debug>  {\MT@dinfo@list{#1}{size}{}}%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@checklist@font}
% If the font matches, we skip the rest of the test.
%    \begin{macrocode}
\def\MT@checklist@font#1{%
%<!debug>  \MT@ifdefined@n@T
%<debug>  \MT@ifdefined@n@TF
      {MT@#1list@font@\@tempa}{%
%    \end{macrocode}
% Since \cs{MT@font} may be appended with context and/or letterspacing specs,
% we construct the name from the font characteristics.
%\changes{v2.2}{2007/07/03}{fix: construct font name from characteristics}
%    \begin{macrocode}
    \edef\@tempb{\MT@encoding/\MT@family/\MT@series/\MT@shape/\MT@size}%
    \expandafter\MT@exp@one@n\expandafter\MT@in@clist\expandafter
      \@tempb \csname MT@#1list@font@\@tempa\endcsname
    \ifMT@inlist@
%<debug>\MT@dinfo@list{#1}{font}{in}%
      \expandafter\MT@clist@break
    \else
%<debug>\MT@dinfo@list{#1}{font}{not in}%
      \MT@dofalse
    \fi
  }%
%<debug>  {\MT@dinfo@list{#1}{font}{}}%
}
%    \end{macrocode}
%\end{macro}
%
%\subsubsection{Protrusion}
%
%\begin{macro}{\ifMT@nofamily}
% Info for settings that are not family-specific.
% (Warnings seem to be too irritating.) ^^A at least one thing I found out in the ridiculously long `beta' phase
% The switch is set in \cs{MT@next@listname}.
%\changes{v2.5}{2011/05/28}{info if settings are not family-specific
%                          (suggested by \contributor H\`an \thanhthe{} Th\`anh <thanh\at river-valley.org>)}
%                          ^^A private mail, 2010/09/07
%                          ^^A (beta:07)
%    \begin{macrocode}
\newif\ifMT@nofamily
%</package>
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@protrusion}
% Set up for protrusion?
%    \begin{macrocode}
%<*pdftex-def|xetex-def|luatex-def>
\def\MT@protrusion{\MT@maybe@do{pr}}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@set@pr@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@pr@codes{%
  \MT@nofamilyfalse
%    \end{macrocode}
% Check whether and if, which list should be applied to the current font.
% If family-specific settings don't exist, we write it to the log
%\changes{v2.5}{2013/02/05}{make info about generic settings encoding-specific
%                           (reported by \contributor Sebastian Schubert <schubert.seb\at googlemail.com>)}
%                           ^^A private mail, 2013/01/24
% (for each encoding).
%    \begin{macrocode}
  \MT@if@list@exists{%
    \ifMT@nofamily
      \MT@ifdefined@n@TF{\MT@encoding-\MT@family-settings}\relax{%
        \MT@info@nl{Loading generic protrusion settings for font family\MessageBreak
                    `\MT@family' (encoding: \MT@encoding).\MessageBreak
                    For optimal results, create family-specific settings.\MessageBreak
                    See the microtype manual for details}%
        \MT@glet@nc{\MT@encoding-\MT@family-settings}\@empty
      }%
    \fi
    \MT@get@opt
    \MT@reset@pr@codes
%    \end{macrocode}
% Get the name of the inheritance list and parse it.
%    \begin{macrocode}
    \MT@get@inh@list
%    \end{macrocode}
% Set an input encoding?
%    \begin{macrocode}
    \MT@set@inputenc{c}%
%    \end{macrocode}
% Load additional lists?
%    \begin{macrocode}
    \MT@load@list\MT@pr@c@name
    \MT@set@listname
%    \end{macrocode}
% Load the main list.
%    \begin{macrocode}
    \MT@let@cn\@tempc{MT@pr@c@\MT@pr@c@name}%
    \expandafter\MT@set@codes\@tempc,\relax,%
  }\MT@reset@pr@codes
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@set@all@pr}
%\changes{v2.2}{2007/06/16}{(et al.) allow empty values}
% Set all protrusion codes of the font.
%\changes{v2.5}{2011/08/19}{fix: remove space
%                           (found by \contributor Meho~R <meho.2005\at gmail.com>)}
%                            ^^A MID: <b3c1627e-192f-4004-ab46-4ea86925e298@dc3g2000vbb.googlegroups.com>
%                            ^^A https://tex.stackexchange.com/questions/25036/microtype-package-v-2-5-beta-06-and-footnote-protrusion
%                            ^^A (beta:08)
%    \begin{macrocode}
\def\MT@set@all@pr#1#2{%
%<debug>\MT@dinfo@nl{3}{-- lp/rp: setting all to #1/#2}%
  \let\MT@temp\@empty
  \MT@ifempty{#1}\relax{\g@addto@macro\MT@temp{\lpcode\MT@font\@tempcnta=#1}}%
  \MT@ifempty{#2}\relax{\g@addto@macro\MT@temp{\rpcode\MT@font\@tempcnta=#2}}%
  \MT@do@font\MT@temp
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@reset@pr@codes@}
%\begin{macro}{\MT@reset@pr@codes}
% All protrusion codes are zero for new fonts. However, if we have to reload
% the font due to different contexts, we have to reset them.
% This command will be changed by \cs{microtypecontext} if necessary.
%    \begin{macrocode}
\def\MT@reset@pr@codes@{\MT@set@all@pr\z@\z@}
\let\MT@reset@pr@codes\relax
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\begin{macro}{\MT@the@pr@code}
%\begin{macro}{\MT@the@pr@code@tr}
%\changes{v2.2}{2007/04/05}{adjust protrusion of letterspaced fonts}
% If the font is letterspaced, we have to add half the letterspacing amount to
% the margin kerns. This will be activated in \cs{MT@set@tr@codes}.
%    \begin{macrocode}
\def\MT@the@pr@code{\@tempcntb}
%<*pdftex-def|luatex-def>
%<pdftex-def>\MT@requires@pdftex6
%<luatex-def>\MT@requires@luatex3
  {\def\MT@the@pr@code@tr{%
    \numexpr\@tempcntb+\MT@letterspace@/2\relax
  }
}\relax
%</pdftex-def|luatex-def>
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\begin{macro}{\MT@set@codes}
%\changes{v2.3a}{2007/12/29}{generalised}
% Split up the values and set the codes.
%    \begin{macrocode}
\def\MT@set@codes#1,{%
  \ifx\relax#1\@empty\else
    \MT@split@codes #1==\relax
    \expandafter\MT@set@codes
  \fi
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@split@codes}
%\changes{v1.1}{2004/09/13}{fix: allow zero and negative values}
%\changes{v1.8}{2005/05/25}{get character width once only}
% The \pkg{keyval} package would remove spaces here, which we needn't do since
% \cs{SetProtrusion} ignores spaces in the protrusion list anyway.
% \cs{MT@get@char@unit} may mean different things.
%    \begin{macrocode}
\def\MT@split@codes#1=#2=#3\relax{%
  \def\@tempa{#1}%
  \ifx\@tempa\@empty \else
    \MT@get@slot
%<pdftex-def|luatex-def>    \ifnum\MT@char > \m@ne
%<xetex-def>    \ifx\MT@char\@empty \else
      \MT@get@char@unit
      \csname MT@\MT@feat @split@val\endcsname#2\relax
    \fi
  \fi
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@pr@split@val}
%    \begin{macrocode}
\def\MT@pr@split@val#1,#2\relax{%
  \def\@tempb{#1}%
  \MT@ifempty\@tempb\relax{%
    \MT@scale@to@em
    \lpcode\MT@font\MT@char=\MT@the@pr@code
%<debug>\MT@dinfo@nl{4}{;;; lp (\MT@char): \number\lpcode\MT@font\MT@char\space: [#1]}%
  }%
  \def\@tempb{#2}%
  \MT@ifempty\@tempb\relax{%
    \MT@scale@to@em
    \rpcode\MT@font\MT@char=\MT@the@pr@code
%<debug>\MT@dinfo@nl{4}{;;; rp (\MT@char): \number\rpcode\MT@font\MT@char\space: [#2]}%
  }%
%    \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@T\MT@pr@inh@name{%
    \MT@ifdefined@n@T{MT@inh@\MT@pr@inh@name @\MT@char @}{%
      \MT@exp@cs\MT@map@tlist@c
        {MT@inh@\MT@pr@inh@name @\MT@char @}%
        \MT@set@pr@heirs
    }%
  }%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@scale@to@em}
% Since \pdftex\ version 0.14h, we have to adjust the protrusion factors (\ie,
% convert numbers from thousandths of character width to thousandths of an em
% of the font). We have to do this \emph{before} setting the inheriting
% characters, so that the latter inherit the absolute value, not the relative
% one if they have a differing width (\eg, the `ff' ligature).
%\changes{v1.5}{2004/12/10}{don't use \cmd\lpcode\ and \cmd\rpcode\ for the
%                           calculation}
% Unlike \file{protcode.tex} and \pkg{pdfcprot}, 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 \EM{1} of the font.
%
% The unit is in \cs{MT@count}, the desired factor in \cmd\@tempb, and the
% result will be returned in \cmd\@tempcntb.
%    \begin{macrocode}
%<pdftex-def>\MT@requires@pdftex3{
\def\MT@scale@to@em{%
  \@tempcntb=\MT@count\relax
%    \end{macrocode}
% For really huge fonts (100\,pt or so), an arithmetic overflow could occur
% with vanilla \TeX. Using \etex, this can't happen, since the intermediate
% value is 64\,bit, which could only be reached with a character width larger
% than \cs{maxdimen}.
%    \begin{macrocode}
  \MT@scale\@tempcntb \@tempb \MT@dimen@six
  \ifnum\@tempcntb=\z@ \else
    \MT@scale@factor
  \fi
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@get@charwd}
% Get the width of the character. When using \etex, we can employ
% \cmd\fontcharwd\ instead of building scratch boxes.
%\changes{v1.6}{2005/01/19}{use \etex's \cmd\fontcharwd, if available}
%\changes{v1.8}{2005/05/25}{warning for missing (resp. zero-width) characters}
%    \begin{macrocode}
\def\MT@get@charwd{%
%<*pdftex-def>
^^X  \MT@count=\fontcharwd\MT@font\MT@char\relax
^^Q  \setbox\z@=\hbox{\MT@font \char\MT@char}%
^^Q  \MT@count=\wd\z@
%</pdftex-def>
%<luatex-def>  \MT@count=\fontcharwd\MT@font\MT@char\relax
%    \end{macrocode}
% \cs{MT@char} contains a slot number (legacy fonts), a Unicode number,
% or a glyph name (if \cs{MT@char@} is negative).
%    \begin{macrocode}
%<*xetex-def>
  \ifnum\MT@char@<\z@
    \setbox\z@=\hbox{\MT@font \XeTeXglyph-\MT@char@}%
    \MT@count=\wd\z@
  \else
    \MT@count=\fontcharwd\MT@font\MT@char@\relax
  \fi
%</xetex-def>
  \ifnum\MT@count=\z@ \MT@info@missing@char \fi
}
%    \end{macrocode}
%\changes{v2.2}{2007/04/05}{subtract letterspacing amount from width}
% For letterspaced fonts, we have to subtract the letterspacing amount from the
% characters' widths. The protrusion amounts will be adjusted in
% \cs{MT@set@pr@codes}.
% The letterspaced font is already loaded so that \EM{1} = \fontdim6.
%    \begin{macrocode}
%<*pdftex-def>
\MT@requires@pdftex6{
  \g@addto@macro\MT@get@charwd{%
    \MT@ifdefined@c@T\MT@letterspace@
      {\advance\MT@count -\dimexpr\MT@letterspace@ sp *\dimexpr 1em/1000\relax}%
  }
}\relax
}{
%    \end{macrocode}
%\end{macro}
% No adjustment with versions 0.14f and 0.14g.
%    \begin{macrocode}
\def\MT@scale@to@em{%
  \MT@count=\@tempb\relax
  \ifnum\MT@count=\z@ \else
    \MT@scale@factor
  \fi
}
%    \end{macrocode}
% We need this in \cs{MT@warn@code@too@large} (neutralised).
%    \begin{macrocode}
\def\MT@get@charwd{\MT@count=\MT@dimen@six}
}
%</pdftex-def>
%</pdftex-def|xetex-def|luatex-def>
%    \end{macrocode}
%\begin{macro}{\MT@get@font@dimen}
% For the |space| unit.
%\changes{v1.9d}{2006/02/13}{warning for zero fontdimen}
%    \begin{macrocode}
%<*package>
\def\MT@get@font@dimen#1{%
  \ifnum\fontdimen#1\MT@font=\z@
    \MT@warning@nl{Font `\MT@@font' does not specify its\MessageBreak
      \@backslashchar fontdimen #1 (it's zero)!\MessageBreak
      You should use a different `unit' for \MT@curr@list@name}%
  \else
    \MT@count=\fontdimen#1\MT@font
  \fi
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@info@missing@char}
%\changes{v1.9a}{2005/11/17}{info instead of warning
%                (after \contributor Michael Hoppe <mh\at michael-hoppe.de> reported that
%                 the `fl' ligature is missing in Palatino <SC>)}
%                 ^^A MID: <1h64d0x.16xsx9n1151dieN%mh@michael-hoppe.de>
% Info about missing characters, or characters with zero width.
%\changes{v2.5}{2010/11/11}{fix error message for \xetex\
%                           (reported by \contributor Juan Acevedo <juan.acevedo.juan\at gmail.com>)}
%                           ^^A <http://permalink.gmane.org/gmane.comp.tex.xetex/17202>
%                           ^^A (beta:05)
%\changes{v2.7b}{2018/02/20}{fix message for glyphs specified as names in \xetex\
%                            (reported by \contributor Paolo Ney <@\at @>)}
%                            ^^A https://tex.stackexchange.com/questions/416310/problem-of-amsart-and-microtype-under-xelatex
%    \begin{macrocode}
\def\MT@info@missing@char{%
  \MT@info@nl{Character `\the\MT@toks'
^^X   \ifnum\MT@char@<\z@ is missing\else
^^X     \iffontchar\MT@font\MT@char@
               has a width of 0pt
^^X      \else is missing\fi\fi
^^Q    \MessageBreak (it's probably missing)
    \MessageBreak in font `\MT@@font'.\MessageBreak
    Ignoring protrusion settings for this character}%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@scale@factor}
%\changes{v1.5}{2004/12/10}{warning for factors outside limits}
%\changes{v1.9}{2005/09/28}{generalised}
% Furthermore, we might have to multiply with a factor.
%    \begin{macrocode}
\def\MT@scale@factor{%
  \ifnum\csname MT@\MT@feat @factor@\endcsname=\@m \else
    \expandafter\MT@scale\expandafter \@tempcntb
      \csname MT@\MT@feat @factor@\endcsname \@m
  \fi
  \ifnum\@tempcntb>\csname MT@\MT@feat @max\endcsname\relax
    \MT@exp@cs\MT@warn@code@too@large{MT@\MT@feat @max}%
  \else
    \ifnum\@tempcntb<\csname MT@\MT@feat @min\endcsname\relax
      \MT@exp@cs\MT@warn@code@too@large{MT@\MT@feat @min}%
    \fi
  \fi
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@warn@code@too@large}
% Type out a warning if a chosen protrusion factor is too large after the
% conversion. As a special service, we also type out the maximum amount that
% may be specified in the configuration.
%\changes{v1.7}{2005/02/17}{new macro: type out maximum protrusion factor}
%\changes{v1.9b}{2006/01/03}{fix calculation with present factor}
%    \begin{macrocode}
\def\MT@warn@code@too@large#1{%
  \@tempcnta=#1\relax
  \ifnum\csname MT@\MT@feat @factor@\endcsname=\@m \else
    \expandafter\MT@scale\expandafter\@tempcnta\expandafter
      \@m \csname MT@\MT@feat @factor@\endcsname
  \fi
  \MT@scale\@tempcnta \MT@dimen@six \MT@count
  \MT@warning@nl{The \@nameuse{MT@abbr@\MT@feat} code \@tempb\space
    is too large for character\MessageBreak
    `\the\MT@toks' in \MT@curr@list@name.\MessageBreak
    Setting it to the maximum of \number\@tempcnta}%
  \@tempcntb=#1\relax
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@get@opt}
% The optional argument to the configuration commands (except for
% \cs{SetExpansion} and \cs{SetTracking}, which are being dealt with
% in \cs{MT@get@ex@opt} and \cs{MT@get@tr@opt}, resp.).
%    \begin{macrocode}
\def\MT@get@opt{%
  \MT@set@listname
%    \end{macrocode}
%\begin{macro}{\MT@pr@factor@}
%\begin{macro}{\MT@sp@factor@}
%\begin{macro}{\MT@kn@factor@}
% Apply a factor?
%    \begin{macrocode}
  \MT@ifdefined@n@TF{MT@\MT@feat @c@\csname MT@\MT@feat @c@name\endcsname @factor}{%
    \MT@let@nn{MT@\MT@feat @factor@}
        {MT@\MT@feat @c@\csname MT@\MT@feat @c@name\endcsname @factor}%
    \MT@vinfo{... : Multiplying \@nameuse{MT@abbr@\MT@feat} codes by
                    \number\csname MT@\MT@feat @factor@\endcsname/1000}%
  }{%
    \MT@let@nn{MT@\MT@feat @factor@}{MT@\MT@feat @factor}%
  }%
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\end{macro}
%\begin{macro}{\MT@pr@unit@}
%\begin{macro}{\MT@sp@unit@}
%\begin{macro}{\MT@kn@unit@}
% The |unit| can only be evaluated here, since it might be font-specific.
% If it's \cmd\@empty, it's relative to character widths, if it's \textminus1,
% relative to space dimensions.
%    \begin{macrocode}
  \MT@ifdefined@n@TF{MT@\MT@feat @c@\csname MT@\MT@feat @c@name\endcsname @unit}{%
    \MT@let@nn{MT@\MT@feat @unit@}%
        {MT@\MT@feat @c@\csname MT@\MT@feat @c@name\endcsname @unit}%
    \MT@exp@cs\ifx{MT@\MT@feat @unit@}\@empty
      \MT@vinfo{... : Setting \@nameuse{MT@abbr@\MT@feat} codes
                      relative to character widths}%
    \else
      \MT@exp@cs\ifx{MT@\MT@feat @unit@}\m@ne
        \MT@vinfo{... : Setting \@nameuse{MT@abbr@\MT@feat} codes
                        relative to width of space}%
      \fi
    \fi
  }{%
    \MT@let@nn{MT@\MT@feat @unit@}{MT@\MT@feat @unit}%
  }%
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\end{macro}
%\begin{macro}{\MT@get@space@unit}
%\begin{macro}{\MT@get@char@unit}
% The codes are either relative to character widths, or to a fixed width.
% For spacing and kerning lists, they may also be relative to the width of
% the interword glue.
% Only the setting from the top list will be taken into account.
%    \begin{macrocode}
  \let\MT@get@char@unit\relax
  \let\MT@get@space@unit\@gobble
  \MT@exp@cs\ifx{MT@\MT@feat @unit@}\@empty
    \let\MT@get@char@unit\MT@get@charwd
  \else
    \MT@exp@cs\ifx{MT@\MT@feat @unit@}\m@ne
      \let\MT@get@space@unit\MT@get@font@dimen
    \else
      \MT@exp@cs\MT@get@unit{MT@\MT@feat @unit@}%
    \fi
  \fi
%    \end{macrocode}
%\end{macro}
%\end{macro}
% Preset all characters? If so, we surely don't need to reset, too.
%\changes{v1.9}{2005/10/08}{new key `\texttt{preset}' to set all characters to
%                           the specified value before loading the lists}
%\changes{v1.9d}{2006/02/13}{set list name before presetting}
%\changes{v1.9d}{2006/02/18}{optimise: don't reset when \texttt{preset} option is set}
%    \begin{macrocode}
  \MT@ifdefined@n@T{MT@\MT@feat @c@\csname MT@\MT@feat @c@name\endcsname @preset}{%
    \csname MT@preset@\MT@feat\endcsname
    \MT@let@nc{MT@reset@\MT@feat @codes}\relax
  }%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@get@unit}
%\changes{v1.8}{2005/04/14}{new macro: get unit for codes}
%\begin{macro}{\MT@get@unit@}
% If |unit| contains an |em| or |ex|, we use the corresponding \cmd\fontdimen\
% to obtain the real size. Simply converting the em into points might give a
% wrong result, since the font probably isn't set up yet, so that these
% dimensions haven't been updated, either.
%    \begin{macrocode}
\def\MT@get@unit#1{%
  \expandafter\MT@get@unit@#1 e!\@nil
  \ifx\x\@empty\else\let#1\x\fi
  \@defaultunits\@tempdima#1 pt\relax\@nnil
  \ifdim\@tempdima=\z@
    \MT@warning@nl{%
      Cannot set \@nameuse{MT@abbr@\MT@feat} factors relative to zero\MessageBreak
      width. Setting factors of list `\@nameuse{MT@\MT@feat @c@name}'\MessageBreak
      relative to character widths instead}%
    \let#1\@empty
    \let\MT@get@char@unit\MT@get@charwd
  \else
    \MT@vinfo{... : Setting \@nameuse{MT@abbr@\MT@feat} factors relative
                    to \the\@tempdima}%
    \MT@count=\@tempdima\relax
  \fi
}
\def\MT@get@unit@#1e#2#3\@nil{%
  \ifx\\#3\\\let\x\@empty \else
    \if m#2%
      \edef\x{#1\fontdimen6\MT@font}%
    \else
      \if x#2%
        \edef\x{#1\fontdimen5\MT@font}%
      \fi
    \fi
  \fi
}
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\begin{macro}{\MT@set@inputenc}
% The configurations may be under the regime of an input encoding.
%    \begin{macrocode}
\def\MT@set@inputenc#1{%
%    \end{macrocode}
%\begin{macro}{\MT@cat}
% We remember the current category (|c| or |inh|), in case of warnings later.
%    \begin{macrocode}
  \def\MT@cat{#1}%
%    \end{macrocode}
%\end{macro}
%    \begin{macrocode}
  \edef\@tempa{MT@\MT@feat @#1@\csname MT@\MT@feat @#1@name\endcsname @inputenc}%
  \MT@ifdefined@n@T\@tempa\MT@set@inputenc@
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@set@inputenc@}
%\changes{v2.2}{2007/06/08}{only load \pkg{inputenc} files if necessary}
% More recent versions of \pkg{inputenc} remember the current encoding, so that
% we can test whether we really have to load the encoding file.
%    \begin{macrocode}
\MT@addto@setup{%
  \@ifpackageloaded{inputenc}{%
    \@ifpackagelater{inputenc}{2006/02/22}{%
      \def\MT@set@inputenc@{%
        \MT@ifstreq\inputencodingname{\csname\@tempa\endcsname}\relax
          \MT@load@inputenc
      }%
    }{%
      \let\MT@set@inputenc@\MT@load@inputenc
    }%
  }{%
    \def\MT@set@inputenc@{%
      \MT@warning@nl{Key `inputenc' used in \MT@curr@list@name, but the `inputenc'
          \MessageBreak package isn't loaded. Ignoring input encoding}%
    }%
  }%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@load@inputenc}
% Set up normal catcodes, since, \eg, \pkg{listings} would otherwise want to
% actually typeset the \pkg{inputenc} file when it is being loaded inside a
% listing.
%\changes{v2.0}{2006/09/15}{sanitise catcodes before loading input encoding
%                            (problem with \pkg{listings})}
%    \begin{macrocode}
\def\MT@load@inputenc{%
  \MT@cfg@catcodes
%<debug>\MT@dinfo@nl{1}{loading input encoding: \@nameuse{\@tempa}}%
  \inputencoding{\@nameuse{\@tempa}}%
}
%</package>
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@set@pr@heirs}
% Set the inheriting characters.
%    \begin{macrocode}
%<*pdftex-def|xetex-def|luatex-def>
\def\MT@set@pr@heirs#1{%
  \lpcode\MT@font #1=\lpcode\MT@font\MT@char\relax
  \rpcode\MT@font #1=\rpcode\MT@font\MT@char\relax
%<debug>\MT@dinfo@nl{2}{-- heir of \MT@char: #1}%
%<debug>\MT@dinfo@nl{4}{;;; lp/rp (#1): \number\lpcode\MT@font\MT@char\space/%
%<debug>                                \number\rpcode\MT@font\MT@char\space}%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@preset@pr}
%\begin{macro}{\MT@preset@pr@}
% Preset characters. Presetting them relative to their widths is not allowed.
%    \begin{macrocode}
\def\MT@preset@pr{%
  \expandafter\expandafter\expandafter\MT@preset@pr@
    \csname MT@pr@c@\MT@pr@c@name @preset\endcsname\@nil
}
\def\MT@preset@pr@#1,#2\@nil{%
  \ifx\MT@pr@unit@\@empty
    \MT@warn@preset@towidth{pr}%
    \let\MT@preset@aux\MT@preset@aux@factor
  \else
    \def\MT@preset@aux{\MT@preset@aux@space2}%
  \fi
  \MT@ifempty{#1}{\let\@tempa\@empty}{\MT@preset@aux{#1}\@tempa}%
  \MT@ifempty{#2}{\let\@tempb\@empty}{\MT@preset@aux{#2}\@tempb}%
  \MT@set@all@pr\@tempa\@tempb
}
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\begin{macro}{\MT@preset@aux}
%\begin{macro}{\MT@preset@aux@factor}
%\begin{macro}{\MT@preset@aux@space}
%\changes{v2.2}{2007/06/16}{generalised}
% Auxiliary macro for presetting. Store value \meta{\#1} in macro \meta{\#2}.
%    \begin{macrocode}
\def\MT@preset@aux@factor#1#2{%
  \@tempcntb=#1\relax
  \MT@scale@factor
  \edef#2{\number\@tempcntb}%
}
\def\MT@preset@aux@space#1#2#3{%
  \def\@tempb{#2}%
  \MT@get@space@unit#1%
  \MT@scale@to@em
  \edef#3{\number\@tempcntb}%
}
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\end{macro}
%\begin{macro}{\MT@warn@preset@towidth}
%    \begin{macrocode}
\def\MT@warn@preset@towidth#1{%
  \MT@warning@nl{%
    Cannot preset characters relative to their widths\MessageBreak
    for \@nameuse{MT@abbr@#1} list `\@nameuse{MT@#1@c@name}'. Presetting them%
    \MessageBreak relative to 1em instead}%
}
%</pdftex-def|xetex-def|luatex-def>
%    \end{macrocode}
%\end{macro}
%
%\subsubsection{Expansion}
%
%\begin{macro}{\MT@expansion}
% Set up for expansion?
%    \begin{macrocode}
%<*pdftex-def|luatex-def>
\def\MT@expansion{\MT@maybe@do{ex}}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@set@ex@codes@s}
% Setting up font expansion is a bit different because of the \opt{selected} option.
% There are two versions of this macro.
%
% If \opt{selected}|=true|, we only apply font expansion to those fonts for which a
% list has been declared (\ie, like for protrusion).
%    \begin{macrocode}
\def\MT@set@ex@codes@s{%
  \MT@if@list@exists{%
    \MT@get@ex@opt
    \let\MT@get@char@unit\relax
    \MT@reset@ef@codes
    \MT@get@inh@list
    \MT@set@inputenc{c}%
    \MT@load@list\MT@ex@c@name
    \MT@set@listname
    \MT@let@cn\@tempc{MT@ex@c@\MT@ex@c@name}%
    \expandafter\MT@set@codes\@tempc,\relax,%
    \MT@expandfont
  }\relax
}
%</pdftex-def|luatex-def>
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\MT@set@ex@codes@n}
% If, on the other hand, all characters should be expanded by the same amount,
% we only take the first optional argument to \cs{SetExpansion} into account.
%\begin{macro}{\ifMT@nonselected}
% We need this boolean in \cs{MT@if@list@exists} so that no warning for missing
% lists will be issued.
%    \begin{macrocode}
%<package>\newif\ifMT@nonselected
%    \end{macrocode}
%\end{macro}
%    \begin{macrocode}
%<*pdftex-def|luatex-def>
\def\MT@set@ex@codes@n{%
  \MT@nonselectedtrue
  \MT@if@list@exists
    \MT@get@ex@opt
  {%
    \let\MT@stretch@  \MT@stretch
    \let\MT@shrink@   \MT@shrink
    \let\MT@step@     \MT@step
    \let\MT@auto@     \MT@auto
    \let\MT@ex@factor@\MT@ex@factor
  }%
  \MT@reset@ef@codes
  \MT@expandfont
  \MT@nonselectedfalse
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@set@ex@codes}
%\changes{v1.5}{2004/12/02}{allow non-selected font expansion}
%\changes{v1.6}{2004/12/26}{introduce \texttt{factor} option}
%\changes{v1.7}{2005/02/06}{two versions of this macro}
% Default is non-selected. It can be changed in the package options.
%    \begin{macrocode}
\let\MT@set@ex@codes\MT@set@ex@codes@n
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@expandfont}
% Expand the font. For some reason, older \luatex\ versions freeze if
% the |autoexpand| modifier is missing. Can't be bothered to find out why.
% For newer versions, we could also use the function |font.setexpansion|,
% or, in the future, \pkg{luaotfload}'s expansion font feature. ^^A https://github.com/latex3/luaotfload/commit/4907e23407c52437cca56966d11d3b4548bba585
%\iffalse
% In \luatex, we try to go the |lua| way, if the |font.setexpansion| function exists.
%\changes{v2.7d}{2019/11/17}{use \luatex\ function \texttt{font.}\penalty\exhyphenpenalty\texttt{setexpansion} if available}
%\fi
%    \begin{macrocode}
%<*luatex-def>
\MT@requires@luatex3{
\MT@requires@luatex4{\let\pdffontexpand\expandglyphsinfont}\relax
\ifnum\luatexversion<79
\def\MT@expandfont{%
  \pdffontexpand\MT@font \MT@stretch@ \MT@shrink@ \MT@step@ autoexpand\relax
}
\else
\def\MT@expandfont{%
  \pdffontexpand\MT@font \MT@stretch@ \MT@shrink@ \MT@step@\relax
}
\fi
}{
%</luatex-def>
\def\MT@expandfont{%
  \pdffontexpand\MT@font \MT@stretch@ \MT@shrink@ \MT@step@ \MT@auto@\relax
}
%<luatex-def>}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@set@all@ex}
%\begin{macro}{\MT@reset@ef@codes@}
% At first, all expansion factors for the characters will be set to 1000
% (respectively the |factor| of this font).
%    \begin{macrocode}
\def\MT@set@all@ex#1{%
%<debug>\MT@dinfo@nl{3}{-- ex: setting all to \number#1}%
  \MT@do@font{\efcode\MT@font\@tempcnta=#1\relax}%
}
\def\MT@reset@ef@codes@{\MT@set@all@ex\MT@ex@factor@}
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\begin{macro}{\MT@reset@ef@codes}
% However, this is only necessary for \pdftex\ versions prior to~1.20,
% or \luatex\ $\less$~0.90 (actually, I think, 0.87).
%\changes{v1.6a}{2005/01/30}{only reset \cmd\efcode s for older \pdftex\ versions}
%\changes{v2.7}{2017/02/13}{only reset \cmd\efcode s for older \luatex\ versions}
%    \begin{macrocode}
%<pdftex-def>\MT@requires@pdftex4
%<luatex-def>\MT@requires@luatex5
{
  \def\MT@reset@ef@codes{%
    \ifnum\MT@ex@factor@=\@m \else
      \MT@reset@ef@codes@
    \fi
  }
}{
  \let\MT@reset@ef@codes\MT@reset@ef@codes@
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@ex@split@val}
% There's only one number per character.
%    \begin{macrocode}
\def\MT@ex@split@val#1\relax{%
  \@tempcntb=#1\relax
%    \end{macrocode}
% Take an optional factor into account.
%    \begin{macrocode}
  \ifnum\MT@ex@factor@=\@m \else
    \MT@scale\@tempcntb \MT@ex@factor@ \@m
  \fi
  \ifnum\@tempcntb > \MT@ex@max
    \MT@warn@ex@too@large\MT@ex@max
  \else
    \ifnum\@tempcntb < \MT@ex@min
      \MT@warn@ex@too@large\MT@ex@min
    \fi
  \fi
  \efcode\MT@font\MT@char=\@tempcntb
%<debug>\MT@dinfo@nl{4}{::: ef (\MT@char): \number\efcode\MT@font\MT@char: [#1]}%
%    \end{macrocode}
% Heirs, heirs, I love thy heirs.
%    \begin{macrocode}
  \MT@ifdefined@c@T\MT@ex@inh@name{%
    \MT@ifdefined@n@T{MT@inh@\MT@ex@inh@name @\MT@char @}{%
      \MT@exp@cs\MT@map@tlist@c{MT@inh@\MT@ex@inh@name @\MT@char @}\MT@set@ex@heirs
    }%
  }%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@warn@ex@too@large}
%    \begin{macrocode}
\def\MT@warn@ex@too@large#1{%
  \MT@warning@nl{Expansion factor \number\@tempcntb\space too large for
    character\MessageBreak `\the\MT@toks' in \MT@curr@list@name.\MessageBreak
    Setting it to the maximum of \number#1}%
  \@tempcntb=#1\relax
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@get@ex@opt}
%\changes{v1.9d}{2006/02/13}{fix: evaluate \texttt{preset}}
%\begin{macro}{\MT@ex@factor@}
%\begin{macro}{\MT@stretch@}
%\begin{macro}{\MT@shrink@}
%\begin{macro}{\MT@step@}
%\begin{macro}{\MT@auto@}
% Apply different values to this font?
%    \begin{macrocode}
\def\MT@get@ex@opt{%
  \MT@set@listname
  \MT@ifdefined@n@TF{MT@ex@c@\MT@ex@c@name @factor}{%
    \MT@let@cn\MT@ex@factor@{MT@ex@c@\MT@ex@c@name @factor}%
    \MT@vinfo{... : Multiplying expansion factors by \number\MT@ex@factor@/1000}%
  }{%
    \let\MT@ex@factor@\MT@ex@factor
  }%
  \MT@get@ex@opt@{stretch}{Setting stretch limit to \number\MT@stretch@}%
  \MT@get@ex@opt@{shrink} {Setting shrink limit to \number\MT@shrink@}%
  \MT@get@ex@opt@{step}   {Setting expansion step to \number\MT@step@}%
%<luatex-def>  \MT@requires@luatex3\relax{%
  \MT@get@ex@opt@{auto}{\MT@ifstreq{\MT@auto@}{autoexpand}{En}{Dis}abling automatic expansion}%
%<luatex-def>  }%
  \MT@ifdefined@n@T{MT@ex@c@\MT@ex@c@name @preset}{%
    \MT@preset@ex
    \let\MT@reset@ef@codes\relax
  }%
}
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\begin{macro}{\MT@get@ex@opt@}
%    \begin{macrocode}
\def\MT@get@ex@opt@#1#2{%
  \MT@ifdefined@n@TF{MT@ex@c@\MT@ex@c@name @#1}{%
    \MT@let@nn{MT@#1@}{MT@ex@c@\MT@ex@c@name @#1}%
    \MT@vinfo{... : #2}%
  }{%
    \MT@let@nn{MT@#1@}{MT@#1}%
  }%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@set@ex@heirs}
%    \begin{macrocode}
\def\MT@set@ex@heirs#1{%
  \efcode\MT@font#1=\efcode\MT@font\MT@char
%<debug>\MT@dinfo@nl{2}{-- heir of \MT@char: #1}%
%<debug>\MT@dinfo@nl{4}{::: ef (#1) \number\efcode\MT@font\MT@char}%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@preset@ex}
%    \begin{macrocode}
\def\MT@preset@ex{%
  \@tempcntb=\csname MT@ex@c@\MT@ex@c@name @preset\endcsname\relax
  \MT@scale@factor
  \MT@set@all@ex\@tempcntb
}
%</pdftex-def|luatex-def>
%    \end{macrocode}
%\end{macro}
%
%\subsubsection{Interword spacing (glue)}
%
%\begin{macro}{\MT@spacing}
% Adjustment of interword spacing? Only works with \pdftex.
%    \begin{macrocode}
%<*pdftex-def>
\MT@requires@pdftex6{
\def\MT@spacing{\MT@maybe@do{sp}}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@set@sp@codes}
% This is all the same.
%    \begin{macrocode}
\def\MT@set@sp@codes{%
  \MT@if@list@exists{%
    \MT@get@opt
    \MT@reset@sp@codes
    \MT@get@inh@list
    \MT@set@inputenc{c}%
    \MT@load@list\MT@sp@c@name
    \MT@set@listname
    \MT@let@cn\@tempc{MT@sp@c@\MT@sp@c@name}%
    \expandafter\MT@set@codes\@tempc,\relax,%
  }\MT@reset@sp@codes
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@sp@split@val}
% If |unit=space|, \cs{MT@get@space@unit} will be defined to fetch the
% corresponding fontdimen (2 for the first, 3 for the second and 4 for the
% third argument).
%    \begin{macrocode}
\def\MT@sp@split@val#1,#2,#3\relax{%
  \def\@tempb{#1}%
  \MT@ifempty\@tempb\relax{%
    \MT@get@space@unit2%
    \MT@scale@to@em
    \knbscode\MT@font\MT@char=\@tempcntb
%<debug>\MT@dinfo@nl{4}{;;; knbs (\MT@char): \number\knbscode\MT@font\MT@char: [#1]}%
  }%
  \def\@tempb{#2}%
  \MT@ifempty\@tempb\relax{%
    \MT@get@space@unit3%
    \MT@scale@to@em
    \stbscode\MT@font\MT@char=\@tempcntb
%<debug>\MT@dinfo@nl{4}{;;; stbs (\MT@char): \number\stbscode\MT@font\MT@char: [#2]}%
  }%
  \def\@tempb{#3}%
  \MT@ifempty\@tempb\relax{%
    \MT@get@space@unit4%
    \MT@scale@to@em
    \shbscode\MT@font\MT@char=\@tempcntb
%<debug>\MT@dinfo@nl{4}{;;; shbs (\MT@char): \number\shbscode\MT@font\MT@char: [#3]}%
  }%
  \MT@ifdefined@c@T\MT@sp@inh@name{%
    \MT@ifdefined@n@T{MT@inh@\MT@sp@inh@name @\MT@char @}{%
      \MT@exp@cs\MT@map@tlist@c{MT@inh@\MT@sp@inh@name @\MT@char @}\MT@set@sp@heirs
    }%
  }%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@set@sp@heirs}
%    \begin{macrocode}
\def\MT@set@sp@heirs#1{%
  \knbscode\MT@font#1=\knbscode\MT@font\MT@char
  \stbscode\MT@font#1=\stbscode\MT@font\MT@char
  \shbscode\MT@font#1=\shbscode\MT@font\MT@char
%<debug>\MT@dinfo@nl{2}{-- heir of \MT@char: #1}%
%<debug>\MT@dinfo@nl{4}{;;; knbs/stbs/shbs (#1): \number\knbscode\MT@font\MT@char/%
%<debug>        \number\stbscode\MT@font\MT@char/\number\shbscode\MT@font\MT@char}%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@set@all@sp}
%\begin{macro}{\MT@reset@sp@codes}
%\begin{macro}{\MT@reset@sp@codes@}
%    \begin{macrocode}
\def\MT@set@all@sp#1#2#3{%
%<debug>\MT@dinfo@nl{3}{-- knbs/stbs/shbs: setting all to #1/#2/#3}%
  \let\MT@temp\@empty
  \MT@ifempty{#1}\relax{\g@addto@macro\MT@temp{\knbscode\MT@font\@tempcnta=#1\relax}}%
  \MT@ifempty{#2}\relax{\g@addto@macro\MT@temp{\stbscode\MT@font\@tempcnta=#2\relax}}%
  \MT@ifempty{#3}\relax{\g@addto@macro\MT@temp{\shbscode\MT@font\@tempcnta=#3\relax}}%
  \MT@do@font\MT@temp
}
\def\MT@reset@sp@codes@{\MT@set@all@sp\z@\z@\z@}
\let\MT@reset@sp@codes\relax
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\end{macro}
%\begin{macro}{\MT@preset@sp}
%\begin{macro}{\MT@preset@sp@}
%    \begin{macrocode}
\def\MT@preset@sp{%
  \expandafter\expandafter\expandafter\MT@preset@sp@
    \csname MT@sp@c@\MT@sp@c@name @preset\endcsname\@nil
}
\def\MT@preset@sp@#1,#2,#3\@nil{%
  \ifx\MT@sp@unit@\@empty
    \MT@warn@preset@towidth{sp}%
    \MT@ifempty{#1}{\let\@tempa\@empty}{\MT@preset@aux@factor{#1}\@tempa}%
    \MT@ifempty{#2}{\let\@tempc\@empty}{\MT@preset@aux@factor{#2}\@tempc}%
    \MT@ifempty{#3}{\let\@tempb\@empty}{\MT@preset@aux@factor{#3}\@tempb}%
  \else
    \MT@ifempty{#1}{\let\@tempa\@empty}{\MT@preset@aux@space2{#1}\@tempa}%
    \MT@ifempty{#2}{\let\@tempc\@empty}{\MT@preset@aux@space3{#2}\@tempc}%
    \MT@ifempty{#3}{\let\@tempb\@empty}{\MT@preset@aux@space4{#3}\@tempb}%
  \fi
  \MT@set@all@sp\@tempa\@tempc\@tempb
}
}\relax
%    \end{macrocode}
%\end{macro}
%\end{macro}
%
%\subsubsection{Additional kerning}
%
%\begin{macro}{\MT@kerning}
% Again, only check for additional kerning for new versions of \pdftex.
%    \begin{macrocode}
\MT@requires@pdftex6{
\def\MT@kerning{\MT@maybe@do{kn}}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@set@kn@codes}
% It's getting boring, I know.
%    \begin{macrocode}
\def\MT@set@kn@codes{%
  \MT@if@list@exists{%
    \MT@get@opt
    \MT@reset@kn@codes
    \MT@get@inh@list
    \MT@set@inputenc{c}%
    \MT@load@list\MT@kn@c@name
    \MT@set@listname
    \MT@let@cn\@tempc{MT@kn@c@\MT@kn@c@name}%
    \expandafter\MT@set@codes\@tempc,\relax,%
  }\MT@reset@kn@codes
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@kn@split@val}
% Again, the unit may be measured in the space dimension; this time only
% \fontdim2.
%    \begin{macrocode}
\def\MT@kn@split@val#1,#2\relax{%
  \def\@tempb{#1}%
  \MT@ifempty\@tempb\relax{%
    \MT@get@space@unit2%
    \MT@scale@to@em
    \knbccode\MT@font\MT@char=\@tempcntb
%<debug>\MT@dinfo@nl{4}{;;; knbc (\MT@char): \number\knbccode\MT@font\MT@char: [#1]}%
  }%
  \def\@tempb{#2}%
  \MT@ifempty\@tempb\relax{%
    \MT@get@space@unit2%
    \MT@scale@to@em
    \knaccode\MT@font\MT@char=\@tempcntb
%<debug>\MT@dinfo@nl{4}{;;; knac (\MT@char): \number\knaccode\MT@font\MT@char: [#2]}%
  }%
  \MT@ifdefined@c@T\MT@kn@inh@name{%
    \MT@ifdefined@n@T{MT@inh@\MT@kn@inh@name @\MT@char @}{%
      \MT@exp@cs\MT@map@tlist@c{MT@inh@\MT@kn@inh@name @\MT@char @}\MT@set@kn@heirs
    }%
  }%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@set@kn@heirs}
%    \begin{macrocode}
\def\MT@set@kn@heirs#1{%
  \knbccode\MT@font#1=\knbccode\MT@font\MT@char
  \knaccode\MT@font#1=\knaccode\MT@font\MT@char
%<debug>\MT@dinfo@nl{2}{-- heir of \MT@char: #1}%
%<debug>\MT@dinfo@nl{4}{;;; knbc (#1): \number\knbccode\MT@font\MT@char/%
%<debug>                               \number\knaccode\MT@font\MT@char}%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@set@all@kn}
%\begin{macro}{\MT@reset@kn@codes}
%\begin{macro}{\MT@reset@kn@codes@}
%    \begin{macrocode}
\def\MT@set@all@kn#1#2{%
%<debug>\MT@dinfo@nl{3}{-- knac/knbc: setting all to #1/#2}%
  \let\MT@temp\@empty
  \MT@ifempty{#1}\relax{\g@addto@macro\MT@temp{\knbccode\MT@font\@tempcnta=#1\relax}}%
  \MT@ifempty{#2}\relax{\g@addto@macro\MT@temp{\knaccode\MT@font\@tempcnta=#2\relax}}%
  \MT@do@font\MT@temp
}
\def\MT@reset@kn@codes@{\MT@set@all@kn\z@\z@}
\let\MT@reset@kn@codes\relax
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\end{macro}
%\begin{macro}{\MT@preset@kn}
%\begin{macro}{\MT@preset@kn@}
%    \begin{macrocode}
\def\MT@preset@kn{%
  \expandafter\expandafter\expandafter\MT@preset@kn@
    \csname MT@kn@c@\MT@kn@c@name @preset\endcsname\@nil
}
\def\MT@preset@kn@#1,#2\@nil{%
  \ifx\MT@kn@unit@\@empty
    \MT@warn@preset@towidth{kn}%
    \let\MT@preset@aux\MT@preset@aux@factor
  \else
    \def\MT@preset@aux{\MT@preset@aux@space2}%
  \fi
  \MT@ifempty{#1}{\let\@tempa\@empty}{\MT@preset@aux{#1}\@tempa}%
  \MT@ifempty{#2}{\let\@tempb\@empty}{\MT@preset@aux{#2}\@tempb}%
  \MT@set@all@kn\@tempa\@tempb
}
}\relax
%</pdftex-def>
%    \end{macrocode}
%\end{macro}
%\end{macro}
%
%\subsubsection{\lsstyle Tracking}
%
% This only works with \pdftex\ 1.40
%\changes{v2.5}{2010/09/17}{letterspacing with \luatex\ 0.62} ^^A (beta:03)
% or \luatex\ 0.62.
%    \begin{macrocode}
%<*pdftex-def|luatex-def>
%<pdftex-def>\MT@requires@pdftex6
%<luatex-def>\MT@requires@luatex3
{
%    \end{macrocode}
%\begin{macro}{\MT@tracking}
%\changes{v2.2}{2007/02/23}{remember fonts that shouldn't be letterspaced}
%\begin{macro}{\MT@tracking@}
%\changes{v2.2}{2007/06/16}{fix: tracking couldn't be re-enabled}
%\begin{macro}{\MT@tr@font@list}
% We only check whether a font should not be letterspaced at all, not whether
% we've already done that (because we have to do it again).
%    \begin{macrocode}
\let\MT@tr@font@list\@empty
\def\MT@tracking@{%
  \MT@exp@one@n\MT@in@clist\MT@font\MT@tr@font@list
  \ifMT@inlist@\else
    \MT@maybe@do{tr}%
    \ifMT@do\else
      \xdef\MT@tr@font@list{\MT@tr@font@list\MT@font,}%
    \fi
  \fi
}
%</pdftex-def|luatex-def>
%<pdftex-def|luatex-def|letterspace>\let\MT@tracking
%<pdftex-def|luatex-def>  \MT@tracking@
%<letterspace>  \relax
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\end{macro}
%\begin{macro}{\MT@set@tr@codes}
% The tracking amount is determined by the optional argument to \cs{textls},
% settings from \cs{SetTracking}, or the global \opt{letterspace} option, in
% this order.
%
% Tracking won't work if the original font's \fontdim6 is zero, in which
% case we issue a warning (once for every font).
%    \begin{macrocode}
%<*pdftex-def|luatex-def|letterspace>
\def\MT@set@tr@codes{%
%<*pdftex-def|luatex-def>
  \MT@vinfo{Tracking font `\MT@@font'\on@line}%
  \MT@ifdefined@n@TF{\MT@@font-fake6}{%
    \expandafter\ifx\csname\MT@@font-fake6\endcsname\@empty
      \MT@warning@nl{%
        Font `\MT@@font' does not specify its\MessageBreak
        \@backslashchar fontdimen 6 (width of an `em')! Therefore,\MessageBreak
        \@nameuse{MT@abbr@\MT@feat} will not work with this font}%
      \MT@glet@nc{\MT@@font-fake6}\relax
    \fi
  }{%
  \MT@if@list@exists
    \MT@get@tr@opt
    \relax
%</pdftex-def|luatex-def>
  \MT@ifdefined@c@TF\MT@letterspace@\relax{\let\MT@letterspace@\MT@letterspace}%
  \ifnum\MT@letterspace@=\z@
%    \end{macrocode}
%\changes{v2.3d}{2009/03/05}{allow zero tracking}
% Zero tracking requires special treatment.
%    \begin{macrocode}
    \MT@set@tr@zero
  \else
%<pdftex-def|luatex-def>    \MT@vinfo{... Tracking by \number\MT@letterspace@}%
%    \end{macrocode}
% Letterspacing only works in <PDF> mode.
%    \begin{macrocode}
    \MT@warn@tracking@DVI
%    \end{macrocode}
%\begin{macro}{\MT@lsfont}
% The letterspaced font instances are saved in macros
% |\|\meta{font name}|/|\meta{letterspacing amount}|ls|.
%
%\changes{v2.2}{2007/03/07}{use \cmd\font@name, not \cs{MT@font}}
% In contrast to \cs{MT@font}, which may reflect the font characteristics more
% accurately (taking substitutions into account), \cmd\font@name\ is guaranteed
% to correspond to an actual font identifier.
%    \begin{macrocode}
    \xdef\MT@lsfont{\csname\expandafter\string\font@name
                           /\number\MT@letterspace@ ls\endcsname}%
    \expandafter\ifx\MT@lsfont\relax
%<debug>\MT@dinfo@nl{1}{... new letterspacing instance}%
%    \end{macrocode}
%\end{macro}
% In case of nested letterspacing with different amounts, we have to extract
% the base font again.
%    \begin{macrocode}
      \MT@get@ls@basefont
%    \end{macrocode}
%\changes{v2.6}{2013/07/15}{use \pkg{luaotfload}'s \texttt{kernfactor} feature if available}
% \pkg{luaotfload} provides the faux font feature |kernfactor|, which we will
% use when dealing with non-legacy fonts, as it is less problematic and faster
% than the \pdftex\ primitive \cmd\letterspacefont.
%    \begin{macrocode}
%<*luatex-def|letterspace>
      \MT@if@luaotf@font{%
%<luatex-def&debug>\MT@dinfo@nl{1}{... luaotf font: \MessageBreak
%<luatex-def&debug>         \expandafter\fontname\font@name}%
        \ifnum\MT@letterspace@<\z@\def\MT@minus{-}\else\let\MT@minus\@empty\fi
        \global\expandafter\font\MT@lsfont=%
          \expandafter\MT@exp@two@c\expandafter\MT@ls@fontspec@font
            \expandafter\fontname\expandafter\font@name\space \@nil
      }{%
%</luatex-def|letterspace>
%<luatex-def&debug>\MT@dinfo@nl{1}{... legacy font}%
      \global\expandafter\letterspacefont\MT@lsfont\font@name\MT@letterspace@
%<luatex-def|letterspace>      }%
%    \end{macrocode}
%\changes{v2.2}{2007/06/16}{possibility to customise interword spacing}
% Scale interword spacing (not configurable in \letterspace).
%    \begin{macrocode}
%<*pdftex-def|luatex-def>
      \MT@ifdefined@c@TF\MT@tr@ispace
        {\let\@tempa\MT@tr@ispace}%
        {\edef\@tempa{\MT@letterspace@*,,}}%
      \MT@ifdefined@c@TF\MT@tr@ospace
        {\edef\@tempa{\@tempa,\MT@tr@ospace}}%
        {\edef\@tempa{\@tempa,,,}}%
      \expandafter\MT@tr@set@space\@tempa,%
%</pdftex-def|luatex-def>
%<*letterspace>
      % spacing = {<letterspace amount>*,,}
      \fontdimen2\MT@lsfont=\dimexpr\numexpr 1000+\MT@letterspace@\relax sp
                                            * \fontdimen2\MT@lsfont/1000\relax
%</letterspace>
%    \end{macrocode}
%\changes{v2.3}{2007/11/03}{possibility to customise outer kerning
%                           (suggested by \contributor Stephan Hennig <stephanhennig\at arcor.de>)}
%                            ^^A MID: <46aa1cbb$0$31620$9b4e6d93@newsspool3.arcor-online.net>
% Adjust outer kerning (\microtype\ only).
%    \begin{macrocode}
%<*pdftex-def|luatex-def>
      \MT@ifdefined@c@TF\MT@tr@okern{\let\@tempa\MT@tr@okern}{\def\@tempa{*,*}}%
      \expandafter\MT@tr@set@okern\@tempa,%
%    \end{macrocode}
%\changes{v2.2}{2007/02/23}{disable ligatures in letterspaced fonts manually
%                           (due to change in \pdftex\ 1.40.4)}
% Disable ligatures (not configurable in \letterspace).
%    \begin{macrocode}
      \MT@ifdefined@c@T\MT@tr@ligatures\MT@tr@noligatures
%</pdftex-def|luatex-def>
%<*letterspace>
      % no ligatures = {f}
      \tagcode\MT@lsfont`f=\m@ne
%</letterspace>
%    \end{macrocode}
% Adjust protrusion values now, and maybe later (in \cs{MT@pr@split@val})
% (not for \luatex, though, where letterspacing does not interfere with protrusion).
%\changes{v2.3}{2007/07/27}{also adjust tracking if protrusion is not enabled,
%                           and even for \letterspace\
%                           (reported by \contributor Stephan Hennig <stephanhennig\at arcor.de>)}
%                               ^^A MID: <46a9c6c6$0$21005$9b4e6d93@newsspool1.arcor-online.net>
%\changes{v2.3b}{2008/05/12}{fix: protrusion adjustment only for new fonts
%                            (reported by \contributor Wolfram Schaalo <schaalo\at gmx.net>)}
%                                                              ^^A private mail, 2008/05/12
%    \begin{macrocode}
%<luatex-def|letterspace>      \MT@if@luaotf@font\relax{%
%<debug>\MT@dinfo@nl{2}{... compensating for tracking (\number\MT@letterspace@)}%
      \MT@do@font{\lpcode\MT@lsfont\@tempcnta=\numexpr\MT@letterspace@/2\relax
                  \rpcode\MT@lsfont\@tempcnta=\numexpr\MT@letterspace@/2\relax}%
      \let\MT@the@pr@code\MT@the@pr@code@tr
%<luatex-def|letterspace>     }%
    \fi
%    \end{macrocode}
% Finally, let the letterspaced font propagate.
% With \luatex, we also need to load.
%\changes{v2.5a}{2013/05/15}{fix: load font for \pkg{fontspec}} ^^A for MT@get@slot
%    \begin{macrocode}
    \aftergroup\MT@set@lsfont
%<pdftex-def|luatex-def>    \let\MT@font\MT@lsfont
%<luatex-def>    \MT@if@luaotf@font\MT@font\relax
%    \end{macrocode}
%\begin{macro}{\MT@set@curr@ls}
%\begin{macro}{\MT@curr@ls}
% We need to remember the current letterspacing amount (for \cs{lslig}).
%    \begin{macrocode}
    \xdef\MT@set@curr@ls{\def\noexpand\MT@curr@ls{\MT@letterspace@}}%
    \aftergroup\MT@set@curr@ls
%    \end{macrocode}
%\end{macro}
%\end{macro}
% Adjust surrounding spacing and kerning.
%\begin{macro}{\MT@set@curr@os}
%\changes{v2.3}{2007/11/03}{adjusting spaces made more reliable}
% We get the current outer spacing and adjust it, then, after the end of the
% current outer group, set the current outer spacing, again, and adjust.
%    \begin{macrocode}
%<*pdftex-def|luatex-def>
    \MT@outer@space=\csname MT@outer@space\expandafter\string\font@name\endcsname\relax
    \xdef\MT@set@curr@os{\MT@outer@space=\the\MT@outer@space\relax}%
    \MT@tr@outer@l
%</pdftex-def|luatex-def>
%    \end{macrocode}
%\end{macro}
% If \cs{MT@ls@adjust} is empty, it's the starred version of \cs{textls}.
% Use scaling to avoid a `Dimension too large'.
%    \begin{macrocode}
    \ifx\MT@ls@adjust\@empty
%<letterspace>      % \textls : outer kerning = {*,*} ; \textls* : outer kerning = {0,0}
      \MT@outer@kern=-\dimexpr\MT@letterspace@ sp * \fontdimen6\font@name/2000\relax
      \MT@ls@outer@k
%    \end{macrocode}
% Otherwise, get the current outer kerning and adjust it, for left and right
% side (\microtype\ only).
%    \begin{macrocode}
%<*pdftex-def|luatex-def>
    \else
      \MT@outer@kern=\expandafter\expandafter\expandafter\@firstoftwo
                      \csname MT@outer@kern\expandafter\string\font@name\endcsname\relax
      \ifdim\MT@outer@kern=\z@\else \MT@ls@outer@k \fi
      \MT@outer@kern=\expandafter\expandafter\expandafter\@secondoftwo
                      \csname MT@outer@kern\expandafter\string\font@name\endcsname\relax
%</pdftex-def|luatex-def>
%<*letterspace>
      \xdef\MT@set@curr@ok{\MT@outer@kern=\the\MT@outer@kern\relax}%
      \MT@afteraftergroup{%
        \MT@set@curr@ok
        \noexpand\MT@ls@outer@k
      }%
%</letterspace>
    \fi
%<*pdftex-def|luatex-def>
%    \end{macrocode}
%\begin{macro}{\MT@set@curr@ok}
% Carry the outer kerning amount to outside the next group, then set outer
% spacing (which will set kerning, if no space follows).
%    \begin{macrocode}
    \xdef\MT@set@curr@ok{\MT@outer@kern=\the\MT@outer@kern\relax}%
%    \end{macrocode}
%\end{macro}
% Stuff to be done after the letterspace group. The \letterspace\ package
% only adjusts the kerning.
%    \begin{macrocode}
    \MT@afteraftergroup{%
      \MT@set@curr@os
      \MT@set@curr@ok
      \noexpand\MT@tr@outer@r
    }%
%</pdftex-def|luatex-def>
  \fi
%<pdftex-def|luatex-def>  }%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@afteraftergroup}
% This helper macro carries stuff outside of the current group to the end of
% the next group, but will then respect grouping, which is crucial for nested
% letterspacing. (Following an idea of Will Robertson.)^^A https://tex.stackexchange.com/a/56319
%\changes{v2.5a}{2013/05/15}{fix: get outer kerning and spacing of nested letterspacing right}
%    \begin{macrocode}
\def\MT@afteraftergroup#1{%
%<!letterspace>  \MT@maybe@gobble@with@tikz{%
    \MT@ifdefined@n@TF{MT@aftergroup@\number\currentgrouplevel}\relax{%
      \MT@exp@cs\xdef{MT@aftergroup@\number\currentgrouplevel}%
        {\MT@exp@cs\MT@glet{MT@aftergroup@\number\currentgrouplevel}\noexpand\@undefined#1}%
      \expandafter\aftergroup\expandafter\aftergroup\MT@exp@cs\aftergroup
        {MT@aftergroup@\number\currentgrouplevel}%
    }%
%<!letterspace>  }%
}
%</pdftex-def|luatex-def|letterspace>
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@ls@fontspec@colon}
%\begin{macro}{\MT@ls@fontspec@font}
%\changes{v2.6a}{2016/05/03}{fix for value of \textpm1000}
%\changes{v2.7}{2017/02/10}{fix for `\texttt{file:}\meta{font}' spec
%                            (reported by \contributor Reinhard Kotucha <reinhard.kotucha\at web.de>)}
%                            ^^A http://tug.org/pipermail/lualatex-dev/2017-February/001670.html
% Add the |kernfactor| feature to a font loaded by \pkg{fontspec}
% (we might have to add the colon ourselves).
%    \begin{macrocode}
%<*luatex-def|letterspace>
\def\MT@ls@fontspec@colon#1:#2:#3:#4\@nil{\ifx\\#3\\#1:#2\else#1:#2:#3\fi}
\def\MT@ls@fontspec@font#1 #2\@nil{%
  "\MT@ls@fontspec@colon#1:::\relax\@nil
    kernfactor=\MT@minus \ifnum\MT@letterspace@=1000 1\else 0.%
         \ifnum\MT@minus\MT@letterspace@<100 0\fi
         \ifnum\MT@minus\MT@letterspace@<10  0\fi
        \number\MT@minus\MT@letterspace@ \fi;"
  \ifx\\#2\\ at \f@size pt\else#2\fi\relax
}
%</luatex-def|letterspace>
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\begin{macro}{\MT@get@tr@opt}
% Various settings (only for the \microtype\ version).
%    \begin{macrocode}
%<*pdftex-def|luatex-def>
\def\MT@get@tr@opt{%
  \MT@set@listname
  \let\MT@tr@factor@\@m
%    \end{macrocode}
%\begin{macro}{\MT@tr@unit@}
% Different unit (for |letterspace| and/or |(outer)spacing|)?
%\changes{v2.8}{2020/11/22}{fix: allow unit regardless whether letterspacing is set}
%    \begin{macrocode}
  \MT@ifdefined@n@T{MT@tr@c@\MT@tr@c@name @unit}{%
    \MT@let@cn\MT@tr@unit@{MT@tr@c@\MT@tr@c@name @unit}%
    \ifdim\MT@tr@unit@=1em
      \let\MT@tr@unit@\@undefined
    \else
      \MT@get@unit\MT@tr@unit@
    \fi
  }%
  \MT@ifdefined@n@T{MT@tr@c@\MT@tr@c@name}{%
    \MT@let@cn\MT@letterspace{MT@tr@c@\MT@tr@c@name}%
    \MT@ifdefined@c@T\MT@tr@unit@{%
      \let\@tempb\MT@letterspace
      \MT@scale@to@em
      \edef\MT@letterspace{\number\@tempcntb}%
    }%
  }%
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@tr@ispace}
%\begin{macro}{\MT@tr@ospace}
% Adjust interword spacing.
%    \begin{macrocode}
  \MT@get@tr@opt@{spacing}     {ispace}%
  \MT@get@tr@opt@{outerspacing}{ospace}%
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\begin{macro}{\MT@tr@okern}
% Adjust outer kerning.
%    \begin{macrocode}
  \MT@get@tr@opt@{outerkerning}{okern}%
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@tr@ligatures}
% Which ligatures should we disable (empty means all, undefined none)?
%    \begin{macrocode}
  \MT@get@tr@opt@{noligatures} {ligatures}%
}
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\begin{macro}{\MT@get@tr@opt@}
%    \begin{macrocode}
\def\MT@get@tr@opt@#1#2{%
  \MT@ifdefined@n@T{MT@tr@c@\MT@tr@c@name @#1}%
    {\MT@let@nn{MT@tr@#2}{MT@tr@c@\MT@tr@c@name @#1}}%
}
%</pdftex-def|luatex-def>
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@set@lsfont}
% Redefine \cmd\font@name, which will be called a second later (in
% \cmd\selectfont).
%    \begin{macrocode}
%<*pdftex-def|luatex-def|letterspace>
%<plain>\MT@requires@latex2{
\def\MT@set@lsfont{\MT@exp@two@c\let\font@name\MT@lsfont}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\lsstyle}
%\changes{v2.0}{2005/09/21}{new command: letterspacing} ^^A (beta:1)
%\changes{v2.0}{2006/09/19}{fix: font switches don't pose a problem anymore} ^^A (beta:8)
%\changes{v2.0}{2006/09/21}{fix: letterspacing commands may be nested} ^^A (beta:8)
%\changes{v2.0}{2006/12/28}{totally redone, using the new \cmd\letterspacefont}
%\changes{v2.3d}{2008/11/16}{make invalid in math mode}
%\changes{v2.3d}{2009/01/07}{disable for \luatex}
% Disable the tests whether the font should be letterspaced, then trigger the
% setup.
% Only \cs{textls} can be used in math mode (\cs{lsstyle} may be used inside
% another text switch, of course).
%\changes{v2.5}{2012/11/14}{fix: ensure to set up math fonts (reported by \contributor RazorXsr <@\at @>)}
%                           ^^A https://tex.stackexchange.com/questions/82686/settracking-in-the-math-environment
%\changes{v2.6}{2014/09/07}{fix: ensure to set up math fonts (reported by \contributor kleenstar <@\at @>)}
%                           ^^A https://tex.stackexchange.com/questions/187655/microtype-gives-wrong-letterspacing-in-math-mode
% Still, we have to ensure that math fonts are set up again.
%\changes{v2.7}{2016/08/03}{fix: prevent infinite loop with \pkg{psnfss} and \pkg{exscale} packages
%                            (reported by \contributor user11126 <@\at @>,
%                             solution by \contributor Ulrike Fischer <fischer\at troubleshooting-tex.de>)}
%                           ^^A https://tex.stackexchange.com/questions/316231/microtype-and-exscale-crashing-in-texlive-2016#comment771828_316252
% Setting \cmd\glb@currsize\ globally to \cmd\@empty\ (our previous solution) could
% throw us into an infinite loop (\eg, with the \pkg{psnfss} packages,
% via \cmd\every@math@size), so we issue \cmd\glb@settings\ instead.
%\changes{v2.8}{2020/05/26}{fix: enforce math setup, again}
% However, in certain situations, we may still miss some math fonts, so
% let's try to also enforce it by emptying \cmd\glb@currsize, fingers crossed.
% The overhead seems small.
%    \begin{macrocode}
\DeclareRobustCommand\lsstyle{%
  \not@math@alphabet\lsstyle\textls
  \let\glb@currsize\@empty
%<pdftex-def|luatex-def>  \MT@maybe@gobble@with@tikz{\aftergroup\glb@settings}%
%<pdftex-def|luatex-def>  \def\MT@feat{tr}%
  \let\MT@tracking\MT@set@tr@codes
  \selectfont
}
%    \end{macrocode}
% Now the definitions for the \letterspace\ package with plain \TeX.
%    \begin{macrocode}
%<*plain>
}{
\def\MT@set@lsfont{\MT@lsfont}
\def\lsstyle{%
  \begingroup
  \escapechar\m@ne
  \xdef\font@name{\csname\expandafter\string\the\font\endcsname}%
  \MT@set@tr@codes
  \endgroup
}
\let\textls\@undefined
\let\lslig\@undefined
}
%</plain>
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\lslig}
%\changes{v2.1}{2007/01/17}{new command: protect ligatures in letterspaced text}
%\changes{v2.2}{2007/02/25}{always defined}
%\changes{v2.3}{2007/11/03}{redone: extract outer kerns from current letterspacing
%                           amount}
% For Fraktur fonts, some ligatures shouldn't be broken up. This command will
% temporarily select the base font and insert the correct kerning.
%    \begin{macrocode}
\DeclareRobustCommand\lslig[1]{%
  {\MT@ifdefined@c@TF\MT@curr@ls{%
     \escapechar\m@ne
     \MT@get@ls@basefont
     \MT@outer@kern=\dimexpr\MT@curr@ls sp * \fontdimen6\font@name/2000\relax
     \kern\MT@outer@kern
     \font@name #1%
     \kern\MT@outer@kern
  }{#1}}%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@ls@basefont}
%\begin{macro}{\MT@get@ls@basefont}
%\changes{v2.1}{2007/01/19}{redone: use \cmd\pdfmatch\ to make it bullet-proof}
% \pdftex\ cannot letterspace fonts that already are letterspaced. Therefore,
% we have to save the base font in |\|\meta{font name}|@base|.
%
%\changes{v2.2}{2007/02/18}{fix again: remember base font in a macro}
% The previous solution (checking the macro's meaning with \cmd\pdfmatch),
% where we were loading the base font via the \cmd\font\ primitive again,
% would destroy all previously set up micro-typographic features of the font.
%    \begin{macrocode}
\def\MT@get@ls@basefont{%
  \xdef\MT@ls@basefont{\csname\expandafter\string\font@name @base\endcsname}%
  \expandafter\ifx\MT@ls@basefont\relax
    \MT@exp@two@c\MT@glet\MT@ls@basefont\font@name
  \else
%<debug>\MT@dinfo@nl{1}{... fixing base font}%
    \MT@exp@two@c\let\font@name\MT@ls@basefont
  \fi
}
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\begin{macro}{\MT@set@lsbasefont}
%\begin{macro}{\MT@set@tr@zero}
%\changes{v2.3d}{2009/03/05}{fix: allow switching off tracking
%                            (reported by \contributor Ulrich Dirr <ud\at mucschach.de>)}
%                                                          ^^A private mail, 2009/02/22
% If tracking is switched off in the middle of the document, or if \cs{textls}
% is called with a zero letterspacing amount, we have to retrieve the base font
% and select it.
%    \begin{macrocode}
\def\MT@set@lsbasefont{\MT@exp@two@c\let\font@name\MT@ls@basefont}
\def\MT@set@tr@zero{%
%<debug>\MT@dinfo@nl{1}{... zero tracking}%
  \xdef\MT@ls@basefont{\csname\expandafter\string\font@name @base\endcsname}%
  \expandafter\ifx\MT@ls@basefont\relax \else
%<debug>\MT@dinfo@nl{1}{... fixing base font}%
    \aftergroup\MT@set@lsbasefont
  \fi
}
%</pdftex-def|luatex-def|letterspace>
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\begin{macro}{\MT@tr@noligatures}
% \pdftex\ 1.40.0--1.40.3 disabled all ligatures in letterspaced fonts.
%    \begin{macrocode}
%<*pdftex-def|luatex-def>
%<pdftex-def>\MT@requires@pdftex7{
  \def\MT@tr@noligatures{%
    \ifx\MT@tr@ligatures\@empty
      \MT@noligatures@\MT@lsfont\@undefined
    \else
      \MT@noligatures@\MT@lsfont\MT@tr@ligatures
    \fi
  }
%<*pdftex-def>
}{
  \def\MT@tr@noligatures{%
    \MT@warning@nl{%
      Disabling selected ligatures is only possible since\MessageBreak
      pdftex 1.40.4. Disabling all ligatures instead}%
    \MT@glet\MT@tr@noligatures\relax
  }
}
%</pdftex-def>
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@outer@space}
% A new skip for outer spacing.
%    \begin{macrocode}
\newskip\MT@outer@space
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@tr@set@space}
% Adjust interword spacing (\fontdim2,3,4) for inner and outer space.
% For inner spacing, the font dimensions will be adjusted, the settings for
% outer spacing will be remembered in a macro.
%\todo{don't add stretch components if \pkg{ragged2e} is active?} ^^A reported by \contributor Leo ? <sdl.web\at gmail.com>, MID: <wqlfwxsuo6h.fsf@pip.srcf.ucam.org>
%^^A or in fact, shouldn't we test whether \spaceskip<>0pt ?
%    \begin{macrocode}
\def\MT@tr@set@space#1,#2,#3,#4,#5,#6,{%
%<debug>\MT@dinfo@nl2{... orig. space: \the\fontdimen2\MT@lsfont,
%<debug>    \the\fontdimen3\MT@lsfont, \the\fontdimen4\MT@lsfont
%<debug>    \MessageBreak... (#1,#2,#3) (#4,#5,#6)}%
  \let\MT@temp\@empty
  \MT@tr@set@space@{#1}{#4}{2}\@empty
  \MT@tr@set@space@{#2}{#5}{3}\@plus
  \MT@tr@set@space@{#3}{#6}{4}\@minus
  \MT@glet@nc{MT@outer@space\expandafter\string\font@name}\MT@temp
%<debug>\MT@dinfo@nl2{... inner space: \the\fontdimen2\MT@lsfont,
%<debug>    \the\fontdimen3\MT@lsfont, \the\fontdimen4\MT@lsfont}%
%<debug>\MT@dinfo@nl2{... outer space: \MT@temp}%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@tr@set@space@}
% If settings for outer spacing \meta{\#2} don't exist, they will be inherited
% from the inner spacing settings \meta{\#1}.
%\changes{v2.8}{2020/11/24}{simplified}
%    \begin{macrocode}
\def\MT@tr@set@space@#1#2#3#4{%
  \MT@ifempty{#2}{%
    \MT@ifempty{#1}\relax{%
      \MT@tr@set@space@@{#1}{#3}{1000}%
      \fontdimen#3\MT@lsfont=\@tempdima
    }%
    \edef\MT@temp{\MT@temp#4\the\fontdimen#3\MT@lsfont}%
  }{%
    \MT@tr@set@space@@{#2}{#3}{2000}%
    \edef\MT@temp{\MT@temp#4\the\@tempdima}%
    \MT@ifempty{#1}\relax{%
      \MT@tr@set@space@@{#1}{#3}{1000}%
      \fontdimen#3\MT@lsfont=\@tempdima
    }%
  }%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@tr@set@space@@}
% If the value is followed by an asterisk, the fontdimen will be scaled by the
% respective amount, otherwise the value denotes the desired dimension in the
% respective unit.
%    \begin{macrocode}
\def\MT@tr@set@space@@#1#2#3{%
  \MT@test@ast#1*\@nil{%
    \MT@ifdefined@c@TF\MT@tr@unit@
      {\edef\@tempb{#1}\MT@scale@to@em}
      {\@tempcntb=#1\relax}%
    \@tempdima=\dimexpr\@tempcntb sp*\MT@dimen@six/1000\relax
%    \end{macrocode}
% For \fontdim2, we also have to subtract the kerning that letterspacing adds
% to each side of the characters (only half if it's for outer spacing).
%    \begin{macrocode}
    \ifnum#2=\tw@
      \advance\@tempdima -\dimexpr\MT@letterspace@ sp*\MT@dimen@six/#3\relax
    \fi
  }{%
    \MT@ifempty\@tempa{\let\@tempa\MT@letterspace@}\relax
    \@tempdima=\dimexpr \numexpr1000+\@tempa sp *\fontdimen#2\MT@lsfont/1000\relax
  }%
%<debug>\MT@dinfo@nl3{... : font dimen #2 (#1): \the\@tempdima}%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@tr@outer@l}
% Recall the last skip (must really be an interword space, not just a marker,
%\changes{v2.3}{2007/10/23}{only change pre outer space if it contains shrink}
% nor a `hard' space, \ie, one that doesn't contain stretch or shrink parts).
%\changes{v2.3b}{2008/05/12}{fix: only in horizontal mode}
%    \begin{macrocode}
\def\MT@tr@outer@l{%
  \ifhmode
    \ifdim\lastskip>5sp
      \edef\x{\the\lastskip minus 0pt}%
      \setbox\z@\hbox{\MT@outer@space=\x}%
      \ifdim\wd\z@>\z@
%<debug>\MT@dinfo2{[[[ adjusting pre space: \the\MT@outer@space}%
        \unskip \hskip\MT@outer@space\relax
%    \end{macrocode}
% Disable left outer kerning.
%    \begin{macrocode}
        \let\MT@ls@outer@k\relax
      \else
%    \end{macrocode}
%\changes{v2.3b}{2008/05/18}{make \cmd\spaceskip-aware (\pkg{ragged2e})}
% The \pkg{ragged2e} package sets \cmd\spaceskip\ without glue.
%    \begin{macrocode}
        \ifdim\lastskip=%
            \ifnum\spacefactor<2000
              \spaceskip
            \else
              \ifdim\xspaceskip=\z@
                \dimexpr\spaceskip+\fontdimen7\font@name\relax
              \else
                \xspaceskip
              \fi
            \fi
%<debug>\MT@dinfo2{[[[ adjusting pre space (skip): \the\MT@outer@space}%
          \unskip \hskip\MT@outer@space\relax
          \let\MT@ls@outer@k\relax
        \fi
      \fi
    \fi
  \fi
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@tr@outer@next}
%\begin{macro}{\MT@tr@outer@r}
% \microtype\ also adjusts spacing.
% The following is borrowed from \pkg{soul}. I've added the cases for italic
% correction, since tracking may also be triggered by text commands (\eg,
% \cmd\textsc).
%    \begin{macrocode}
\def\MT@tr@outer@r{%
  \futurelet\MT@tr@outer@next\MT@tr@outer@r@
}
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\begin{macro}{\MT@if@outer@next}
% We avoid using \cs{ifx} tests, in case \cs{MT@tr@outer@next} is \cmd\let\ to
% \cs{fi} etc.
%\changes{v2.5}{2012/02/20}{fix: conflict with \pkg{amsmath}
%                           (reported by \contributor Scott Pakin <scott\at pakin.org>)}
%                            ^^A private mail, 2012/02/09
%                            ^^A (beta:09)
%    \begin{macrocode}
\def\MT@if@outer@next#1{%
  \ifx\MT@tr@outer@next#1\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@tr@outer@r@}
%    \begin{macrocode}
\def\MT@tr@outer@r@{%
  \def\MT@temp*{}%
%    \end{macrocode}
% Don't adjust in math mode.
%\changes{v2.3d}{2008/11/16}{fix: don't adjust in math mode
%                            (reported by \contributor Christoph Bier <christoph.bier\at web.de>)}
%                                                   ^^A MID: <6oapk7F2lvo6U1@mid.individual.net>
% There was a tricky bug when \cs{textls} was the last command in a
% \cmd\mathchoice\ group.
%    \begin{macrocode}
  \ifmmode \else
%    \end{macrocode}
% A similar bug occurred when adjustment would happen inside a discretionary
% group, which we prevent here.
%\changes{v2.3d}{2009/02/08}{fix: don't adjust inside discretionary
%                            (reported by \contributor Maverick Woo <maverick\at cs.cmu.edu>)}
%                                                  ^^A private mail, 2009/02/07
% This only works with \etex\ (which we know is available).
%\changes{v2.3b}{2008/05/18}{additional test for horizontal mode}
%    \begin{macrocode}
    \ifnum\currentgrouptype=10 \else
      \def\MT@temp*##1{\ifhmode\hskip\MT@outer@space
%<debug>\MT@dinfo2{]]] adjusting post space (1): \the\MT@outer@space}%
        \fi}%
      \expandafter\ifcat\expandafter\noexpand\csname MT@tr@outer@next\endcsname\egroup
%    \end{macrocode}
%\changes{v2.3c}{2008/09/18}{additional test for horizontal mode
%                            (reported by \contributor Sveinung Heggen <sveinung.heggen\at orkla.no>)}
%                                                                       ^^A private mail, 2008/09/18
%    \begin{macrocode}
        \ifhmode\unkern\fi\egroup
        \MT@set@curr@ok \MT@set@curr@os
        \def\MT@temp*{\afterassignment\MT@tr@outer@r\let\MT@temp=}%
      \else
%    \end{macrocode}
% If the next token is \cmd\maybe@ic\ (from an enclosing text command), we
% gobble it, read the next one, feed it to \cmd\maybe@ic@\ (via
% \cs{MT@tr@outer@icr}) and then call ourselves again.
%\changes{v2.3d}{2009/02/25}{don't use \cmd\x\
%                            (reported by \contributor Ulrich Dirr <ud\at mucschach.de>)}
%                                 ^^A private mail, 2009/02/22
%\changes{v2.3e}{2009/05/29}{fix: set current kerning and spacing again
%                            (found by \contributor Lars R\"onnb\"ack <lars.ronnback\at affecto.com>)}
%                                 ^^A <http://code.google.com/p/tufte-latex/issues/detail?id=25>
%    \begin{macrocode}
        \MT@if@outer@next\maybe@ic{%
          \MT@set@curr@ok \MT@set@curr@os
          \def\MT@temp*{\afterassignment\MT@tr@outer@icr\let\MT@temp=}%
        }{%
%    \end{macrocode}
% If the next token is \cmd\check@icr\ (from an inner text command), we insert
% ourselves just before it. This will then call \cmd\maybe@ic\ again the next
% round (which however will always insert an italic correction, since it
% doesn't read beyond our group).
%    \begin{macrocode}
          \MT@if@outer@next\check@icr{%
            \def\MT@temp*{\aftergroup\MT@tr@outer@r\check@icr\let\MT@temp=}%
          }{%
            \MT@if@outer@next\@sptoken{%
              \def\MT@temp* {\ifhmode\hskip\MT@outer@space
%<debug>\MT@dinfo2{]]] adjusting post space (2): \the\MT@outer@space}%
                \fi}%
            }{%
              \MT@if@outer@next~{%
                \def\MT@temp*~{\nobreak\hskip\MT@outer@space
%<debug>\MT@dinfo2{]]] adjusting post space (3): \the\MT@outer@space}%
                  }%
              }{%
                \MT@if@outer@next\ \relax{%
                  \MT@if@outer@next\space\relax{%
                    \MT@if@outer@next\@xobeysp\relax{%
%    \end{macrocode}
% \pkg{xspace} requires special treatment.
%    \begin{macrocode}
                      \MT@if@outer@next\xspace{%
                        \def\MT@temp*\xspace{\MT@xspace}%
                      }{%
%    \end{macrocode}
% If there's no outer spacing, there may be outer kerning.
%    \begin{macrocode}
                        \def\MT@temp*{\ifdim\MT@outer@kern=\z@\else\MT@ls@outer@k
%<debug>\MT@dinfo2{--- adjusting post kern: \the\MT@outer@kern}%
                          \fi}%
                        \MT@let@nc{MT@tr@outer@next}\relax
      }}}}}}}}\fi
  \fi\fi
  \MT@temp*%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@tr@outer@icr}
%\begin{macro}{\MT@tr@outer@icr@}
% Helper macros for the italic correction mess.
%    \begin{macrocode}
\def\MT@tr@outer@icr{\afterassignment\MT@tr@outer@icr@\MT@tr@outer@r}
\def\MT@tr@outer@icr@{%
  \let\@let@token= \MT@tr@outer@next
  \maybe@ic@
}
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\begin{macro}{\MT@xspace}
%\changes{v2.5a}{2013/05/15}{fix \texttt{outer spacing} problem with \pkg{xspace}
%                            (reported by \contributor Dave <@\at @>)}
%                            ^^A https://tex.stackexchange.com/questions/59655
%\changes{v2.6}{2014/11/22}{fix \texttt{outer spacing} problem with (not only) \pkg{algorithm}
%                           (reported by \contributor Henning <@\at @>
%                            and \contributor Ronnie Marksch <Ronnie.Marksch\at yahoo.de>)}
%                            ^^A https://tex.stackexchange.com/questions/213164
%                            ^^A MID: <mk1sqc$jve$1@speranza.aioe.org>
%\begin{macro}{\MT@xspace@}
% If the group is followed by \cmd\xspace, we first feed \cmd\xspace\ with the
% next token, then check whether it has inserted a space.
% \cmd\@let@token\ might be something evil, so it should be encapsulated here.
%    \begin{macrocode}
\def\MT@xspace{\futurelet\@let@token\MT@xspace@}
\def\MT@xspace@{\@xspace@firsttrue\@xspace
  \ifdim\lastskip>5sp
    \unskip \hskip\MT@outer@space
  \else
    \ifdim\MT@outer@kern=\z@\else\MT@ls@outer@k \fi
  \fi
}
%    \end{macrocode}
%\end{macro}
%\end{macro}
% For older \pdftex\ versions and \luatex, throw an error.
%    \begin{macrocode}
}{
  \DeclareRobustCommand\lsstyle{%
    \MT@error{Letterspacing only works with \MT@engine tex version
%<pdftex-def>      1.40%
%<luatex-def>      0.62%
      \MessageBreak or newer}
      {Upgrade \MT@engine tex, or try the `soul' package instead.}%
    \MT@glet\lsstyle\relax
  }
}
%    \end{macrocode}
% And for \xetex, too.
%    \begin{macrocode}
%</pdftex-def|luatex-def>
%<*xetex-def>
\DeclareRobustCommand\lsstyle{%
  \MT@error{Letterspacing currently doesn't work with xetex}
           {Run pdftex or luatex, or use the `soul' package instead.}%
  \MT@glet\lsstyle\relax
}
%</xetex-def>
%    \end{macrocode}
%\begin{macro}{\textls}
%\changes{v2.0}{2005/09/21}{new command: letterspacing} ^^A (beta:1)
%\changes{v2.0}{2006/12/28}{starred version: remove spaces around text}
%\changes{v2.1}{2007/01/19}{fix: use \cmd\hmode@bgroup}
%\changes{v2.3d}{2008/11/16}{make math mode aware}
%\begin{macro}{\MT@ls@adjust@}
% This command may be used like the other text commands.
% The starred version removes kerning on the sides.
% The optional argument changes the letterspacing factor.
%    \begin{macrocode}
%<*package|letterspace>
\DeclareRobustCommand\textls{%
  \@ifstar{\let\MT@ls@adjust@\MT@ls@adjust@empty\MT@textls}%
          {\let\MT@ls@adjust@\MT@ls@adjust@relax\MT@textls}%
}
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\begin{macro}{\MT@textls}
%\begin{macro}{\MT@letterspace@}
% This is now almost \LaTeX's \cmd\DeclareTextFontCommand, with the difference
% that we adjust the outer spacing and kerning also for \cs{lsstyle}, while
% \LaTeX's text \emph{switches} don't bother about italic correction.
%    \begin{macrocode}
\newcommand\MT@textls[2][]{%
  \ifmmode
    \nfss@text{\MT@ls@set@ls{#1}\lsstyle#2}%
  \else
    \hmode@bgroup
      \MT@ls@set@ls{#1}%
      \lsstyle #2%
      \expandafter
    \egroup
  \fi
}
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\begin{macro}{\MT@ls@adjust}
%\begin{macro}{\MT@ls@adjust@empty}
%\begin{macro}{\MT@ls@adjust@relax}
%\begin{macro}{\MT@ls@set@ls}
% Set current letterspacing amount and outer kerning. This has to be done inside
% the same group as the letterspacing command.
%\changes{v2.5}{2010/12/02}{allow formulas in optional argument to \cs{textls}
%                           (fix by \contributor Heiko Oberdiek <heiko.oberdiek\at googlemail.com>)}
%                            ^^A private mail, 2010/12/02
%                            ^^A (beta:05)
%    \begin{macrocode}
\def\MT@ls@adjust@empty{\let\MT@ls@adjust\@empty}
\def\MT@ls@adjust@relax{\let\MT@ls@adjust\relax}
\def\MT@ls@set@ls#1{%
  \MT@ifempty{#1}%
    {\let\MT@letterspace@\@undefined}%
    {\KV@@sp@def\MT@letterspace@{#1}%
     \edef\MT@letterspace@{\number\MT@letterspace@}%
     \MT@ls@too@large\MT@letterspace@}%
  \MT@ls@adjust@
}
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\begin{macro}{\MT@ls@too@large}
% Test whether letterspacing amount is too large.
%    \begin{macrocode}
\def\MT@ls@too@large#1{%
  \ifnum#1>\MT@tr@max
    \MT@warning{Maximum for option `letterspace' is \number\MT@tr@max}%
    \let#1\MT@tr@max
  \else
    \ifnum#1<\MT@tr@min
      \MT@warning{Minimum for option `letterspace' is \number\MT@tr@min}%
      \let#1\MT@tr@min
    \fi
  \fi
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@outer@kern}
%\begin{macro}{\MT@tr@set@okern}
%\changes{v2.3d}{2008/12/19}{allow empty value for \texttt{outer kerning}}
% This dimen is used for the starred version of \cs{textls}, for \cs{lslig}
% and for adjusted outer kerning.
%    \begin{macrocode}
\newdimen\MT@outer@kern
%</package|letterspace>
%<*pdftex-def|luatex-def>
\def\MT@tr@set@okern#1,#2,{%
  \let\MT@temp\@empty
  \MT@ifempty{#1}{\MT@tr@set@okern@{*}}{\MT@tr@set@okern@{#1}}%
  \MT@ifempty{#2}{\MT@tr@set@okern@{*}}{\MT@tr@set@okern@{#2}}%
  \MT@glet@nc{MT@outer@kern\expandafter\string\font@name}\MT@temp
%<debug>\MT@dinfo@nl2{... outer kerning: (#1,#2)
%<debug>              = \@nameuse{MT@outer@kern\expandafter\string\font@name}}%
}
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\begin{macro}{\MT@tr@set@okern@}
%    \begin{macrocode}
\def\MT@tr@set@okern@#1{%
  \MT@test@ast#1*\@nil{%
    \MT@ifdefined@c@TF\MT@tr@unit@
      {\edef\@tempb{#1}\MT@scale@to@em}
      {\@tempcntb=#1\relax}%
    \@tempdima=\dimexpr \@tempcntb sp * \MT@dimen@six/1000\relax
  }{%
    \MT@ifempty\@tempa{\let\@tempa\@m}\relax
    \@tempdima=\dimexpr \numexpr\@tempa*\MT@letterspace@/1000\relax sp
                      * \fontdimen6\MT@lsfont/2000\relax
  }%
  \advance\@tempdima -\dimexpr \MT@letterspace@ sp
                             * \fontdimen6\MT@lsfont/2000\relax
  \edef\MT@temp{\MT@temp{\the\@tempdima}}%
}
%</pdftex-def|luatex-def>
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@ls@outer@k}
% Adjust outer kerning. We additionally add a marker (|\kern3sp\kern-3sp|)
% for cases of nested letterspacing without anything actually printed. ^^A eg. \LaTeX!
%\changes{v2.5a}{2013/05/15}{add marker for tightly nested letterspacing}
%    \begin{macrocode}
%<*pdftex-def|luatex-def|letterspace>
\def\MT@ls@outer@k{%
  \ifhmode
    \ifdim\lastkern=-3sp \unkern
      \ifdim\lastkern=3sp \kern-3sp
        \expandafter\expandafter\expandafter\@gobble
      \else \unkern
        \expandafter\expandafter\expandafter\@firstofone
      \fi
    \else
      \expandafter\@firstofone
    \fi
    {\kern\MT@outer@kern\kern3sp\kern-3sp\relax}%
  \fi
}
%</pdftex-def|luatex-def|letterspace>
%    \end{macrocode}
%\end{macro}
%
%\subsubsection{Disabling ligatures}
%
%\begin{macro}{\MT@noligatures}
% The possibility to disable ligatures is a new features of \pdftex\ 1.30, and
% also works with \luatex.
%\changes{v2.3}{2007/10/23}{fix: set evaluation didn't work (bug introduced in v2.2)}
%    \begin{macrocode}
%<*pdftex-def|luatex-def>
%<pdftex-def>\MT@requires@pdftex5{
\def\MT@noligatures{%
  \MT@dotrue
  \let\@tempa\MT@nl@setname
  \MT@map@clist@n{font,encoding,family,series,shape,size}{%
    \MT@ifdefined@n@TF{MT@checklist@##1}%
      {\csname MT@checklist@##1\endcsname}%
      {\MT@checklist@{##1}}%
    {nl}%
  }%
  \ifMT@do
    \MT@noligatures@\MT@font\MT@nl@ligatures
  \fi
}
%    \end{macrocode}
%\begin{macro}{\MT@noligatures@}
% This is also used by \cs{MT@set@tr@codes}.
%    \begin{macrocode}
%<luatex-def>\MT@requires@luatex4{\let\pdfnoligatures\ignoreligaturesinfont}\relax
\def\MT@noligatures@#1#2{%
  \MT@ifdefined@c@TF#2{%
%    \end{macrocode}
% Early MiK\TeX\ versions (before 2.5.2579) didn't know \cmd\tagcode.
%    \begin{macrocode}
    \MT@ifdefined@c@TF\tagcode{%
%    \end{macrocode}
% No `|inputenc|' key.
%\changes{v2.3b}{2008/03/27}{fix: warning messages for unknown slots}
%    \begin{macrocode}
      \let\MT@warn@maybe@inputenc\@empty
      \def\MT@curr@list@name{\@backslashchar DisableLigatures}%
      \MT@map@clist@c#2{%
        \KV@@sp@def\@tempa{##1}\MT@get@slot
        \ifnum\MT@char>\m@ne
          \tagcode#1\MT@char=\m@ne
%    \end{macrocode}
% With \luatex, we additionally register the ligatures that should be inhibited
% in a table (used by the \pkg{luaotfload} function |keepligature|).
%\changes{v2.6}{2016/04/20}{use \pkg{luaotfload} function to keep\slash inhibit ligatures}
%    \begin{macrocode}
%<luatex-def>          \MT@if@luaotf@font
%<luatex-def>             {\MT@lua{microtype.noligatures([[#1]],[[\MT@char]])}}\relax
        \fi
      }%
      \MT@vinfo{... Disabling ligatures for characters: #2}%
    }{%
      \pdfnoligatures#1%
      \MT@warning{Cannot disable selected ligatures (pdftex doesn't\MessageBreak
          know \@backslashchar tagcode). Disabling all ligatures of\MessageBreak
          the font instead}%
    }%
  }{%
    \pdfnoligatures#1%
%<luatex-def>    \MT@if@luaotf@font
%<luatex-def>        {\MT@lua{microtype.noligatures([[#1]],"_all_")}}\relax
    \MT@vinfo{... Disabling all ligatures}%
  }%
}
%<pdftex-def>}\relax
%</pdftex-def|luatex-def>
%    \end{macrocode}
%\end{macro}
%\end{macro}
% For each potential ligature, \pkg{luaotfload} will call the
% |keepligature| function, which expects the first node of the ligature,
% to check whether they should be kept or inhibited.
% Here's our concoction of this function. The table |microtype.ligs| will
% be populated in \cmd\MT@noligatures@.
%\changes{v2.7c}{2019/03/08}{turn warning into info when overwriting the \texttt{keepligature} function
%                            (reported by \contributor Andy N <@\at @>)}
%                            ^^A https://tex.stackexchange.com/questions/478344/
%    \begin{macrocode}
%<*luafile>
microtype.ligs = microtype.ligs or { }

local function noligatures(fontcs,liga)
  local fontcs = match(fontcs,"([^ ]+)")
  microtype.ligs[fontcs] = microtype.ligs[fontcs] or { }
  table.insert(microtype.ligs[fontcs],liga)
end
microtype.noligatures = noligatures

local function keepligature(c)
  local nodedirect = node.direct
  local getfield   = nodedirect.getfield
  local getfont    = nodedirect.getfont
  local f,ch
  if type(c) == "userdata" then -- in older luaotfload versions, c was a node
    f  = c.font
    ch = c.components.char
  else                          -- since 2.6, c is a (direct node) number
    f  = getfont(c)
    ch = getfield(getfield(c,"components"),"char")
  end
--  if ch then -- should always be true
  local ligs = microtype.ligs[match(tex.fontidentifier(f),"\\([^ ]+)")]
  if ligs then
    for _,lig in pairs(ligs) do
      if lig == "_all_" or tonumber(lig) == ch then
        return false
      end
    end
  end
  return true
--  end
end

if luaotfload and luaotfload.letterspace then
  if luaotfload.letterspace.keepligature then
    microtype.info("overwriting function `keepligature'")
  end
  luaotfload.letterspace.keepligature = keepligature
end

%</luafile>
%    \end{macrocode}
%
%\subsubsection{Loading the configuration}
%
%\begin{macro}{\MT@load@list}
% Recurse through the lists to be loaded.
%\changes{v1.3}{2004/10/27}{check whether list exists}
%\todo{load more than one list}
%    \begin{macrocode}
%<*package>
\def\MT@load@list#1{%
  \edef\@tempa{#1}%
  \MT@let@cn\@tempb{MT@\MT@feat @c@\@tempa @load}%
  \MT@ifstreq\@tempa\@tempb{%
    \MT@error{\@nameuse{MT@abbr@\MT@feat} list `\@tempa' cannot load itself}{}%
  }{%
    \ifx\@tempb\relax \else
      \MT@ifdefined@n@TF{MT@\MT@feat @c@\@tempb}{%
        \MT@vinfo{... : First loading \@nameuse{MT@abbr@\MT@feat} list `\@tempb'}%
        \begingroup
          \MT@load@list\@tempb
        \endgroup
        \edef\MT@curr@list@name{\@nameuse{MT@abbr@\MT@feat} list
          \noexpand\MessageBreak`\@tempb'}%
        \MT@let@cn\@tempc{MT@\MT@feat @c@\@tempb}%
        \expandafter\MT@set@codes\@tempc,\relax,%
      }{%
        \MT@error{\@nameuse{MT@abbr@\MT@feat} list `\@tempb' undefined.\MessageBreak
                    Cannot load it from list `\@tempa'}{}%
      }%
    \fi
  }%
}
%    \end{macrocode}
%\end{macro}
%\changes{v1.1}{2004/09/13}{configuration file names in lowercase
%               (suggested by \contributor Harald Harders <h.harders\at tu-bs.de>)}
%                                                    ^^A private mail, 2004/09/13
%\begin{macro}{\MT@find@file}
%\changes{v1.1}{2004/09/14}{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|.
%\changes{v1.8}{2005/04/16}{no longer wrap names in commands}
%\begin{macro}{\MT@file@list}
% We must also record whether we've already loaded the file.
%    \begin{macrocode}
\let\MT@file@list\@empty
\def\MT@find@file#1{%
%    \end{macrocode}
%\end{macro}
% Check for existence of the file only once.
%    \begin{macrocode}
  \MT@in@clist{#1}\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.
%    \begin{macrocode}
    \MT@begin@catcodes
      \let\MT@begin@catcodes\relax
      \let\MT@end@catcodes\relax
      \InputIfFileExists{mt-#1.cfg}{%
        \edef\MT@curr@file{mt-#1.cfg}%
        \MT@vinfo{... Loading configuration file \MT@curr@file}%
        \MT@xadd\MT@file@list{#1,}%
      }{%
        \MT@get@basefamily#1\@empty\@empty\@empty\@nil
        \MT@exp@one@n\MT@in@clist\@tempa\MT@file@list
        \ifMT@inlist@
          \MT@xadd\MT@file@list{#1,}%
        \else
          \InputIfFileExists{mt-\@tempa.cfg}{%
            \edef\MT@curr@file{mt-\@tempa.cfg}%
            \MT@vinfo{... Loading configuration file \MT@curr@file}%
            \MT@xadd\MT@file@list{\@tempa,#1,}%
          }{%
            \MT@vinfo{... No configuration file mt-#1.cfg}%
            \MT@xadd\MT@file@list{#1,}%
          }%
        \fi
      }%
    \endgroup
  \fi
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@cfg@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 \cmd\nfss@catcodes\
% (from the \LaTeX\ kernel). I've added:
%\changes{v1.4a}{2004/11/16}{fix: reset some more catcodes when reading files
%                (reported by \contributor Michael Hoppe <mh\at michael-hoppe.de>)}
%                                 ^^A MID: <p06002000bdbff1f93eb7@[192.168.0.34]>
% |&| (in |tabular|s), |!|, |?|, |;|,
%\changes{v1.7}{2005/02/06}{reset catcode of `\texttt{:}'
%                           (compatibility with \pkg{french}* packages)}
% |:| (|french|), |,|, |$|, |_|, |~|,
%\changes{v1.5}{2004/11/28}{reset catcode of `\texttt{\quotechar=}'
%                           (compatibility with Turkish \pkg{babel})}
% and |=| (Turkish \pkg{babel}).
%
%\changes{v1.8}{2005/03/29}{reset catcodes of the remaining <ASCII> characters}
% OK, now all printable characters up to 127 are `other'. We hope that letters
% are always letters and numbers other. (\pkg{listings} makes them active, see
% section~\ref{sub:compatibility}.)
%
% We leave |^| at catcode 7, so that stuff like `|^^ff|' remains possible.
%    \begin{macrocode}
\def\MT@cfg@catcodes{%
  \makeatletter
  \catcode`\^7%
  \catcode`\ 9%
  \catcode`\^^I9%
  \catcode`\^^M9%
  \catcode`\\\z@
  \catcode`\{\@ne
  \catcode`\}\tw@
  \catcode`\#6%
  \catcode`\%14%
  \MT@map@tlist@n
    {\!\"\$\&\'\(\)\*\+\,\-\.\/\:\;\<\=\>\?\[\]\_\`\|\~}%
    \@makeother
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@begin@catcodes}
% This will be used before reading the files as well as in all configuration
% commands, so that catcodes are also harmless when these commands are used
% outside the configuration files.
%\changes{v1.7}{2005/02/17}{also use inside configuration commands}
%\changes{v2.3}{2007/11/20}{fix: don't disable \cmd\KV@@sp@def}
%    \begin{macrocode}
\def\MT@begin@catcodes{%
  \begingroup
  \MT@cfg@catcodes
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@end@catcodes}
% End group if outside configuration file (otherwise relax).
%    \begin{macrocode}
\let\MT@end@catcodes\endgroup
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@get@basefamily}
% The family name might have a suffix
%\changes{v1.1}{2004/09/14}{only remove suffixes `\texttt{x}' or `\texttt{j}'}
% \eg, for expert set (|x|), old style numbers (|j|)
%\changes{v1.2}{2004/09/26}{also remove `w' (swash capitals)}
% swash capitals (|w|) etc. 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.4b}{2004/11/25}{fix: failed for font names of the form \texttt{abczz}
%                (reported by \contributor Georg Verweyen <Georg.Verweyen\at WEB.DE>)}
%                                                 ^^A MID: <41A64DC7.7040404@web.de>
%\changes{v2.2}{2007/02/04}{redone, working on font names and suffixes of arbitrary length}
%
% We only work on the font name if it is longer than three characters.
%    \begin{macrocode}
\def\MT@get@basefamily#1#2#3#4\@nil{%
  \ifx\@empty#4%
    \def\@tempa{#1#2#3}%
  \else
    \let\@tempa\@empty
    \edef\@tempb{#1#2#3#4}%
    \expandafter\MT@get@basefamily@\@tempb\@nil
  \fi
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@get@basefamily@}
% This will only remove one suffix (the longest match), so that
% \emph{combinations} of suffixes would have be to added manually (\eg,
% |\DeclareMicrotypeVariants*{aw}|). But otherwise, something like `|padx|'
% would be truncated to `|p|'.
%    \begin{macrocode}
\def\MT@get@basefamily@#1#2\@nil{%
  \edef\@tempa{\@tempa#1}%
  \ifx\\#2\\\expandafter\@gobble\else\expandafter\@firstofone\fi
  {\MT@in@tlist{#2}\MT@variants
   \ifMT@inlist@\else\MT@get@basefamily@#2\@nil\fi}%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@listname}
%\begin{macro}{\MT@get@listname}
%\begin{macro}{\MT@get@listname@}
% Try all combinations of font family, series, shape and size to get a list for
% the current font.
%\changes{v1.1}{2004/09/15}{don't check for empty attributes list}
%\changes{v1.2}{2004/09/30}{alternatively check for alias font name}
%\changes{v1.7}{2005/03/15}{use \cmd\@tfor\
%               (\contributor Andreas B\"uhmann <andreas.buehmann\at web.de>'s idea)}
%                                                      ^^A private mail, 2005/03/12
%\changes{v1.8}{2005/04/16}{made recursive}
%    \begin{macrocode}
\def\MT@get@listname#1{%
%<debug>\MT@dinfo@nl{1}{trying to find \@nameuse{MT@abbr@#1} list for font `\MT@@font'}%
  \let\MT@listname\@undefined
  \def\@tempb{#1}%
  \MT@map@tlist@c\MT@try@order\MT@get@listname@
}
\def\MT@get@listname@#1{%
  \expandafter\MT@next@listname#1%
  \ifx\MT@listname\@undefined \else
    \expandafter\MT@tlist@break
  \fi
}
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\end{macro}
%\begin{macro}{\MT@try@order}
%\changes{v1.7}{2005/03/11}{fix: also check for //\meta{series}/\meta{shape}//
%               (reported by \contributor Andreas B\"uhmann <andreas.buehmann\at web.de>)}
%                                                           ^^A private mail, 2005/03/10
%\changes{v1.7}{2005/03/11}{always check for size, too
%               (suggested by \contributor Andreas B\"uhmann <andreas.buehmann\at web.de>)}
%                                                           ^^A private mail, 2005/03/10
%
%\begin{table}\small
%\caption{Order for matching font attributes}\label{tab:match-order}
%\catcode`\!=13 \let!\match
%\setlength\fboxsep{4pt}
%\leavevmode\kern-\dimexpr\fboxsep+\fboxrule\relax
%\fcolorbox{theframe}{white}{^^A
%\begin{minipage}{\textwidth}
%\def\arraystretch{1.2}
%\begin{tabular}{@{}L{38pt}*{16}{p{19.5pt}<{\centering}@{}}}
%          & 1.& 2.& 3.& 4.& 5.& 6.& 7.& 8.& 9.&10.&11.&12.&13.&14.&15.&16.\\
%\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(r){9-9}
%\cmidrule(r){10-10}\cmidrule(r){11-11}\cmidrule(r){12-12}\cmidrule(r){13-13}
%\cmidrule(r){14-14}\cmidrule(r){15-15}\cmidrule(r){16-16}\cmidrule   {17-17}
% Encoding & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! \\
% Family   & ! & ! & ! & ! & ! & ! & ! & ! & - & - & - & - & - & - & - & - \\
% Series   & ! & ! & ! & ! & - & - & - & - & ! & ! & ! & ! & - & - & - & - \\
% Shape    & ! & ! & - & - & ! & ! & - & - & ! & ! & - & - & ! & ! & - & - \\
% Size     & ! & - & ! & - & ! & - & ! & - & ! & - & ! & - & ! & - & ! & - \\
%\end{tabular}
%\end{minipage}^^A
%}\kern-\dimexpr\fboxsep+\fboxrule\relax ^^A end \fcolorbox
%\end{table}
%
% Beginning with version 1.7, we always check for the font size. Since the
% matching order has become more logical now, it can be described in words, so
% that we don't need table~\ref{tab:match-order} in the documentation part any
% longer and can cast it off here.
%    \begin{macrocode}
\def\MT@try@order{%
  {1111}{1110}{1101}{1100}{1011}{1010}{1001}{1000}%
  {0111}{0110}{0101}{0100}{0011}{0010}{0001}{0000}%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@next@listname}
% The current context is added to the font attributes. That is, the context must
% match.
%    \begin{macrocode}
\def\MT@next@listname#1#2#3#4{%
  \ifnum#1=\z@\MT@nofamilytrue\fi
  \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 *\fi
               \MT@context}%
%<debug>\MT@dinfo@nl{1}{trying \@tempa}%
  \MT@ifdefined@n@TF{MT@\@tempb @\@tempa}{%
    \MT@next@listname@#4%
  }{%
%    \end{macrocode}
% Also try with an alias family.
%    \begin{macrocode}
    \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 *\fi
                     \MT@context}%
%<debug>\MT@dinfo@nl{1}{(alias) \@tempa}%
        \MT@ifdefined@n@T{MT@\@tempb @\@tempa}{%
          \MT@next@listname@#4%
        }%
      \fi
    \fi
  }%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@next@listname@}
% If size is to be evaluated, do that, otherwise use the current list.
%    \begin{macrocode}
\def\MT@next@listname@#1{%
  \ifnum#1=\@ne
    \MT@exp@cs\MT@in@rlist{MT@\@tempb @\@tempa @sizes}%
    \ifMT@inlist@
      \let\MT@listname\MT@size@name
    \fi
  \else
    \MT@let@cn\MT@listname{MT@\@tempb @\@tempa}%
  \fi
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@if@list@exists}
%\changes{v1.7}{2005/02/06}{don't define \cs{MT@\#1@c@name} \cmd\global ly,
%                           here and elsewhere}
%\begin{macro}{\MT@context}
%    \begin{macrocode}
\def\MT@if@list@exists{%
  \MT@let@cn\MT@context{MT@\MT@feat @context}%
  \MT@ifstreq{@}\MT@context{\let\MT@context\@empty}\relax
  \MT@get@listname{\MT@feat @c}%
  \MT@ifdefined@c@TF\MT@listname{%
    \MT@edef@n{MT@\MT@feat @c@name}{\MT@listname}%
    \ifMT@nonselected
      \MT@vinfo{... Applying non-selected expansion (list `\MT@listname')}%
    \else
      \MT@vinfo{... Loading \@nameuse{MT@abbr@\MT@feat} list `\MT@listname'}%
    \fi
    \@firstoftwo
  }{%
%    \end{macrocode}
% Since the name cannot be \cmd\@empty, this is a sound proof that no matching
% list exists.
%    \begin{macrocode}
    \MT@let@nc{MT@\MT@feat @c@name}\@empty
%    \end{macrocode}
% Don't warn if \opt{selected}|=false|.
%    \begin{macrocode}
    \ifMT@nonselected
      \MT@vinfo{... Applying non-selected expansion (no list)}%
    \else
%    \end{macrocode}
% Tracking doesn't require a list, either.
%    \begin{macrocode}
      \MT@ifstreq\MT@feat{tr}\relax{%
        \MT@warning{I cannot find a \@nameuse{MT@abbr@\MT@feat} list
          for font\MessageBreak`\MT@@font'%
            \ifx\MT@context\@empty\else\space(context: `\MT@context')\fi.
          Switching off\MessageBreak\@nameuse{MT@abbr@\MT@feat} for this font}%
      }%
    \fi
    \@secondoftwo
  }%
}
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\begin{macro}{\MT@get@inh@list}
%\changes{v1.6}{2004/12/18}{correct message if \opt{selected} is false}
%\begin{macro}{\MT@context}
% The inheritance lists are global (no context).
%    \begin{macrocode}
\def\MT@get@inh@list{%
  \let\MT@context\@empty
%    \end{macrocode}
%\end{macro}
%    \begin{macrocode}
  \MT@get@listname{\MT@feat @inh}%
  \MT@ifdefined@c@TF\MT@listname{%
    \MT@edef@n{MT@\MT@feat @inh@name}{\MT@listname}%
%<debug>\MT@dinfo@nl{1}{... Using \@nameuse{MT@abbr@\MT@feat} inheritance list
%<debug>                `\MT@listname'}%
    \MT@let@cn\@tempc{MT@\MT@feat @inh@\MT@listname}%
%    \end{macrocode}
% If the list is \cmd\@empty, it has already been parsed.
%\changes{v1.2}{2004/09/26}{fix: set inheritance list \cmd\global ly to \cmd\@empty}
%    \begin{macrocode}
    \ifx\@tempc\@empty \else
%<debug>\MT@dinfo@nl{1}{parsing inheritance list ...}%
%    \end{macrocode}
% The group is only required in case an input encoding is given.
%\changes{v1.9f}{2006/08/03}{fix: input encoding must be set after the inheritance
%                            list has been parsed}
%    \begin{macrocode}
      \begingroup
      \edef\MT@curr@list@name{inheritance list\noexpand\MessageBreak`\MT@listname'}%
      \MT@set@inputenc{inh}%
      \expandafter\MT@inh@do\@tempc,\relax,%
      \MT@glet@nc{MT@\MT@feat @inh@\MT@listname}\@empty
      \endgroup
    \fi
  }{%
    \MT@let@nc{MT@\MT@feat @inh@name}\@undefined
  }%
}
%    \end{macrocode}
%\end{macro}
%
% \subsubsection{Translating characters into slots}
%
%\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.
%
%\begin{macro}{\MT@get@slot}
%^^A\changes{v1.2}{2004/09/26}{fix: group must also include \cs{MT@get@composite}}
%\changes{v1.4b}{2004/11/22}{don't define \cs{MT@char} globally (save stack problem)}
%\changes{v1.6a}{2005/01/30}{completely redone, hopefully more robust
%                (compatible with \pkg{frenchpro}; problem reported by
%                 \contributor Bernard Gaulle <gaulle\at idris.fr>)}
%                                     ^^A private mail, 2005/01/28
%\changes{v1.7}{2005/03/21}{remove backslash hack}
% There are lots of possibilities how a character may be specified in the
% configuration files, which makes translating them into slot numbers quite
% expensive. Also, we want to have this as robust as possible, so that the user
% does not have to solve a sphinx's riddle if anything goes wrong.
%
%\begin{macro}{\MT@char}
%\begin{macro}{\MT@char@}
% The character is in \cs{@tempa}, we want its slot number in \cs{MT@char}.
%    \begin{macrocode}
\def\MT@get@slot{%
  \escapechar`\\
  \let\MT@char@\m@ne
  \MT@noresttrue
%    \end{macrocode}
%\end{macro}
%\end{macro}
% Save unexpanded string in case we need to issue a warning message.
%    \begin{macrocode}
  \MT@toks=\expandafter{\@tempa}%
%    \end{macrocode}
%\changes{v1.8}{2005/03/30}{fix: expand active characters}
%\changes{v2.7a}{2018/01/12}{expand active characters earlier}
%  \item It might be an active character, \ie, an 8-bit character defined by
%        \pkg{inputenc}. If so, we will expand it here to its <LICR> form.
%    \begin{macrocode}
  \MT@exp@two@c\MT@is@active\string\@tempa\@nil
%    \end{macrocode}
% Now, let's walk through (hopefully) all possible cases.
%\begin{itemize}
%  \item It's a letter, a character or a number.
%    \begin{macrocode}
  \expandafter\MT@is@letter\@tempa\relax\relax
  \ifnum\MT@char@ < \z@
%    \end{macrocode}
%  \item OK, so it must be a macro. We do not allow random commands but only
%        those defined in \LaTeX's idiosyncratic font encoding scheme:
%
%        If |\|\meta{encoding}|\|\meta{command} (that's \emph{one} command) is
%        defined, we try to extract the slot number.
%\changes{v1.7}{2005/02/27}{test whether \cs{}\meta{encoding}\cs{}\meta{...} is defined}
%\changes{v1.8}{2005/04/04}{test whether \cs{}\meta{encoding}\cs{}\meta{...} is defined
%                           made more robust}
%
%        We must be cautious not to stumble over accented characters consisting
%        of two commands, like \cmd\`\cmd\i\ or \cmd\U\cmd\CYRI, hence,
%        \cmd\string\ wouldn't be safe enough.
%    \begin{macrocode}
    \MT@ifdefined@n@TF{\MT@encoding\MT@detokenize@c\@tempa}%
      \MT@is@symbol
%    \end{macrocode}
%  \item Now, we'll catch the rest, which hopefully is an accented character
%        (\eg~|\"a|).
%    \begin{macrocode}
      {\expandafter\MT@is@composite\@tempa\relax\relax}%
    \ifnum\MT@char@ < \z@
%    \end{macrocode}
%  \item It could also be a \cmd\chardef ed command (\eg, the percent character).
%        This seems the least likely case, so it's last.
%\changes{v1.7}{2005/03/20}{test for \cmd\chardef ed commands}
%    \begin{macrocode}
      \expandafter\MT@exp@two@c\expandafter\MT@is@char\expandafter
          \meaning\expandafter\@tempa\MT@charstring\relax\relax\relax
    \fi
  \fi
%    \end{macrocode}
%\end{itemize}
%    \begin{macrocode}
  \let\MT@char\MT@char@
  \MT@get@slot@
  \escapechar\m@ne
}
%</package>
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@get@slot@}
%\changes{v2.5}{2010/05/18}{adapt for \xetex}
%    \begin{macrocode}
%<*pdftex-def|luatex-def|xetex-def>
\def\MT@get@slot@{%
%    \end{macrocode}
% If it's a legacy (\ie, <TFM>) font, proceed as usual.
%    \begin{macrocode}
%<xetex-def>  \ifnum\XeTeXfonttype\MT@font=\z@
  \ifnum\MT@char > \m@ne
%    \end{macrocode}
% In \luatex, it may also be a glyph name, prefixed with `|/|'.
%\changes{v2.5}{2012/08/14}{adapt for \luatex\ (requested by \contributor Georg Duffner <g.duffner\at gmail.com>)}
%                           ^^A private mail, 2012/07/17
%                           ^^A (beta:10)
%    \begin{macrocode}
%<*luatex-def>
    \ifnum\MT@char=47\relax
      \ifMT@norest \else
        \@tempcnta=\MT@lua{
           local glyph = microtype.name_to_slot([[\expandafter\@gobble\@tempa]],true)
           if glyph then tex.write(glyph)
           else tex.write(-1)
           end
        }\relax
        \ifnum\@tempcnta<\z@
          \MT@warn@unknown
          \let\MT@char\m@ne
        \else
          \edef\MT@char{\the\@tempcnta}%
%<debug>\MT@dinfo@nl{3}{> `\the\MT@toks' is a glyph name (\the\@tempcnta)}%
        \fi
      \fi
    \else
%</luatex-def>
%    \end{macrocode}
% If the user has specified something like `|fi|', or wanted to define a number
% but forgot to use three digits, we'll have something left of the string. In
% this case, we issue a warning and forget the complete string.
%\changes{v2.6}{2016/04/23}{fix: could fail with \xetex\
%                           (reported by \contributor Christopher Schramm <debian\at shakaweb.org>)}
%                           ^^A http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=725395#15
%    \begin{macrocode}
    \ifMT@norest \else
      \MT@warn@rest
%<pdftex-def|luatex-def>      \let\MT@char\m@ne
%<xetex-def>      \let\MT@char\@empty
    \fi
%<luatex-def>    \fi
  \else
    \MT@warn@unknown
%<xetex-def>    \let\MT@char\@empty
  \fi
%<*xetex-def>
  \else
%    \end{macrocode}
% There are more possibilities for \xetex:
% It may also be a glyph name (prefixed with~`|/|'). We indicate this to
% \cs{MT@get@charwd} by reversing the sign of \cs{MT@char@}.
%    \begin{macrocode}
    \ifnum\MT@char=47\relax
      \ifMT@norest \edef\MT@char{U47}%
      \else
        \@tempcnta=\XeTeXglyphindex"\expandafter\@gobble\@tempa"\relax
        \ifnum\@tempcnta=\z@
          \MT@warn@unknown
          \let\MT@char\@empty
        \else
          \edef\MT@char{\@tempa\space}%
          \edef\MT@char@{-\the\@tempcnta}%
%<debug>\MT@dinfo@nl{3}{> `\the\MT@toks' is a glyph name (\the\@tempcnta)}%
        \fi
      \fi
    \else
      \ifnum\MT@char > \m@ne
        \ifMT@norest
%    \end{macrocode}
% Or, it's a Unicode number, which we mustn't translate into a glyph number,
% since the latter is font-specific.
%    \begin{macrocode}
          \@tempcnta=\XeTeXcharglyph\MT@char\relax
          \ifnum\@tempcnta=\z@
            \MT@info@missing@char
            \let\MT@char\@empty
          \else
%<debug>\MT@dinfo@nl{3}{> (glyph number: \the\@tempcnta,
%<debug>                   glyph name:   \XeTeXglyphname\MT@font\@tempcnta)}%
            \edef\MT@char{U\MT@char}%
          \fi
        \else
          \MT@warn@rest
          \let\MT@char\@empty
        \fi
      \else
        \MT@warn@unknown
        \let\MT@char\@empty
      \fi
    \fi
  \fi
%</xetex-def>
}
%</pdftex-def|luatex-def|xetex-def>
%    \end{macrocode}
% This is the lua function to translate glyph name into slot number.
% Beginning with v2.2, \pkg{luaotfload} provides this function in an <API>, which
% we use if available, but (for now, at least) keep the old code for backward
% compatibility.
%\changes{v2.5a}{2013/04/19}{adapt to \pkg{luaotfload} v2.2
%                            (contributed by \contributor \'Elie Roux <elie.roux\at telecom-bretagne.eu>)}
%                            ^^A MID: <516AAF6B.8040605@telecom-bretagne.eu>
%    \begin{macrocode}
%<*luafile>
if luaotfload and luaotfload.aux and luaotfload.aux.slot_of_name then
  local slot_of_name = luaotfload.aux.slot_of_name
  microtype.name_to_slot = function(name, unsafe)
    return slot_of_name(font.current(), name, unsafe)
  end
else
  -- we dig into internal structure (should be avoided)
  local function name_to_slot(name, unsafe)
    if fonts then
      local unicodes
      if fonts.ids then       -- legacy luaotfload
        local tfmdata = fonts.ids[font.current()]
        if not tfmdata then return end
        unicodes = tfmdata.shared.otfdata.luatex.unicodes
      else                    -- new location
        local tfmdata = fonts.hashes.identifiers[font.current()]
        if not tfmdata then return end
        unicodes = tfmdata.resources.unicodes
      end
      local unicode = unicodes[name]
      if unicode then -- does the 'or' branch actually exist?
        return type(unicode) == "number" and unicode or unicode[1]
      end
    end
  end
  microtype.name_to_slot = name_to_slot
end

%</luafile>
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@is@letter}
% Input is a letter, a character or a number.
%\changes{v1.8}{2005/04/04}{warning for non-<ASCII> characters}
%\changes{v1.9}{2005/10/22}{using \cmd\catcode\ should be more efficient than
%                           inspecting the \cmd\meaning}
%\begin{macro}{\MT@max@char}
%\begin{macro}{\MT@max@slot}
% Warning if resulting character or slot number is too large.
%    \begin{macrocode}
%<*pdftex-def|luatex-def|xetex-def>
\def\MT@max@char
%<pdftex-def>  {127 }
%<luatex-def|xetex-def>  {1114111 }
\def\MT@max@slot
%<pdftex-def>  {255 }
%<luatex-def|xetex-def>  {1114111 }
%</pdftex-def|luatex-def|xetex-def>
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\begin{macro}{\ifMT@norest}
% Test whether all of the string has been used up.
%    \begin{macrocode}
%<*package>
\newif\ifMT@norest
%    \end{macrocode}
%\end{macro}
%    \begin{macrocode}
\def\MT@is@letter#1#2\relax{%
  \ifcat a\noexpand#1\relax
    \edef\MT@char@{\number`#1}%
    \ifx\\#2\\%
%<debug>\MT@dinfo@nl{3}{> `\the\MT@toks' is a letter (\MT@char@)}%
    \else
      \MT@norestfalse
    \fi
  \else
    \ifcat !\noexpand#1\relax
      \edef\MT@char@{\number`#1}%
%<debug>\MT@dinfo@nl{3}{> `\the\MT@toks' is a character (\MT@char@)}%
      \ifx\\#2\\%
        \ifnum\MT@char@ > \MT@max@char \MT@warn@ascii \fi
      \else
        \MT@norestfalse
        \expandafter\MT@is@number#1#2\relax\relax
      \fi
    \fi
  \fi
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@is@number}
% Numbers may be specified as a three-digit decimal number (|029|),
%\changes{v1.1}{2004/09/13}{numbers may also be specified in hexadecimal or octal
%               (suggested by \contributor Harald Harders <h.harders\at tu-bs.de>)}
%                                                    ^^A private mail, 2004/09/13
% as a hexadecimal number (prefixed with~|"|: |"1D|) or as a octal number
% (prefixed with~|'|: |'35|). They must consist of at least three characters
% (including the prefix), that is, |"F| is not permitted.
%    \begin{macrocode}
\def\MT@is@number#1#2#3\relax{%
  \ifx\relax#3\relax \else
    \ifx\relax#2\relax \else
      \MT@noresttrue
      \if#1"\relax
        \def\x{\uppercase{\edef\MT@char@{\number#1#2#3}}}\x
%<debug>\MT@dinfo@nl{3}{> ... a hexadecimal number: \MT@char@}%
      \else
        \if#1'\relax
          \def\MT@char@{\number#1#2#3}%
%<debug>\MT@dinfo@nl{3}{> ... an octal number: \MT@char@}%
        \else
          \MT@ifint{#1#2#3}{%
            \def\MT@char@{\number#1#2#3}%
%<debug>\MT@dinfo@nl{3}{> ... a decimal number: \MT@char@}%
          }\MT@norestfalse
        \fi
      \fi
      \ifnum\MT@char@ > \MT@max@slot
        \MT@warn@number@too@large{\noexpand#1\noexpand#2\noexpand#3}%
        \let\MT@char@\m@ne
      \fi
    \fi
  \fi
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@is@active}
%\changes{v1.8}{2005/03/30}{new macro: translate \pkg{inputenc}-defined characters}
% Expand an active character. (This was completely broken in v1.7, and only
% worked by chance before.)
%\changes{v1.9}{2005/09/08}{redone: use \cmd\set@display@protect}
% We \cmd\set@display@protect\ to translate, \eg, \expandafter|\"A| into |\"A|,
% that is to whatever it is defined in the \pkg{inputenc} encoding file.
%
%\iffalse
% Previous solution, slightly more robust (but doesn't understand Unicode):
%\begin{verbatim}
%\def\MT@is@active#1#2\@nil{%
%   \ifx\\#2\\%
%      \ifnum\catcode`#1 = \active
%         \toks@=\expandafter\expandafter\expandafter{\@tempa}%
%         \expandafter\MT@active@inpenc\the\toks@\relax\relax
%         \edef\@tempa{\the\toks@}%
%         \edef\x{\MT@toks={\the\MT@toks\space(= \the\toks@)}}\x
%      \fi
%   \fi
%}
%\def\MT@active@inpenc#1#2#3\relax{%
%   \ifx#1\IeC
%      \def\IeC##1{\toks@={##1}}%
%      \the\toks@
%      \expandafter\MT@active@inpenc\the\toks@\relax\relax
%   \fi
%   \ifx#1\@tabacckludge
%      \def\@tabacckludge##1##2{%
%         \toks@=\expandafter{\csname\string##1\endcsname#3}}%
%      \the\toks@
%   \fi
%   \ifx#1\@inpenc@undefined@
%      \def\@inpenc@undefined@##1{%
%         \edef\x{\toks@={%
%            undefined^^J(\MT@MT)\@spaces\@spaces\@spaces\@spaces
%            in input encoding ``##1''}}\x}%
%      \the\toks@
%   \fi
%}
%\end{verbatim}
%\fi
%
% Unfortunately, the (older) \pkg{inputenc} definitions prefer the
% protected\slash generic variants (\eg, \cmd\copyright\ instead of
% \cmd\textcopyright), which our parser won't be able to understand.
% (I'm fed up now, so you have to complain if you really, really want to be able
% to write `\expandafter|\textcopyright|' instead of \cmd\textcopyright, thus
% rendering your configuration files unportable.)
%
% Unicode characters (\pkg{inputenc}/|utf8|,|utf8x|) are also supported.
%\changes{v1.9d}{2006/03/06}{support for Unicode (\pkg{inputenc}\slash\texttt{utf8})}
%\changes{v2.3}{2007/11/11}{support for extended Unicode (\pkg{inputenc}\slash\texttt{utf8x} resp. \pkg{ucs}) -- experimental}
%
%\iffalse ^^A obsolete because of `inputenc' key
% We presume that only one input encoding is being used throughout the entire
% document. We could of course save the input encoding together with the list,
% but this would entail a couple of problems: (1)~the overhead of resetting the
% input encoding every time, (2)~the problem (or rather, impossibility) to
% decide which input encoding should be chosen -- the one active when the list
% was declared or the one active when the font is selected, and (3)~the
% improbability of multiple input encodings being used at all.
%\fi
%    \begin{macrocode}
\def\MT@is@active#1#2\@nil{%
  \ifnum\catcode`#1 = \active
    \begingroup
      \set@display@protect
      \let\IeC\@firstofone
      \let\@inpenc@undefined@\MT@undefined@char
%    \end{macrocode}
% Unicode handling has changed again with \LaTeX\ 2019/10/01.
%\changes{v2.7c}{2019/10/10}{compatibility with \LaTeX\ 2019/10/01} ^^A https://github.com/latex3/latex2e/commit/2edd9339ed9a710d45b435ba91545240d0cc9528#diff-d138747c4604d436824f8cb7cedd7d46
%    \begin{macrocode}
      \let\UTF@two@octets@noexpand\@empty
      \let\UTF@three@octets@noexpand\@empty
      \let\UTF@four@octets@noexpand\@empty
%    \end{macrocode}
% We refrain from checking whether there is a sufficient number of octets.
%    \begin{macrocode}
      \def\UTFviii@defined##1{\ifx ##1\relax
        \MT@undefined@char{utf8}\else\expandafter ##1\fi}%
%    \end{macrocode}
% For \pkg{ucs} (utf8x). Let's call it experimental~\dots
%    \begin{macrocode}
      \MT@ifdefined@c@T\PrerenderUnicode
        {\PrerenderUnicode{\@tempa}\let\unicode@charfilter\@firstofone}%
%    \end{macrocode}
% The \cmd\expandafter\ hocus-pocus should please \pkg{newunicodechar}.
%\changes{v2.7a}{2017/11/25}{compatibility with \pkg{newunicodechar}
%                            (reported by \contributor Nils Anders Danielsson <nad\at cse.gu.se>)}
%                            ^^A private mail, 2017/09/05
%    \begin{macrocode}
      \edef\x{\endgroup
        \def\noexpand\@tempa{\expandafter\expandafter\expandafter\@empty\@tempa}%
%    \end{macrocode}
% Append what we think the translation is to the token register we use for the
% log.
%    \begin{macrocode}
        \MT@toks={\the\MT@toks\space(=
                  \expandafter\expandafter\expandafter\@empty\@tempa)}%
      }%
    \x
  \fi
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@undefined@char}
% For characters not defined in the current input encoding.
%    \begin{macrocode}
\def\MT@undefined@char#1{undefined in input encoding ``#1''}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@is@symbol}
% The symbol commands might expand to funny stuff, depending on context.
% Instead of simply expanding |\|\meta{command}, we construct the command
% |\|\meta{encoding}|\|\meta{command} and see whether its meaning is
% \cmd\char|"|\meta{hex number}, which is the case for everything that has
% been defined with \cs{DeclareTextSymbol} in the encoding definition files.
%\changes{v2.0}{2006/09/15}{made even more robust}
%    \begin{macrocode}
\def\MT@is@symbol{%
  \expandafter\def\expandafter\MT@char\expandafter
      {\csname\MT@encoding\MT@detokenize@c\@tempa\endcsname}%
  \expandafter\MT@exp@two@c\expandafter\MT@is@char\expandafter
      \meaning\expandafter\MT@char\MT@charstring\relax\relax\relax
  \ifnum\MT@char@ < \z@
%    \end{macrocode}
%\changes{v2.7c}{2019/08/13}{take care of \cs{remove@tlig}}
% For <TU> encoding, the commands \cmd\textquotesingle, \cmd\textasciigrave\
% and \cmd\textquotedbl\ are defined by means of the auxiliary macro
% \cmd\remove@tlig, which we take care of here.
%    \begin{macrocode}
    \expandafter\expandafter\expandafter\MT@is@tlig\MT@char\relax\relax
    \ifnum\MT@char@ < \z@
%    \end{macrocode}
%\changes{v2.2}{2007/03/07}{expand once more (for \pkg{frenchpro})}
% Finally, if it hasn't been defined by \cs{DeclareTextSymbol}, it could be a letter
% (\eg, \cmd\i, when using \pkg{frenchpro}). ^^A as noted by Bernard Gaulle
%                                              ^^A private mail, 2005/01/28
%    \begin{macrocode}
      \expandafter\expandafter\expandafter\MT@is@letter\MT@char\relax\relax
    \fi
  \fi
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@is@char}
%\begin{macro}{\MT@charstring}
% A helper macro that inspects the \cmd\meaning\ of its argument.
%    \begin{macrocode}
\begingroup
  \catcode`\/=\z@
%    \end{macrocode}
%\SpecialEscapechar{\/}
%    \begin{macrocode}
  /MT@map@tlist@n{/\CHARLEX}/@makeother
  /lowercase{%
    /def/x{/endgroup
      /def/MT@charstring{\CHAR"}%
      /def/MT@is@char##1\CHAR"##2##3##4/relax{%
        /ifx/relax##4/relax
          /ifMT@xunicode
            /expandafter/MT@is@charx/MT@strip@prefix##1>/relax\CHAR "%
              /relax/relax/relax/relax/relax
          /fi
        /else
          /ifx/relax##1/relax
            /if##3\/relax
              /edef/MT@char@{/number"##2}%
              /MT@ifstreq/MT@charstring{##3##4}/relax/MT@norestfalse
            /else
              /edef/MT@char@{/number"##2##3}%
              /MT@ifstreq/MT@charstring{##4}/relax
                {/MT@is@xchar##2##3|##4\CHAR"/relax}%
            /fi
%<debug>    /MT@dinfo@nl{3}{> `/the/MT@toks' is a \char (/MT@char@)}%
          /fi
        /fi
      }%
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\begin{macro}{\MT@is@xchar}
%\changes{v2.6}{2016/04/23}{update for \pkg{fontspec}'s <TU> encoding}
% With \pkg{fontspec}'s <TU> encoding, glyph numbers may be up to four digits.
%\SpecialEscapechar{\/}
%    \begin{macrocode}
      /def/MT@is@xchar##1|##2\CHAR"##3##4/relax{%
        /MT@ifstreq/MT@charstring{##3##4}%
          {/edef/MT@char@{/number"##1##2}}/MT@norestfalse
      }%
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@charxstring}
%\begin{macro}{\MT@strip@prefix}
%\begin{macro}{\MT@is@charx}
% For \pkg{xunicode}, which doesn't \cmd\countdef, but rather \cmd\def s the chars.
%\changes{v2.5}{2010/02/27}{compatibility with \pkg{xunicode}}
%\SpecialEscapechar{\/}
%    \begin{macrocode}
      /def/MT@charxstring{\CHAR "}%
      /def/MT@strip@prefix##1>##2/relax{##2}%
      /def/MT@is@charx##1\CHAR "##2##3##4##5##6/relax{%
        /ifx/relax##1/relax
          /ifx/relax##6/relax/else
            /edef/MT@char@{/number"##2##3##4##5}%
            /MT@ifstreq{\RELAX >\CHAR "}{##6}/relax/MT@norestfalse
%<debug>    /MT@dinfo@nl{3}{> `/the/MT@toks' is a xunicode \char (/MT@char@)}%
          /fi
        /fi
      }%
    }%
  }
/x
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\end{macro}
%\begin{macro}{\MT@is@tlig}
% This might have to change again with the next \LaTeX\ release, ^^A see https://github.com/latex3/latex2e/issues/165
% \dots\ or so I feared, but it still seems to be fine.
%    \begin{macrocode}
\def\MT@is@tlig#1#2{%
  \ifx#1\remove@tlig
%<debug>    \MT@dinfo@nl{3}{> `\the\MT@toks' (removing remove@tlig)}%
    \MT@is@number #2\relax\relax
  \fi
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@is@composite}
% Here, we are dealing with accented characters, specified as two tokens.
%\changes{v1.7}{2005/03/10}{new macro: construct command for composite character;
%                           no uncontrolled expansion}
%\changes{v2.2}{2007/06/08}{more robust: expand exactly once}
%    \begin{macrocode}
\def\MT@is@composite#1#2\relax{%
  \ifx\\#2\\\else
%    \end{macrocode}
% Again, we construct a control sequence, this time of the form:
% |\\|\meta{encoding}\allowbreak|\|\meta{accent}|-|\meta{character}, \eg,
% |\\T1\"-a|, which we then expand once to see if it is a letter (if it has
% been defined by \cs{DeclareTextComposite}). This should be robust, finally,
% especially, since we also \cmd\detokenize\ the input instead of only
% \cmd\string ifying it. Thus, we will die gracefully even on wrong Unicode
% input without |utf8|.
%    \begin{macrocode}
    \expandafter\def\expandafter\MT@char\expandafter{\csname\expandafter
                    \string\csname\MT@encoding\endcsname
                    \MT@detokenize@n{#1}-\MT@detokenize@n{#2}\endcsname}%
%    \end{macrocode}
% In 2017, \LaTeX\ introduced a new way of declaring accented
% Unicode commands (\cs{DeclareUnicodeComposite}), which we take care of here
% (\cs{UnicodeEncodingName} has been introduced at the same time):
%\changes{v2.7}{2017/04/29}{compatibility with \LaTeX\ 2017/01/01 (\cs{DeclareUnicodeComposite})
%                            (reported by \contributor Ulrike Fischer <news3\at nililand.de> and
%                             `\contributor jcr <@\at @>')}
%                             ^^A (1) private mail, 2017/04/25
%                             ^^A (2) https://tex.stackexchange.com/questions/373594/
%    \begin{macrocode}
    \ifx\UnicodeEncodingName\@undefined\else
      \expandafter\expandafter\expandafter
        \MT@is@uni@comp\MT@char\iffontchar\else\fi\relax
    \fi
    \expandafter\expandafter\expandafter\MT@is@letter\MT@char\relax\relax
%    \end{macrocode}
% Again, \pkg{xunicode}.
%    \begin{macrocode}
    \ifnum\MT@char@ < \z@
      \ifMT@xunicode
        \edef\MT@char{\MT@exp@two@c\MT@strip@prefix\meaning\MT@char>\relax}%
        \expandafter\MT@exp@two@c\expandafter\MT@is@charx\expandafter
            \MT@char\MT@charxstring\relax\relax\relax\relax\relax
      \fi
    \fi
  \fi
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@is@uni@comp}
% Helper for \cs{DeclareUnicodeComposite}.
%    \begin{macrocode}
\def\MT@is@uni@comp#1\iffontchar#2\else#3\fi\relax{%
  \ifx\\#2\\\else\edef\MT@char{\iffontchar#2\fi}\fi
}
%    \end{macrocode}
%\end{macro}
% [What about math? Well, for a moment the following looked like a solution, with
% \cs{mt@is@mathchar} defined accordingly, analogous to \cs{MT@is@char} above,
% to pick up the last two tokens (the \cmd\meaning\ of a \cmd\mathchardef'ed
% command expands to its hexadecimal notation):
%\begin{verbatim}
%\def\MT@is@mathchar#1{%
%  \if\relax\noexpand#1% it's a macro
%    \let\x#1%
%  \else % it's a character
%    \mathchardef\x=\mathcode`#1\relax
%  \fi
%  \expandafter\MT@exp@two@c\expandafter\mt@is@mathchar\expandafter
%    \meaning\expandafter\x\mt@mathcharstring\relax\relax\relax
%}
%\end{verbatim}
% However, the problem is that \cmd\mathcode s and \cmd\mathchardef s have
% global scope. Therefore, if they are changed by a package that loads
% different math fonts, there is no guarantee whatsoever that things will still
% be correct (\eg, the minus in |cmsy| when the \pkg{euler} package is loaded).
% So, no way to go, unfortunately.]
%
% Some warning messages, for performance reasons separated here.
%\begin{macro}{\MT@curr@list@name}
%\changes{v1.8}{2005/06/08}{new macro: current list type and name}
%\changes{v1.9f}{2006/08/03}{fix: \cs{MessageBreak} must not be expanded}
%\begin{macro}{\MT@set@listname}
% The type and name of the current list, defined at various places.
%    \begin{macrocode}
\def\MT@set@listname{%
  \edef\MT@curr@list@name{\@nameuse{MT@abbr@\MT@feat} list\noexpand\MessageBreak
    `\@nameuse{MT@\MT@feat @c@name}'}%
}
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\begin{macro}{\MT@warn@ascii}
% For `other' characters \textgreater\ 127, we issue a warning (\pkg{inputenc}
% probably hasn't been loaded), since correspondence with the slot numbers
% would be purely coincidental.
%    \begin{macrocode}
\def\MT@warn@ascii{%
  \MT@warning@nl{Character `\the\MT@toks' (= \MT@char@)
    is outside of ASCII range.\MessageBreak
    You must load the `inputenc' package before using\MessageBreak
    8-bit characters in \MT@curr@list@name}%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@warn@number@too@large}
% Number too large.
%    \begin{macrocode}
\def\MT@warn@number@too@large#1{%
  \MT@warning@nl{%
    Number #1 in encoding `\MT@encoding' too large!\MessageBreak
    Ignoring it in \MT@curr@list@name}%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@warn@rest}
% Not all of the string has been parsed.
%    \begin{macrocode}
\def\MT@warn@rest{%
  \MT@warning@nl{%
    Unknown slot number of character\MessageBreak`\the\MT@toks'%
    \MT@warn@maybe@inputenc\MessageBreak
    in font encoding `\MT@encoding'.\MessageBreak
    Make sure it's a single character\MessageBreak
    (or a number) in \MT@curr@list@name}%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@warn@unknown}
% No idea what went wrong.
%    \begin{macrocode}
\def\MT@warn@unknown{%
  \MT@warning@nl{%
    Unknown slot number of character\MessageBreak`\the\MT@toks'%
    \MT@warn@maybe@inputenc\MessageBreak
    in font encoding `\MT@encoding' in \MT@curr@list@name}%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@warn@maybe@inputenc}
% In case an input encoding had been requested.
%    \begin{macrocode}
\def\MT@warn@maybe@inputenc{%
  \MT@ifdefined@n@T
     {MT@\MT@feat @\MT@cat @\csname MT@\MT@feat @\MT@cat @name\endcsname @inputenc}%
    { (input encoding `\@nameuse
     {MT@\MT@feat @\MT@cat @\csname MT@\MT@feat @\MT@cat @name\endcsname @inputenc}')}%
}
%    \end{macrocode}
%\end{macro}
\def\MT@warn@unknown@once#1{%
  \def\MT@warn@unknown{%
    \MT@warning@nl{One or more slots in the configuration are unknown.\MessageBreak
                   Make sure that no text commands are used.\MessageBreak
                   See the documentation for details (the note\MessageBreak
                   on `#1' in section 9: `Hints and caveats')}%
    \MT@glet\MT@warn@unknown\relax}%
}
%
%\subsubsection{Hook into \LaTeX's font selection}\label{sssec:impl.hook}
%
% We append \cs{MT@setupfont} to \cmd\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, it is not necessary to declare in
% advance which fonts should benefit from micro-typographic treatment. Also,
% only those fonts that are actually being used will be set up.
%
% For my reference:
%\begin{itemize}
%  \item \cmd\pickup@font\ is called by \cmd\selectfont, \cmd\wrong@fontshape,
%     or \\ \cmd\getanddefine@fonts\ (for math).
%  \item \cmd\pickup@font\ calls \cmd\define@newfont.
%  \item \cmd\define@newfont\ may call (inside a group!)
%  \begin{itemize}
%     \item \cmd\wrong@fontshape, which in turn will call \cmd\pickup@font,
%        and thus \\ \cmd\define@newfont\ again, or
%     \item \cmd\extract@font.
%  \end{itemize}
%  \item \cmd\get@external@font\ is called by \cmd\extract@font, by itself,
%        and by the substitution macros.
%\end{itemize}
%
%\iffalse
%\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}
%\fi
%\changes{v1.4}{2004/11/04}{use \cmd\pickup@font\ instead of \cmd\define@newfont\
%                           as the hook for \cs{MT@setupfont}}
% Up to version 1.3 of this package, we were using \cmd\define@newfont\ as the
% hook, which is only called for \emph{new} fonts, and therefore seemed the
% natural choice. However, this meant that we had to take special care to catch
% all fonts: we additionally had to set up the default font, the error font (if
% it wasn't the default font), we had to check for some packages that might
% have been loaded before \microtype\ and were loading fonts, \eg,
% \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), and the \pkg{memoir} class, too. To cut this
% short: it seemed to get out of hand, and I decided that it would be better to
% use \cmd\pickup@font\ and decide for ourselves whether we've already seen
% that font. I hope the overhead isn't too large.
%\changes{v1.8}{2005/05/15}{if font substitution has occurred, set up the
%                           substitute font, not the selected one}
%\changes{v1.9}{2005/10/03}{allow context-specific font setup}
%\begin{macro}{\MT@font@list}
%\begin{macro}{\MT@font}
% We use a comma separated list.
%    \begin{macrocode}
\let\MT@font@list\@empty
\let\MT@font\@empty
%    \end{macrocode}
%\end{macro}
%\end{macro}
% All this is done at the beginning of the document.
% It doesn't work for plain, of course, which doesn't have \cmd\pickup@font.
%    \begin{macrocode}
%</package>
%<*package|letterspace>
%<plain>\MT@requires@latex2{
\MT@addto@setup{%
%    \end{macrocode}
%\begin{macro}{\MT@orig@pickupfont}
% The \pkg{luatexja} package redefines \cmd\char, which will upset our parsing
% of text symbols and commands; instead of fixing this, we won't bother,
% at least for the moment, but simply issue a warning and disable all
% further warnings. The fix is left to the user by not specifying any text
% commands but only (Unicode) letters.
%\changes{v2.6}{2015/12/05}{(in)compatibility with \pkg{luatexja}: disable unknown slots warnings
%                          (reported by \contributor Max <@\at @>)}
%                           ^^A https://tex.stackexchange.com/questions/272102/luatexja-with-microtype-generates-lots-of-warnings
% The \pkg{xeCJK} package, or rather its \pkg{xunicode-addon}, also modifies the way
% text symbols are defined (like \pkg{luatexja} but in a different way).
% Again, we only issue a warning.
%\changes{v2.6}{2015/11/03}{(in)compatibility with \pkg{xeCJK}: disable unknown slots warnings
%                           (reported by \contributor HcN <@\at @>)}
%                           ^^A https://tex.stackexchange.com/questions/275653/warning-using-microtype-and-excjk-packages
%    \begin{macrocode}
%<package>  \MT@with@package@T{luatexja}{\MT@warn@unknown@once{luatexja}}%
%<package>  \MT@with@package@T{xeCJK}   {\MT@warn@unknown@once{xeCJK}}%
%    \end{macrocode}
%\changes{v2.1}{2007/01/15}{compatibility with \pkg{CJK}: also check for its definition}
%\changes{v2.3b}{2008/05/26}{compatibility with \pkg{CJKutf8}: also check for its definition}
% \microtype\ also works with \pkg{CJK} in the sense that nothing will break
% when both packages are used at the same time. However, since \pkg{CJK} has
% its own way of encoding, it is currently not possible to create
% character-specific settings. That is, the only feature available with
% \pkg{CJK} fonts is (non-selected) expansion.
% (Tracking doesn't really work for other reasons.)
%\todo{fix tracking with \pkg{CJK}, if worth the trouble}^^A
% Like us, \pkg{CJK} redefines \cmd\pickup@font.
%    \begin{macrocode}
  \@ifpackageloaded{CJK}{%
%    \end{macrocode}
%\changes{v2.6}{2013/06/06}{compatibility with \pkg{xeCJK}: pretend that \pkg{CJK} wasn't loaded}
% The \pkg{xeCJK} package in turn pretends that \pkg{CJK} was loaded, but does not
% change the definition of \cmd\pickup@font.
% With \pkg{xeCJK}, protrusion should be possible also for C/J/K characters;
% I haven't tried it, though.
%^^A also, \XeTeXinterchartoks probably interferes ...
%    \begin{macrocode}
    \@ifpackageloaded{xeCJK}{\@firstofone}{%
      \@ifpackagelater{CJK}{2006/10/17}% 4.7.0
        {\def\MT@orig@pickupfont{\CJK@ifundefined\CJK@plane}}%
        {\def\MT@orig@pickupfont{\@ifundefined{CJK@plane}}}%
      \g@addto@macro\MT@orig@pickupfont
        {{\expandafter\ifx\font@name\relax\define@newfont\fi}}%
%    \end{macrocode}
% \pkg{CJKutf8} redefines \cmd\pickup@font\ once more (recent versions, in
% <PDF> mode, as determined by \pkg{ifpdf}, which \pkg{CJKutf8} loads).
%    \begin{macrocode}
      \@ifpackageloaded{CJKutf8}%
        {\@ifpackagelater{CJKutf8}{2008/05/22}% 4.8.0
          {\ifpdf\expandafter\@secondoftwo\else\expandafter\@firstoftwo\fi}%
          {\@firstoftwo}}%
        {\@firstoftwo}%
      {\g@addto@macro\MT@orig@pickupfont{%
        {\expandafter\ifx\csname\curr@fontshape/\f@size/\CJK@plane\endcsname\relax
           \define@newfont\else\xdef\font@name{%
             \csname \curr@fontshape/\f@size/\CJK@plane\endcsname}\fi}}}%
      {\g@addto@macro\MT@orig@pickupfont{%
        {\expandafter\ifx\csname \curr@fontshape/\f@size/\CJK@plane\endcsname\relax
           \define@newfont\def\CJK@temp{v}%
           \ifx\CJK@temp\CJK@plane
             \expandafter\ifx\csname CJK@cmap@\f@family\CJK@plane\endcsname\relax
             \else\csname CJK@cmap@\f@family\CJK@plane\endcsname\fi
           \else \CJK@addcmap\CJK@plane \fi
         \else\xdef\font@name{%
           \csname \curr@fontshape/\f@size/\CJK@plane\endcsname}\fi}}}%
      \@gobble
    }%
  }{\@firstofone}%
%    \end{macrocode}
% This is the normal \LaTeX\ definition.
%    \begin{macrocode}
  {\def\MT@orig@pickupfont{\expandafter\ifx\font@name\relax\define@newfont\fi}}%
%    \end{macrocode}
% Check whether \cmd\pickup@font\ is defined as expected.
% The warning issued by \cmd{\CheckCommand*} would be a bit too generic.
%    \begin{macrocode}
  \ifx\pickup@font\MT@orig@pickupfont \else
    \MT@warning@nl{%
      Command \string\pickup@font\space is not defined as expected.%
      \MessageBreak Patching it anyway. Some things may break%
%<*package>
     .\MessageBreak Double-check whether micro-typography is indeed%
      \MessageBreak applied to the document.%
      \MessageBreak (Hint: Turn on `verbose' mode)%
%</package>
    }%
  \fi
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\pickup@font}
% Then we append our stuff. Everything is done inside a group.
%\changes{v2.2}{2007/04/15}{\letterspace: setup inside group}
%    \begin{macrocode}
  \g@addto@macro\pickup@font{\begingroup}%
%    \end{macrocode}
% If the \pkg{trace} package is loaded, we turn off tracing of \microtype's
% setup, which is extremely noisy.
%\changes{v1.9e}{2006/05/25}{no tracing with \pkg{trace} package}
%    \begin{macrocode}
  \MT@with@package@T{trace}{\g@addto@macro\pickup@font{\conditionally@traceoff}}%
  \g@addto@macro\pickup@font{%
      \escapechar\m@ne
%<*package>
%<debug>      \global\MT@inannottrue
%<debug>      \MT@glet\MT@pdf@annot\@empty
%<debug>      \MT@addto@annot{(line \number\inputlineno)}%
%    \end{macrocode}
% If \cs{MT@font} is empty, no substitution has taken place, hence
% \cmd\font@name\ is correct. Otherwise, if they are different,
% \cmd\font@name\ does not describe the font actually used. This test will
% catch first order substitutions, like |bx| to |b|, but it will still fail if
% the substituting font is itself substituted.
%    \begin{macrocode}
      \MT@let@cn\MT@font{MT@subst@\expandafter\string\font@name}%
      \ifx\MT@font\relax
        \let\MT@font\font@name
      \else
        \ifx\MT@font\font@name \else
%<debug>  \MT@addto@annot{= substituted with \MT@@font}%
          \MT@register@subst@font
        \fi
      \fi
      \MT@setupfont
%</package>
%<letterspace>      \MT@tracking
    \endgroup
  }%
%<*package>
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@pickupfont}
%\begin{macro}{\MT@MT@pickupfont}
%\begin{macro}{\MT@ltx@pickupfont}
% Remember the patched command, because we may have to disable
% ourselves in certain situations.
%    \begin{macrocode}
  \let\MT@pickupfont\pickup@font
  \def\MT@MT@pickupfont {\let\pickup@font\MT@pickupfont}%
  \def\MT@ltx@pickupfont{\let\pickup@font\MT@orig@pickupfont}%
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\end{macro}
%\begin{macro}{\do@subst@correction}
% Additionally, we hook into \cmd\do@subst@correction, which is called if
% a substitution has taken place, to record the name of the ersatz font.
% Unfortunately, this will only work for one-level substitutions.
%\changes{v2.3}{2007/08/05}{remember substitute font for all times
%                           (reported by \contributor Stephan Hennig <stephanhennig\at arcor.de>)}
%                               ^^A MID: <46ab4fbb$0$31632$9b4e6d93@newsspool3.arcor-online.net>
% We have to remember the substitute for the rest of the document, not just for
% the first time it is called, since we need it every time a font is
% letterspaced.
%    \begin{macrocode}
  \g@addto@macro\do@subst@correction
    {\edef\MT@font{\csname\curr@fontshape/\f@size\endcsname}%
     \MT@glet@nc{MT@subst@\expandafter\string\font@name}\MT@font}%
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\add@accent}
%\changes{v1.8}{2005/06/14}{fix: disable micro-typographic setup inside \cmd\add@accent\
%               (reported by \contributor Stephan Hennig <stephanhennig\at arcor.de>)}
%                    ^^A MID: <42adb0e3$0$27784$9b4e6d93@newsread2.arcor-online.net>
%\begin{macro}{\MT@orig@add@accent}
% Inside \cmd\add@accent, we have to disable \microtype's setup, since the
% grouping in the patched \cmd\pickup@font\ would break the accent if
% different fonts are used for the base character and the accent. Fortunately,
% \LaTeX\ takes care that the fonts used for the \cmd\accent\ are already set
% up, so that we cannot be overlooking them.
%    \begin{macrocode}
  \let\MT@orig@add@accent\add@accent
  \def\add@accent#1#2{%
    \MT@ltx@pickupfont
    \MT@orig@add@accent{#1}{#2}%
    \MT@MT@pickupfont
  }%
%</package>
}
%<plain>}\relax
%<*package>
%    \end{macrocode}
%\end{macro}
%\end{macro}
% Consequently (if all goes well), we are the last ones to change these
% commands, therefore there is no need to check whether our definition has
% survived.
%\changes{v1.6}{2004/12/29}{test whether \cmd\pickup@font\ has changed}
%\changes{v1.9a}{2005/11/21}{remove superfluous test whether \cmd\pickup@font\ has changed}
%
%\begin{macro}{\MT@check@font}
% Check whether we've already seen the current font.
%    \begin{macrocode}
\def\MT@check@font{\MT@exp@one@n\MT@in@clist\MT@font\MT@font@list}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@register@font}
% Register the current font.
%    \begin{macrocode}
\def\MT@register@font{\xdef\MT@font@list{\MT@font@list\MT@font,}}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@register@subst@font}
% Register the substituted font
%\changes{v2.5}{2010/08/23}{only register substituted font if it isn't registered already
%                           (reported by \contributor George Gratzer <gratzer\at me.com>
%                            and \contributor Josep Maria Font <jmfont\at ub.edu>)}
%                             ^^A 1. <http://permalink.gmane.org/gmane.comp.tex.macosx/38293>
%                             ^^A 2. <http://permalink.gmane.org/gmane.comp.tex.macosx/38303>
%                             ^^A (beta:02)
% (only if it isn't registered already).
%\changes{v2.7d}{2019/10/28}{remove substitute font from list
%                            (reported by \contributor Markus Kohm <komascript\at gmx.info>)}
%                             ^^A private mail, 2019/01/16
%                             ^^A https://tex.stackexchange.com/q/470311
% Additionally, we have to remove the substitute font from the list of fonts,
% so that we set it up again.
%    \begin{macrocode}
\def\MT@register@subst@font{%
  \MT@exp@one@n\MT@in@clist\font@name\MT@font@list
  \ifMT@inlist@\else
    \xdef\MT@font@list{\MT@font@list\font@name,}%
    \expandafter\MT@rem@from@clist\MT@font\MT@font@list
  \fi
}
%    \end{macrocode}
%\end{macro}
%
%\subsubsection{Context-sensitive setup}
%
% Here are the variants for context-sensitive setup.
%\begin{macro}{\MT@active@features}
% The activated features are stored in this command.
%    \begin{macrocode}
\let\MT@active@features\@empty
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@check@font@cx}
% Every feature has its own list of fonts that have already been dealt with. If
% the font needn't be set up for a feature, we temporarily disable the
% corresponding setup command.
%\changes{v1.9a}{2005/11/14}{optimise context-sensitive setup}
% This should be more efficient than book-keeping the fonts in lists associated
% with the combination of contexts, as we've done it before.
%    \begin{macrocode}
\def\MT@check@font@cx{%
  \MT@if@true
  \MT@map@clist@c\MT@active@features{%
    \expandafter\MT@exp@one@n\expandafter\MT@in@clist\expandafter\MT@font
      \csname MT@##1@\csname MT@##1@context\endcsname font@list\endcsname
    \ifMT@inlist@
      \MT@let@nc{MT@\@nameuse{MT@abbr@##1}}\relax
    \else
      \MT@if@false
    \fi
  }%
  \ifMT@if@ \MT@inlist@true \else \MT@inlist@false \fi
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@register@subst@font@cx}
% Add the substituted font to each feature list and possibly remove substitute font.
%\todo{remove from other lists?}
%\changes{v2.5}{2010/08/23}{only register if it isn't registered already} ^^A (beta:02)
%\changes{v2.7d}{2019/10/28}{remove substitute font from lists}
%    \begin{macrocode}
\def\MT@register@subst@font@cx{%
  \MT@map@clist@c\MT@active@features{%
    \expandafter\MT@exp@one@n\expandafter\MT@in@clist\expandafter\font@name
      \csname MT@##1@\csname MT@##1@context\endcsname font@list\endcsname
    \ifMT@inlist@ \else
      \MT@exp@cs\MT@xadd
        {MT@##1@\csname MT@##1@context\endcsname font@list}%
        {\font@name,}%
      \expandafter\MT@exp@one@n\expandafter\MT@rem@from@clist\expandafter\MT@font
         \csname MT@##1@\csname MT@##1@context\endcsname font@list\endcsname
    \fi
  }%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@register@font@cx}
% For each feature, add the current font to the list, unless we didn't set it
% up.
%    \begin{macrocode}
\def\MT@register@font@cx{%
  \MT@map@clist@c\MT@active@features{%
    \MT@exp@cs\ifx{MT@\@nameuse{MT@abbr@##1}}\relax\else
      \MT@exp@cs\MT@xadd
        {MT@##1@\csname MT@##1@context\endcsname font@list}%
        {\MT@font,}%
      \def\@tempa{##1}%
      \MT@exp@cs\MT@map@tlist@c{MT@##1@doc@contexts}\MT@maybe@rem@from@list
    \fi
  }%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@maybe@rem@from@list}
% Recurse through all context font lists of the document and remove the font,
% unless it's the current context.
%    \begin{macrocode}
\def\MT@maybe@rem@from@list#1{%
  \MT@ifstreq{\@tempa/#1}{\@tempa/\csname MT@\@tempa @context\endcsname}\relax{%
    \expandafter\MT@exp@one@n\expandafter\MT@rem@from@clist\expandafter
       \MT@font \csname MT@\@tempa @#1font@list\endcsname
  }%
}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\microtypecontext}
%\changes{v1.9}{2005/10/03}{new command: change setup context in the document}
%\changes{v2.3}{2007/08/05}{made robust (reported by \contributor Stephan Hennig <stephanhennig\at arcor.de>)}
%                                           ^^A MID: <46ab4fbb$0$31632$9b4e6d93@newsspool3.arcor-online.net>
%\changes{v2.6}{2014/03/26}{allow \texttt{activate} shortcut (reported by \contributor Karl Berry <karl\at freefriends.org>)}
%                                           ^^A private mail, 2014/03/21
%\changes{v2.8}{2019/11/25}{fix \texttt{activate} shortcut}
%\changes{v2.8}{2019/12/12}{ignore spaces}
%\begin{macro}{\MT@microtypecontext}
% The user may change the context, so that different setups are possible. This
% is especially useful for multi-lingual documents.
%
% Inside the preamble, this command shouldn't actually do anything but remember itself for
% later.
%    \begin{macrocode}
\def\microtypecontext{\MT@begin@catcodes\MT@microtypecontext}
\def\MT@microtypecontext#1{\MT@end@catcodes\MT@addto@setup{\microtypecontext{#1}}}
\MT@addto@setup{%
  \DeclareRobustCommand\microtypecontext{%
    \MT@begin@catcodes
    \MT@microtypecontext
  }%
  \def\MT@microtypecontext#1{%
    \MT@end@catcodes
    \MT@setup@contexts
    \let\MT@reset@context\relax
%    \end{macrocode}
% We need to ensure that math fonts are set up anew.
%\changes{v2.5}{2012/11/13}{fix: ensure to set up math fonts (reported by \contributor RazorXsr <@\at @>)}
%                           ^^A https://tex.stackexchange.com/questions/82556/pdftex-font-expansion-error-setexpansion-in-microtype-package
%    \begin{macrocode}
    \MT@glet\glb@currsize\@empty
    \setkeys{MTC}{#1}%
    \selectfont
    \MT@reset@context
  }%
}
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\begin{macro}{\textmicrotypecontext}
%\changes{v2.2}{2007/07/03}{new command: wrapper around \cs{microtypecontext}}
%\changes{v2.8}{2019/12/12}{ignore spaces}
%\begin{macro}{\MT@textmicrotypecontext}
%\begin{macro}{\MT@text@microtypecontext}
% This is just a wrapper around \cs{microtypecontext}.
%    \begin{macrocode}
\DeclareRobustCommand\textmicrotypecontext{\MT@begin@catcodes\MT@textmicrotypecontext}
\def\MT@textmicrotypecontext#1{\MT@end@catcodes\MT@text@microtypecontext{#1}}
\def\MT@text@microtypecontext#1#2{{\microtypecontext{#1}#2}}
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\end{macro}
%\begin{macro}{\MT@reset@context}
%\changes{v1.9f}{2006/08/03}{only reset context if it has actually been changed}
%\begin{macro}{\MT@reset@context@}
% We have to reset the font at the end of the group, provided there actually was
% a change.
%    \begin{macrocode}
\def\MT@reset@context@{%
  \MT@vinfo{<<< Resetting contexts\on@line
%<debug>  \MessageBreak= \MT@pr@context/\MT@ex@context
%<debug>                /\MT@tr@context/\MT@kn@context/\MT@sp@context
  }%
  \selectfont
}
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\begin{macro}{\MT@setup@contexts}
% The first time \cs{microtypecontext} is called, we initialise the context
% lists and redefine the commands used in \cmd\pickup@font.
%    \begin{macrocode}
\def\MT@setup@contexts{%
  \MT@map@clist@c\MT@active@features
    {\MT@glet@nc{MT@##1@@font@list}\MT@font@list}%
  \MT@glet\MT@check@font\MT@check@font@cx
  \MT@glet\MT@register@font\MT@register@font@cx
  \MT@glet\MT@register@subst@font\MT@register@subst@font@cx
  \MT@glet\MT@setup@contexts\relax
}
%    \end{macrocode}
%\end{macro}
% Define context keys.
%    \begin{macrocode}
\MT@map@clist@c\MT@features@long{%
  \define@key{MTC}{#1}[]{%
    \edef\@tempb{\@nameuse{MT@rbba@#1}}%
    \MT@exp@one@n\MT@in@clist\@tempb\MT@active@features
    \ifMT@inlist@
%    \end{macrocode}
% Using an empty context is only asking for trouble, therefore we choose the
% `|@|' instead (hoping for the \LaTeX\ users' natural awe of this character).
%    \begin{macrocode}
      \MT@ifempty{##1}{\def\MT@val{@}}{\def\MT@val{##1}}%
      \MT@exp@cs\ifx{MT@\@tempb @context}\MT@val
%<debug>\MT@dinfo{1}{>>> no change of #1 context: `\MT@val'}%
      \else
        \MT@vinfo{>>> Changing #1 context to `\MT@val'\MessageBreak\on@line
%<debug>          \space(previous: `\@nameuse{MT@\@tempb @context}')%
                 }%
        \def\MT@reset@context{\aftergroup\MT@reset@context@}%
%    \end{macrocode}
% The next time we see the font, we have to reset \emph{all} factors.
%^^A TODO: only for pdftex? or why at all?
%    \begin{macrocode}
        \MT@glet@nn{MT@reset@\@tempb @codes}{MT@reset@\@tempb @codes@}%
%    \end{macrocode}
% We must also keep track of all contexts in the document.
%    \begin{macrocode}
        \expandafter\MT@exp@one@n\expandafter\MT@in@tlist\expandafter
          \MT@val \csname MT@\@tempb @doc@contexts\endcsname
        \ifMT@inlist@ \else
          \MT@exp@cs\MT@xadd{MT@\@tempb @doc@contexts}{{\MT@val}}%
%<debug>  \MT@dinfo{1}{||| added #1 context: \@nameuse{MT@\@tempb @doc@contexts}}%
        \fi
        \MT@edef@n{MT@\@tempb @context}{\MT@val}%
      \fi
    \fi
  }%
}
%    \end{macrocode}
% We also allow the |activate| shortcut.
%    \begin{macrocode}
\define@key{MTC}{activate}[]{%
  \setkeys{MTC}{protrusion={#1}}%
  \setkeys{MTC}{expansion={#1}}%
}
%    \end{macrocode}
%\begin{macro}{\MT@pr@context}
%\begin{macro}{\MT@ex@context}
%\begin{macro}{\MT@tr@context}
%\begin{macro}{\MT@sp@context}
%\begin{macro}{\MT@kn@context}
%\begin{macro}{\MT@pr@doc@contexts}
%\begin{macro}{\MT@ex@doc@contexts}
%\begin{macro}{\MT@tr@doc@contexts}
%\begin{macro}{\MT@sp@doc@contexts}
%\begin{macro}{\MT@kn@doc@contexts}
%\begin{macro}{\MT@extra@context}
% Initialise the contexts.
%    \begin{macrocode}
\MT@exp@one@n\MT@map@clist@n{\MT@features,nl}{%
  \MT@def@n{MT@#1@context}{@}%
  \MT@def@n{MT@#1@doc@contexts}{{@}}%
}
\let\MT@extra@context\@empty
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%
%\subsection{Configuration}
%
%\subsubsection{Font sets}
%\todo{allow for \texttt{load}ing and extending another set; or using more than one set?}
%
%\begin{macro}{\DeclareMicrotypeSet}
%^^A \changes{v1.1}{2004/09/15}{remove spaces around first argument}
%\changes{v2.6}{2013/08/05}{ignore spaces}
%\begin{macro}{\DeclareMicrotypeSet*}
% Calling this macro will create a comma list for every font attribute of the
% form: |\MT|\meta{feature}|list@|\meta{attribute}|@|\meta{set name}. If the
% optional argument is empty, lists for all available features will be created.
%
% The third argument must be a list of |key=value| pairs. If a font attribute
% is not specified, we define the corresponding list to \cmd\relax, so that it
% does not constitute a constraint.
%    \begin{macrocode}
\def\DeclareMicrotypeSet{%
  \MT@begin@catcodes
  \@ifstar
    \MT@DeclareSetAndUseIt
    \MT@DeclareSet
}
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\begin{macro}{\MT@DeclareSet}
%    \begin{macrocode}
\newcommand\MT@DeclareSet[3][]{%
  \MT@ifempty{#1}{%
    \MT@map@clist@c\MT@features{{\MT@declare@sets{##1}{#2}{#3}}}%
  }{%
    \MT@map@clist@n{#1}{{%
      \MT@ifempty{##1}\relax{%
        \MT@is@feature{##1}{set declaration `#2'}{%
          \MT@exp@one@n\MT@declare@sets
            {\csname MT@rbba@##1\endcsname}{#2}{#3}%
        }%
      }%
    }}%
  }%
  \MT@end@catcodes
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@DeclareSetAndUseIt}
%    \begin{macrocode}
\newcommand\MT@DeclareSetAndUseIt[3][]{%
  \MT@DeclareSet[#1]{#2}{#3}%
  \UseMicrotypeSet[#1]{#2}%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@curr@set@name}
% We need to remember the name of the set currently being declared.
%    \begin{macrocode}
\let\MT@curr@set@name\@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}
%\changes{v1.8}{2005/05/15}{warning when redefining a set}
%\changes{v2.0}{2006/10/16}{fix: empty size list when redefining set}
%\changes{v2.6}{2016/04/20}{fix: undefine lists for redefining}
%\todo{share one set between features}
%    \begin{macrocode}
\def\MT@declare@sets#1#2#3{%
  \def\MT@curr@set@name{#2}%
  \MT@ifdefined@n@T{MT@#1@set@@\MT@curr@set@name}{%
    \MT@warning{Redefining \@nameuse{MT@abbr@#1} set `\MT@curr@set@name'}%
    \MT@map@clist@n{font,encoding,family,series,shape,size}{%
      \MT@glet@nc{MT@#1list@##1@\MT@curr@set@name}\@undefined
    }%
  }%
  \MT@glet@nc{MT@#1@set@@\MT@curr@set@name}\@empty
%<debug>\MT@dinfo{1}{declaring \@nameuse{MT@abbr@#1} set `\MT@curr@set@name'}%
  \setkeys{MT@#1@set}{#3}%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@define@set@key@}
% \meta{\#1} = font axis, \meta{\#2} = feature.
%\changes{v1.8}{2005/04/16}{use comma lists instead of token lists}
%\changes{v1.9a}{2005/11/21}{don't expand variables immediately
%                (requested by \contributor Georg Verweyen <verweyen\at gmail.com>)}
%                   ^^A MID: <437a522d$0$7419$9b4e6d93@newsread4.arcor-online.net>
%    \begin{macrocode}
\def\MT@define@set@key@#1#2{%
  \define@key{MT@#2@set}{#1}[]{%
    \MT@glet@nc{MT@#2list@#1@\MT@curr@set@name}\@empty
    \MT@map@clist@n{##1}{%
      \KV@@sp@def\MT@val{####1}%
      \MT@get@highlevel{#1}%
%    \end{macrocode}
% We do not add the expanded value to the list~\dots
%    \begin{macrocode}
      \MT@exp@two@n\g@addto@macro
        {\csname MT@#2list@#1@\MT@curr@set@name\expandafter\endcsname}%
        {\MT@val,}%
    }%
%    \end{macrocode}
% \dots~but keep in mind that the list has to be expanded at the end of the
% preamble.
%    \begin{macrocode}
    \expandafter\g@addto@macro\expandafter\MT@font@sets
      \csname MT@#2list@#1@\MT@curr@set@name\endcsname
%<debug>\MT@dinfo@nl{1}{-- #1: \@nameuse{MT@#2list@#1@\MT@curr@set@name}}%
  }%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@get@highlevel}
% Saying, for instance, `|family=rm*|' or `|shape=bf*|' will expand to
% \cmd\rmdefault\ resp. \cmd\bfdefault.
%    \begin{macrocode}
\def\MT@get@highlevel#1{%
  \expandafter\MT@test@ast\MT@val*\@nil\relax{%
%    \end{macrocode}
% And `|family = *|' will become \cmd\familydefault.
%    \begin{macrocode}
    \MT@ifempty\@tempa{\def\@tempa{#1}}\relax
%    \end{macrocode}
% Test whether the command is actually defined.
%\changes{v2.7a}{2017/11/17}{test whether \cs{\dots default} is defined}
%    \begin{macrocode}
    \MT@ifdefined@n@TF{\@tempa default}%
      {\edef\MT@val{\expandafter\noexpand\csname \@tempa default\endcsname}}%
      {\MT@warning{`\@backslashchar\@tempa default' is not a defined command.\MessageBreak
                   Ignoring `#1 = {\@tempa*}' in font set\MessageBreak`\MT@curr@set@name'}%
       \let\MT@val\@empty}%
%    \end{macrocode}
% In contrast to earlier versions, these values will not be expanded immediately,
% but at the end of the preamble.
%\changes{v1.2}{2004/09/26}{check whether defaults have changed}
%\changes{v1.5}{2004/12/02}{don't test defaults if called after begin document}
%\changes{v1.9a}{2005/11/21}{no longer check whether defaults have changed}
%    \begin{macrocode}
  }%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@test@ast}
% It the last character is an asterisk, execute the second argument, otherwise
% the first one.
%\changes{v1.7}{2005/03/10}{make it simpler}
%    \begin{macrocode}
\def\MT@test@ast#1*#2\@nil{%
  \def\@tempa{#1}%
  \MT@ifempty{#2}%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@font@sets}
%\begin{macro}{\MT@fix@font@set}
% Fully expand the font specification and fix catcodes for all font sets. Also
% remove \pkg{fontspec}'s counters.
%    \begin{macrocode}
\let\MT@font@sets\@empty
\def\MT@fix@font@set#1{%
  \MT@ifdefined@c@T{#1}{%
    \xdef#1{#1}%
    \ifMT@fontspec
      \xdef#1{\expandafter\MT@scrubfeatures#1()\relax}%
    \fi
    \global\@onelevel@sanitize#1%
  }%
}
%    \end{macrocode}
%\end{macro}
%\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}[]{%
    \MT@map@clist@n{##1}{%
      \def\MT@val{####1}%
      \expandafter\MT@get@range\MT@val--\@nil
      \ifx\MT@val\relax \else
        \MT@exp@cs\MT@xadd
          {MT@#1list@size@\MT@curr@set@name}%
          {{{\MT@lower}{\MT@upper}\relax}}%
      \fi
    }%
%<debug>\MT@dinfo@nl{1}{-- size: \@nameuse{MT@#1list@size@\MT@curr@set@name}}%
  }%
}
%    \end{macrocode}
%\end{macro}
%\changes{v1.7}{2005/03/11}{allow specification of size ranges
%               (suggested by \contributor Andreas B\"uhmann <andreas.buehmann\at web.de>)}
%                                                            ^^A private mail, 2005/03/10
% Font sizes may also be specified as ranges. This has been requested by Andreas
% B\"uhmann, who has also offered valuable help in implementing this. Now, it
% is for instance possible to set up different lists for fonts with optical
% sizes. (The \pkg{MinionPro} project does this for the OpenType version
% of Adobe's Minion. (\ctanpkgurl{minionpro}))
%
%\begin{macro}{\MT@get@range}
%\begin{macro}{\MT@upper}
%\begin{macro}{\MT@lower}
% Ranges will be stored as triplets of |{|\meta{lower bound}|}|\allowbreak
% |{|\meta{upper bound}|}|\allowbreak|{|\meta{list name}|}|.
% For simple sizes, the upper boundary is \textminus1.
%    \begin{macrocode}
\def\MT@get@range#1-#2-#3\@nil{%
  \MT@ifempty{#1}{%
    \MT@ifempty{#2}{%
      \let\MT@val\relax
    }{%
      \def\MT@lower{0}%
      \def\MT@val{#2}%
      \MT@get@size
      \edef\MT@upper{\MT@val}%
    }%
  }{%
    \def\MT@val{#1}%
    \MT@get@size
    \ifx\MT@val\relax \else
      \edef\MT@lower{\MT@val}%
      \MT@ifempty{#2}{%
        \MT@ifempty{#3}%
          {\def\MT@upper{-1}}%
%    \end{macrocode}
% 2048\,pt is \TeX's maximum font size.
%    \begin{macrocode}
          {\def\MT@upper{2048}}%
      }{%
        \def\MT@val{#2}%
        \MT@get@size
        \ifx\MT@val\relax \else
          \MT@ifdim\MT@lower>\MT@val{%
            \MT@error{%
              Invalid size range (\MT@lower\space > \MT@val) in font set
              `\MT@curr@set@name'.\MessageBreak Swapping sizes}{}%
            \edef\MT@upper{\MT@lower}%
            \edef\MT@lower{\MT@val}%
          }{%
            \edef\MT@upper{\MT@val}%
          }%
          \MT@ifdim\MT@lower=\MT@upper
            {\def\MT@upper{-1}}%
            \relax
        \fi
      }%
    \fi
  }%
}
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\end{macro}
%\begin{macro}{\MT@get@size}
% Translate a size selection command and normalise it.
%    \begin{macrocode}
\def\MT@get@size{%
%    \end{macrocode}
% A single star would mean \cs{sizedefault}, which doesn't exist, so we define
% it to be \cmd\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 \cmd\@setfontsize\ does not work with the
% <AMS> classes, among others. I hope my hijacking doesn't do any harm.
%\changes{v1.2}{2004/09/26}{hijack \cmd\set@fontsize\ instead of \cmd\@setfontsize}
% We redefine \cmd\set@fontsize\ instead of \cmd\@setfontsize\ because some classes
% might define the size selection commands by simply using \cmd\fontsize\
% (\eg, the \pkg{a0poster} class).
%\changes{v2.3b}{2008/03/07}{grouping}
%    \begin{macrocode}
    \begingroup
      \def\set@fontsize##1##2##3##4\@nil{\endgroup\def\MT@val{##2}}%
      \@tempa\@nil
  \fi
%    \end{macrocode}
% Test whether we finally got a number or dimension so that we can strip the
% `|pt|' (\cmd\@defaultunits\ and \cmd\strip@pt\ are kernel macros).
%\changes{v1.2}{2004/09/27}{additional magic to catch some errors}
%    \begin{macrocode}
  \MT@ifdimen\MT@val{%
    \@defaultunits\@tempdima\MT@val pt\relax\@nnil
    \edef\MT@val{\strip@pt\@tempdima}%
  }{%
    \MT@warning{Could not parse font size `\MT@val'\MessageBreak
                in font set `\MT@curr@set@name'}%
    \let\MT@val\relax
  }%
}
%    \end{macrocode}
%\end{macro}
%\changes{v1.9}{2005/07/13}{\cs{DeclareMicrotypeSet}: new key: \texttt{font}}
%\begin{macro}{\MT@define@set@key@font}
%\changes{v2.3}{2007/11/20}{\texttt{font}: single asterisk means normal font}
%    \begin{macrocode}
\def\MT@define@set@key@font#1{%
  \define@key{MT@#1@set}{font}[]{%
    \MT@glet@nc{MT@#1list@font@\MT@curr@set@name}\@empty
    \MT@map@clist@n{##1}{%
      \def\MT@val{####1}%
      \MT@ifstreq\MT@val*{\def\MT@val{*/*/*/*/*}}\relax
      \expandafter\MT@get@font\MT@val/////\@nil
      \MT@exp@two@n\g@addto@macro
        {\csname MT@#1list@font@\MT@curr@set@name\expandafter\endcsname}%
        {\MT@val,}%
    }%
    \expandafter\g@addto@macro\expandafter\MT@font@sets
      \csname MT@#1list@font@\MT@curr@set@name\endcsname
%<debug>\MT@dinfo@nl{1}{-- font: \@nameuse{MT@#1list@font@\MT@curr@set@name}}%
  }%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@get@font}
% Translate any asterisks.
%    \begin{macrocode}
\def\MT@get@font#1/#2/#3/#4/#5/#6\@nil{%
  \MT@get@font@{#1}{#2}{#3}{#4}{#5}{0}%
  \ifx\MT@val\relax\def\MT@val{0}\fi
  \expandafter\g@addto@macro\expandafter\@tempb\expandafter{\MT@val}%
  \let\MT@val\@tempb
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@get@font@}
% Helper macro, also used by \cs{MT@get@font@and@size}.
%    \begin{macrocode}
\def\MT@get@font@#1#2#3#4#5#6{%
  \let\@tempb\@empty
  \def\MT@temp{#1/#2/#3/#4/#5}%
  \MT@get@axis{encoding}{#1}%
  \MT@get@axis{family}  {#2}%
  \MT@get@axis{series}  {#3}%
  \MT@get@axis{shape}   {#4}%
  \ifnum#6>\z@\edef\@tempb{\@tempb*}\fi
  \MT@ifempty{#5}{%
    \MT@warn@axis@empty{size}{\string\normalsize}%
    \def\MT@val{*}%
  }{%
    \def\MT@val{#5}%
  }%
  \MT@get@size
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@get@axis}
%    \begin{macrocode}
\def\MT@get@axis#1#2{%
  \def\MT@val{#2}%
  \MT@get@highlevel{#1}%
  \MT@ifempty\MT@val{%
    \MT@warn@axis@empty{#1}{\csname #1default\endcsname}%
    \expandafter\def\expandafter\MT@val\expandafter{\csname #1default\endcsname}%
  }\relax
  \expandafter\g@addto@macro\expandafter\@tempb\expandafter{\MT@val/}%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@warn@axis@empty}
%    \begin{macrocode}
\def\MT@warn@axis@empty#1#2{%
  \MT@warning{#1 axis is empty in font specification\MessageBreak
    `\MT@temp'. Using `#2' instead}%
}
%    \end{macrocode}
%\end{macro}
% We can finally assemble all pieces to define \cs{DeclareMicrotypeSet}'s
% keys.
% They are also used for \cs{DisableLigatures}.
%    \begin{macrocode}
\MT@exp@one@n\MT@map@clist@n{\MT@features,nl}{%
  \MT@define@set@key@{encoding}{#1}%
  \MT@define@set@key@{family}  {#1}%
  \MT@define@set@key@{series}  {#1}%
  \MT@define@set@key@{shape}   {#1}%
  \MT@define@set@key@size      {#1}%
  \MT@define@set@key@font      {#1}%
}
%    \end{macrocode}
%\begin{macro}{\UseMicrotypeSet}
% To use a particular set we simply redefine |MT@|\meta{feature}|@setname|.
% If the optional argument is empty, set names for all features will be
% redefined.
%^^A \changes{v1.1}{2004/09/20}{remove spaces around first argument}
%\changes{v2.6}{2013/08/05}{ignore spaces}
%    \begin{macrocode}
\def\UseMicrotypeSet{%
  \MT@begin@catcodes
  \MT@UseMicrotypeSet
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@UseMicrotypeSet}
%    \begin{macrocode}
\newcommand*\MT@UseMicrotypeSet[2][]{%
  \MT@ifempty{#1}{%
    \MT@map@clist@c\MT@features{{\MT@use@set{##1}{#2}}}%
  }{%
    \MT@map@clist@n{#1}{{%
      \MT@ifempty{##1}\relax{%
        \MT@is@feature{##1}{activation of set `#2'}{%
          \MT@exp@one@n\MT@use@set
            {\csname MT@rbba@##1\endcsname}{#2}%
        }%
      }%
    }}%
  }%
  \MT@end@catcodes
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@pr@setname}
%\begin{macro}{\MT@ex@setname}
%\begin{macro}{\MT@tr@setname}
%\begin{macro}{\MT@sp@setname}
%\begin{macro}{\MT@kn@setname}
%\begin{macro}{\MT@use@set}
% Only use sets that have been declared.
%\changes{v1.1}{2004/09/20}{remove spaces around set name}
%\changes{v1.4b}{2004/11/25}{don't use undeclared font sets}
%\changes{v1.6}{2005/01/19}{retain current set if new set is undeclared}
%\changes{v1.8}{2005/05/15}{fix: remove braces in first line}
%    \begin{macrocode}
\def\MT@use@set#1#2{%
  \MT@ifdefined@n@TF{MT@#1@set@@#2}{%
    \MT@xdef@n{MT@#1@setname}{#2}%
  }{%
    \MT@ifdefined@n@TF{MT@#1@setname}\relax{%
      \MT@xdef@n{MT@#1@setname}{\@nameuse{MT@default@#1@set}}%
    }%
    \MT@error{%
      The \@nameuse{MT@abbr@#1} set `#2' is undeclared.\MessageBreak
      Using set `\@nameuse{MT@#1@setname}' instead}{}%
  }%
}
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\begin{macro}{\DeclareMicrotypeSetDefault}
%\changes{v1.8}{2005/05/15}{new command: set default font set}
%\changes{v2.6}{2013/08/05}{ignore spaces}
% This command can be used in the main configuration file to declare the
% default font set, in case no set is specified in the package options.
%    \begin{macrocode}
\def\DeclareMicrotypeSetDefault{%
  \MT@begin@catcodes
  \MT@DeclareMicrotypeSetDefault
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@DeclareMicrotypeSetDefault}
%    \begin{macrocode}
\newcommand*\MT@DeclareMicrotypeSetDefault[2][]{%
  \MT@ifempty{#1}{%
    \MT@map@clist@c\MT@features{{\MT@set@default@set{##1}{#2}}}%
  }{%
    \MT@map@clist@n{#1}{{%
      \MT@ifempty{##1}\relax{%
        \MT@is@feature{##1}{declaration of default set `#2'}{%
          \MT@exp@one@n\MT@set@default@set
            {\csname MT@rbba@##1\endcsname}{#2}%
        }%
      }%
    }}%
  }%
  \MT@end@catcodes
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@default@pr@set}
%\begin{macro}{\MT@default@ex@set}
%\begin{macro}{\MT@default@tr@set}
%\begin{macro}{\MT@default@sp@set}
%\begin{macro}{\MT@default@kn@set}
%\begin{macro}{\MT@set@default@set}
%    \begin{macrocode}
\def\MT@set@default@set#1#2{%
  \MT@ifdefined@n@TF{MT@#1@set@@#2}{%
%<debug>\MT@dinfo{1}{declaring default \@nameuse{MT@abbr@#1} set `#2'}%
    \MT@xdef@n{MT@default@#1@set}{#2}%
  }{%
    \MT@error{%
      The \@nameuse{MT@abbr@#1} set `#2' is not declared.\MessageBreak
      Cannot make it the default set. Using set\MessageBreak `all' instead}{}%
    \MT@xdef@n{MT@default@#1@set}{all}%
  }%
}
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%
%\subsubsection{Variants and aliases}
%
%\begin{macro}{\DeclareMicrotypeVariants}
%\changes{v2.2}{2007/02/04}{new command}
%\changes{v2.6}{2013/08/05}{ignore spaces}
%\begin{macro}{\MT@variants}
% Specify suffixes for variants (see \file{fontname/variants.map}).
% The starred version appends to the list.
%    \begin{macrocode}
\let\MT@variants\@empty
\def\DeclareMicrotypeVariants{%
  \MT@begin@catcodes
  \@ifstar
    \MT@DeclareVariants
    {\let\MT@variants\@empty\MT@DeclareVariants}%
}
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\begin{macro}{\MT@DeclareVariants}
%    \begin{macrocode}
\def\MT@DeclareVariants#1{%
  \MT@map@clist@n{#1}{%
    \def\@tempa{##1}%
    \@onelevel@sanitize\@tempa
    \xdef\MT@variants{\MT@variants{\@tempa}}%
  }%
  \MT@end@catcodes
}
%    \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}
%\changes{v1.8}{2005/05/09}{warning when overriding an alias font}
%\changes{v2.5}{2010/05/17}{ignore spaces}
%    \begin{macrocode}
\def\DeclareMicrotypeAlias{%
  \MT@begin@catcodes
  \MT@DeclareMicrotypeAlias
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@DeclareMicrotypeAlias}
%    \begin{macrocode}
\newcommand*\MT@DeclareMicrotypeAlias[2]{%
  \def\@tempb{#2}%
  \@onelevel@sanitize\@tempb
  \MT@ifdefined@n@T{MT@#1@alias}{%
    \MT@warning{Alias font family `\@tempb' will override
      alias `\@nameuse{MT@#1@alias}'\MessageBreak
      for font family `#1'}}%
  \MT@xdef@n{MT@#1@alias}{\@tempb}%
%    \end{macrocode}
% If we encounter this command while a font is being set up, we also set the
% alias for the current font so that if \cs{DeclareMicrotypeAlias} has been
% issued inside a configuration file, the configuration file for the alias font
% will be loaded, too.
%\changes{v1.7}{2005/03/23}{may also be used inside configuration files}
%    \begin{macrocode}
  \MT@ifdefined@c@T\MT@family{%
%<debug>\MT@dinfo{1}{Activating alias font `\@tempb' for `\MT@family'}%
    \MT@glet\MT@familyalias\@tempb
  }%
  \MT@end@catcodes
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\LoadMicrotypeFile}
%\changes{v1.7}{2005/03/22}{new command (suggested by
%               \contributor Andreas B\"uhmann <andreas.buehmann\at web.de>)}
%                                              ^^A private mail, 2005/03/21
%\changes{v2.5}{2010/05/13}{remove all spaces in font name}
% May be used to load a configuration file manually.
%    \begin{macrocode}
\def\LoadMicrotypeFile#1{%
  \edef\@tempa{\zap@space#1 \@empty}%
  \@onelevel@sanitize\@tempa
  \MT@exp@one@n\MT@in@clist\@tempa\MT@file@list
  \ifMT@inlist@
    \MT@vinfo{... Configuration file mt-\@tempa.cfg already loaded}%
  \else
    \MT@xadd\MT@file@list{\@tempa,}%
    \MT@begin@catcodes
    \InputIfFileExists{mt-\@tempa.cfg}{%
      \edef\MT@curr@file{mt-\@tempa.cfg}%
      \MT@vinfo{... Loading configuration file \MT@curr@file}%
    }{%
      \MT@warning{Configuration file mt-\@tempa.cfg\MessageBreak
                  does not exist}%
    }%
    \MT@end@catcodes
  \fi
}
%</package>
%</package|letterspace>
%    \end{macrocode}
%\end{macro}
%
%\subsubsection{Disabling ligatures}
%
%\begin{macro}{\DisableLigatures}
%\changes{v1.9}{2005/07/11}{new command: disable ligatures (requires \pdftex\ 1.30)}
%\changes{v2.2}{2007/01/22}{new optional argument: disable selected ligatures only}
%\begin{macro}{\MT@DisableLigatures}
%\begin{macro}{\MT@nl@setname}
%\begin{macro}{\MT@nl@ligatures}
% This is really simple now: we can re-use the set definitions of
% \cs{DeclareMicrotypeSet}; there can only be one set, which we'll call
% `|no ligatures|'.
%
% The optional argument may be used to disable selected ligatures only.
%    \begin{macrocode}
%<*pdftex-def|luatex-def>
%<pdftex-def>\MT@requires@pdftex5{
\def\DisableLigatures{%
  \MT@begin@catcodes
  \MT@DisableLigatures
}
\newcommand*\MT@DisableLigatures[2][]{%
  \MT@ifempty{#1}\relax{\gdef\MT@nl@ligatures{#1}}%
  \xdef\MT@active@features{\MT@active@features,nl}%
  \global\MT@noligaturestrue
  \MT@declare@sets{nl}{no ligatures}{#2}%
  \gdef\MT@nl@setname{no ligatures}%
  \MT@end@catcodes
}
%<pdftex-def>}{
%</pdftex-def|luatex-def>
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\end{macro}
% If \pdftex\ is too old, we throw an error.
%    \begin{macrocode}
%<*pdftex-def|xetex-def>
\renewcommand*\DisableLigatures[2][]{%
  \MT@error{Disabling ligatures of a font is only possible\MessageBreak
    with pdftex version 1.30 or newer.\MessageBreak
    Ignoring \string\DisableLigatures}{%
%<pdftex-def>    Upgrade
%<xetex-def>    Use
    pdftex.}%
}
%<pdftex-def>}
%</pdftex-def|xetex-def>
%    \end{macrocode}
%\end{macro}
%
%\subsubsection{Interaction with \pkg{babel}}
%
%\begin{macro}{\DeclareMicrotypeBabelHook}
% Declare the context that should be loaded when a \pkg{babel} language
% is selected. The command will not check whether a previous declaration will
% be overwritten.
%\changes{v2.0}{2005/10/04}{new command: interaction with \pkg{babel}} ^^A (beta:1)
%    \begin{macrocode}
%<*package>
\def\DeclareMicrotypeBabelHook#1#2{%
  \MT@map@clist@n{#1}{%
    \KV@@sp@def\@tempa{##1}%
    \MT@gdef@n{MT@babel@\@tempa}{#2}%
  }%
}
%</package>
%    \end{macrocode}
%\end{macro}
%
%
%\subsubsection{Fine tuning}
%
% The commands \cs{SetExpansion} and \cs{SetProtrusion} provide an interface for
% setting the character protrusion resp. expansion factors for a set of fonts.
%
%\begin{macro}{\SetProtrusion}
%\changes{v1.9}{2005/07/13}{(et al.) new key: \texttt{font}}
%\changes{v1.9d}{2006/02/23}{(et al.) split keys of optional and mandatory argument}
%\changes{v1.9d}{2006/02/23}{(et al.) optimise: unify keys for mandatory argument}
%\changes{v1.9e}{2006/07/26}{(et al.) new key: \texttt{inputenc}}
%\changes{v1.9f}{2006/08/10}{(et al.) set catcodes before parsing optional argument}
% This macro accepts three arguments: [options,] set of font attributes and
% list of character protrusion factors.
%
% A new macro called |\MT@pr@c@|\meta{name} will be defined to be \meta{\#3}
% (\ie, the list of characters, not expanded).
%    \begin{macrocode}
%<*pdftex-def|xetex-def|luatex-def>
\def\SetProtrusion{%
  \MT@begin@catcodes
  \MT@SetProtrusion
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@SetProtrusion}
%\begin{macro}{\MT@pr@c@name}
%\begin{macro}{\MT@extra@context}
%\begin{macro}{\MT@permutelist}
% We want the catcodes to be correct even if this is called in the preamble.
%    \begin{macrocode}
\newcommand*\MT@SetProtrusion[3][]{%
  \let\MT@extra@context\@empty
%    \end{macrocode}
% Parse the optional first argument. We first have to know the name before we
% can deal with the extra options.
%    \begin{macrocode}
  \MT@set@named@keys{MT@pr@c}{#1}%
%<debug>\MT@dinfo{1}{creating protrusion list `\MT@pr@c@name'}%
  \def\MT@permutelist{pr@c}%
  \setkeys{MT@cfg}{#2}%
%    \end{macrocode}
% We have parsed the second argument, and can now define macros for all
% permutations of the font attributes to point to |\MT@pr@c@|\meta{name},~\dots
%    \begin{macrocode}
  \MT@permute
%    \end{macrocode}
% \dots~which we can now define to be \meta{\#3}.
% Here, as elsewhere, we have to make the definitions global, since they will
% occur inside a group.
%    \begin{macrocode}
  \MT@gdef@n{MT@pr@c@\MT@pr@c@name}{#3}%
  \MT@end@catcodes
}
%</pdftex-def|xetex-def|luatex-def>
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\begin{macro}{\SetExpansion}
%\changes{v1.4}{2004/11/10}{fix: specifying extra options does no
%                           longer require to give a \texttt{name}, too}
%\changes{v1.9e}{2006/07/26}{new key: \texttt{inputenc}}
% \cs{SetExpansion} only differs in that it allows some extra options
% (|stretch|, |shrink|, |step|, |auto|).
%    \begin{macrocode}
%<*pdftex-def|luatex-def>
\def\SetExpansion{%
  \MT@begin@catcodes
  \MT@SetExpansion
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@SetExpansion}
%\begin{macro}{\MT@ex@c@name}
%\begin{macro}{\MT@extra@context}
%\begin{macro}{\MT@permutelist}
%    \begin{macrocode}
\newcommand*\MT@SetExpansion[3][]{%
  \let\MT@extra@context\@empty
  \MT@set@named@keys{MT@ex@c}{#1}%
  \MT@ifdefined@n@T{MT@ex@c@\MT@ex@c@name @factor}{%
    \ifnum\csname MT@ex@c@\MT@ex@c@name @factor\endcsname > \@m
      \MT@warning@nl{Expansion factor \number\@nameuse{MT@ex@c@\MT@ex@c@name @factor}
        too large in list\MessageBreak `\MT@ex@c@name'. Setting it to the
        maximum of 1000}%
      \MT@glet@nc{MT@ex@c@\MT@ex@c@name @factor}\@m
    \fi
  }%
%<debug>\MT@dinfo{1}{creating expansion list `\MT@ex@c@name'}%
  \def\MT@permutelist{ex@c}%
  \setkeys{MT@cfg}{#2}%
  \MT@permute
  \MT@gdef@n{MT@ex@c@\MT@ex@c@name}{#3}%
  \MT@end@catcodes
}
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\begin{macro}{\SetTracking}
%\changes{v2.0}{2006/12/28}{new command: tracking}
%\changes{v2.2}{2007/02/23}{third argument may be empty}
%\changes{v2.2}{2007/02/23}{new key `\texttt{no ligatures}' to disable
%                           ligatures of letterspaced fonts}
%\changes{v2.2}{2007/06/16}{new keys `\texttt{spacing}' and `\texttt{outer spacing}'
%                           to adjust interword spacing
%                           (suggested by \contributor Steven~E. Harris <seh\at panix.com>)}
%                                                             ^^A private mail, 2007/06/15
%    \begin{macrocode}
\def\SetTracking{%
  \MT@begin@catcodes
  \MT@SetTracking
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@SetTracking}
% Third argument may be empty.
%\changes{v2.3}{2007/11/20}{sanity check for value}
%    \begin{macrocode}
\newcommand*\MT@SetTracking[3][]{%
  \let\MT@extra@context\@empty
  \MT@set@named@keys{MT@tr@c}{#1}%
%<debug>\MT@dinfo{1}{creating tracking list `\MT@tr@c@name'}%
  \def\MT@permutelist{tr@c}%
  \setkeys{MT@cfg}{#2}%
  \MT@permute
  \KV@@sp@def\@tempa{#3}%
  \MT@ifempty\@tempa\relax{%
    \MT@ifint\@tempa
      {\MT@xdef@n{MT@tr@c@\MT@tr@c@name}{\@tempa}}%
      {\MT@warning{Value `\@tempa' is not a number in\MessageBreak
                   tracking set `\MT@curr@set@name'}}}%
  \MT@end@catcodes
}
%</pdftex-def|luatex-def>
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\SetExtraSpacing}
%\changes{v2.0}{2005/09/28}{new command: adjustment of interword spacing} ^^A (beta:1)
%    \begin{macrocode}
%<*pdftex-def>
\def\SetExtraSpacing{%
  \MT@begin@catcodes
  \MT@SetExtraSpacing
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@SetExtraSpacing}
%\begin{macro}{\MT@sp@c@name}
%\begin{macro}{\MT@extra@context}
%\begin{macro}{\MT@permutelist}
%    \begin{macrocode}
\newcommand*\MT@SetExtraSpacing[3][]{%
  \let\MT@extra@context\@empty
  \MT@set@named@keys{MT@sp@c}{#1}%
%<debug>\MT@dinfo{1}{creating spacing list `\MT@sp@c@name'}%
  \def\MT@permutelist{sp@c}%
  \setkeys{MT@cfg}{#2}%
  \MT@permute
  \MT@gdef@n{MT@sp@c@\MT@sp@c@name}{#3}%
  \MT@end@catcodes
}
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\begin{macro}{\SetExtraKerning}
%\changes{v2.0}{2005/09/28}{new command: additional kerning} ^^A (beta:1)
%    \begin{macrocode}
\def\SetExtraKerning{%
  \MT@begin@catcodes
  \MT@SetExtraKerning
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@SetExtraKerning}
%\begin{macro}{\MT@kn@c@name}
%\begin{macro}{\MT@extra@context}
%\begin{macro}{\MT@permutelist}
%    \begin{macrocode}
\newcommand*\MT@SetExtraKerning[3][]{%
  \let\MT@extra@context\@empty
  \MT@set@named@keys{MT@kn@c}{#1}%
%<debug>\MT@dinfo{1}{creating kerning list `\MT@kn@c@name'}%
  \def\MT@permutelist{kn@c}%
  \setkeys{MT@cfg}{#2}%
  \MT@permute
  \MT@gdef@n{MT@kn@c@\MT@kn@c@name}{#3}%
  \MT@end@catcodes
}
%</pdftex-def>
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\begin{macro}{\MT@set@named@keys}
%\changes{v1.9f}{2006/08/10}{new macro: set name first, simplify parsing of
%                            optional argument}
%\begin{macro}{\MT@options}
% We first set the name (if specified), then remove it from the list, and set
% the remaining keys.
%    \begin{macrocode}
%<*package>
\def\MT@set@named@keys#1#2{%
  \def\x##1name=##2,##3\@nil{%
    \setkeys{#1}{name=##2}%
    \gdef\MT@options{##1##3}%
    \MT@rem@from@clist{name=}\MT@options
  }%
  \x#2,name=,\@nil
  \@expandtwoargs\setkeys{#1}\MT@options
}
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\begin{macro}{\MT@define@code@key}
% Define the keys for the configuration lists (which are setting the codes, in
% \pdftex\ speak).
%    \begin{macrocode}
\def\MT@define@code@key#1#2{%
  \define@key{MT@#2}{#1}[]{%
    \@tempcnta=\@ne
    \MT@map@clist@n{##1}{%
      \KV@@sp@def\MT@val{####1}%
%    \end{macrocode}
% Here, too, we allow for something like `|bf*|'. It will be expanded
% immediately.
%    \begin{macrocode}
      \MT@get@highlevel{#1}%
      \MT@edef@n{MT@temp#1\the\@tempcnta}{\MT@val}%
      \advance\@tempcnta \@ne
    }%
  }%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@define@code@key@family}
%\changes{v2.5}{2011/02/07}{compatibility with \pkg{fontspec}: remove its internal counter
%                           (reported by \contributor Till~A. Heilmann <till.heilmann\at unibas.ch>)}
%                           ^^A <http://permalink.gmane.org/gmane.comp.tex.lualatex.devel/668>
%                           ^^A (beta:06)
% Remove \pkg{fontspec}'s internal feature counter.
%    \begin{macrocode}
\def\MT@define@code@key@family#1{%
  \define@key{MT@#1}{family}[]{%
    \@tempcnta=\@ne
    \MT@map@clist@n{##1}{%
      \KV@@sp@def\MT@val{####1}%
      \MT@get@highlevel{family}%
      \ifMT@fontspec
        \edef\x{\edef\noexpand\MT@val{\noexpand\MT@scrubfeature\MT@val()\relax}}\x
      \fi
      \MT@edef@n{MT@tempfamily\the\@tempcnta}{\MT@val}%
      \advance\@tempcnta \@ne
    }%
  }%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@define@code@key@size}
%\changes{v1.9c}{2006/01/25}{fix: embrace \cs{MT@tempsize} in \cmd\csname\
%                            (bug introduced in v1.9b)}
% \cs{MT@tempsize} must be in a \cmd\csname, so that it is at least
% \cmd\relax, not undefined.
%    \begin{macrocode}
\def\MT@define@code@key@size#1{%
  \define@key{MT@#1}{size}[]{%
    \MT@map@clist@n{##1}{%
      \KV@@sp@def\MT@val{####1}%
      \expandafter\MT@get@range\MT@val--\@nil
      \ifx\MT@val\relax \else
        \MT@exp@cs\MT@xadd{MT@tempsize}%
           {{{\MT@lower}{\MT@upper}{\MT@curr@set@name}}}%
      \fi
    }%
  }%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@define@code@key@font}
%\changes{v1.9c}{2006/01/25}{fix: context was ignored}
%\changes{v2.5}{2011/09/04}{scrub \pkg{fontspec} feature count
%                           (found by \contributor Meho~R <meho.2005\at gmail.com>)}
%                            ^^A MID: <e16242e2-49cf-47bf-9ab4-66f81ced4c7a@glegroupsg2000goo.googlegroups.com>
%                            ^^A (beta:08)
%    \begin{macrocode}
\def\MT@define@code@key@font#1{%
  \define@key{MT@#1}{font}[]{%
    \MT@map@clist@n{##1}{%
      \KV@@sp@def\MT@val{####1}%
      \MT@ifstreq\MT@val*{\def\MT@val{*/*/*/*/*}}\relax
      \expandafter\MT@get@font@and@size\MT@val/////\@nil
      \ifMT@fontspec
        \edef\@tempb{\expandafter\MT@scrubfeatures\@tempb()\relax}%
      \fi
      \MT@xdef@n{MT@\MT@permutelist @\@tempb\MT@extra@context}%
        {\csname MT@\MT@permutelist @name\endcsname}%
%<debug>\MT@dinfo@nl{1}{initialising: use list for font \@tempb=\MT@val
%<debug>                \ifx\MT@extra@context\@empty\else\MessageBreak
%<debug>                  (context: \MT@extra@context)\fi}%
      \MT@exp@cs\MT@xaddb
        {MT@\MT@permutelist @\@tempb\MT@extra@context @sizes}%
        {{{\MT@val}{\m@ne}{\MT@curr@set@name}}}%
    }%
  }%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@get@font@and@size}
% Translate any asterisks and split off the size.
%    \begin{macrocode}
\def\MT@get@font@and@size#1/#2/#3/#4/#5/#6\@nil{%
  \MT@get@font@{#1}{#2}{#3}{#4}{#5}{1}%
}
%    \end{macrocode}
%\end{macro}
%    \begin{macrocode}
\MT@define@code@key{encoding}{cfg}
\MT@define@code@key@family   {cfg}
\MT@define@code@key{series}  {cfg}
\MT@define@code@key{shape}   {cfg}
\MT@define@code@key@size     {cfg}
\MT@define@code@key@font     {cfg}
%    \end{macrocode}
%\begin{macro}{\MT@define@opt@key}
%    \begin{macrocode}
\def\MT@define@opt@key#1#2{%
  \define@key{MT@#1@c}{#2}[]{\MT@ifempty{##1}\relax{%
    \MT@xdef@n{MT@#1@c@\MT@curr@set@name @#2}{##1}}}%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@listname@count}
% The options in the optional first argument.
%    \begin{macrocode}
\newcount\MT@listname@count
\MT@map@clist@c\MT@features{%
%    \end{macrocode}
%\end{macro}
%\changes{v1.9a}{2005/11/21}{`\meta{file name}\texttt{/}\meta{line number}' as default list name}
% Use file name and line number as the list name if the user didn't bother
% to invent one -- also check whether the name already exists (in case more
% than one unnamed list is loaded in the same line, for example
% \cmd\AtBeginDocument).
%\changes{v2.5}{2011/02/26}{fix: check whether `\meta{file}\texttt{/}\meta{line}' list name already exists
%                           (reported by \contributor Till~A. Heilmann <till.heilmann\at unibas.ch>)}
%                           ^^A private mail, 2011/02/25
%                           ^^A (beta:07)
%\changes{v1.3}{2004/10/27}{fix: specifying \texttt{load} option does no
%                           longer require to give a \texttt{name}, too}
%\changes{v2.2}{2007/01/28}{simplify key declarations}
%    \begin{macrocode}
  \define@key{MT@#1@c}{name}[]{%
    \MT@ifempty{##1}{%
      \MT@ifdefined@n@TF{MT@#1@c@\MT@curr@file/\the\inputlineno}{%
        \global\advance\MT@listname@count\@ne
        \MT@edef@n{MT@#1@c@name}{\MT@curr@file/\the\inputlineno
                                 (\number\MT@listname@count)}%
      }{%
        \MT@edef@n{MT@#1@c@name}{\MT@curr@file/\the\inputlineno}%
      }%
    }{%
      \MT@edef@n{MT@#1@c@name}{##1}%
      \MT@ifdefined@n@T{MT@#1@c@\csname MT@#1@c@name\endcsname}{%
        \MT@warning{Redefining \@nameuse{MT@abbr@#1} list `\@nameuse{MT@#1@c@name}'}%
      }%
    }%
    \MT@let@cn\MT@curr@set@name{MT@#1@c@name}%
  }%
  \MT@define@opt@key{#1}{load}%
  \MT@define@opt@key{#1}{factor}%
  \MT@define@opt@key{#1}{preset}%
  \MT@define@opt@key{#1}{inputenc}%
%    \end{macrocode}
% Only one context is allowed. This might change in the future.
%    \begin{macrocode}
  \define@key{MT@#1@c}{context}[]{\MT@ifempty{##1}\relax{\def\MT@extra@context{##1}}}%
}
%</package>
%    \end{macrocode}
% Automatically enable font copying if we find a protrusion or expansion context.
% After the preamble, check whether font copying is enabled.
% For older \pdftex\ versions, disallow.
%\changes{v2.5}{2010/02/27}{allow contexts for \luatex}
% It also works with \luatex\ 0.30 or newer.
%    \begin{macrocode}
%<*pdftex-def|luatex-def>
%<pdftex-def>\MT@requires@pdftex7{
  \define@key{MT@ex@c}{context}[]{%
    \MT@ifempty{#1}\relax{%
      \MT@glet\MT@copy@font\MT@copy@font@
      \def\MT@extra@context{#1}%
    }%
  }
  \MT@addto@setup{%
    \define@key{MT@ex@c}{context}[]{%
      \ifx\MT@copy@font\MT@copy@font@
        \MT@ifempty{#1}\relax{\def\MT@extra@context{#1}}%
      \else
        \MT@error{\MT@MT\space isn't set up for expansion contexts.\MessageBreak
           Ignoring `context' key\on@line}%
          {Either move the settings inside the preamble,\MessageBreak
           or load the package with the `copyfonts' option.}%
      \fi
    }%
  }
%    \end{macrocode}
% Protrusion contexts \emph{might} also work without copying the font, so we
% don't issue an error but only a warning. The problem is that \pdftex\ only
% allows one set of protrusion factors for a given font within one paragraph
% (those that are in effect at the end of the paragraph will be in effect for
% the whole paragraph). When different fonts are loaded -- like in the example
% with the footnote markers -- we don't need to copy the fonts.
%    \begin{macrocode}
  \define@key{MT@pr@c}{context}[]{%
    \MT@ifempty{#1}\relax{%
      \MT@glet\MT@copy@font\MT@copy@font@
      \def\MT@extra@context{#1}%
    }%
  }
  \MT@addto@setup{%
    \define@key{MT@pr@c}{context}[]{%
      \MT@ifempty{#1}\relax{\def\MT@extra@context{#1}}%
      \ifx\MT@copy@font\MT@copy@font@\else
        \MT@warning@nl{If protrusion contexts don't work as expected,
          \MessageBreak load the package with the `copyfonts' option}%
      \fi
    }%
  }
%</pdftex-def|luatex-def>
%<*pdftex-def>
}{
  \define@key{MT@ex@c}{context}[]{%
    \MT@error{Expansion contexts only work with pdftex 1.40.4\MessageBreak
        or later. Ignoring `context' key\on@line}%
      {Upgrade pdftex.}%
  }
%</pdftex-def>
%<*pdftex-def|xetex-def>
  \define@key{MT@pr@c}{context}[]{%
    \MT@error{Protrusion contexts only work with pdftex
%<pdftex-def>        1.40.4\MessageBreak or later.
%<xetex-def>        \MessageBreak or luatex.
        Ignoring `context' key\on@line}%
%<pdftex-def>      {Upgrade pdftex.}%
%<xetex-def>      {Use pdftex or luatex.}%
  }
%</pdftex-def|xetex-def>
%<pdftex-def>}
%    \end{macrocode}
%\begin{macro}{\MT@warn@nodim}
%    \begin{macrocode}
%<*package>
\def\MT@warn@nodim#1{%
  \MT@warning{`\@tempa' is not a dimension.\MessageBreak
              Ignoring it and setting values relative to\MessageBreak #1}%
}
%</package>
%    \end{macrocode}
%\end{macro}
%\changes{v1.8}{2005/04/14}{\cs{SetProtrusion}: new key: \texttt{unit}}
%\changes{v1.9}{2005/09/28}{\cs{SetProtrusion}: value `\texttt{relative}' renamed
%                           to `\texttt{character}' for key \texttt{unit}}
%\changes{v2.0}{2006/09/30}{option `\opt{unit}', \cs{SetProtrusion}:
%                           deprecate value `\texttt{relative}' completely}
%\todo{new key for unit: \texttt{dimen} (for \texttt{kerning}, especially)}
% Protrusion codes may be relative to character width, or to any dimension.
%    \begin{macrocode}
%<*pdftex-def|xetex-def|luatex-def>
\define@key{MT@pr@c}{unit}[character]{%
  \MT@glet@nc{MT@pr@c@\MT@curr@set@name @unit}\@empty
  \def\@tempa{#1}%
  \MT@ifstreq\@tempa{character}\relax{%
%    \end{macrocode}
% Test whether it's a dimension, but do not translate it into its final
% form here, since it may be font-specific.
%    \begin{macrocode}
    \MT@ifdimen\@tempa
      {\MT@glet@nc{MT@pr@c@\MT@curr@set@name @unit}\@tempa}%
      {\MT@warn@nodim{character widths}}%
  }%
}
%</pdftex-def|xetex-def|luatex-def>
%    \end{macrocode}
% Tracking may only be relative to a dimension.
%    \begin{macrocode}
%<*pdftex-def|luatex-def>
\define@key{MT@tr@c}{unit}[1em]{%
  \MT@glet@nc{MT@tr@c@\MT@curr@set@name @unit}\@empty
  \def\@tempa{#1}%
  \MT@ifdimen\@tempa
    {\MT@glet@nc{MT@tr@c@\MT@curr@set@name @unit}\@tempa}%
    {\MT@warn@nodim{1em}%
     \MT@gdef@n{MT@tr@c@\MT@curr@set@name @unit}{1em}}%
}
%</pdftex-def|luatex-def>
%    \end{macrocode}
% Spacing and kerning codes may additionally be relative to space dimensions.
%    \begin{macrocode}
%<*pdftex-def>
\MT@map@clist@n{sp,kn}{%
  \define@key{MT@#1@c}{unit}[space]{%
    \MT@glet@nc{MT@#1@c@\MT@curr@set@name @unit}\@empty
    \def\@tempa{##1}%
    \MT@ifstreq\@tempa{character}\relax{%
      \MT@glet@nc{MT@#1@c@\MT@curr@set@name @unit}\m@ne
      \MT@ifstreq\@tempa{space}\relax{%
        \MT@ifdimen\@tempa
          {\MT@glet@nc{MT@#1@c@\MT@curr@set@name @unit}\@tempa}%
          {\MT@warn@nodim{width of space}}%
      }%
    }%
  }%
}
%</pdftex-def>
%    \end{macrocode}
% The first argument to \cs{SetExpansion} accepts some more options.
%    \begin{macrocode}
%<*pdftex-def|luatex-def>
\MT@map@clist@n{stretch,shrink,step}{%
  \define@key{MT@ex@c}{#1}[]{%
    \MT@ifempty{##1}\relax{%
      \MT@ifint{##1}{%
%    \end{macrocode}
% A space terminates the number.
%    \begin{macrocode}
        \MT@gdef@n{MT@ex@c@\MT@curr@set@name @#1}{##1 }%
      }{%
        \MT@warning{%
          Value `##1' for option `#1' is not a number.\MessageBreak
          Ignoring it}%
      }%
    }%
  }%
}
\define@key{MT@ex@c}{auto}[true]{%
  \def\@tempa{#1}%
  \csname if\@tempa\endcsname
%    \end{macrocode}
% Don't use |autoexpand| for \pdftex\ version older than 1.20.
%\changes{v1.7}{2005/03/07}{fix: remove space after \texttt{autoexpand}}
%\changes{v1.7}{2005/03/07}{disallow automatic expansion if \pdftex\ too old}
%\changes{v2.7a}{2017/08/08}{disallow non-automatic expansion with \luatex}
%    \begin{macrocode}
%<pdftex-def>    \MT@requires@pdftex4%
%<luatex-def>    \MT@requires@luatex3\relax
      {\MT@gdef@n{MT@ex@c@\MT@curr@set@name @auto}{autoexpand}}%
%<pdftex-def>      {\MT@warning{pdftex too old for automatic font expansion}}%
  \else
%<pdftex-def>    \MT@requires@pdftex4%
%<*luatex-def>
    \MT@requires@luatex3{%
      \MT@warning{Non-automatic font expansion doesn't work with\MessageBreak
                  luatex}}%
%</luatex-def>
      {\MT@glet@nc{MT@ex@c@\MT@curr@set@name @auto}\@empty}%
%<pdftex-def>      \relax
  \fi
}
%    \end{macrocode}
% Tracking: Interword spacing and outer kerning.
% The variant with space just in case \cs{SetTracking} is called inside an
% argument (\eg, to \cmd\IfFileExists).
%    \begin{macrocode}
\MT@define@opt@key{tr}{spacing}
\MT@define@opt@key{tr}{outerspacing}
\MT@define@opt@key{tr}{outerkerning}
%    \end{macrocode}
% Which ligatures should be disabled?
%    \begin{macrocode}
\define@key{MT@tr@c}{noligatures}[]%
  {\MT@xdef@n{MT@tr@c@\MT@curr@set@name @noligatures}{#1}}
\define@key{MT@tr@c}{outer spacing}[]{\setkeys{MT@tr@c}{outerspacing={#1}}}
\define@key{MT@tr@c}{outer kerning}[]{\setkeys{MT@tr@c}{outerkerning={#1}}}
\define@key{MT@tr@c}{no ligatures}[]{\setkeys{MT@tr@c}{noligatures={#1}}}
%</pdftex-def|luatex-def>
%    \end{macrocode}
%
%\subsubsection{Character inheritance}
%
%\begin{macro}{\DeclareCharacterInheritance}
%\changes{v1.1}{2004/09/15}{new command: possibility to specify character inheritance}
%^^A\changes{v1.2}{2004/09/29}{check whether only one encoding specified}
%\changes{v1.9d}{2006/02/09}{fix: empty context}
%\changes{v1.9e}{2006/07/26}{new key `\texttt{inputenc}' to set the input encoding}
%\changes{v2.5}{2010/05/18}{allow more than one encoding}
% 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 (\eg, |\`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{macro}{\MT@inh@feat}
% The optional argument may be used to restrict the list to some features,
%\begin{macro}{\MT@extra@inputenc}
% and to specify an input encoding.
%    \begin{macrocode}
%<*package>
\renewcommand*\DeclareCharacterInheritance[1][]{%
  \let\MT@extra@context\@empty
  \let\MT@extra@inputenc\@undefined
  \let\MT@inh@feat\@empty
  \setkeys{MT@inh@}{#1}%
  \MT@begin@catcodes
  \MT@set@inh@list
}
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\end{macro}
%\begin{macro}{\MT@set@inh@list}
% Safe category codes.
%    \begin{macrocode}
\def\MT@set@inh@list#1#2{%
  \MT@ifempty\MT@inh@feat{%
    \MT@map@clist@c\MT@features{{\MT@declare@char@inh{##1}{#1}{#2}}}%
  }{%
    \MT@map@clist@c\MT@inh@feat{{%
      \KV@@sp@def\@tempa{##1}%
      \MT@ifempty\@tempa\relax{%
        \MT@exp@one@n\MT@declare@char@inh
          {\csname MT@rbba@\@tempa\endcsname}{#1}{#2}%
      }%
    }}%
  }%
  \MT@end@catcodes
}
%    \end{macrocode}
%\changes{v1.9f}{2006/08/09}{fix: forgotten comma in the features list}
%\end{macro}
% The keys for the optional argument.
%    \begin{macrocode}
\MT@map@clist@c\MT@features@long{%
  \define@key{MT@inh@}{#1}[]{\edef\MT@inh@feat{\MT@inh@feat#1,}}}
\define@key{MT@inh@}{inputenc}{\def\MT@extra@inputenc{#1}}
%    \end{macrocode}
%\begin{macro}{\MT@declare@char@inh}
%\todo{share one list between features}
% The lists cannot be given a name by the user.
%    \begin{macrocode}
\def\MT@declare@char@inh#1#2#3{%
  \MT@edef@n{MT@#1@inh@name}%
    {\MT@curr@file/\the\inputlineno (\@nameuse{MT@abbr@#1})}%
  \MT@let@cn\MT@curr@set@name{MT@#1@inh@name}%
  \MT@ifdefined@c@T\MT@extra@inputenc{%
    \MT@xdef@n{MT@#1@inh@\MT@curr@set@name @inputenc}{\MT@extra@inputenc}}%
%<debug>\MT@dinfo{1}{creating inheritance list `\@nameuse{MT@#1@inh@name}'}%
  \MT@gdef@n{MT@#1@inh@\csname MT@#1@inh@name\endcsname}{#3}%
  \def\MT@permutelist{#1@inh}%
  \setkeys{MT@inh}{#2}%
  \MT@permute
}
%    \end{macrocode}
%\end{macro}
% Parse the second argument. \cs{DeclareCharacterInheritance} may also be set
% up for various combinations.
% We can reuse the key setup from the configuration lists
% (|\Set...|).
%    \begin{macrocode}
\MT@define@code@key{encoding}{inh}
\MT@define@code@key@family   {inh}
\MT@define@code@key{series}  {inh}
\MT@define@code@key{shape}   {inh}
\MT@define@code@key@size     {inh}
\MT@define@code@key@font     {inh}
%    \end{macrocode}
%\begin{macro}{\MT@inh@do}
% Now parse the third 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 |\MT@set@|\meta{feature}|@codes|).
%    \begin{macrocode}
\def\MT@inh@do#1,{%
  \ifx\relax#1\@empty \else
    \MT@inh@split #1==\relax
    \expandafter\MT@inh@do
  \fi
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@inh@split}
% Only gather the inheriting characters here. Their codes will actually be set
% in |\MT@set@|\meta{feature}|@codes|.
%    \begin{macrocode}
%</package>
%<*pdftex-def|xetex-def|luatex-def>
\def\MT@inh@split#1=#2=#3\relax{%
  \def\@tempa{#1}%
  \ifx\@tempa\@empty \else
    \MT@get@slot
%<pdftex-def|luatex-def>    \ifnum\MT@char > \m@ne
%<xetex-def>    \ifx\MT@char\@empty\else
      \let\MT@val\MT@char
      \MT@map@clist@n{#2}{%
        \def\@tempa{##1}%
        \ifx\@tempa\@empty \else
          \MT@get@slot
%<pdftex-def|luatex-def>          \ifnum\MT@char > \m@ne
%<xetex-def>          \ifx\MT@char\@empty\else
            \MT@exp@cs\MT@xadd{MT@inh@\MT@listname @\MT@val @}{{\MT@char}}%
          \fi
        \fi
      }%
%<debug>\MT@dinfo@nl{2}{children of #1 (\MT@val):
%<debug>                \@nameuse{MT@inh@\MT@listname @\MT@val @}}%
    \fi
  \fi
}
%</pdftex-def|xetex-def|luatex-def>
%    \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@@@@}
% Calling \cs{MT@permute} will define commands for all permutations
% of the specified font attributes of the form
% |\MT@|\meta{list type}|@/|\allowbreak
%       \meta{encoding}|/|\allowbreak
%       \meta{family}|/|\allowbreak
%       \meta{series}|/|\allowbreak
%       \meta{shape}|/|\allowbreak
%       \meta{\textbar*}
% to be the expansion of |\MT@|\meta{list type}|@name|, \ie, the name of the
% currently defined list. Size ranges are held in a separate macro called
% |\MT@|\meta{list type}|@/|\allowbreak\meta{font axes}|@sizes|, which in turn
% contains the respective \meta{list name}s attached to the ranges.
%    \begin{macrocode}
%<*package>
\def\MT@permute{%
  \let\MT@cnt@encoding\@ne
  \MT@permute@
%    \end{macrocode}
% Undefine commands for the next round.
%    \begin{macrocode}
  \MT@map@tlist@n{{encoding}{family}{series}{shape}}\MT@permute@reset
  \MT@glet\MT@tempsize\@undefined
}
\def\MT@permute@{%
  \let\MT@cnt@family\@ne
  \MT@permute@@
  \MT@increment\MT@cnt@encoding
  \MT@ifdefined@n@T{MT@tempencoding\MT@cnt@encoding}%
    \MT@permute@
}
\def\MT@permute@@{%
  \let\MT@cnt@series\@ne
  \MT@permute@@@
  \MT@increment\MT@cnt@family
  \MT@ifdefined@n@T{MT@tempfamily\MT@cnt@family}%
    \MT@permute@@
}
\def\MT@permute@@@{%
  \let\MT@cnt@shape\@ne
  \MT@permute@@@@
  \MT@increment\MT@cnt@series
  \MT@ifdefined@n@T{MT@tempseries\MT@cnt@series}%
    \MT@permute@@@
}
\def\MT@permute@@@@{%
  \MT@permute@@@@@
  \MT@increment\MT@cnt@shape
  \MT@ifdefined@n@T{MT@tempshape\MT@cnt@shape}%
    \MT@permute@@@@
}
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\begin{macro}{\MT@permute@@@@@}
%\changes{v1.9a}{2005/12/05}{don't define permutations for unused encodings}
% In order to save some memory, we can ignore unused encodings (inside the
% document).
%    \begin{macrocode}
\def\MT@permute@@@@@{%
  \MT@permute@define{encoding}%
  \ifMT@document
    \ifx\MT@tempencoding\@empty \else
      \MT@ifdefined@n@TF{T@\MT@tempencoding}\relax
        {\expandafter\expandafter\expandafter\@gobble}%
    \fi
  \fi
  \MT@permute@@@@@@
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@permute@@@@@@}
%    \begin{macrocode}
\def\MT@permute@@@@@@{%
  \MT@permute@define{family}%
  \MT@permute@define{series}%
  \MT@permute@define{shape}%
  \edef\@tempa{\MT@tempencoding
              /\MT@tempfamily
              /\MT@tempseries
              /\MT@tempshape
              /\MT@ifdefined@c@T\MT@tempsize *}%
%    \end{macrocode}
%\changes{v1.2}{2004/09/29}{more sanity checks for \cs{SetProtrusion} and
%                          \cs{SetExpansion}}
% Some sanity checks: an encoding must be specified (unless nothing else is).
%    \begin{macrocode}
  \MT@ifstreq\@tempa{////}\relax{%
    \ifx\MT@tempencoding\@empty
      \MT@warning{%
        You have to specify an encoding for\MessageBreak
        \@nameuse{MT@abbr@\MT@permutelist} list
        `\@nameuse{MT@\MT@permutelist @name}'.\MessageBreak
        Ignoring it}%
    \else
      \MT@ifdefined@c@TF\MT@tempsize{%
%    \end{macrocode}
% Add the list of ranges to the beginning of the current combination, after
% checking for conflicts.
%\changes{v1.8}{2005/04/20}{add ranges to the beginning of the lists}
%    \begin{macrocode}
        \MT@ifdefined@n@T{MT@\MT@permutelist @\@tempa\MT@extra@context @sizes}{%
          \MT@map@tlist@c\MT@tempsize\MT@check@rlist
        }%
        \MT@exp@cs\MT@xaddb
          {MT@\MT@permutelist @\@tempa\MT@extra@context @sizes}%
          \MT@tempsize
%<debug>\MT@dinfo@nl{1}{initialising: use list for font \@tempa,\MessageBreak
%<debug>         sizes: \csname MT@\MT@permutelist @\@tempa\MT@extra@context
%<debug>                        @sizes\endcsname}%
      }{%
%    \end{macrocode}
% Only one list can apply to a given combination.
%\changes{v2.7}{2017/07/07}{don't warn for override if conflicting list is loaded}
% But we don't warn if the overridden list is to be loaded by the current one.
%    \begin{macrocode}
        \MT@ifdefined@n@T{MT@\MT@permutelist @\@tempa\MT@extra@context}{%
          \MT@ifstreq{\csname MT@\MT@permutelist @\@tempa\MT@extra@context\endcsname}%
             {\csname MT@\MT@permutelist @\csname MT@\MT@permutelist @name\endcsname @load\endcsname}%
              \relax{%
            \MT@warning{\@nameuse{MT@abbr@\MT@permutelist} list
              `\@nameuse{MT@\MT@permutelist @name}' will\MessageBreak override
              list `\@nameuse{MT@\MT@permutelist @\@tempa\MT@extra@context}'
              for \MessageBreak font `\@tempa'}%
          }%
        }%
%<debug>\MT@dinfo@nl{1}{initialising: use list for font \@tempa
%<debug>                \ifx\MT@extra@context\@empty\else\MessageBreak
%<debug>                  (context: \MT@extra@context)\fi}%
      }%
      \MT@xdef@n{MT@\MT@permutelist @\@tempa\MT@extra@context}%
          {\csname MT@\MT@permutelist @name\endcsname}%
    \fi
  }%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@permute@define}
% Define the commands.
%    \begin{macrocode}
\def\MT@permute@define#1{%
  \@tempcnta=\csname MT@cnt@#1\endcsname\relax
  \MT@ifdefined@n@TF{MT@temp#1\the\@tempcnta}%
    {\MT@edef@n{MT@temp#1}{\csname MT@temp#1\the\@tempcnta\endcsname}}%
    {\MT@let@nc{MT@temp#1}\@empty}%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@permute@reset}
% Reset the commands.
%    \begin{macrocode}
\def\MT@permute@reset#1{%
  \@tempcnta=\@ne
  \MT@loop
    \MT@let@nc{MT@temp#1\the\@tempcnta}\@undefined
    \advance\@tempcnta\@ne
    \MT@ifdefined@n@TF{MT@temp#1\the\@tempcnta}%
      \iftrue
      \iffalse
  \MT@repeat
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@check@rlist}
%\changes{v1.8}{2005/04/20}{made recursive}
% For every new range item in \cs{MT@tempsize}, check whether it overlaps with
% ranges in the existing list.
%    \begin{macrocode}
\def\MT@check@rlist#1{\expandafter\MT@check@rlist@ #1}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@check@rlist@}
% Define the current new range and~\dots
%    \begin{macrocode}
\def\MT@check@rlist@#1#2#3{%
  \def\@tempb{#1}%
  \def\@tempc{#2}%
  \MT@if@false
  \MT@exp@cs\MT@map@tlist@c
    {MT@\MT@permutelist @\@tempa\MT@extra@context @sizes}%
    \MT@check@range
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@check@range}
% \dots~recurse through the list of existing ranges.
%    \begin{macrocode}
\def\MT@check@range#1{\expandafter\MT@check@range@ #1}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@check@range@}
% \cmd\@tempb\ and \cmd\@tempc\ are lower resp. upper bound of the new range,
% \meta{\#1} and \meta{\#2} those of the existing range. \meta{\#3} is the list name.
%\changes{v2.7}{2017/07/07}{don't warn for override if conflicting list is loaded}
%    \begin{macrocode}
\def\MT@check@range@#1#2#3{%
  \MT@ifdim{#2}=\m@ne{%
    \MT@ifdim\@tempc=\m@ne{%
%    \end{macrocode}
%\begin{itemize}
%  \item Both items are simple sizes.
%    \begin{macrocode}
      \MT@ifdim\@tempb={#1}\MT@if@true\relax
    }{%
%    \end{macrocode}
%  \item Item in list is a simple size, new item is a range.
%    \begin{macrocode}
      \MT@ifdim\@tempb>{#1}\relax{%
        \MT@ifdim\@tempc>{#1}{%
          \MT@if@true
          \edef\@tempb{#1 (with range: \@tempb\space to \@tempc)}%
        }\relax
      }%
    }%
  }{%
    \MT@ifdim\@tempc=\m@ne{%
%    \end{macrocode}
%  \item Item in list is a range, new item is a simple size.
%    \begin{macrocode}
      \MT@ifdim\@tempb<{#2}{%
        \MT@ifdim\@tempb<{#1}\relax\MT@if@true
      }\relax
    }{%
%    \end{macrocode}
%  \item Both items are ranges.
%    \begin{macrocode}
      \MT@ifdim\@tempb<{#2}{%
        \MT@ifdim\@tempc>{#1}{%
          \MT@if@true
          \edef\@tempb{#1 to #2 (with range: \@tempb\space to \@tempc)}%
        }\relax
      }\relax
    }%
  }%
  \ifMT@if@
    \MT@ifstreq{#3}%
        {\csname MT@\MT@permutelist @\csname MT@\MT@permutelist @name\endcsname @load\endcsname}%
        \relax{%
      \MT@warning{\@nameuse{MT@abbr@\MT@permutelist} list
        `\@nameuse{MT@\MT@permutelist @name}' will override\MessageBreak
        list `#3' for font \@tempa,\MessageBreak size \@tempb}%
    }%
%    \end{macrocode}
% If we've already found a conflict with this item, we can skip the rest of the
% list.
%    \begin{macrocode}
    \expandafter\MT@tlist@break
  \fi
}
%    \end{macrocode}
%\end{itemize}
%\end{macro}
%
%\subsection{Package options}
%
%\subsubsection{Declaring the options}
%
%\begin{macro}{\ifMT@opt@expansion}
%\begin{macro}{\ifMT@opt@auto}
%\begin{macro}{\ifMT@opt@DVI}
% Keep track of whether the user explicitly set these options.
%    \begin{macrocode}
\newif\ifMT@opt@expansion
\newif\ifMT@opt@auto
\newif\ifMT@opt@DVI
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\end{macro}
%\begin{macro}{\MT@optwarn@admissible}
% Some warnings.
%    \begin{macrocode}
\def\MT@optwarn@admissible#1#2{%
  \MT@warning@nl{`#1' is not an admissible value for option\MessageBreak
                 `#2'. Assuming `false'}%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@optwarn@nan}
%    \begin{macrocode}
%</package>
%<*package|letterspace>
%<plain>\MT@requires@latex1{
\def\MT@optwarn@nan#1#2{%
  \MT@warning@nl{Value `#1' for option `#2' is not a\MessageBreak number.
                 Using default value of \number\@nameuse{MT@#2@default}}%
}
%<plain>}\relax
%</package|letterspace>
%<*package>
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@opt@def@set}
%    \begin{macrocode}
\def\MT@opt@def@set#1{%
  \MT@ifdefined@n@TF{MT@\@tempb @set@@\MT@val}{%
    \MT@xdef@n{MT@\@tempb @setname}{\MT@val}%
  }{%
    \MT@xdef@n{MT@\@tempb @setname}{\@nameuse{MT@default@\@tempb @set}}%
    \MT@warning@nl{The #1 set `\MT@val' is undeclared.\MessageBreak
                   Using set `\@nameuse{MT@\@tempb @setname}' instead}%
  }%
}
%    \end{macrocode}
%\end{macro}
% \opt{expansion} and \opt{protrusion} may be |true|, |false|, |compatibility|,
% |nocompatibility| and/or a \meta{set name}.
%\changes{v1.9}{2005/10/06}{fix: use \texttt{true} as the default value}
%    \begin{macrocode}
\MT@map@clist@n{protrusion,expansion}{%
  \define@key{MT}{#1}[true]{%
    \csname MT@opt@#1true\endcsname
    \MT@map@clist@n{##1}{%
      \KV@@sp@def\MT@val{####1}%
      \MT@ifempty\MT@val\relax{%
        \csname MT@#1true\endcsname
        \edef\@tempb{\csname MT@rbba@#1\endcsname}%
        \MT@ifstreq\MT@val{true}\relax
        {%
          \MT@ifstreq\MT@val{false}{%
            \csname MT@#1false\endcsname
          }{%
            \MT@ifstreq\MT@val{compatibility}{%
              \MT@let@nc{MT@\@tempb @level}\@ne
            }{%
              \MT@ifstreq\MT@val{nocompatibility}{%
                \MT@let@nc{MT@\@tempb @level}\tw@
              }{%
%    \end{macrocode}
% If everything failed, it should be a set name.
%    \begin{macrocode}
                \MT@opt@def@set{#1}%
              }%
            }%
          }%
        }%
      }%
    }%
  }%
}
%    \end{macrocode}
% \opt{activate} is a shortcut for \opt{protrusion} and \opt{expansion}.
%\changes{v1.9e}{2006/07/18}{fix: default value for \opt{activate}: \texttt{true}}
%\todo{add \opt{spacing} to \opt{activate}, when the feature has stabilised in \pdftex?} ^^A probably won't happen ...
%    \begin{macrocode}
\define@key{MT}{activate}[true]{%
   \setkeys{MT}{protrusion={#1}}%
   \setkeys{MT}{expansion={#1}}%
}
%    \end{macrocode}
% \opt{spacing}, \opt{kerning} and \opt{tracking} do not have a compatibility level.
%    \begin{macrocode}
\MT@map@clist@n{spacing,kerning,tracking}{%
  \define@key{MT}{#1}[true]{%
    \MT@map@clist@n{##1}{%
      \KV@@sp@def\MT@val{####1}%
      \MT@ifempty\MT@val\relax{%
        \csname MT@#1true\endcsname
        \MT@ifstreq\MT@val{true}\relax
        {%
          \MT@ifstreq\MT@val{false}{%
            \csname MT@#1false\endcsname
          }{%
            \edef\@tempb{\csname MT@rbba@#1\endcsname}%
            \MT@opt@def@set{#1}%
          }%
        }%
      }%
    }%
  }%
}
%    \end{macrocode}
%\changes{v1.5}{2004/12/02}{new option: \opt{selected}, by default false
%               (suggested by \contributor H\`an \thanhthe{} Th\`anh <hanthethanh\at gmx.net>)}
%                                               ^^A private mail, 2004/11/30
%\changes{v2.0}{2005/10/04}{new option: \opt{babel}, by default false
%               (language-dependent setup suggested by \contributor Ulrich Dirr <ud\at art-satz.de>)}
%                                               ^^A private mail, 2005/08/27
%                                               ^^A (beta:1)
%\begin{macro}{\MT@def@bool@opt}
% The |true|/|false| options:
% \opt{draft}, \opt{final} (may be inherited from the class options),
% \opt{auto},
% \opt{selected},
% \opt{babel},
% \opt{DVIoutput},
% \opt{defersetup},
% \opt{copyfonts}.
%    \begin{macrocode}
\def\MT@def@bool@opt#1#2{%
  \define@key{MT}{#1}[true]{%
    \def\@tempa{##1}%
    \MT@ifstreq\@tempa{true}\relax{%
      \MT@ifstreq\@tempa{false}\relax{%
        \MT@optwarn@admissible{##1}{#1}%
        \def\@tempa{false}%
      }%
    }%
    #2%
  }%
}
%    \end{macrocode}
%\end{macro}
% Boolean options that only set the switch.
%    \begin{macrocode}
\MT@map@clist@n{draft,selected,babel}{%
  \MT@def@bool@opt{#1}{\csname MT@#1\@tempa\endcsname}}
\MT@def@bool@opt{auto}{\csname MT@auto\@tempa\endcsname \MT@opt@autotrue}
%    \end{macrocode}
% The \opt{DVIoutput} option will change \cmd\pdfoutput\ immediately to minimise
% the risk of confusing other packages.
%\changes{v2.5}{2010/09/17}{disable `\opt{DVIoutput}' option for \xetex} ^^A (beta:03)
%    \begin{macrocode}
%</package>
%<*pdftex-def|luatex-def|xetex-def>
%<luatex-def>\MT@requires@luatex4{\let\pdfoutput\outputmode}\relax
\MT@def@bool@opt{DVIoutput}{%
  \csname if\@tempa\endcsname
%<*pdftex-def|luatex-def>
    \ifnum\pdfoutput>\z@ \MT@opt@DVItrue \fi
    \pdfoutput\z@
  \else
    \ifnum\pdfoutput<\@ne \MT@opt@DVItrue \fi
    \pdfoutput\@ne
%</pdftex-def|luatex-def>
%<xetex-def>    \MT@warning@nl{Ignoring `DVIoutput' option}%
  \fi
}
%</pdftex-def|luatex-def|xetex-def>
%    \end{macrocode}
%\changes{v1.9a}{2005/11/21}{new option: \opt{defersetup}, by default true}
% Setting the \opt{defersetup} option to false will restore the old behaviour,
% where the setup took place at the time when the package was loaded. This is
% \emph{undocumented}, since I would like to learn about the cases where this is
% necessary.
%
% The only problem with the new deferred setup I can think of is when a box
% is being constructed inside the preamble and this box contains a font that is
% not loaded before the box is being used.
%    \begin{macrocode}
%<*package>
\MT@def@bool@opt{defersetup}{%
  \csname if\@tempa\endcsname \else
    \AtEndOfPackage{%
      \MT@setup@
      \let\MT@setup@\@empty
      \let\MT@addto@setup\@firstofone
    }%
  \fi
}
%</package>
%    \end{macrocode}
% \opt{copyfonts} will copy all fonts before setting them up. This allows
% protrusion and expansion with different parameters.
%\changes{v2.2}{2007/07/03}{new option: \opt{copyfonts}}
% This options is also \emph{undocumented} in the hope that we can always find
% out automatically whether it's required.
% It also works with \luatex\ 0.30 or newer.
%    \begin{macrocode}
%<*pdftex-def|luatex-def>
%<pdftex-def>\MT@requires@pdftex7{
  \MT@def@bool@opt{copyfonts}{%
    \csname if\@tempa\endcsname
      \MT@glet\MT@copy@font\MT@copy@font@
    \else
      \MT@glet\MT@copy@font\relax
    \fi
  }
%<pdftex-def>}{
%</pdftex-def|luatex-def>
%<*pdftex-def|xetex-def>
  \MT@def@bool@opt{copyfonts}{%
    \csname if\@tempa\endcsname
      \MT@error
%<pdftex-def>        {The pdftex version you are using is too old\MessageBreak
%<pdftex-def>        to use the `copyfonts' option}{Upgrade pdftex.}%
%<xetex-def>        {The `copyfonts' option does not work with xetex}
%<xetex-def>        {Use pdftex or luatex instead.}%
    \fi
  }
%<pdftex-def>}
%</pdftex-def|xetex-def>
%    \end{macrocode}
% \opt{final} is the opposite to \opt{draft}.
%\changes{v1.4a}{2004/11/16}{new option: \opt{final}}
%    \begin{macrocode}
%<*package>
\MT@def@bool@opt{final}{%
  \csname if\@tempa\endcsname
    \MT@draftfalse
  \else
    \MT@drafttrue
  \fi
}
%    \end{macrocode}
% For \opt{verbose} output, we redefine \cs{MT@vinfo}.
%\changes{v2.3}{2007/11/05}{turned some warnings into errors}
%    \begin{macrocode}
\define@key{MT}{verbose}[true]{%
  \let\MT@vinfo\MT@info@nl
  \def\@tempa{#1}%
  \MT@ifstreq\@tempa{true}\relax{%
%    \end{macrocode}
%\changes{v1.7}{2005/03/16}{new value for \opt{verbose} option: \texttt{errors}}
% Take problems seriously.
%    \begin{macrocode}
    \MT@ifstreq\@tempa{errors}{%
      \let\MT@warning   \MT@warn@err
      \let\MT@warning@nl\MT@warn@err
    }{%
      \let\MT@vinfo\@gobble
%    \end{macrocode}
%\changes{v2.3}{2007/11/05}{new value for \opt{verbose} option: \texttt{silent}
%                           (suggested by \contributor Karl Berry <karl\at freefriends.org>)}
%                                                              ^^A private mail, 2007/11/05
% Cast warnings to the winds.
%    \begin{macrocode}
      \MT@ifstreq\@tempa{silent}{%
        \let\MT@warning   \MT@info
        \let\MT@warning@nl\MT@info@nl
      }{%
        \MT@ifstreq\@tempa{false}\relax{\MT@optwarn@admissible{#1}{verbose}}%
      }%
    }%
  }%
}
%</package>
%    \end{macrocode}
%\changes{v1.5}{2004/12/02}{defaults: \opt{step}: 4
%               (suggested by \contributor H\`an \thanhthe{} Th\`anh <hanthethanh\at gmx.net>)}
%                                               ^^A private mail, 2004/11/30
%\changes{v1.6}{2004/12/18}{new option: \opt{factor}, by default 1000}
%\changes{v2.0}{2005/09/21}{new option: \opt{letterspace}, by default 100} ^^A (beta:1)
%^^A\changes{v2.0}{2007/01/05}{option `\texttt{letterspacing}' renamed to `\opt{letterspace}'}
% Options with numerical keys:
%   \opt{factor},
%   \opt{stretch},
%   \opt{shrink},
%   \opt{step},
%   \opt{letterspace}.
%    \begin{macrocode}
%<*package|letterspace>
%<plain>\MT@requires@latex1{
\MT@map@clist@n{%
%<package>    stretch,shrink,step,%
    letterspace}{%
  \define@key{MT}{#1}[\csname MT@#1@default\endcsname]{%
    \def\@tempa{##1 }%
%    \end{macrocode}
% No nonsense in \cs{MT@factor} et al.?
%\changes{v1.6}{2005/01/06}{test whether numeric options receive a number}
% A space terminates the number.
%    \begin{macrocode}
    \MT@ifint\@tempa
      {\MT@edef@n{MT@#1}{\@tempa}}%
      {\MT@optwarn@nan{##1}{#1}}%
  }%
}
%<plain>}\relax
%</package|letterspace>
%    \end{macrocode}
% \opt{factor} will define the protrusion factor only.
%    \begin{macrocode}
%<*package>
\define@key{MT}{factor}[\MT@factor@default]{%
  \def\@tempa{#1 }%
  \MT@ifint\@tempa
    {\edef\MT@pr@factor{\@tempa}}
    {\MT@optwarn@nan{#1}{factor}}%
}
%    \end{macrocode}
% Unit for protrusion codes.
%\changes{v1.8}{2005/04/14}{new option: \opt{unit}, by default \texttt{character}}
%\changes{v1.9}{2005/09/28}{option \opt{unit}: rename value \texttt{relative} to \texttt{character}}
%    \begin{macrocode}
\define@key{MT}{unit}[character]{%
  \def\@tempa{#1}%
  \MT@ifstreq\@tempa{character}\relax{%
    \MT@ifdimen\@tempa
      {\let\MT@pr@unit\@tempa}%
      {\MT@warning@nl{`\@tempa' is not a dimension.\MessageBreak
              Ignoring it and setting values relative to\MessageBreak
              character widths}}%
  }%
}
%    \end{macrocode}
%
%\subsubsection{Loading the definition file}
%
%\begin{macro}{\MT@endinput}
% Abort if no capable engine found.
%    \begin{macrocode}
\let\MT@endinput\relax
%    \end{macrocode}
%\end{macro}
%    \begin{macrocode}
\ifx\MT@engine\relax
  \MT@warning@nl{You don't seem to be using pdftex, luatex or xetex.\MessageBreak
    `\MT@MT' only works with these engines.\MessageBreak
    I will quit now}
  \MT@clear@options
\else
%    \end{macrocode}
% Otherwise load the engine-specific code (as strewn across this file).
%    \begin{macrocode}
  \input{microtype-\MT@engine tex.def}
\fi
\MT@endinput
%    \end{macrocode}
%
% \subsubsection{Reading the configuration file}
%
% 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
% modern \TeX\ systems have switched 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
%</package>
%<*pdftex-def|luatex-def>
\ifnum\pdfoutput<\@ne \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}
%<pdftex-def>  \MT@requires@pdftex4{
    \MT@expansiontrue
%<pdftex-def>    \MT@autotrue
%<pdftex-def>  }\relax
\fi
%<luatex-def>\MT@autotrue
%</pdftex-def|luatex-def>
%    \end{macrocode}
% The main configuration file will be loaded before processing the package
% options.
%\changes{v1.8}{2005/05/15}{new option: \opt{config} to load a different main
%                           configuration file}
%\begin{macro}{\MT@config@file}
%\begin{macro}{\MT@get@config}
% However, the \opt{config} option must of course be evaluated beforehand.
% We also have to define a no-op for the regular option processing later.
%    \begin{macrocode}
%<*package>
\define@key{MT}{config}[]{\relax}
\def\MT@get@config#1config=#2,#3\@nil{%
  \MT@ifempty{#2}%
    {\def\MT@config@file{\MT@MT.cfg}}%
    {\def\MT@config@file{#2.cfg}}%
}
\expandafter\expandafter\expandafter\MT@get@config
  \csname opt@\@currname.\@currext\endcsname,config=,\@nil
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\changes{v1.4b}{2004/11/25}{fix: set catcodes before reading global configuration file
%                (reported by \contributor Christoph Bier <christoph.bier\at web.de>)}
%                                           ^^A MID: <30k2tqF30v483U1@uni-berlin.de>
% Load the file.
%    \begin{macrocode}
\IfFileExists{\MT@config@file}{%
  \MT@info@nl{Loading configuration file \MT@config@file}%
  \MT@begin@catcodes
    \let\MT@begin@catcodes\relax
    \let\MT@end@catcodes\relax
    \let\MT@curr@file\MT@config@file
    \input{\MT@config@file}%
  \endgroup
}{\MT@warning@nl{%
    Could not find configuration file `\MT@config@file'!\MessageBreak
    This will almost certainly cause undesired results.\MessageBreak
    Please fix your installation}%
}
%    \end{macrocode}
%\begin{macro}{\MT@check@active@set}
% We have to make sure that font sets are active. If the user didn't activate
% any, we use those sets declared by \cs{DeclareMicrotypeSetDefault} (this
% is done at the end of the preamble).
%    \begin{macrocode}
\def\MT@check@active@set#1{%
  \MT@ifdefined@n@TF{MT@#1@setname}{%
    \MT@info@nl{Using \@nameuse{MT@abbr@#1} set `\@nameuse{MT@#1@setname}'}%
  }{%
    \MT@ifdefined@n@TF{MT@default@#1@set}{%
      \MT@glet@nn{MT@#1@setname}{MT@default@#1@set}%
      \MT@info@nl{Using default \@nameuse{MT@abbr@#1} set `\@nameuse{MT@#1@setname}'}%
    }{%
%    \end{macrocode}
% If no default font set has been declared in the main configuration file,
% we use the (empty, non-existent) set `|@|',
%\changes{v2.3d}{2008/11/24}{warning for missing default sets}
% and issue a warning.
%    \begin{macrocode}
      \MT@gdef@n{MT@#1@setname}{@}%
      \MT@warning@nl{No \@nameuse{MT@abbr@#1} set chosen, no default set declared.
                     \MessageBreak Using empty set}%
    }%
  }%
}
%    \end{macrocode}
%\end{macro}
%
%\subsubsection{Hook for other packages}\label{sub:hook}
%
% {\let\special@index\index\SpecialIndex@{\Microtype@Hook}{\encapchar usage}}
%\begin{macro}{\Microtype@Hook}
%\changes{v1.7}{2005/03/22}{new command for font package authors}
% This hook may be used by font package authors, \eg, to declare alias fonts. If
% it is defined, it will be executed here, \ie, after the main configuration
% file has been loaded, and before the package options are evaluated.
%
% This hook was needed in versions prior to 1.9a to overcome the situation that
% (1)~the \microtype\ package should be loaded after all font defaults have
% been set up (hence, using \cmd\@ifpackageloaded\ in the font package was not
% viable), and (2)~checking \cmd\AtBeginDocument\ could be too late, since
% fonts might already have been loaded, and consequently set up, in the
% preamble. With the new deferred setup, one could live without this command,
% however, it remains here since it's simpler than testing whether the package
% was loaded both in the preamble as well as at the beginning of the document
% (which is what one would have to do).
%
% Package authors should check whether the command is already defined so that
% existing definitions by other packages aren't overwritten. Example:
%\begin{verbatim}
%\def\MinionPro@MT@Hook{\DeclareMicrotypeAlias{MinionPro-LF}{MinionPro}}
%\@ifpackageloaded{microtype}
%  \MinionPro@MT@Hook
%  {\@ifundefined{Microtype@Hook}
%    {\let\Microtype@Hook\MinionPro@MT@Hook}
%    {\g@addto@macro\Microtype@Hook{\MinionPro@MT@Hook}}}
%\end{verbatim}
% \cs{MicroType@Hook} with a capital |T| (which only existed in version 1.7) is
% provided for compatibility reasons. At some point in the future, it will no
% longer be available, hence it should not be used.
%    \begin{macrocode}
\MT@ifdefined@c@T\MicroType@Hook{\MT@warning{%
  Command \string\MicroType@Hook\space is deprecated.\MessageBreak
      Use \string\Microtype@Hook\space instead}\MicroType@Hook}
\MT@ifdefined@c@T\Microtype@Hook\Microtype@Hook
%    \end{macrocode}
%\end{macro}
%
%\subsubsection{Changing options later}
%
%\begin{macro}{\microtypesetup}
%\changes{v1.4}{2004/11/04}{fix: set the correct levels, and remember them;
%                           warning when enabling an option disabled in package options}
%\changes{v1.7}{2005/02/17}{fix: warning also when setting to \texttt{(no)compatibility}}
%\changes{v1.9a}{2005/11/21}{inside the preamble, accepts all package options}
%\changes{v2.3d}{2009/03/05}{select font after setup}
%\begin{macro}{\MT@define@optionX}
% Inside the preamble, \cs{microtypesetup} accepts the same options as the
% package (unless \opt{defersetup}|=false|).
% In the document body, it accepts the options:
% |protrusion|, |expansion|, |activate|, |tracking|, |spacing| and |kerning|.
% Specifying font sets is not allowed.
%    \begin{macrocode}
\def\microtypesetup{\setkeys{MT}}
\MT@addto@setup{\def\microtypesetup#1{\setkeys{MTX}{#1}\selectfont}}
%</package>
%<*pdftex-def|luatex-def|xetex-def>
\def\MT@define@optionX#1#2{%
  \define@key{MTX}{#1}[true]{%
    \edef\@tempb{\csname MT@rbba@#1\endcsname}%
    \MT@map@clist@n{##1}{%
      \KV@@sp@def\MT@val{####1}%
      \MT@ifempty\MT@val\relax{%
        \@tempcnta=\m@ne
        \MT@ifstreq\MT@val{true}{%
%    \end{macrocode}
% Enabling micro-typography in the middle of the document is not allowed if it
% has been disabled in the package options since fonts might already have been
% loaded and hence wouldn't be set up.
%    \begin{macrocode}
          \MT@checksetup{#1}{%
            \@tempcnta=\csname MT@\@tempb @level\endcsname
            \MT@vinfo{Enabling #1
                    (level \number\csname MT@\@tempb @level\endcsname)\on@line}%
          }%
        }{%
          \MT@ifstreq\MT@val{false}{%
            \@tempcnta=\z@
            \MT@vinfo{Disabling #1\on@line}%
          }{%
            \MT@ifstreq\MT@val{compatibility}{%
              \MT@checksetup{#1}{%
                \@tempcnta=\@ne
                \MT@let@nc{MT@\@tempb @level}\@ne
                \MT@vinfo{Setting #1 to level 1\on@line}%
              }%
            }{%
              \MT@ifstreq\MT@val{nocompatibility}{%
                \MT@checksetup{#1}{%
                  \@tempcnta=\tw@
                  \MT@let@nc{MT@\@tempb @level}\tw@
                  \MT@vinfo{Setting #1 to level 2\on@line}%
                }%
              }{\MT@error{Value `\MT@val' for key `#1' not recognised}
                         {Use any of `true', `false', `compatibility' or
                          `nocompatibility'.}%
              }%
            }%
          }%
        }%
        \ifnum\@tempcnta>\m@ne
          #2\@tempcnta\relax
        \fi
      }%
    }%
  }%
}
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\begin{macro}{\MT@checksetup}
% Test whether the feature wasn't disabled in the package options.
%    \begin{macrocode}
\def\MT@checksetup#1{%
  \csname ifMT@#1\endcsname
    \expandafter\@firstofone
  \else
    \MT@error{You cannot enable #1 if it was disabled\MessageBreak
              in the package options}{Load microtype with #1 enabled.}%
    \expandafter\@gobble
  \fi
}
%    \end{macrocode}
%\end{macro}
%    \begin{macrocode}
\MT@define@optionX{protrusion}\MT@protrudechars
%</pdftex-def|luatex-def|xetex-def>
%<*pdftex-def|luatex-def>
\MT@define@optionX{expansion}\MT@adjustspacing
%    \end{macrocode}
%\begin{macro}{\MT@protrudechars}
%\begin{macro}{\MT@adjustspacing}
%    \begin{macrocode}
%<*luatex-def>
\MT@requires@luatex4{
  \let\pdfprotrudechars\protrudechars
  \let\pdfadjustspacing\adjustspacing
}\relax
%</luatex-def>
\let\MT@protrudechars\pdfprotrudechars
\let\MT@adjustspacing\pdfadjustspacing
%</pdftex-def|luatex-def>
%<*xetex-def>
\let\MT@protrudechars\XeTeXprotrudechars
\define@key{MTX}{expansion}[true]{\MT@warning{Ignoring expansion setup}}
%</xetex-def>
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\begin{macro}{\MT@define@optionX@}
% The same for |tracking|, |spacing| and |kerning|, which do not have a
% |compatibility| level.
%    \begin{macrocode}
%<*pdftex-def|luatex-def>
%<pdftex-def>\MT@requires@pdftex6{
%<luatex-def>\MT@requires@luatex3{
  \def\MT@define@optionX@#1#2{%
    \define@key{MTX}{#1}[true]{%
      \MT@map@clist@n{##1}{%
        \KV@@sp@def\MT@val{####1}%
        \MT@ifempty\MT@val\relax{%
          \@tempcnta=\m@ne
          \MT@ifstreq\MT@val{true}{%
            \MT@checksetup{#1}{%
              \@tempcnta=\@ne
              \MT@vinfo{Enabling #1\on@line}%
            }%
          }{%
            \MT@ifstreq\MT@val{false}{%
              \@tempcnta=\z@
              \MT@vinfo{Disabling #1\on@line}%
            }{\MT@error{Value `\MT@val' for key `#1' not recognised}
                       {Use either `true' or `false'}%
            }%
          }%
          \ifnum\@tempcnta>\m@ne
            #2\relax
          \fi
        }%
      }%
    }%
  }
%    \end{macrocode}
%\end{macro}
% We cannot simply let \cs{MT@tracking} relax, since this may select the already
% letterspaced font instance.
%    \begin{macrocode}
  \MT@define@optionX@{tracking}{\ifnum\@tempcnta=\z@ \let\MT@tracking\MT@set@tr@zero
                                \else \let\MT@tracking\MT@tracking@ \fi}
%<pdftex-def>  \MT@define@optionX@{spacing}{\pdfadjustinterwordglue\@tempcnta}
%<pdftex-def>  \MT@define@optionX@{kerning}{\pdfprependkern\@tempcnta
%<pdftex-def>                               \pdfappendkern\@tempcnta}
}{
%</pdftex-def|luatex-def>
%<*pdftex-def|luatex-def|xetex-def>
%    \end{macrocode}
% Disable for older \pdftex\ versions and for \xetex\ and \luatex.
%    \begin{macrocode}
\define@key{MTX}{tracking}[true]{\MT@warning{Ignoring tracking setup}}
%<luatex-def>}
\define@key{MTX}{kerning}[true]{\MT@warning{Ignoring kerning setup}}
\define@key{MTX}{spacing}[true]{\MT@warning{Ignoring spacing setup}}
%<pdftex-def>}
\define@key{MTX}{activate}[true]{%
  \setkeys{MTX}{protrusion={#1}}%
%<pdftex-def|luatex-def>  \setkeys{MTX}{expansion={#1}}%
}
%</pdftex-def|luatex-def|xetex-def>
%    \end{macrocode}
%\begin{macro}{\MT@saved@setupfont}
% Disable everything -- may be used as a temporary work-around in case
% setting up fonts doesn't work under certain circumstances, but only until
% that specific problem is fixed. This is \emph{undocumented}, as it completely
% deprives us of the possibility to act -- we're blind and paralysed.
%    \begin{macrocode}
%<*package>
\let\MT@saved@setupfont\MT@setupfont
%    \end{macrocode}
%\end{macro}
%    \begin{macrocode}
\define@key{MTX}{disable}[]{%
  \MT@info{Inactivate `\MT@MT' package}%
  \let\MT@setupfont\relax
}
\define@key{MTX}{enable}[]{%
  \MT@info{Reactivate `\MT@MT' package}%
  \let\MT@setupfont\MT@saved@setupfont
}
%</package>
%    \end{macrocode}
%
%\subsubsection{Processing the options}\label{sssec:impl.options}
%
%\begin{macro}{\MT@ProcessOptionsWithKV}
% Parse options.
%    \begin{macrocode}
%<*package|letterspace>
%<plain>\MT@requires@latex1{
\def\MT@ProcessOptionsWithKV#1{%
  \let\@tempc\relax
  \let\MT@temp\@empty
%<plain>  \MT@requires@latex2{
    \MT@map@clist@c\@classoptionslist{%
      \def\CurrentOption{##1}%
      \MT@ifdefined@n@T{KV@#1@\expandafter\MT@getkey\CurrentOption=\@nil}{%
        \edef\MT@temp{\MT@temp,\CurrentOption,}%
        \@expandtwoargs\@removeelement\CurrentOption
          \@unusedoptionlist\@unusedoptionlist
      }%
    }%
    \edef\MT@temp{\noexpand\setkeys{#1}%
                    {\MT@temp\@ptionlist{\@currname.\@currext}}}%
%    \end{macrocode}
% \pkg{eplain} can handle package options.
%    \begin{macrocode}
%<*plain>
  }{\edef\MT@temp{\noexpand\setkeys{#1}%
                    {\csname usepkg@options@\usepkg@pkg\endcsname}}}
%</plain>
  \MT@temp
  \MT@clear@options
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@getkey}
% For |key=val| in class options.
%\changes{v2.3a}{2008/02/09}{fix: \texttt{key\quotechar=val} in class options list}
%    \begin{macrocode}
\def\MT@getkey#1=#2\@nil{#1}
%    \end{macrocode}
%\end{macro}
%    \begin{macrocode}
\MT@ProcessOptionsWithKV{MT}
%<plain>}\relax
%</package|letterspace>
%<*package>
%    \end{macrocode}
% Now we can take the appropriate actions. We also tell the log file which
% options the user has chosen (in case it's interested).
%    \begin{macrocode}
\MT@addto@setup{%
\ifMT@draft
%    \end{macrocode}
% We disable most of what we've just defined in the \arabic{CodelineNo} lines
% above if we are running in draft mode.
%\changes{v1.7}{2005/02/06}{warning when running in draft mode}
%    \begin{macrocode}
  \MT@warning@nl{`draft' option active.\MessageBreak
                 Disabling all micro-typographic extensions.\MessageBreak
                 This might lead to different line and page breaks}%
  \let\MT@setupfont\relax
  \renewcommand*\LoadMicrotypeFile[1]{}%
  \renewcommand*\microtypesetup[1]{}%
  \renewcommand*\microtypecontext[1]{}%
  \renewcommand*\lsstyle{}%
\else
  \MT@setup@PDF
  \MT@setup@copies
%    \end{macrocode}
% Fix the font sets.
%    \begin{macrocode}
  \MT@map@tlist@c\MT@font@sets\MT@fix@font@set
  \MT@setup@protrusion
  \MT@setup@expansion
  \MT@setup@tracking
  \MT@setup@warntracking
  \MT@setup@spacing
  \MT@setup@kerning
  \MT@setup@noligatures
}
%</package>
%    \end{macrocode}
%\begin{macro}{\MT@setup@PDF}
% \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.4b}{2004/11/19}{new message if \cmd\pdfoutput\ is changed}
% Some packages depend on the value of \cmd\pdfoutput\ and will get confused if
% it is changed after they have been loaded. These packages are, among others:
% \pkg{color}, \pkg{graphics}, \pkg{hyperref}, \pkg{crop}, \pkg{contour},
% \pkg{pstricks} and, as a matter of course, \pkg{ifpdf}. Instead of testing
% for each package (that's not our job), we only say that it was \microtype\
% that changed it. This must be sufficient!
%    \begin{macrocode}
%<*pdftex-def|luatex-def>
\def\MT@setup@PDF{%
  \MT@info@nl{Generating \ifnum\pdfoutput<\@ne DVI \else PDF \fi output%
              \ifMT@opt@DVI\space (changed by \MT@MT)\fi}%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@setup@copies}
% Working on font copies?
%    \begin{macrocode}
\def\MT@setup@copies{%
  \ifx\MT@copy@font\relax\else \MT@info@nl{Using font copies for contexts}\fi
}
%</pdftex-def|luatex-def>
%<*xetex-def>
\let\MT@setup@PDF\relax
\let\MT@setup@copies\relax
%</xetex-def>
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@setup@protrusion}
% Protrusion.
%    \begin{macrocode}
%<*pdftex-def|xetex-def|luatex-def>
\def\MT@setup@protrusion{%
  \ifMT@protrusion
    \edef\MT@active@features{\MT@active@features,pr}%
    \MT@protrudechars\MT@pr@level
    \MT@info@nl{Character protrusion enabled (level \number\MT@pr@level)%
      \ifnum\MT@pr@factor=\MT@factor@default \else,\MessageBreak
        factor: \number\MT@pr@factor\fi
      \ifx\MT@pr@unit\@empty \else,\MessageBreak unit: \MT@pr@unit\fi}%
    \MT@check@active@set{pr}%
  \else
    \let\MT@protrusion\relax
    \MT@info@nl{No character protrusion}%
  \fi
}
%</pdftex-def|xetex-def|luatex-def>
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@setup@expansion}
% For <DVI> output, the user must have explicitly passed the \opt{expansion}
% option to the package.
%\changes{v1.5}{2004/12/02}{defaults: turn off expansion for <DVI> output}
% Under \luatex, expansion works quite differently: the glyphs will be
% positioned as if they were transformed, without actually being transformed.
% Since this could still be considered a viable option, we don't disable
% the feature completely, but issue a warning.
%\changes{v2.8}{2020/02/09}{warning when expanding in <DVI> mode with \luatex\
%                           (reported by \contributor d909 <@\at @>)}
%                           ^^A https://tex.stackexchange.com/questions/531413/dvipdfmx-and-dvips-do-not-expand-fonts-properly-with-lualatex-in-dvi-mode
%    \begin{macrocode}
%<*pdftex-def|luatex-def>
\def\MT@setup@expansion{%
  \ifnum\pdfoutput<\@ne
    \ifMT@opt@expansion
%<*luatex-def>
      \ifMT@expansion
        \MT@requires@luatex3{%
          \MT@warning@nl{Font expansion doesn't work properly with luatex in\MessageBreak
             DVI mode: the glyphs won't be actually transformed,\MessageBreak
             but will only be shifted. You might want to use\MessageBreak
             pdflatex instead. I'll continue anyway ..}%
          %\MT@expansionfalse
        }\relax
      \fi
%</luatex-def>
    \else
      \MT@expansionfalse
    \fi
  \fi
  \ifMT@expansion
%    \end{macrocode}
% Set up the values for font expansion: if \opt{stretch} has not been specified, we
% take the default value of 20.
%    \begin{macrocode}
    \ifnum\MT@stretch=\m@ne
      \let\MT@stretch\MT@stretch@default
    \fi
%    \end{macrocode}
% If \opt{shrink} has not been specified, it will inherit the value from \opt{stretch}.
%    \begin{macrocode}
    \ifnum\MT@shrink=\m@ne
      \let\MT@shrink\MT@stretch
    \fi
%    \end{macrocode}
%\changes{v2.3d}{2008/11/19}{default \texttt{step}: 1 for \pdftex\ versions $\geq$ 1.40}
% If \opt{step} has not been specified, we will just set it to 1 for recent
% \pdftex\ versions. My tests did not show much difference neither in
% compilation time (within the margin of error) nor in file size (less than
% 1\% difference for \file{microtype.pdf} with |step=1| compared to |step=5|).
%\changes{v1.5}{2004/12/02}{defaults: calculate \opt{step} as
%                           min(\texttt{stretch},\texttt{shrink})/5}
% With older versions, we set it to min(\opt{stretch},\opt{shrink})/5,
% rounded off, minimum value 1.
%\changes{v1.9}{2005/07/08}{warning if user requested zero \opt{step}}
%    \begin{macrocode}
    \ifnum\MT@step=\m@ne
%<pdftex-def>    \MT@requires@pdftex6{%
      \def\MT@step{1 }%
%<*pdftex-def>
    }{%
      \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 5\relax
      \ifnum\@tempcnta=\z@ \@tempcnta=\@ne \fi
      \edef\MT@step{\number\@tempcnta\space}%
    }%
%</pdftex-def>
    \fi
    \ifnum\MT@step=\z@
      \MT@warning@nl{The expansion step cannot be set to zero.\MessageBreak
          Setting it to one}%
      \def\MT@step{1 }%
    \fi
%    \end{macrocode}
%\begin{macro}{\MT@auto}
% Automatic expansion of the font? This new feature of \pdftex\ 1.20 makes the
% \textit{\fontfamily{pzc}\selectfont hz}~programme really usable.
% It must be either `|autoexpand|' or empty (or `|1000|' for older versions of
% \pdftex).
%\changes{v2.7a}{2017/07/18}{with \luatex, non-automatic font expansion is no longer possible
%                            (as confirmed by \contributor Hans Hagen <pragma\at wxs.nl>)}
%                             ^^A http://tug.org/pipermail/luatex/2017-July/006579.html and following
% With \luatex, we just leave it empty, as there's actually no difference --
% non-automatic font expansion doesn't work anymore.
%\changes{v2.7a}{2017/11/01}{remove `\texttt{autoexpand}' for \luatex\ 1.0.6
%                            (reported by \contributor Ulrike Fischer <news3\at nililand.de>)}
%                            ^^A private mail, 2017/10/29
% In \luatex\ 1.0.6, the `|autoexpand|' option seems to have been removed altogether
% and would trigger a warning.
%    \begin{macrocode}
    \let\MT@auto\@empty
    \ifMT@auto
%    \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}
%\changes{v2.7}{2017/07/02}{don't disable automatic expansion for <DVI> output with \luatex}
%    \begin{macrocode}
%<*pdftex-def>
      \MT@requires@pdftex4{%
        \ifnum\pdfoutput<\@ne
          \ifMT@opt@auto
            \MT@error{%
              Automatic font expansion only works for PDF output.\MessageBreak
              However, you are creating a DVI file}
             {If you have created expanded fonts instances, remove `auto' from%
              \MessageBreak the package options. Otherwise, you have to switch
              off expansion\MessageBreak completely.}%
          \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}
      }{%
        \MT@error{%
          The pdftex version you are using is too old for\MessageBreak
          automatic font expansion}%
         {If you have created expanded fonts instances, remove `auto' from\MessageBreak
          the package options. Otherwise, you have to switch off expansion\MessageBreak
          completely, or upgrade pdftex to version 1.20 or newer.}%
        \MT@autofalse
        \def\MT@auto{1000 }%
      }%
%</pdftex-def>
%<luatex-def>      \MT@requires@luatex3\relax{\def\MT@auto{autoexpand}}%
    \else
%<*pdftex-def>
%    \end{macrocode}
% No automatic expansion.
%    \begin{macrocode}
      \MT@requires@pdftex4\relax{%
        \def\MT@auto{1000 }%
      }%
%</pdftex-def>
%<*luatex-def>
      \MT@requires@luatex3{%
        \ifMT@opt@auto
          \MT@error{Non-automatic font expansion does not work with\MessageBreak
                    luatex}{Remove `auto=false' from the package options, or use pdftex.}%
          \MT@autotrue
        \fi
      }\relax
%</luatex-def>
    \fi
%    \end{macrocode}
% Choose the appropriate macro for selected expansion.
%    \begin{macrocode}
    \ifMT@selected
      \let\MT@set@ex@codes\MT@set@ex@codes@s
    \else
      \let\MT@set@ex@codes\MT@set@ex@codes@n
    \fi
%    \end{macrocode}
% Filter out |stretch=0,shrink=0|, since it would result in a \pdftex\ error.
%\changes{v1.9}{2005/07/08}{disable expansion if both \opt{step} and \opt{shrink} are zero}
%    \begin{macrocode}
    \ifnum\MT@stretch=\z@
      \ifnum\MT@shrink=\z@
        \MT@warning@nl{%
          Both the stretch and shrink limit are set to zero.\MessageBreak
          Disabling font expansion}%
        \MT@expansionfalse
      \fi
    \fi
  \fi
  \ifMT@expansion
    \edef\MT@active@features{\MT@active@features,ex}%
    \MT@adjustspacing\MT@ex@level
    \MT@info@nl{\ifMT@auto A\else Non-a\fi utomatic font expansion enabled
                (level \number\MT@ex@level),\MessageBreak
                stretch: \number\MT@stretch, shrink: \number\MT@shrink,
                step: \number\MT@step, \ifMT@selected\else non-\fi selected}%
%    \end{macrocode}
%\changes{v2.2}{2007/01/28}{warning if \opt{stretch} or \opt{shrink} aren't multiples of \opt{step}}
%\begin{macro}{\MT@check@step}
% Check whether \opt{stretch} and \opt{shrink} are multiples of \opt{step}.
%    \begin{macrocode}
    \def\MT@check@step##1{%
      \@tempcnta=\csname MT@##1\endcsname
      \divide\@tempcnta \MT@step
      \multiply\@tempcnta \MT@step
      \ifnum\@tempcnta=\csname MT@##1\endcsname\else
        \MT@warning@nl{The ##1 amount is not a multiple of step.\MessageBreak
                       The effective maximum ##1 is \the\@tempcnta\space
                       (step \number\MT@step)}%
      \fi
    }%
    \MT@check@step{stretch}%
    \MT@check@step{shrink}%
    \MT@check@active@set{ex}%
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\showhyphens}
%\changes{v1.7}{2005/03/02}{modify \cmd\showhyphens}
% Inside \cmd\showhyphens, font expansion should be disabled.
% (Since 2017/01/10, the \LaTeX\ format contains a different version
% for \xetex, but since expansion doesn't work with \xetex, we don't
% have to bother.)
%\changes{v2.7c}{2019/10/02}{compatibility with \LaTeX\ 2019/10/01
%                            (reported by \contributor Phelype Oleinik <phe.h.o1\at gmail.com>
%                             and \contributor Falk Hanisch <falk.hanisch\at tu-dresden.de>)}
%                            ^^A private mail, 2019/09/26
%                            ^^A private mail, 2019/10/08
% Since 2019/10/01, the command is robust.
%    \begin{macrocode}
    \MT@ifdefined@n@TF{showhyphens }{%
      \def\MT@temp##1##2{%
        \expandafter\CheckCommand\csname showhyphens \endcsname[1]{##1}%
        \DeclareRobustCommand\showhyphens[1]{##2}}%
    }{%
      \def\MT@temp##1##2{%
        \CheckCommand*\showhyphens[1]{##1}%
        \gdef\showhyphens####1{##2}}%
    }%
    \MT@temp
       {\setbox0\vbox{\color@begingroup
        \everypar{}\parfillskip\z@skip
        \hsize\maxdimen\normalfont\pretolerance\m@ne\tolerance\m@ne
        \hbadness\z@\showboxdepth\z@\ ##1\color@endgroup}}
       {\setbox0\vbox{\color@begingroup\pdfadjustspacing\z@
        \everypar{}\parfillskip\z@skip
        \hsize\maxdimen\normalfont\pretolerance\m@ne\tolerance\m@ne
        \hbadness\z@\showboxdepth\z@\ ##1\color@endgroup}}%
%    \end{macrocode}
%\end{macro}
%    \begin{macrocode}
  \else
    \let\MT@expansion\relax
    \MT@info@nl{No font expansion}%
  \fi
}
%</pdftex-def|luatex-def>
%<*xetex-def>
\def\MT@setup@expansion{%
  \ifMT@expansion
    \ifMT@opt@expansion
      \MT@error{Font expansion does not work with xetex}
               {Use pdftex or luatex instead.}%
    \fi
  \fi
}
%</xetex-def>
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@setup@tracking}
% Tracking, spacing and kerning.
%    \begin{macrocode}
%<*pdftex-def|luatex-def>
%<pdftex-def>\MT@requires@pdftex6{%
%<luatex-def>\MT@requires@luatex3{%
  \def\MT@setup@tracking{%
    \ifMT@tracking
      \edef\MT@active@features{\MT@active@features,tr}%
      \MT@info@nl{Tracking enabled}%
      \MT@check@active@set{tr}%
%    \end{macrocode}
% Enable protrusion for compensation at the line edges.
%\changes{v2.3}{2007/07/27}{enable protrusion when tracking is enabled}
%    \begin{macrocode}
      \ifMT@protrusion\else\MT@protrudechars\@ne\fi
    \else
      \let\MT@tracking\relax
      \MT@info@nl{No adjustment of tracking}%
    \fi
  }
%</pdftex-def|luatex-def>
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@setup@spacing}
%    \begin{macrocode}
%<*pdftex-def>
  \def\MT@setup@spacing{%
    \ifMT@spacing
      \edef\MT@active@features{\MT@active@features,sp}%
      \pdfadjustinterwordglue\@ne
      \MT@info@nl{Adjustment of interword spacing enabled}%
%    \end{macrocode}
%\changes{v2.5}{2011/11/29}{warning with \pkg{ragged2e}
%                           (reported by \contributor Steffen Hoffmann <speraviro-delenda\at expires-2011-11-30.arcornews.de>)}
%                            ^^A MID: <dctt-20353621.20111126$90.sph@virsperans.my-fqdn.de>
%                            ^^A (beta:09)
% The \pkg{ragged2e} package sets interword spaces to a fixed value without glue.
% \microtype's modifications can therefore have undesired effects. Therefore,
% we issue a warning.
%    \begin{macrocode}
      \MT@with@package@T{ragged2e}{%
        \MT@warning@nl{You are using the `ragged2e' package.\MessageBreak
          Adjustment of interword spacing may lead to\MessageBreak
          undesired results when used with `ragged2e'.\MessageBreak
          In this case, disable the `spacing' option}%
      }%
      \MT@check@active@set{sp}%
    \else
      \let\MT@spacing\relax
      \MT@info@nl{No adjustment of interword spacing}%
    \fi
  }
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@setup@spacing@check}
% Warning if \cmd\nonfrenchspacing\ is active, since space factors will be
% ignored with \cmd\pdfadjustinterwordglue\,|>|\,0. Why 1500? Because some
% packages redefine \cmd\frenchspacing.\footnote{
%   Cf. the \texttt{c.t.t.} thread `\cmd\frenchspacing\ with <AMS> packages
%   and babel', started by Philipp Lehman on 16~August 2005,
%   <MID>:~\nolinkurl{ddtbaj$rob$1@online.de}}
%    \begin{macrocode}
  \def\MT@setup@spacing@check{%
    \ifMT@spacing
      \ifMT@babel \else
        \ifnum\sfcode`\. > 1500
          \MT@ifstreq\MT@sp@context{nonfrench}\relax{%
            \MT@warning@nl{%
              \string\nonfrenchspacing\space is active. Adjustment of\MessageBreak
              interword spacing will disable it. You might want\MessageBreak
              to add `\@backslashchar\MT@MT context{spacing=nonfrench}'\MessageBreak
              to your preamble}%
          }%
        \fi
      \fi
    \fi
  }
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@setup@kerning}
%    \begin{macrocode}
  \def\MT@setup@kerning{%
    \ifMT@kerning
      \edef\MT@active@features{\MT@active@features,kn}%
      \pdfprependkern\@ne
      \pdfappendkern\@ne
      \MT@info@nl{Adjustment of character kerning enabled}%
      \MT@check@active@set{kn}%
    \else
      \let\MT@kerning\relax
      \MT@info@nl{No adjustment of character kerning}%
    \fi
  }
%</pdftex-def>
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@error@doesnt@work}
% If \pdftex\ is too old, we disable tracking, spacing and kerning,
%\changes{v2.3a}{2008/02/16}{error messages if \pdftex\ is too old for extensions}
% and throw an error message.
% We also switch the features off for \luatex\ and \xetex.
%    \begin{macrocode}
%<pdftex-def|luatex-def>}{
%<*luatex-def>
  \def\MT@setup@tracking{%
    \ifMT@tracking
      \MT@error{The tracking feature only works with luatex 0.62\MessageBreak
        or newer. Switching it off}{Upgrade luatex.}%
      \MT@trackingfalse
      \MT@let@nc{MT@tracking}\relax
    \else
      \MT@info@nl{No adjustment of tracking (luatex too old)}%
    \fi
  }
}
%</luatex-def>
%<*pdftex-def|xetex-def|luatex-def>
  \def\MT@error@doesnt@work#1{%
    \csname ifMT@#1\endcsname
      \MT@error{The #1 feature only works with pdftex 1.40\MessageBreak
        or newer. Switching it off}
%<pdftex-def>        {Upgrade pdftex.}%
%<luatex-def|xetex-def>        {Use pdftex instead.}%
      \csname MT@#1false\endcsname
      \MT@let@nc{MT@#1}\relax
    \else
      \MT@info@nl{No adjustment of #1%
%<pdftex-def>      \space(pdftex too old)%
      }%
    \fi
  }
%<pdftex-def|xetex-def>  \def\MT@setup@tracking{\MT@error@doesnt@work{tracking}}
  \def\MT@setup@kerning {\MT@error@doesnt@work{kerning}}
  \def\MT@setup@spacing {\MT@error@doesnt@work{spacing}}
%<pdftex-def>}
%</pdftex-def|xetex-def|luatex-def>
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@setup@warntracking}
%    \begin{macrocode}
%<letterspace>\MT@addto@setup
%<pdftex-def|luatex-def>\def\MT@setup@warntracking
%    \end{macrocode}
%\begin{macro}{\MT@warn@tracking@DVI}
%\changes{v2.2}{2007/02/11}{warning when letterspacing in <DVI> mode}
%\changes{v2.7}{2017/07/06}{don't warn for letterspacing in <DVI> mode with \luatex}
% With \pdftex, we issue a warning, when letterspacing in <DVI> mode, since it will probably
% not work. We also switch on protrusion if it isn't already, to compensate for
% the letterspacing kerns.
%    \begin{macrocode}
%<*pdftex-def|luatex-def|letterspace>
{%
%<*pdftex-def|letterspace>
  \ifnum\pdfoutput<\@ne
    \def\MT@warn@tracking@DVI{%
%<letterspace>      \MT@pdf@or@lua{%
      \MT@warning@nl{%
          You are using tracking/letterspacing in DVI mode.\MessageBreak
          This will probably not work, unless the post-\MessageBreak
          processing program (dvips, dvipdfm(x), ...) is\MessageBreak
          able to create the virtual fonts on the fly}%
%<letterspace>      }\relax
      \MT@glet\MT@warn@tracking@DVI\relax
    }%
  \else
%</pdftex-def|letterspace>
    \def\MT@warn@tracking@DVI{%
      \ifnum\pdfprotrudechars<\@ne \global\pdfprotrudechars\@ne \fi
      \MT@glet\MT@warn@tracking@DVI\relax
    }%
%<pdftex-def|letterspace>  \fi
%    \end{macrocode}
%\end{macro}
%    \begin{macrocode}
  \ifnum\MT@letterspace=\m@ne
    \let\MT@letterspace\MT@letterspace@default
  \else
    \MT@ls@too@large\MT@letterspace
  \fi
}
%</pdftex-def|luatex-def|letterspace>
%<xetex-def>\let\MT@setup@warntracking\relax
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@setup@noligatures}
% \cs{DisableLigatures} is only admissible in the preamble, therefore we can
% now disable the corresponding macro, if it was never called.
%\changes{v2.0}{2006/12/14}{maybe disable \cs{MT@noligatures} after the preamble}
%    \begin{macrocode}
%<*pdftex-def|luatex-def>
\def\MT@setup@noligatures{%
%<pdftex-def>  \MT@requires@pdftex5{%
    \ifMT@noligatures \else
      \let\MT@noligatures\relax
    \fi
%<pdftex-def>  }\relax
}
%</pdftex-def|luatex-def>
%<xetex-def>\let\MT@setup@noligatures\relax
%    \end{macrocode}
%\end{macro}
% Remove the leading comma in \cs{MT@active@features}, and set the
% document switch to true.
%    \begin{macrocode}
%<*package>
\MT@addto@setup{%
  \ifx\MT@active@features\@empty \else
    \edef\MT@active@features{\expandafter\@gobble\MT@active@features}%
  \fi
  \MT@documenttrue
}
%    \end{macrocode}
%\begin{macro}{\MT@set@babel@context}
% Interaction with \pkg{babel}.
%    \begin{macrocode}
\def\MT@set@babel@context#1{%
  \MT@ifdefined@n@TF{MT@babel@#1}{%
    \MT@vinfo{*** Changing to language context `#1'\MessageBreak\on@line}%
    \expandafter\MT@exp@one@n\expandafter\microtypecontext
      \csname MT@babel@#1\endcsname
  }{%
    \microtypecontext{protrusion=,expansion=,spacing=,kerning=}%
  }%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@shorthandoff}
% Active characters can only be switched off if \pkg{babel} isn't loaded after
% \microtype.
%    \begin{macrocode}
\@ifpackageloaded{babel}{
  \def\MT@shorthandoff#1#2{%
    \MT@info@nl{Switching off #1 babel's active characters (#2)}%
    \shorthandoff{#2}}
}{
  \def\MT@shorthandoff#1#2{%
    \MT@error{You must load `babel' before `\MT@MT'}
             {Otherwise, `\MT@MT' cannot switch off #1 babel's\MessageBreak
              active characters.}}
}
%    \end{macrocode}
%\end{macro}
% We patch the language switching commands to enable language-dependent setup.
%    \begin{macrocode}
\MT@addto@setup{%
  \ifMT@babel
    \@ifpackageloaded{babel}{%
      \MT@info@nl{Redefining babel's language switching commands}%
      \let\MT@orig@select@language\select@language
      \def\select@language#1{%
        \MT@orig@select@language{#1}%
        \MT@set@babel@context{#1}%
      }%
      \let\MT@orig@foreign@language\foreign@language
      \def\foreign@language#1{%
        \MT@orig@foreign@language{#1}%
        \MT@set@babel@context{#1}%
      }%
      \ifMT@kerning
%    \end{macrocode}
%\todo{make switching off of \pkg{babel}'s shorthands configurable}
% Disable French \pkg{babel}'s active characters.
%\changes{v2.0}{2006/10/10}{option `\opt{babel}': fix: switch off French
%                           \pkg{babel}'s shorthands properly
%                           (reported by \contributor Daniel Flipo <daniel.flipo\at univ-lille1.fr>)}
%                                                      ^^A private mail, 2006/10/09
%                                                      ^^A (beta:8)
%    \begin{macrocode}
        \MT@if@false
        \MT@with@babel@and@T{french}  \MT@if@true
        \MT@with@babel@and@T{frenchb} \MT@if@true
        \MT@with@babel@and@T{francais}\MT@if@true
        \MT@with@babel@and@T{canadien}\MT@if@true
        \MT@with@babel@and@T{acadian} \MT@if@true
        \ifMT@if@\MT@shorthandoff{French}{:;!?}\fi
%    \end{macrocode}
% Disable Turkish \pkg{babel}'s active characters.
%\changes{v2.0}{2006/10/10}{option `\opt{babel}': switch off Turkish \pkg{babel}'s shorthands} ^^A (beta:8)
%\changes{v2.3}{2007/10/03}{fix: really switch off Turkish shorthands}
%    \begin{macrocode}
        \MT@if@false
        \MT@with@babel@and@T{turkish} \MT@if@true
        \ifMT@if@\MT@shorthandoff{Turkish}{:!=}\fi
      \fi
%    \end{macrocode}
% In case \pkg{babel} was loaded before \microtype:
%    \begin{macrocode}
      \MT@set@babel@context\languagename
    }{%
      \MT@warning@nl{You did not load the babel package.\MessageBreak
        The `babel' option won't have any effect}%
    }%
  \fi
}
%    \end{macrocode}
% Now we close the \cs{fi} from \cs{ifMT@draft}.
%    \begin{macrocode}
\MT@addto@setup{\fi
%    \end{macrocode}
% Set up the current font, most likely the normal font. This has to come after
% all of the setup (including anything from the preamble) has been dealt with.
%    \begin{macrocode}
  \selectfont}
%    \end{macrocode}
%\begin{macro}{\MT@curr@file}
% This is the current file (hopefully with the correct extension).
%    \begin{macrocode}
\edef\MT@curr@file{\jobname.tex}
%</package>
%    \end{macrocode}
%\end{macro}
% Finally, execute the setup macro at the end of the preamble, and empty it
% (the \pkg{combine} class calls it repeatedly).
%\changes{v2.3d}{2009/02/05}{move setup to the very end
%                            (for \contributor Colin Rourke <gt\at msp.warwick.ac.uk>)}
%                                                       ^^A private mail, 2009/02/03
%    \begin{macrocode}
%<*package|letterspace>
%<plain>\MT@requires@latex1{
\AtBeginDocument{\MT@setup@ \MT@glet\MT@setup@\@empty}
%<plain>}\relax
%</package|letterspace>
%    \end{macrocode}
% Must come at the very, very end.
%    \begin{macrocode}
%<package>\MT@ifdefined@c@T\MT@setup@spacing@check
%<package>  {\AtBeginDocument{\MT@setup@spacing@check}}
%    \end{macrocode}
% Restore catcodes.
%    \begin{macrocode}
%<package|letterspace>\MT@restore@catcodes
%    \end{macrocode}
% That was that.
%
% ^^A -------------------------------------------------------------------------
%\NoIndexing  ^^A from now on, don't bother indexing
%
%\newpage
%
%\section{Configuration files}
%\changes{v1.6}{2005/01/24}{restructure \file{dtx} file}
%
% Let's now write the font configuration files.
%    \begin{macrocode}
%<*config>

%    \end{macrocode}
%\subsection{Font sets}
%\GeneralChanges{Font sets}
%
% We first declare some sets in the main configuration file.
%
%    \begin{macrocode}
%<*m-t>
%%% -----------------------------------------------------------------------
%%% FONT SETS

\DeclareMicrotypeSet{all}
   { }

%    \end{macrocode}
%\changes{v1.2}{2004/10/02}{new: \texttt{allmath} and \texttt{basicmath}}
%\changes{v1.8}{2005/05/25}{add <U> encoding to \texttt{allmath}}
%\changes{v1.9}{2005/08/17}{add <OT4> encoding to text sets}
%\changes{v1.9}{2005/08/17}{add <T5> encoding to text sets}
%\changes{v1.9d}{2006/04/20}{add <QX> encoding to text sets}
%\changes{v2.3e}{2009/10/28}{add <T2A> encoding}
%\changes{v2.5}{2010/05/13}{add <EU1> and <EU2> encodings}
%\changes{v2.6}{2016/04/22}{add <TU> encoding
%                           (notified by \contributor Will Robertson <will\at wspr.io>)}
%                           ^^A semi-private mail, 2016/01/28
%    \begin{macrocode}
\DeclareMicrotypeSet{allmath}
   { encoding = {OT1,T1,T2A,LY1,OT4,QX,T5,EU1,EU2,TU,TS1,OML,OMS,U} }

\DeclareMicrotypeSet{alltext}
   { encoding = {OT1,T1,T2A,LY1,OT4,QX,T5,TS1,EU1,EU2,TU} }

%    \end{macrocode}
%\changes{v2.6}{2014/04/07}{new: \texttt{allmath-nott} and \texttt{alltext-nott}
%                           (reqested by \contributor Karl Berry <karl\at freefriends.org>)}
%                           ^^A private mail, 2014/03/21
%    \begin{macrocode}
\DeclareMicrotypeSet{allmath-nott}
   { encoding = {OT1,T1,T2A,LY1,OT4,QX,T5,EU1,EU2,TU,TS1,OML,OMS,U},
     family   = {rm*,sf*}
   }

\DeclareMicrotypeSet{alltext-nott}
   { encoding = {OT1,T1,T2A,LY1,OT4,QX,T5,TS1,EU1,EU2,TU},
     family   = {rm*,sf*}
   }

%    \end{macrocode}
%\changes{v1.9d}{2006/02/22}{\texttt{md*} instead of \texttt{m} series in basic sets}
%    \begin{macrocode}
\DeclareMicrotypeSet{basicmath}
   { encoding = {OT1,T1,T2A,LY1,OT4,QX,T5,EU1,EU2,TU,OML,OMS},
     family   = {rm*,sf*},
     series   = {md*},
     size     = {normalsize,footnotesize,small,large}
   }

\DeclareMicrotypeSet{basictext}
   { encoding = {OT1,T1,T2A,LY1,OT4,QX,T5,EU1,EU2,TU},
     family   = {rm*,sf*},
     series   = {md*},
     size     = {normalsize,footnotesize,small,large}
   }

%    \end{macrocode}
%\changes{v2.0}{2006/12/28}{new: \texttt{smallcaps}}
%\changes{v2.3e}{2009/06/01}{\texttt{sc*} instead of \texttt{sc} in \texttt{smallcaps} set}
%\changes{v2.6}{2014/02/18}{add \texttt{si} and \texttt{scit} to \texttt{smallcaps} set
%                           (reported by \contributor uli <@\at @>)}
%                           ^^A https://tex.stackexchange.com/questions/157397
%    \begin{macrocode}
\DeclareMicrotypeSet{smallcaps}
   { encoding = {OT1,T1,T2A,LY1,OT4,QX,T5,TS1,EU1,EU2,TU},
     shape    = {sc*,si,scit}
   }

%    \end{macrocode}
%\changes{v2.0}{2006/12/21}{new: \texttt{footnotesize} and \texttt{scriptsize}}
%    \begin{macrocode}
\DeclareMicrotypeSet{footnotesize}
   { encoding = {OT1,T1,T2A,LY1,OT4,QX,T5,TS1,EU1,EU2,TU},
     size     = {-small}
   }

\DeclareMicrotypeSet{scriptsize}
   { encoding = {OT1,T1,T2A,LY1,OT4,QX,T5,TS1,EU1,EU2,TU},
     size     = {-footnotesize}
   }

\DeclareMicrotypeSet{normalfont}
   { font = */*/*/*/* }

%    \end{macrocode}
% The default sets.
%\changes{v2.2}{2007/04/15}{default set for tracking: \texttt{smallcaps}}
%\changes{v2.8}{2019/12/04}{default set for expansion: \texttt{alltext-nott}}
%\changes{v2.8}{2019/12/04}{default set for spacing: \texttt{alltext-nott}}
%    \begin{macrocode}
%%% -----------------------------------------------------------------------
%%% DEFAULT SETS

\DeclareMicrotypeSetDefault[protrusion]{alltext}
\DeclareMicrotypeSetDefault[expansion] {alltext-nott}
\DeclareMicrotypeSetDefault[spacing]   {alltext-nott}
\DeclareMicrotypeSetDefault[kerning]   {alltext}
\DeclareMicrotypeSetDefault[tracking]  {smallcaps}

%    \end{macrocode}
%
%\subsection{Font variants and aliases}
%\GeneralChanges{Font aliases}
%
% These are the variants I happen to be using (expert encoding, oldstyle
% numerals, swashes, alternative, display, inferior and superior numerals):
%    \begin{macrocode}
%%% -----------------------------------------------------------------------
%%% FONT VARIANTS AND ALIASES

\DeclareMicrotypeVariants{x,j,w,a,d,0,1}
%    \end{macrocode}
% Other candidates: |2|~(proportional digits), |e|~(engraved), |f|~(Fraktur),
% |g|~(small text), |h|~(shadow), |l|~(outline), |n|~(informal),
% |p|~(ornaments), |r|~(roman), |s|~(sans serif), |t|~(typewriter).
% I've omitted them since they seem hardly be used and/or they are actually
% more than just a variant, \ie, they shouldn't share a file.
%
%\bigskip\noindent
% Fonts that are `the same':
% The \pkg{fontspec} package will set |lmr| as the default font, whose
% declarations for <EU1>/<EU2>/<TU> encoding are in \file{mt-LatinModernRoman.cfg}.
%\changes{v2.5}{2012/08/23}{declare Latin Modern Roman (OpenType version) as alias of \texttt{lmr}
%                           when \pkg{fontspec} is loaded}
% Since 2016/12/03, the default encoding with \xetex\ and \luatex\ in the
% \LaTeX\ format is <TU>, even if \pkg{fontspec} is not loaded.
%\changes{v2.7}{2017/01/27}{declare Latin Modern Roman as alias of \texttt{lmr}
%                            with new \LaTeX\ format
%                            (reported by \contributor Ulrike Fischer <news3\at nililand.de>)}
%                            ^^A private mail, 2017/01/25
%    \begin{macrocode}

\MT@if@false
\ifx\UnicodeEncodingName\@undefined\else
  \MT@ifstreq{\encodingdefault}{\UnicodeEncodingName}\MT@if@true\relax
\fi
\ifMT@fontspec\MT@if@true\fi
\ifMT@if@
%% -- Computer/Latin Modern Roman
\DeclareMicrotypeAlias{lmr}{Latin Modern Roman}
  \else
\DeclareMicrotypeAlias{lmr}{cmr}           % lmodern
\fi
%    \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. Some of them are in part overwritten later.
%\changes{v1.2}{2004/10/03}{declare \texttt{cmor} as an alias of \texttt{cmr}}
%\changes{v1.3}{2004/10/22}{declare \texttt{aer}, \texttt{zer} and \texttt{hfor}
%                           as aliases of \texttt{cmr}}
% We mustn't forget the Latin Modern math fonts.
%\changes{v2.5}{2012/07/17}{declare \texttt{lmsy} and \texttt{lmm} as aliases
%                           of \texttt{cmsy} resp. \texttt{cmm}
%                           (reported by \contributor Jonas Hogstrom <hjb981\at gmail.com>)}
%                           ^^A https://tex.stackexchange.com/questions/63558/how-to-get-microtype-to-work-with-mathematical-minus-sign-and-package-lmodern
%    \begin{macrocode}
\DeclareMicrotypeAlias{lmsy}{cmsy}         %   "
\DeclareMicrotypeAlias{lmm} {cmm}          %   "
\DeclareMicrotypeAlias{aer} {cmr}          % ae
\DeclareMicrotypeAlias{zer} {cmr}          % zefonts
\DeclareMicrotypeAlias{cmor}{cmr}          % eco
\DeclareMicrotypeAlias{hfor}{cmr}          % hfoldsty
%    \end{macrocode}
% Another, new Computer Modern extension.
%\changes{v2.8}{2019/11/22}{declare New Computer Modern as an alias of Latin Modern Roman}
%    \begin{macrocode}
\DeclareMicrotypeAlias{New Computer Modern}{Latin Modern Roman}
%    \end{macrocode}
% The packages \pkg{pxfonts} and \pkg{txfonts} fonts inherit Palatino and Times
% settings respectively,
%\changes{v1.8}{2005/04/19}{declare \texttt{pxr} and \texttt{txr}
%                           as aliases of \texttt{ppl} resp. \texttt{ptm}}
% also the \TeX\ Gyre fonts Pagella and Termes (formerly: \pkg{qfonts}).
%\changes{v1.9}{2005/08/16}{declare \texttt{qpl} and \texttt{qtm} (\pkg{qfonts}, \TeX\ Gyre)
%                           as aliases of \texttt{ppl} resp. \texttt{ptm}}
%    \begin{macrocode}
%% -- Palatino
\DeclareMicrotypeAlias{pxr} {ppl}          % pxfonts
\DeclareMicrotypeAlias{qpl} {ppl}          % TeX Gyre Pagella (formerly: qfonts/QuasiPalatino)
%    \end{macrocode}
% The `<FPL> Neu' fonts, a `re-implementation' of Palatino.
%\changes{v2.2}{2007/05/27}{declare \texttt{fp9x}, \texttt{fp9j} (<FPL> Neu) as aliases of \texttt{ppl[xj]}}
%    \begin{macrocode}
\DeclareMicrotypeAlias{fp9x}{pplx}         % FPL Neu
\DeclareMicrotypeAlias{fp9j}{pplj}         %    "
%    \end{macrocode}
% The \pkg{newpx} package, a replacement for \pkg{pxfonts}.
%\changes{v2.7}{2017/03/13}{declare aliases for \pkg{newpx}}
%    \begin{macrocode}
\DeclareMicrotypeAlias{zpllf}{pplx}        % newpxtext
\DeclareMicrotypeAlias{zplosf}{pplj}       %    "
\DeclareMicrotypeAlias{zpltlf}{pplx}       %    "
\DeclareMicrotypeAlias{zpltosf}{pplj}      %    "
%    \end{macrocode}
% The \pkg{domitian} package.
%\changes{v2.8}{2020/03/07}{declare aliases for \pkg{step} and \pkg{domitian}
%                           (notified by \contributor Daniel Benjamin Miller <dbmiller\at dbmiller.org>)}
%                           ^^A private mail, 2020/02/27
%    \begin{macrocode}
\DeclareMicrotypeAlias{Domitian-TLF} {pplx}% domitian
\DeclareMicrotypeAlias{Domitian-TOsF}{pplj}%    "
%    \end{macrocode}
% The OpenType versions:
%
%\changes{v2.5}{2012/03/29}{declare TeX Gyre Pagella, Asana Math, Palatino <LT> Std, and Palatino
%                           as aliases of Palatino Linotype (OpenType version)}
%    \begin{macrocode}
\DeclareMicrotypeAlias{Domitian}        {Palatino Linotype}
\DeclareMicrotypeAlias{TeX Gyre Pagella}{Palatino Linotype}
\DeclareMicrotypeAlias{Palatino LT Std} {Palatino Linotype}
\DeclareMicrotypeAlias{Palatino}        {Palatino Linotype}
\DeclareMicrotypeAlias{Asana Math}      {Palatino Linotype}
%% -- Times New Roman
\DeclareMicrotypeAlias{txr}{ptm}           % txfonts
%    \end{macrocode}
% The \pkg{newtx} package, a replacement for \pkg{txfonts}.
%\changes{v2.7}{2017/02/25}{declare aliases for \pkg{newtx}}
%    \begin{macrocode}
\DeclareMicrotypeAlias{ntxlf}{ptmx}        % newtxtext
\DeclareMicrotypeAlias{ntxosf}{ptmj}       %    "
\DeclareMicrotypeAlias{ntxtlf}{ptmx}       %    "
\DeclareMicrotypeAlias{ntxtosf}{ptmj}      %    "
%    \end{macrocode}
% The \pkg{tempora} package.
%\changes{v2.7}{2017/02/25}{declare aliases for \pkg{tempora}}
%    \begin{macrocode}
\DeclareMicrotypeAlias{Tempora-TLF}{ptmx}  % tempora
\DeclareMicrotypeAlias{Tempora-TOsF}{ptmj} %    "
\DeclareMicrotypeAlias{qtm}{ptm}           % TeX Gyre Termes (formerly: qfonts/QuasiTimes)
%    \end{macrocode}
% The \pkg{step} package.
%    \begin{macrocode}
\DeclareMicrotypeAlias{STEP-TLF}{ptmx}     % step
\DeclareMicrotypeAlias{STEP-TOsF}{ptmj}    %   "
%    \end{macrocode}
% The \pkg{stix} and \pkg{stix2} packages (the latter has departed a bit from being
% a Times clone, but still seems close enough).
%\changes{v2.8}{2020/05/31}{declare aliases for \pkg{stix} and \pkg{stix2} fonts}
%    \begin{macrocode}
\DeclareMicrotypeAlias{stix} {ptm}         % stix
\DeclareMicrotypeAlias{stix2}{ptm}         % stix2
%    \end{macrocode}
%\todo{check Times variants}
% More Times variants, to be checked: |pns|, |mns| (TimesNewRomanPS); |mnt|
% (Times\-NewRomanMT, TimesNRSevenMT), |mtm| (TimesSmallTextMT); |pte|
% (TimesEuropa); |ptt| (TimesTen); TimesEighteen; TimesModernEF.
%
% MicroPress's Charter version (\pkg{chmath}).
%\changes{v2.2}{2007/06/08}{declare \texttt{chr} (\pkg{chmath}) as an alias of \texttt{bch}
%                           (reported by \contributor Geoff Vallis <gkv\at Princeton.EDU>)}
%                                                            ^^A private mail, 2007/06/07
%    \begin{macrocode}
%% -- Charter
\DeclareMicrotypeAlias{chr}{bch}           % CH Math
%    \end{macrocode}
%\changes{v2.7}{2017/03/13}{declare aliases for \pkg{XCharter}}
% The \pkg{XCharter} package extends the Charter fonts.
%    \begin{macrocode}
\DeclareMicrotypeAlias{XCharter-TLF} {bch} % XCharter
\DeclareMicrotypeAlias{XCharter-TOsF}{bch} %    "
%    \end{macrocode}
% The \pkg{mathdesign} package provides math fonts matching Bitstream Charter
%\changes{v1.9a}{2005/10/31}{declare \texttt{mdbch} (\pkg{mathdesign})
%                            as an alias of \texttt{bch}}
% and <URW> Garamond.
%    \begin{macrocode}
\DeclareMicrotypeAlias{mdbch}{bch}         % mathdesign/Charter
%% -- Garamond
\DeclareMicrotypeAlias{mdugm}{ugm}         % mathdesign/URW Garamond
%    \end{macrocode}
% The \pkg{garamondx} package, an extension of <URW> Garamond, providing
% small caps and oldstyle figures.
%\changes{v2.5}{2013/02/20}{declare \texttt{zgmx} etc. (\pkg{garamondx})
%                           as aliases of \texttt{ugm}}
%    \begin{macrocode}
\DeclareMicrotypeAlias{zgmx}{ugm}          % garamondx
\DeclareMicrotypeAlias{zgmj}{ugm}          %    "
\DeclareMicrotypeAlias{zgmI}{ugm}          %    "
\DeclareMicrotypeAlias{zgmq}{ugm}          %    "
%% --
%    \end{macrocode}
% <URW> Letter Gothic is similar enough to Bitstream Letter Gothic to share the
% configuration.
%    \begin{macrocode}
\DeclareMicrotypeAlias{ulg}{blg}           % URW LetterGothic -> Bitstream LetterGothic12Pitch
%    \end{macrocode}
% The \pkg{eulervm} package virtually extends the Euler fonts.
%\changes{v1.9e}{2006/07/28}{declare \texttt{zeur} and \texttt{zeus} (\pkg{eulervm})
%                            as aliases of \texttt{eur} resp. \texttt{eus} (\pkg{euler})}
%    \begin{macrocode}
\DeclareMicrotypeAlias{zeur}{eur}          % Euler VM
\DeclareMicrotypeAlias{zeus}{eus}          %    "
%    \end{macrocode}
% Euro symbol fonts, to save some files.
%    \begin{macrocode}
\DeclareMicrotypeAlias{zpeus}   {zpeu}     % Adobe Euro sans -> serif
\DeclareMicrotypeAlias{eurosans}{zpeu}     % Adobe Euro sans -> serif
\DeclareMicrotypeAlias{euroitcs}{euroitc}  % ITC Euro sans -> serif

%    \end{macrocode}
%
%\subsection{Interaction with \pkg{babel}}
%
% Contexts that are to be set when switching to a language.
%    \begin{macrocode}
%%% -----------------------------------------------------------------------
%%% INTERACTION WITH THE `babel' PACKAGE

\DeclareMicrotypeBabelHook
   {english,UKenglish,british,USenglish,american}
   {kerning=, spacing=nonfrench}

\DeclareMicrotypeBabelHook
   {french,francais,acadian,canadien}
   {kerning=french, spacing=}

\DeclareMicrotypeBabelHook
   {turkish}
   {kerning=turkish, spacing=}

%    \end{macrocode}
%\GeneralChanges*
%
% \subsection{Note on admissible characters}
%
% All printable <ASCII> characters are allowed in the settings, with the
% following exceptions (on the left hand side, the replacements on the right):
%
%\begin{tabbing}
%  |\|\quad\=:\quad\=\cmd\textbackslash   \\
%  |{|     \>:\>     \cmd\textbraceleft   \\
%  |}|     \>:\>     \cmd\textbraceright  \\
%  |^|     \>:\>     \cmd\textasciicircum \\
%  |%|     \>:\>     \cmd\%               \\
%  |#|     \>:\>     \cmd\#
%\end{tabbing}
%
%\noindent
% Comma and equal sign must be guarded with braces (`|{,}|', `|{=}|') to keep
% \pkg{keyval} happy.
%
% Character commands are allowed as far as they have been defined in the proper
% \LaTeX\ way, that is, when they have been assigned a slot in the font
% encoding with \cmd\DeclareTextSymbol\ or \cmd\DeclareTextComposite.
% Characters defined via \cmd\chardef\ are also possible.
%
% Ligatures and \cmd\mathchardef'ed symbols have to be specified numerically.
% Of course, numerical identification is possible in any other case, too.
%
%\changes{v1.1}{2004/09/14}{remove 8-bit characters from the configuration files
%               (suggested by \contributor Harald Harders <h.harders\at tu-bs.de>)}
%                                                    ^^A private mail, 2004/09/13
% 8-bit characters are also admissible, provided they have been declared in the
% input encoding file. They should, however, only be used in private
% configuration files, where the proper input encoding is guaranteed, or else in
% combination with the `|inputenc|' key.
%
% With \xetex\ or \luatex, in contrast, it is advisable to use the proper
% Unicode characters, or the font-specific glyph names prefixed with `|/|'
% (cf. section \ref{sec:OpenType}).
%
%\subsection{Character inheritance}
%\GeneralChanges{Inheritance}
%
% First the lists of inheriting characters. We only declare those characters
% that are the same on \emph{both} sides, \ie, not \OE\ for O.
%    \begin{macrocode}
%</m-t>
%<*m-t|zpeu|mvs>
%%% -----------------------------------------------------------------------
%%% CHARACTER INHERITANCE

%</m-t|zpeu|mvs>
%<*m-t>
%    \end{macrocode}
%
%\subsubsection{<OT1>}
% Glyphs that should possibly inherit settings on one side only:
% |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}
%
%\subsubsection{<T1>}
% Candidates here: |028|~(`fi'), |029|~(`fl'), |030|~(`ffi'), |031|~(`ffl'),
% |156| (`\IJ'~ligature, since \LaTeX\ 2005/12/01 accessible as |\IJ|),
% |188|~(`\ij', |\ij|), \AE, \ae, \OE, \oe.
%\changes{v1.5}{2004/12/11}{remove \cmd\ss\ from <T1> list, add \cmd\DJ}
%\changes{v1.8}{2005/04/26}{remove \cmd\DJ\ from <T1> list (it's the same as \cmd\DH)}
%    \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},
     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}
%    \end{macrocode}
%\changes{v2.2}{2007/02/04}{remove `\texttt{-}' $\rightarrow$ `\texttt{127}'}
% The `soft hyphen' often has reduced right side bearing so that it may already
% be protruded, hence no inheritance.
%    \begin{macrocode}
%    - = {127},
   }

%    \end{macrocode}
%
%\subsubsection{<LY1>}
% 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}
   }

%    \end{macrocode}
%
%\subsubsection{<OT4>}
%\changes{v1.9}{2005/08/16}{add list for <OT4>}
%\changes{v2.7b}{2019/02/28}{add textquotedblleft ligature to <OT4>
%                (reported by \contributor Franz Wexler <@\at @>)}
%                ^^A https://tex.stackexchange.com/questions/476648/
% The Polish <OT1> extension. More interesting characters here:
% |009|~(`fk'), |012|~(`fi'), |013|~(`fl'), |014|~(`ffi'), |015|~(`ffl'),
% \AE, \ae, \OE, \oe.
%    \begin{macrocode}
\DeclareCharacterInheritance
   { encoding = OT4 }
   { A = {\k A},
     a = {\k a},
     C = {\'C},
     c = {\'c},
     E = {\k E},
     e = {\k e},
     f = {011}, % ff
     i = {\i},
     j = {\j},
     L = {\L},
     l = {\l},
     N = {\'N},
     n = {\'n},
     O = {\O,\'O},
     o = {\o,\'o},
     S = {\'S},
     s = {\'s},
     Z = {\'Z,\.Z},
     z = {\'z,\.z},
     \textquotedblleft = "FF
   }

%    \end{macrocode}
%
%\subsubsection{<QX>}
%\changes{v1.9d}{2006/04/20}{add list for <QX> encoding (contributed by
%                            \contributor Maciej Eder <maciej_eder\at poczta.onet.pl>)}
%                                                     ^^A private mail, 2006/04/19
% The Central European <QX> encoding.\footnote{
%   Contributed by \contributor Maciej Eder <maciej_eder\at poczta.onet.pl>.}
% Ligatures: |009|~(`fk'), |012|~(`fi'), |013|~(`fl'), |014|~(`ffi'),
% |015|~(`ffl'), \AE, \ae, \OE, \oe.
%    \begin{macrocode}
\DeclareCharacterInheritance
   { encoding = QX }
   { A = {\`A,\'A,\^A,\~A,\"A,\k A,\AA},
     a = {\`a,\'a,\^a,\~a,\"a,\k a,\aa},
     C = {\'C,\c C},
     c = {\'c,\c c},
     D = {\DH},
     E = {\`E,\'E,\^E,\"E,\k E},
     e = {\`e,\'e,\^e,\"e,\k e},
     f = {011}, % ff
     I = {\`I,\'I,\^I,\"I,\k I},
     i = {\`i,\'i,\^i,\"i,\k i,\i},
     j = {\j},
     L = {\L},
     l = {\l},
     N = {\'N,\~N},
     n = {\'n,\~n},
     O = {\O,\`O,\'O,\^O,\~O,\"O},
     o = {\o,\`o,\'o,\^o,\~o,\"o},
%    \end{macrocode}
%\changes{v2.3c}{2008/09/01}{add \cmd\textcommabelow[\texttt{STst}] to <QX> encoding
%                            (reported by \contributor Vasile Gaburici <vgaburici\at gmail.com>)}
%                                          ^^A private mail, 2008/09/01, and
%                                          ^^A http://tug.org/pipermail/tex-live/2008-September/017385.html
% The Romanian \cmd\textcommabelow\ accents are actually replacements for the
% \cmd\c\ variants, which had previously (and erroneously\footnote{
%   Cf. \url{http://tug.org/pipermail/tex-live/2008-August/017204.html}})
% been included in <QX> encoding. They are still kept for backwards
% compatibility.
%\iffalse
% If \cmd\textcommabelow\ is undefined, it will be silently ignored.
% This is due to a quirk in \cs{\MT@map@clist@}.
%\todo{fix \cs{\MT@map@clist@}?}
%\fi
%    \begin{macrocode}
     S = {\'S,\c S,\textcommabelow S,\v S},
     s = {\'s,\c s,\textcommabelow s,\v s},
     T = {\c T,\textcommabelow T},
     t = {\c t,\textcommabelow t},
     U = {\`U,\'U,\^U,\"U,\k U},
     u = {\`u,\'u,\^u,\"u,\k u},
     Y = {\'Y,\"Y},
     y = {\'y,\"y},
     Z = {\'Z,\.Z,\v Z},
     z = {\'z,\.z,\v z},
     . = \textellipsis
   }

%    \end{macrocode}
%
%\subsubsection{<T5>}
%\changes{v1.9}{2005/08/17}{add list for <T5> (requested by
%                           \contributor H\`an \thanhthe{} Th\`anh <hanthethanh\at gmail.com>)}
%                                                ^^A private email, 2005/08/16
% The Vietnamese encoding <T5>. It is so crowded with accented and double-accented
% characters that there is no room for any ligatures.
%    \begin{macrocode}
\DeclareCharacterInheritance
   { encoding = T5 }
   { A = {\`A,\'A,\~A,\h A,\d A,\^A,\u A,
          \`\Acircumflex,\'\Acircumflex,\~\Acircumflex,\h\Acircumflex,\d\Acircumflex,
          \`\Abreve,\'\Abreve,\~\Abreve,\h\Abreve,\d\Abreve},
     a = {\`a,\'a,\~a,\h a,\d a,\^a,\u a,
          \`\acircumflex,\'\acircumflex,\~\acircumflex,\h\acircumflex,\d\acircumflex,
          \`\abreve,\'\abreve,\~\abreve,\h\abreve,\d\abreve},
     D = {\DJ},
     d = {\dj},
     E = {\`E,\'E,\~E,\h E,\d E,\^E,
          \`\Ecircumflex,\'\Ecircumflex,\~\Ecircumflex,\h\Ecircumflex,\d\Ecircumflex},
     e = {\`e,\'e,\~e,\h e,\d e,\^e,
          \`\ecircumflex,\'\ecircumflex,\~\ecircumflex,\h\ecircumflex,\d\ecircumflex},
     I = {\`I,\'I,\~I,\h I,\d I},
     i = {\`i,\'i,\~i,\h i,\d i,\i},
     O = {\`O,\'O,\~O,\h O,\d O,\^O,\horn O,
          \`\Ocircumflex,\'\Ocircumflex,\~\Ocircumflex,\h\Ocircumflex,\d\Ocircumflex,
          \`\Ohorn,\'\Ohorn,\~\Ohorn,\h\Ohorn,\d\Ohorn},
     o = {\`o,\'o,\~o,\h o,\d o,\^o,\horn o,
          \`\ocircumflex,\'\ocircumflex,\~\ocircumflex,\h\ocircumflex,\d\ocircumflex,
          \`\ohorn,\'\ohorn,\~\ohorn,\h\ohorn,\d\ohorn},
     U = {\`U,\'U,\~U,\h U,\d U,\horn U,
          \`\Uhorn,\'\Uhorn,\~\Uhorn,\h\Uhorn,\d\Uhorn},
     u = {\`u,\'u,\~u,\h u,\d u,\horn u,
          \`\uhorn,\'\uhorn,\~\uhorn,\h\uhorn,\d\uhorn},
     Y = {\`Y,\'Y,\~Y,\h Y,\d Y},
     y = {\`y,\'y,\~y,\h y,\d y}
   }

%    \end{macrocode}
%\subsubsection{<EU1>, <EU2>, <TU>}
%\changes{v2.5}{2010/11/05}{add rudimentary list for <EU1> and <EU2>} ^^A (beta:03)
%\changes{v2.6}{2016/04/22}{add <TU> encoding}
% The <EU1> (\xetex), <EU2> (\luatex), and, since \pkg{fontspec} version 2.5,
% <TU> encodings are not well-defined in the sense that they don't
% contain a fixed number of glyphs, all of which must be present.
% OpenType fonts may contain thousands of glyphs, but we only define those
% that should be present in every font (basically <T1>). This inheritance list
% should be overridden by font-specific ones.
%    \begin{macrocode}
\DeclareCharacterInheritance
   { encoding = {EU1,EU2,TU} }
   { 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},
     d = {\v d,\dj},
     E = {\`E,\'E,\^E,\"E,\k E,\v E},
     e = {\`e,\'e,\^e,\"e,\k e,\v e},
%     f = {/f_f}, % sometimes /f_f, sometimes /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}
   }

%</m-t>
%    \end{macrocode}
%
%\subsubsection{Euro symbols}
% Make Euro symbols settings simpler.
%    \begin{macrocode}
%<*zpeu>
\DeclareCharacterInheritance
   { encoding = U,
     family   = {zpeu,zpeus,eurosans} }
   { E = 128 }

%</zpeu>
%<*mvs>
%    \end{macrocode}
% Since 2006/05/11 (that is, one week after I've added these settings, after the
% package had been dormant for six years!), \pkg{marvosym}'s encoding is
% (correctly) <U> instead of <OT1>.
%\changes{v1.9e}{2006/07/05}{adapt to \pkg{marvosym}'s changed encoding}
%    \begin{macrocode}
\DeclareCharacterInheritance
   { encoding = {OT1,U},
     family   = mvs }
   { 164 = {099,100,101} } % \EURhv,\EURcr,\EURtm

%</mvs>
%    \end{macrocode}
%
%\subsection{Tracking}
%\GeneralChanges{Tracking}
%
%\changes{v2.2}{2007/02/23}{add ligatures that are to be disabled}
%\changes{v2.5}{2011/09/07}{add <EU2> encoding to default list} ^^A (beta:09)
%\changes{v2.6}{2016/04/22}{add <TU> encoding to default list}
% By default, we only disable the `f*' ligatures, for those fonts that have
% any. Thus, ligatures and especially kerning for all other characters will be
% retained.
%    \begin{macrocode}
%<*m-t>
%%% -----------------------------------------------------------------------
%%% TRACKING/LETTERSPACING

\SetTracking
  [ name         = default,
    no ligatures = {f} ]
  { encoding     = {OT1,T1,T2A,LY1,OT4,QX,EU2,TU} }
  { }

%    \end{macrocode}
%
%\subsection{Font expansion}
%\GeneralChanges{Expansion}
%
% These are \thanh's original expansion settings. They are used for all fonts
% (until somebody shows mercy and creates font-specific settings).
%    \begin{macrocode}
%%% -----------------------------------------------------------------------
%%% EXPANSION

\SetExpansion
   [ name     = default      ]
   { encoding = {OT1,OT4,QX,T1,LY1} }
   {
     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
   }

%    \end{macrocode}
% Settings for Cyrillic <T2A> encoding.\footnote{Contributed by
%                                           \contributor Karl Karlsson <karl-karlsson\at yandex.ru>.}
%\changes{v2.3e}{2009/10/28}{settings for <T2A> encoding
%                            (contributed by \contributor Karl Karlsson <karl-karlsson\at yandex.ru>)}
%    \begin{macrocode}
\SetExpansion
   [ name     = T2A ]
   { encoding = T2A }
   {
     A = 500,     a = 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,
     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,
     \CYRA = 500,     \cyra = 700,
     \CYRB = 700,     \cyrb = 700,
     \CYRV = 700,     \cyrv = 700,
     \CYRG = 700,     \cyrg = 700,
     \CYRD = 700,     \cyrd = 700,
     \CYRE = 700,     \cyre = 700,
     \CYRZH = 700,    \cyrzh = 700,
     \CYRZ = 700,     \cyrz = 700,
     \CYRI = 700,     \cyri = 700,
     \CYRISHRT = 700, \cyrishrt = 700,
     \CYRK = 700,     \cyrk = 700,
     \CYRL = 700,     \cyrl = 700,
     \CYRM = 700,     \cyrm = 700,
     \CYRN = 700,     \cyrn = 700,
     \CYRO = 500,     \cyro = 700,
     \CYRP = 700,     \cyrp = 700,
     \CYRR = 700,     \cyrr = 700,
     \CYRS = 700,     \cyrs = 700,
     \CYRT = 700,     \cyrt = 700,
     \CYRU = 700,     \cyru = 700,
     \CYRF = 700,     \cyrf = 700,
     \CYRH = 700,     \cyrh = 700,
     \CYRC = 700,     \cyrc = 700,
     \CYRCH = 700,    \cyrch = 700,
     \CYRSH = 700,    \cyrsh = 700,
     \CYRSHCH = 700,  \cyrshch = 700,
     \CYRHRDSN = 700, \cyrhrdsn = 700,
     \CYRERY = 700,   \cyrery = 700,
     \CYRSFTSN = 700, \cyrsftsn = 700,
     \CYREREV = 700,  \cyrerev = 700,
     \CYRYU = 700,    \cyryu = 700,
     \CYRYA = 700,    \cyrya = 700
   }

%    \end{macrocode}
% <T5> encoding does not contain \cmd\AE, \cmd\ae, \cmd\OE\ and \cmd\oe.
%    \begin{macrocode}
\SetExpansion
   [ name     = T5 ]
   { encoding = T5 }
   {
     A = 500,     a = 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,
     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}
%\GeneralChanges{Protrusion}
%
%\changes{v1.1}{2004/09/14}{add factors for some more characters}
%\changes{v1.4b}{2004/11/19}{harmonise dashes in upshape and italic
%                            (\texttt{cmr}, \texttt{pad}, \texttt{ppl})}
%\changes{v1.9}{2005/08/16}{settings for <OT4> encoding (Computer Modern Roman,
%                           Palatino, Times)}
%\changes{v1.9}{2005/08/17}{settings for <T5> encoded Computer Modern Roman}
%\changes{v1.9a}{2005/12/02}{settings for <T5> encoded Charter}
%
%    \begin{macrocode}
%%% -----------------------------------------------------------------------
%%% PROTRUSION

%    \end{macrocode}
% For future historians, \thanh's original settings (from \file{protcode.tex},
% converted to \microtype\ notation).
%\begin{verbatim}
%\SetProtrusion
%   [ name     = thanh ]
%   { encoding = OT1 }
%   {
%     A = {50,50},
%     F = {  ,50},
%     J = {50,  },
%     K = {  ,50},
%     L = {  ,50},
%     T = {50,50},
%     V = {50,50},
%     W = {50,50},
%     X = {50,50},
%     Y = {50,50},
%     k = {  ,50},
%     r = {  ,50},
%     t = {  ,50},
%     v = {50,50},
%     w = {50,50},
%     x = {50,50},
%     y = {50,50},
%     . = { ,700},    {,}= { ,700},
%     : = { ,500},     ; = { ,500},
%     ! = { ,200},     ? = { ,200},
%     ( = {50,  },     ) = {  ,50},
%     - = { ,700},
%     \textendash        = { ,300},     \textemdash        = { ,200},
%     \textquoteleft     = {700, },     \textquoteright    = { ,700},
%     \textquotedblleft  = {500, },     \textquotedblright = { ,500}
%   }
%\end{verbatim}
%
%\subsubsection{Normal}
%
% The default settings always use the most moderate value.
%
%    \begin{macrocode}
%<*cfg-t>
\SetProtrusion
%<m-t>   [ name     = default ]
%    \end{macrocode}
% We also create configuration files for the fonts
%\begin{itemize}
%  \item Bitstream Charter (<NFSS> code |bch|)
%\changes{v1.5}{2004/11/28}{settings for Bitstream Charter}
%    \begin{macrocode}
%<bch>   [ name     = bch-default ]
%    \end{macrocode}
%  \item Bitstream Letter Gothic (|blg|)
%\changes{v2.2}{2007/03/03}{settings for Bitstream Letter Gothic}
%    \begin{macrocode}
%<blg>   [ name     = blg-default ]
%    \end{macrocode}
%  \item Computer Modern Roman (|cmr|)
%    \begin{macrocode}
%<cmr>   [ name     = cmr-default ]
%    \end{macrocode}
%  \item Adobe Garamond (|pad|, |padx|, |padj|)
%    \begin{macrocode}
%<pad>   [ name     = pad-default ]
%    \end{macrocode}
%  \item Minion\footnote{Contributed by \contributor Harald Harders <h.harders\at tu-bs.de>
%                        and \contributor Karl Karlsson <karl-karlsson\at yandex.ru>.}
%        (|pmnx|, |pmnj|)
%\changes{v1.1}{2004/09/14}{settings for Adobe Minion (contributed by
%                           \contributor Harald Harders <h.harders\at tu-bs.de>)}
%                                                  ^^A private mail, 2004/09/14
%    \begin{macrocode}
%<pmn>   [ name     = pmnj-default ]
%    \end{macrocode}
%  \item Palatino (|ppl|, |pplx|, |pplj|)
%    \begin{macrocode}
%<ppl>   [ name     = ppl-default ]
%    \end{macrocode}
%  \item Times (|ptm|, |ptmx|, |ptmj|)
%    \begin{macrocode}
%<ptm>   [ name     = ptm-default ]
%    \end{macrocode}
%  \item <URW> Garamond (|ugm|)
%\changes{v1.9c}{2006/01/26}{settings for <URW> Garamond}
%\end{itemize}
%    \begin{macrocode}
%<ugm>   [ name     = ugm-default ]
%<m-t|cmr|pmn>   { }
%<bch|blg|pad|ugm>   { encoding = OT1,
%<ppl|ptm>   { encoding = {OT1,OT4},
%<bch>     family   = bch }
%<blg>     family   = blg }
%<pad>     family   = {pad,padx,padj} }
%<ppl>     family   = {ppl,pplx,pplj} }
%<ptm>     family   = {ptm,ptmx,ptmj} }
%<ugm>     family   = ugm }
   {
%<m-t|bch|blg|cmr|pad|pmn|ppl|ptm>     A = {50,50},
%<ugm>     A = {50,100},
%<pad|ptm>   \AE = {50,  },
%<ugm>   \AE = {150,50},
%<ugm>     B = {  ,50},
%<bch|pad|pmn|ugm>     C = {50,  },
%<bch|pad|pmn>     D = {  ,50},
%<ugm>     D = {  ,70},
%<ugm>     E = {  ,50},
%<m-t|bch|cmr|pad|pmn|ptm>     F = {  ,50},
%<ugm>     F = {  ,70},
%<bch|pad|pmn>     G = {50,  },
%<ugm>     G = {50,50},
%<blg>     I = {150,150},
%<m-t|cmr|pad|pmn|ppl|ptm|ugm>     J = {50,  },
%<bch|blg>     J = {100,  },
%<!blg>     K = {  ,50},
%<blg>     K = {50,  },
%<m-t|bch|cmr|pad|pmn|ppl>     L = {  ,50},
%<blg>     L = {  ,150},
%<ptm>     L = {  ,80},
%<ugm>     L = {  ,120},
%<bch|pad|pmn|ugm>     O = {50,50},
%<pad>   \OE = {50,  },
%<ugm>   \OE = {50,50},
%<blg>     P = {  ,100},
%<ugm>     P = {  ,50},
%<bch|pad|pmn>     Q = {50,70},
%<ugm>     Q = {50,50},
%<bch>     R = {  ,50},
%<ugm>     R = {  ,70},
%<m-t|bch|cmr|pad|pmn|ppl|ptm>     T = {50,50},
%<blg>     T = {100,100},
%<ugm>     T = {70,70},
%<m-t|bch|cmr|pad|pmn|ppl|ptm>     V = {50,50},
%<blg|ugm>     V = {70,70},
%<m-t|bch|cmr|pad|pmn|ppl|ptm>     W = {50,50},
%<ugm>     W = {70,70},
%<m-t|bch|cmr|pad|pmn|ppl|ptm>     X = {50,50},
%<ugm>     X = {50,70},
%<m-t|bch|cmr|pad|pmn|ppl>     Y = {50,50},
%<blg|ptm|ugm>     Y = {80,80},
%<ugm>     Z = {50,50},
%<blg>     f = {150,100},
%<blg>     i = {150,150},
%<blg>     j = {100,100},
%<m-t|bch|cmr|pad|pmn|ppl|ptm>     k = {  ,50},
%<ugm>     k = {  ,70},
%<blg>     l = {150,150},
%<pmn>     l = {  ,-50},
%<pad|ppl>     p = {50,50},
%<ugm>     p = {  ,50},
%<pad|ppl>     q = {50,  },
%<!blg>     r = {  ,50},
%<blg>     r = {100, 80},
%<cmr|pad|pmn>     t = {  ,70},
%<bch>     t = {  ,50},
%<blg>     t = {150, 80},
%<ugm>     t = {  ,100},
%<m-t|bch|cmr|pad|pmn|ppl|ptm>     v = {50,50},
%<blg>     v = {100,100},
%<ugm>     v = {50,70},
%<m-t|bch|cmr|pad|pmn|ppl|ptm>     w = {50,50},
%<ugm>     w = {50,70},
%<!blg>     x = {50,50},
%<blg>     x = {100,100},
%<m-t|bch|pad|pmn>     y = {  ,50},
%<blg>     y = { 50,100},
%<cmr|ppl|ptm>     y = {50,70},
%<ugm>     y = {  ,70},
%    \end{macrocode}
%\changes{v1.6}{2005/01/11}{improve settings for numbers
%               (pointed out by \contributor Peter Muthesius <newsname\at gmx.de>)}
%                                       ^^A MID: <34b1h7F48s44tU1@individual.net>
%    \begin{macrocode}
%<cmr>     0 = {  ,50},
%<m-t>     1 = {50,50},
%<bch|blg|pad|ptm|ugm>     1 = {150,150},
%<cmr>     1 = {100,200},
%<pmn>     1 = {  ,50},
%<ppl>     1 = {100,100},
%<bch|cmr|pad|ugm>     2 = {50,50},
%<blg>     2 = {  ,100},
%<bch|pmn>     3 = {50,  },
%<cmr|pad|ugm>     3 = {50,50},
%<blg>     3 = {100,  },
%<m-t|pad>     4 = {50,50},
%<bch>     4 = {100,50},
%<blg>     4 = {100,  },
%<cmr|ugm>     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|ugm>     7 = {50,80},
%<blg>     7 = {100,100},
%<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|ugm>     . = { ,700},
%<bch>     . = { ,600},
%<blg>     . = {400,500},
%<!blg>    {,}= { ,500},
%<blg>    {,}= {300,400},
%<m-t|cmr|pad|pmn|ppl|ptm|ugm>     : = { ,500},
%<bch>     : = { ,400},
%<blg>     : = {300,400},
%<m-t|bch|pad|pmn|ptm>     ; = { ,300},
%<blg>     ; = {200,300},
%<cmr|ppl>     ; = { ,500},
%<ugm>     ; = { ,400},
%<!blg>     ! = { ,100},
%<blg>     ! = {200,200},
%<m-t|pad|pmn|ptm>     ? = { ,100},
%<bch|cmr|ppl|ugm>     ? = { ,200},
%<blg>     ? = {150,150},
%<pmn>     " = {300,300},
%<m-t|bch|cmr|pad|pmn|ppl>     @ = {50,50},
%<ptm>     @ = {100,100},
%<m-t|bch|blg|cmr|pad|pmn|ppl|ptm>     ~ = {200,250},
%<ugm>     ~ = {300,350},
%<pad|ppl|ptm>     & = {50,100},
%<ugm>     & = {  ,100},
%<m-t|cmr|pad|pmn>    \% = {50,50},
%<bch>    \% = {  ,50},
%<ppl|ptm>    \% = {100,100},
%<ugm>    \% = {50,100},
%<blg>    \# = {100,100},
%<m-t|ppl|ptm|ugm>     * = {200,200},
%<bch|pmn>     * = {200,300},
%<blg>     * = {150,200},
%<cmr|pad>     * = {300,300},
%<m-t|cmr|ppl|ptm>     + = {250,250},
%<bch>     + = {150,250},
%<pad>     + = {300,300},
%<blg|pmn>     + = {150,200},
%<ugm>     + = {250,300},
%<blg|ugm>    {=}= {200,200},
%<m-t|pad|pmn|ptm>     ( = {100,   },    ) = {   ,200},
%<bch|ugm>     ( = {200,   },    ) = {   ,200},
%<cmr|blg>     ( = {300,   },    ) = {   ,300},
%<ppl>     ( = {100,   },    ) = {   ,300},
%<bch|pmn>     [ = {100,   },    ] = {   ,100},
%<blg>     [ = {300,100},    ] = {   ,300},
%    \end{macrocode}
%\changes{v1.7}{2005/03/15}{fix: remove \textbackslash\ from <OT1>,
%                           add \cmd\textbackslash\ to <T1> encoding}
%    \begin{macrocode}
%<m-t|pad|pmn|ptm>     / = {100,200},
%<bch>     / = { ,200},
%<blg>     / = {300,300},
%<cmr|ppl>     / = {200,300},
%<ugm>     / = {100,300},
%<m-t|ptm>     - = {500,500},
%<bch|cmr|ppl>     - = {400,500},
%<blg>     - = {300,400},
%<pad>     - = {300,500},
%<pmn>     - = {200,400},
%<ugm>     - = {500,600},
%<blg>     < = {200,100},    > = {100,200},
%<blg>     _ = {150,250},
%<blg>     | = {250,250},
%<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},
%<ugm>     \textendash       = {250,300},   \textemdash        = {250,250},
%    \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},
%<blg>     \textquoteleft     = {400,600},   \textquoteright    = {400,600},
%<cmr>     \textquoteleft    = {500,700},   \textquoteright    = {500,600},
%<pad|ppl>     \textquoteleft    = {500,700},   \textquoteright    = {500,700},
%<ptm>     \textquoteleft    = {500,500},   \textquoteright    = {300,500},
%<ugm>     \textquoteleft    = {300,600},   \textquoteright    = {300,600},
%<m-t|bch|pmn>     \textquotedblleft = {300,300},   \textquotedblright = {300,300}
%<blg>     \textquotedblright = {300,400}
%<cmr>     \textquotedblleft = {500,300},   \textquotedblright = {200,600}
%<pad|ppl|ptm>     \textquotedblleft = {300,400},   \textquotedblright = {300,400}
%<ugm>     \textquotedblleft = {400,400},   \textquotedblright = {400,400}
   }

%    \end{macrocode}
% Greek uppercase letters are in <OT1> encoding only.
%\changes{v1.9}{2005/07/10}{fix: remove uppercase Greek letters from <T1> encoded <CMR>}
%    \begin{macrocode}
%<*m-t|cmr|pmn>
\SetProtrusion
%<m-t>   [ name     = OT1-default,
%<cmr>   [ name     = cmr-OT1,
%<pmn>   [ name     = pmnj-OT1,
%<m-t>     load     = default ]
%<cmr>     load     = cmr-default ]
%<pmn>     load     = pmnj-default ]
%<m-t>   { encoding = OT1 }
%<cmr>   { encoding = {OT1,OT4},
%<pmn>   { encoding = OT1,
%<cmr>     family   = cmr  }
%<pmn>     family   = pmnj }
   {
%<m-t|cmr>     \AE = {50,   },
%<pmn>     \OE = {50,  }
%<*cmr>
     "00 = {   ,150}, % \Gamma
     "01 = {100,100}, % \Delta
     "02 = { 50, 50}, % \Theta
     "03 = {100,100}, % \Lambda
     "06 = { 50, 50}, % \Sigma
     "07 = {100,100}, % \Upsilon
     "08 = { 50, 50}, % \Phi
     "09 = { 50, 50}  % \Psi
%    \end{macrocode}
% Remaining slots can be found in the source file.
%\iffalse ^^A ... namely, here:
%    "04 = {   ,   }, % \Xi
%    "05 = {   ,   }, % \Pi
%    "0A = {   ,   }, % \Omega
%\fi
%    \begin{macrocode}
%</cmr>
   }

%</m-t|cmr|pmn>
%    \end{macrocode}
% <T1> and <LY1> encodings contain some more characters. The default list
% will be loaded first.
%\changes{v1.9a}{2005/11/07}{fix: remove `\texttt{\_}' from <OT1> encoding}
% For \xetex\ (<EU1>) and \luatex\ (<EU2>) we simply use the <T1> list as
% default (for now).
%\changes{v2.5}{2010/11/05}{add default lists for <EU1> and <EU2>} ^^A (beta:03)
%\changes{v2.6}{2016/04/22}{add <TU> encoding to lists}
%    \begin{macrocode}
\SetProtrusion
%<m-t>   [ name     = T1-default,
%<bch>   [ name     = bch-T1,
%<blg>   [ name     = blg-T1,
%<cmr>   [ name     = cmr-T1,
%<pad>   [ name     = pad-T1,
%<pmn>   [ name     = pmnj-T1,
%<ppl>   [ name     = ppl-T1,
%<ptm>   [ name     = ptm-T1,
%<ugm>   [ name     = ugm-T1,
%<m-t>     load     = default     ]
%<bch>     load     = bch-default ]
%<blg>     load     = blg-default ]
%<cmr>     load     = cmr-default ]
%<pad>     load     = pad-default ]
%<pmn>     load     = pmnj-default ]
%<ppl>     load     = ppl-default ]
%<ptm>     load     = ptm-default ]
%<ugm>     load     = ugm-default ]
%<m-t>   { encoding = {T1,LY1,EU1,EU2,TU} }
%<bch|cmr|pad|pmn|ppl>   { encoding = {T1,LY1},
%<blg|ptm|ugm>   { encoding = {T1},
%<bch>     family   = bch }
%<blg>     family   = blg }
%<cmr>     family   = cmr }
%<pad>     family   = {pad,padx,padj} }
%<pmn>     family   = pmnj }
%<ppl>     family   = {ppl,pplx,pplj} }
%<ptm>     family   = {ptm,ptmx,ptmj} }
%<ugm>     family   = ugm }
   {
%<m-t|cmr>     \AE = {50,  },
%<bch|pmn>     \OE = {50,  },
%<pmn>     \TH = {  ,50},
%<blg>     \v L = {   ,250},
%<blg>     \v d = {   ,250},
%<blg>     \v l = {   ,250},
%<blg>     \v t = {   ,250},
%<blg>     127 =  {300,400},
%<blg>     156 =  {100,   }, % IJ
%<blg>     188 =  { 80, 80}, % ij
%<m-t|bch|pad|pmn|ppl|ptm>       _ = {100,100},
%<cmr>       _ = {200,200},
%<ugm>       _ = {100,200},
%<m-t|pad|pmn|ptm>     \textbackslash    = {100,200},
%<bch>     \textbackslash    = {150,200},
%<blg>     \textbackslash    = {250,300},
%<cmr|ppl>     \textbackslash    = {200,300},
%<ugm>     \textbackslash    = {100,300},
%<ugm>     \textbar          = {200,200},
%<blg>     \textendash       = {300,300},   \textemdash        = {150,150},
%<blg>     \textquotedbl     = {300,400},   \textquotedblleft  = {300,400},
%<cmr>     \textquotedbl     = {300,300},   \textquotedblleft  = {200,600},
%    \end{macrocode}
%\changes{v1.4}{2004/10/30}{tweak quote characters for \texttt{cmr}
%                           variants (<OT1>, <T1>, \texttt{lmr})}
% The <EC> fonts do something weird: they insert an implicit kern between quote
% and boundary character. Therefore, we must override the settings from <OT1>.
%    \begin{macrocode}
%<m-t|cmr|pad|ppl|ptm|ugm>     \quotesinglbase   = {400,400},   \quotedblbase      = {400,400},
%<blg>     \quotesinglbase   = {400,400},   \quotedblbase      = {300,400},
%<bch|pmn>     \quotesinglbase   = {400,400},   \quotedblbase      = {300,300},
%<m-t|bch|pmn>     \guilsinglleft    = {400,300},   \guilsinglright    = {300,400},
%<blg>     \guilsinglleft    = {300,500},   \guilsinglright    = {300,500},
%<cmr|pad|ppl|ptm>     \guilsinglleft    = {400,400},   \guilsinglright    = {300,500},
%<ugm>     \guilsinglleft    = {400,400},   \guilsinglright    = {300,600},
%<m-t>     \guillemotleft    = {200,200},   \guillemotright    = {200,200},
%<cmr>     \guillemotleft    = {300,200},   \guillemotright    = {100,400},
%<bch|pmn>     \guillemotleft    = {200,200},   \guillemotright    = {150,300},
%<blg|pad|ppl|ptm>     \guillemotleft    = {300,300},   \guillemotright    = {200,400},
%<ugm>     \guillemotleft    = {300,400},   \guillemotright    = {300,400},
%<m-t|bch|cmr|pad|pmn|ppl|ugm>     \textexclamdown   = {100,   },   \textquestiondown  = {100,   },
%<blg>     \textexclamdown   = {200,   },   \textquestiondown  = {100,   },
%<ptm>     \textexclamdown   = {200,   },   \textquestiondown  = {200,   },
%<m-t|cmr|pad|ppl|ptm|ugm>     \textbraceleft    = {400,200},   \textbraceright    = {200,400},
%<bch|blg|pmn>     \textbraceleft    = {200,   },   \textbraceright    = {   ,300},
%<m-t|bch|cmr|pad|ppl|ptm|ugm>     \textless         = {200,100},   \textgreater       = {100,200}
%<pmn>     \textless         = {100,   },   \textgreater       = {   ,100},
%<pmn>     \textvisiblespace = {100,100} % not in LY1
%    \end{macrocode}
%\iffalse
%   \dh = {  ,  },
%   \th = {  ,  },
%   \NG = {  ,  },
%   \ng = {  ,  },
%   \textasciicircum = {  ,  },
%   \textsterling = {  ,  }, % also in TS1
%   \textsection = {  ,  }, % also in TS1
%\fi
%    \begin{macrocode}
   }

%    \end{macrocode}
% The \pkg{lmodern} fonts used to restore the original settings from <OT1>
% fonts. Now, they require even other settings, though.
%\changes{v2.3a}{2008/02/19}{adjust <LMR> quotation marks again}
%    \begin{macrocode}
%<*cmr>
\SetProtrusion
   [ name     = lmr-T1,
     load     = cmr-T1   ]
   { encoding = {T1,LY1},
     family   = lmr      }
   {
     \textquotedblleft  = {300,400},  \textquotedblright = {300,400}
   }

%</cmr>
%    \end{macrocode}
% Settings for the <T2A> encoding (generic, Computer Modern Roman, and Minion).\footnote{Contributed by
%                            \contributor Karl Karlsson <karl-karlsson\at yandex.ru>.}
%\changes{v2.3e}{2009/10/28}{settings for <T2A> encoding (contributed by
%                            \contributor Karl Karlsson <karl-karlsson\at yandex.ru>)}
%                                                       ^^A private mail, 2009/10/21
%\changes{v2.4}{2009/11/15}{settings for <T2A> encoded Minion (contributed by
%                           \contributor Karl Karlsson <karl-karlsson\at yandex.ru>)}
%                                                       ^^A private mail, 2009/11/14
%    \begin{macrocode}
%<*m-t|cmr|pmn>
\SetProtrusion
%<m-t>   [ name     = T2A-default,
%<cmr>   [ name     = cmr-T2A,
%<pmn>   [ name     = pmnj-T2A,
%<m-t>     load     = default     ]
%<cmr>     load     = cmr-default ]
%<pmn>     load     = pmnj-default ]
   { encoding = T2A,
%<m-t>   }
%<cmr>     family   = cmr }
%<pmn>     family   = pmnj }
   {
     \CYRA = {50,50},
     \CYRG = {  ,50},
     \CYRK = {  ,50},
     \CYRT = {50,50},
     \CYRH = {50,50},
     \CYRU = {50,50},
%<pmn>     \CYRS = {50,  },
%<pmn>     \CYRO = {50,50},
     \cyrk = {  ,50},
     \cyrg = {  ,50},
     \cyrh = {50,50},
%<m-t|pmn>     \cyru = {50,50},
%<cmr>     \cyru = {50,70},
%<m-t>        _  = {100,100},
%<cmr>        _  = {200,200},
%<m-t>     \textbackslash    = {100,200},   \quotedblbase      = {400,400},
%<cmr>     \textbackslash    = {200,300},   \quotedblbase      = {400,400},
%<pmn>     \textbackslash    = {100,200},   \quotedblbase      = {300,300},
%<cmr>     \textquotedbl     = {300,300},   \textquotedblleft  = {200,600},
%<m-t>     \guillemotleft    = {200,200},   \guillemotright    = {200,200},
%<cmr>     \guillemotleft    = {300,200},   \guillemotright    = {100,400},
%<pmn>     \guillemotleft    = {200,200},   \guillemotright    = {150,300},
%<m-t|cmr>     \textbraceleft    = {400,200},   \textbraceright    = {200,400},
%<pmn>     \textbraceleft    = {200,   },   \textbraceright    = {   ,300},
%<m-t|cmr>     \textless         = {200,100},   \textgreater       = {100,200}
%<pmn>     \textless         = {100,   },   \textgreater       = {   ,100}
   }

%</m-t|cmr|pmn>
%    \end{macrocode}
% Settings for the <QX> encoding (generic and Times).\footnote{Contributed by
%                            \contributor Maciej Eder <maciej_eder\at poczta.onet.pl>.}
%\changes{v1.9d}{2006/04/20}{settings for <QX> encoding (contributed by
%                            \contributor Maciej Eder <maciej_eder\at poczta.onet.pl>)}
%                                                     ^^A private mail, 2006/04/19
% It also includes some glyphs otherwise in <TS1>.
%    \begin{macrocode}
%<*m-t|ptm>
\SetProtrusion
%<m-t>   [ name     = QX-default,
%<ptm>   [ name     = ptm-QX,
%<m-t>     load     = default ]
%<ptm>     load     = ptm-default ]
%<m-t>   { encoding = QX }
%<ptm>   { encoding = QX,
%<ptm>     family   = {ptm,ptmx,ptmj} }
   {
     \AE = {50,  },
%<ptm>      *  = {200,200},
     {=} = {100,100},
     \textunderscore   = {100,100},
     \textbackslash    = {100,200},
     \quotedblbase     = {400,400},
%<m-t>     \guillemotleft    = {200,200},   \guillemotright    = {200,200},
%<ptm>     \guillemotleft    = {300,300},   \guillemotright    = {200,400},
     \textexclamdown   = {100,   },   \textquestiondown  = {100,   },
%<m-t>     \textbraceleft    = {400,200},   \textbraceright    = {200,400},
%<ptm>     \textbraceleft    = {200,200},   \textbraceright    = {200,300},
     \textless         = {200,100},   \textgreater       = {100,200},
     \textminus        = {200,200},   \textdegree        = {300,300},
%<m-t>     \copyright        = {100,100},   \textregistered    = {100,100}
%<ptm>     \copyright        = {100,150},   \textregistered    = {100,150},
%<ptm>     \textxgeq         = {   ,100},   \textxleq          = {100,   },
%<ptm>     \textalpha        = {   , 50},   \textDelta         = { 70, 70},
%<ptm>     \textpi           = { 50, 80},   \textSigma         = {   , 70},
%<ptm>     \textmu           = {   , 80},   \texteuro          = { 50, 50},
%<ptm>     \textellipsis     = {150,200},   \textasciitilde    = { 80, 80},
%<ptm>     \textapprox       = { 50, 50},   \textinfty         = {100,100},
%<ptm>     \textdagger       = {150,150},   \textdaggerdbl     = {100,100},
%<ptm>     \textdiv          = { 50,150},   \textsection       = { 80, 80},
%<ptm>     \texttimes        = {100,150},   \textpm            = { 50, 80},
%<ptm>     \textbullet       = {150,150},   \textperiodcentered = {300,300},
%<ptm>     \textquotesingle  = {500,500},   \textquotedbl      = {300,300},
%<ptm>     \textperthousand  = {    ,50}
   }

%</m-t|ptm>
%    \end{macrocode}
% <T5> is based on <OT1>; it shares some but not all extra characters of <T1>.
% All accented characters are already taken care of by the inheritance list.
%    \begin{macrocode}
%<*cmr|bch>
\SetProtrusion
%<cmr>   [ name     = cmr-T5,
%<cmr>     load     = cmr-default ]
%<bch>   [ name     = bch-T5,
%<bch>     load     = bch-default ]
   { encoding = T5,
%<cmr>     family   = cmr }
%<bch>     family   = bch }
   {
%<bch>     _ = {100,100},
%<bch>     \textbackslash    = {150,200},
%<cmr>     \textbackslash    = {200,300},
%<cmr>     \textquotedblleft = {200,600},
%<cmr>     \textquotedbl     = {300,300},
%<bch>     \quotesinglbase   = {400,400},   \quotedblbase      = {300,300},
%<cmr>     \quotesinglbase   = {400,400},   \quotedblbase      = {400,400},
%<bch>     \guilsinglleft    = {400,300},   \guilsinglright    = {300,400},
%<cmr>     \guilsinglleft    = {400,400},   \guilsinglright    = {300,500},
%<bch>     \guillemotleft    = {200,200},   \guillemotright    = {150,300},
%<cmr>     \guillemotleft    = {300,200},   \guillemotright    = {100,400},
%<bch>     \textbraceleft    = {200,   },   \textbraceright    = {   ,300},
%<cmr>     \textbraceleft    = {400,200},   \textbraceright    = {200,400},
     \textless         = {200,100},   \textgreater       = {100,200}
   }

%</cmr|bch>
%    \end{macrocode}
% Minion with lining numbers.
%    \begin{macrocode}
%<*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}
   }

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

%</pmn>
%    \end{macrocode}
% Times is the default font for <LY1>, therefore we provide settings for the
% additional characters in this encoding, too.
%\changes{v1.8}{2005/04/26}{add <LY1> characters for Times}
%    \begin{macrocode}
%<*ptm>
 \SetProtrusion
   [ name     = ptm-LY1,
     load     = ptm-T1 ]
   { encoding = LY1,
     family   = {ptm,ptmx,ptmj} }
   {
     _                         = {100,100},
     \texttrademark            = {100,100},
     \textregistered           = {100,100},
     \textcopyright            = {100,100},
     \textdegree               = {300,300},
     \textminus                = {200,200},
     \textellipsis             = {150,200},
%    \texteuro                 = {   ,   }, % ?
     \textcent                 = {100,100},
     \textquotesingle          = {500,500},
     \textflorin               = { 50, 70},
     \textdagger               = {150,150},
     \textdaggerdbl            = {100,100},
     \textperthousand          = {   , 50},
     \textbullet               = {150,150},
     \textonesuperior          = {100,100},
     \texttwosuperior          = { 50, 50},
     \textthreesuperior        = { 50, 50},
     \textperiodcentered       = {300,300},
     \textplusminus            = { 50, 80},
     \textmultiply             = {100,100},
     \textdivide               = { 50,150}
%    \end{macrocode}
% Remaining slots in the source file.
%\iffalse
%    \textbrokenbar            = {   ,   },
%    \textyen                  = {   ,   },
%    \textfractionsolidus      = {   ,   },
%    \textordfeminine          = {   ,   },
%    \textordmasculine         = {   ,   },
%    \textmu                   = {   ,   },
%    \textparagraph            = {   ,   },
%    \textonequarter           = {   ,   },
%    \textonehalf              = {   ,   },
%    \textthreequarters        = {   ,   },
%\fi
%    \begin{macrocode}
   }

%</ptm>
%    \end{macrocode}
%
%\subsubsection{Italics}
%
%\changes{v1.4b}{2004/11/22}{slanted like italics}
%\changes{v1.6}{2004/12/26}{add italic uppercase Greek letters}
%
% 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. In the generic settings we therefore omit the letters,
% and only set up the punctuation characters.
%
% The italic glyphs of Computer Modern Roman feature a lot of side bearing,
% therefore almost all of them have to protrude.\footnote{Settings
%                            contributed by \contributor Hendrik Vogt <hendrik.vogt\at tu-dresden.de>.}
%\changes{v2.5}{2011/04/09}{improvements to Computer Modern Roman italics
%                           (contributed by \contributor Hendrik Vogt <hendrik.vogt\at tu-dresden.de>)}
%                           ^^A private mail, 2011/02/24
%                           ^^A (beta:07)
%
%    \begin{macrocode}
\SetProtrusion
%<m-t>   [ name     = OT1-it   ]
%<bch>   [ name     = bch-it   ]
%<blg>   [ name     = blg-it,
%<blg>     load     = blg-default ]
%<cmr>   [ name     = cmr-it   ]
%<pad>   [ name     = pad-it   ]
%<pmn>   [ name     = pmnj-it  ]
%<ppl>   [ name     = ppl-it   ]
%<ptm>   [ name     = ptm-it   ]
%<ugm>   [ name     = ugm-it   ]
%<m-t|bch|blg|pad|ugm>   { encoding = OT1,
%<ppl|ptm>   { encoding = {OT1,OT4},
%<bch>     family   = bch,
%<blg>     family   = blg,
%<pad>     family   = {pad,padx,padj},
%<ppl>     family   = {ppl,pplx,pplj},
%<ptm>     family   = {ptm,ptmx,ptmj},
%<ugm>     family   = ugm,
%<m-t|bch|pad|ppl|ptm>     shape    = {it,sl}  }
%<blg|ugm>     shape    = it  }
%<cmr|pmn>   { }
   {
%<cmr>     A = {100,100},
%<ptm>     A = {100,50},
%<pad|pmn>     A = {50,  },
%<ugm>     A = {  ,150},
%<ppl>     A = {50,50},
%<ptm>   \AE = {100,  },
%<pad|ppl>   \AE = {50,  },
%<cmr>     B = {83,-40},
%<pad|ppl|ptm>     B = {50,  },
%<pmn>     B = {20,-50},
%<bch|ppl|ptm|ugm>     C = {50,  },
%<cmr>     C = {165,-75},
%<pad>     C = {100, },
%<pmn>     C = {50,-50},
%<cmr>     D = {75, -28},
%<pad|ppl|ptm>     D = {50,50},
%<pmn>     D = {20,  },
%<cmr>     E = {80,-55},
%<pad|ppl|ptm>     E = {50,  },
%<pmn>     E = {20,-50},
%<cmr>     F = {85,-80},
%<pad|ptm>     F = {100, },
%<pmn>     F = {10,  },
%<ppl>     F = {50,  },
%<bch|ppl|ptm|ugm>     G = {50,  },
%<cmr>     G = {153,-15},
%<pad>     G = {100, },
%<pmn>     G = {50,-50},
%<cmr>     H = {73,-60},
%<pad|ppl|ptm>     H = {50,  },
%<cmr>     I = {140,-120},
%<pad|ptm>     I = {50,  },
%<pmn>     I = {20,-50},
%<cmr>     J = {135,-80},
%<pad>     J = {50,  },
%<pmn>     J = {20,  },
%<ptm>     J = {100, },
%<cmr>     K = {70,-30},
%<pad|ppl|ptm>     K = {50,  },
%<pmn>     K = {20,  },
%<cmr>     L = {87, 40},
%<pad|ppl|ptm>     L = {50,  },
%<pmn>     L = {20,50},
%<ugm>     L = {  ,100},
%<cmr>     M = {67,-45},
%<pmn>     M = {  ,-30},
%<ptm>     M = {50,  },
%<cmr>     N = {75,-55},
%<pmn>     N = {  ,-30},
%<ptm>     N = {50,  },
%<bch|pmn|ppl|ptm>     O = {50,  },
%<cmr>     O = {150,-30},
%<pad>     O = {100, },
%<ugm>     O = {70,50},
%<ppl|ptm>   \OE = {50,  },
%<pad>   \OE = {100, },
%<cmr>     P = {82,-50},
%<pad|ppl|ptm>     P = {50,  },
%<pmn>     P = {20,-50},
%<bch|pmn|ppl|ptm>     Q = {50,  },
%<cmr>     Q = {150,-30},
%<pad>     Q = {100, },
%<ugm>     Q = {70,50},
%<cmr>     R = {75, 15},
%<pad|ppl|ptm>     R = {50,  },
%<pmn>     R = {20,  },
%<bch|pad|ppl|ptm>     S = {50,  },
%<cmr>     S = {90,-65},
%<pmn>     S = {20,-30},
%<bch|pad|ppl|ptm>     $ = {50,  },
%<cmr>     $ = {100,-20},
%<pmn>     $ = {20,-30},
%<bch|pmn|ugm>     T = {70,  },
%<cmr>     T = {220,-85},
%<pad|ppl|ptm>     T = {100, },
%<cmr>     U = {230,-55},
%<pad|ppl|ptm>     U = {50,  },
%<pmn>     U = {50,-50},
%<cmr>     V = {260,-60},
%<pad|pmn|ugm>     V = {100, },
%<ppl|ptm>     V = {100,50},
%<cmr>     W = {185,-55},
%<pad|pmn|ugm>     W = {100, },
%<ppl>     W = {50,  },
%<ptm>     W = {100,50},
%<cmr>     X = {70,-30},
%<ppl|ptm>     X = {50,  },
%<cmr>     Y = {250,-60},
%<pmn>     Y = {50,  },
%<ppl>     Y = {100,50},
%<ptm>     Y = {100, },
%<cmr>     Z = {90,-60},
%<pmn>     Z = {  ,-50},
%<cmr>     a = {150,-10},
%<cmr>     b = {170,   },
%<cmr>     c = {173,-10},
%<cmr>     d = {150,-55},
%<pmn>     d = {  ,-50},
%<cmr>     e = {180, },
%<cmr>     f = {  ,-250},
%<pad|pmn>     f = { ,-100},
%<cmr>     g = {150,-10},
%<cmr>     h = {100, },
%<cmr>     i = {210, },
%<pmn>     i = {  ,-30},
%<cmr>     j = {  ,-40},
%<pmn>     j = {  ,-30},
%<cmr>     k = {110,-50},
%<cmr>     l = {240,-110},
%<pmn>     l = {  ,-100},
%<cmr>     m = {80, },
%<cmr>     n = {115, },
%<bch>     o = {50,50},
%<cmr>     o = {155, },
%<bch>     p = {  ,50},
%<pmn>     p = {-50,  },
%<bch>     q = {50,  },
%<cmr>     q = {170,-40},
%<cmr>     r = {155,-40},
%<pmn>     r = {  ,50},
%<cmr>     s = {130, },
%<bch>     t = {  ,50},
%<cmr>     t = {230,-10},
%<cmr>     u = {120, },
%<cmr>     v = {140,-25},
%<pmn|ugm>     v = {50,  },
%<bch>     w = {  ,50},
%<cmr>     w = {98,-20},
%<pmn|ugm>     w = {50,  },
%<cmr>     x = {65,-40},
%<bch>     y = {  ,50},
%<cmr>     y = {130,-20},
%<cmr>     z = {110,-80},
%<cmr>     0 = {170,-85},
%<bch|ptm>     1 = {150,100},
%<cmr>     1 = {230,110},
%<pad>     1 = {150, },
%<pmn>     1 = {50,  },
%<ppl>     1 = {100, },
%<ugm>     1 = {150,150},
%<cmr>     2 = {130,-70},
%<pad|ppl|ptm>     2 = {50,  },
%<pmn>     2 = {-50,  },
%<bch>     3 = {50,  },
%<cmr>     3 = {140,-70},
%<pmn>     3 = {-100, },
%<ptm>     3 = {100,50},
%<bch>     4 = {100, },
%<cmr>     4 = {130,80},
%<pad>     4 = {150, },
%<ppl|ptm>     4 = {50,  },
%<cmr>     5 = {160, },
%<ptm>     5 = {50,  },
%<bch>     6 = {50,  },
%<cmr>     6 = {175,-30},
%<bch|pad|ptm>     7 = {100, },
%<cmr>     7 = {250,-150},
%<pmn>     7 = {20,  },
%<ppl>     7 = {50,  },
%<cmr>     8 = {130,-40},
%<cmr>     9 = {155,-80},
%<m-t|cmr|pad|pmn|ppl>     . = { ,500},
%<blg>     . = {400,600},
%<bch|ptm|ugm>     . = { ,700},
%<blg>    {,}= {300,500},
%<m-t|pad|pmn|ppl>    {,}= { ,500},
%<cmr>    {,}= { ,450},
%<bch|ugm>    {,}= { ,600},
%<ptm>    {,}= { ,700},
%<m-t|cmr|pad|ppl>     : = { ,300},
%<bch|ugm>     : = { ,400},
%<pmn>     : = { ,200},
%<ptm>     : = { ,500},
%<m-t|cmr|pad|ppl>     ; = { ,300},
%<bch|ugm>     ; = { ,400},
%<pmn>     ; = { ,200},
%<ptm>     ; = { ,500},
%<ptm>     ! = { ,100},
%<bch>     ? = { ,200},
%<ptm>     ? = { ,100},
%<ppl>     ? = { ,300},
%<pmn>     " = {400,200},
%<m-t|pad|pmn|ppl|ptm>     & = {50,50},
%<bch>     & = {  ,80},
%<cmr>     & = {130,30},
%<ugm>     & = {50,100},
%<m-t|pad|pmn>    \% = {100, },
%<cmr>    \% = {180,50},
%<bch>    \% = {50,50},
%<ppl|ptm>    \% = {100,100},
%<ugm>    \% = {100,50},
%<m-t|pmn|ppl>     * = {200,200},
%<bch>     * = {300,200},
%<cmr>     * = {380,20},
%<pad>     * = {500,100},
%<ptm|ugm>     * = {400,200},
%<m-t|pmn|ppl>     + = {150,200},
%<cmr>     + = {180,200},
%<bch|ugm>     + = {250,250},
%<pad|ptm>     + = {250,200},
%<m-t|pad|pmn|ppl>     @ = {50,50},
%<bch>     @ = {80,50},
%<cmr>     @ = {180,10},
%<ptm>     @ = {150,150},
%<m-t|bch|ugm>     ~ = {150,150},
%<cmr|pad|pmn|ppl|ptm>     ~ = {200,150},
%<ugm>    {=}= {200,200},
%<m-t|bch|pad|pmn|ppl|ptm|ugm>     ( = {200, },    ) = {  ,200},
%<cmr>     ( = {300, },    ) = {  ,70},
%<m-t|pad|ppl|ptm|ugm>     / = {100,200},
%<cmr>     / = {100,100},
%<bch>     / = {  ,150},
%<pmn>     / = {100,150},
%<m-t>     - = {300,300},
%<bch|pad>     - = {300,400},
%<pmn>     - = {200,300},
%<cmr>     - = {500,300},
%<ppl>     - = {300,500},
%<ptm>     - = {500,500},
%<ugm>     - = {400,700},
%<blg>     _ = {0,300},
%<m-t|pmn>     \textendash       = {200,200},   \textemdash        = {150,150},
%<bch>     \textendash       = {200,300},   \textemdash        = {150,200},
%<cmr>     \textendash       = {500,300},   \textemdash        = {400,170},
%<pad|ppl|ptm|ugm>     \textendash       = {300,300},   \textemdash        = {200,200},
%<m-t|bch|pmn|ugm>     \textquoteleft    = {400,200},   \textquoteright    = {400,200},
%<blg>     \textquoteleft     = {400,400},    \textquoteright    = {400,400},
%<cmr>     \textquoteleft    = {800,200},   \textquoteright    = {800,-20},
%<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}
%<blg>     \textquotedblright = {300,300}
%<cmr>     \textquotedblleft = {540,100},   \textquotedblright = {500,100}
%<pad>     \textquotedblleft = {700,200},   \textquotedblright = {700,200}
%<ppl>     \textquotedblleft = {500,300},   \textquotedblright = {500,300}
%<ptm>     \textquotedblleft = {700,400},   \textquotedblright = {700,400}
%<ugm>     \textquotedblleft = {600,200},   \textquotedblright = {600,200}
   }

%<*cmr|pmn>
\SetProtrusion
%<cmr>   [ name     = cmr-it-OT1,
%<pmn>   [ name     = pmnj-it-OT1,
%<cmr>     load     = cmr-it   ]
%<pmn>     load     = pmnj-it  ]
%<cmr>   { encoding = {OT1,OT4},
%<pmn>   { encoding = OT1,
%<cmr>     family   = cmr,
%<pmn>     family   = pmnj,
%<cmr>     shape    = it       }
%<pmn>     shape    = {it,sl}  }
   {
%<cmr>     \AE = {100,   },
%<pmn>     \AE = {  ,-50},
%<cmr>     \OE = {100,   },
%<pmn>     \OE = {50,   }
%<*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>
   }

%</cmr|pmn>
\SetProtrusion
%<m-t>   [ name     = T1-it-default,
%<bch>   [ name     = bch-it-T1,
%<blg>   [ name     = blg-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,
%<ugm>   [ name     = ugm-it-T1,
%<m-t>     load     = OT1-it   ]
%<bch>     load     = bch-it   ]
%<blg>     load     = blg-T1   ]
%<cmr>     load     = cmr-it   ]
%<pmn>     load     = pmnj-it  ]
%<pad>     load     = pad-it   ]
%<ppl>     load     = ppl-it   ]
%<ptm>     load     = ptm-it   ]
%<ugm>     load     = ugm-it   ]
%<m-t|bch|cmr|pad|pmn|ppl>   { encoding = {T1,LY1},
%<blg|ptm|ugm>   { encoding = T1,
%<bch>     family   = bch,
%<blg>     family   = blg,
%<cmr>     family   = cmr,
%<pmn>     family   = pmnj,
%<pad>     family   = {pad,padx,padj},
%<ppl>     family   = {ppl,pplx,pplj},
%<ptm>     family   = {ptm,ptmx,ptmj},
%<ugm>     family   = ugm,
%<m-t|bch|pad|pmn|ppl|ptm>     shape    = {it,sl}  }
%<blg|cmr|ugm>     shape    = it       }
   {
%<m-t|bch|pmn>     _ = {  ,100},
%<blg>     _ = {0,300},
%<cmr|ugm>     _ = {100,200},
%<pad|ppl|ptm>     _ = {100,100},
%<blg>     . = {400,600},
%<blg>    {,}= {300,500},
%<cmr>     \AE = {100,   },
%<pmn>     \AE = {  ,-50},
%<bch|pmn>     \OE = { 50,   },
%<cmr>     \OE = {100,   },
%<pmn>     031 = { ,-100}, % ffl
%<cmr|ptm>     156 = {100, },  % IJ
%<pad>     156 = {50,  },  % IJ
%<pmn>     156 = {20,  },  % IJ
%<pmn>     188 = {  ,-30}, % ij
%<pmn>   \v t = { ,100},
%<m-t|pad|ppl|ptm>     \textbackslash    = {100,200},
%<cmr|ugm>     \textbackslash    = {300,300},
%<bch>     \textbackslash    = {150,150},
%<pmn>     \textbackslash    = {100,150},
%<ugm>     \textbar          = {200,200},
%<cmr>     \textquotedblleft = {500,300},
%<blg>    \textquoteleft     = {400,400},    \textquoteright    = {400,400},
%<blg>    \textquotedbl      = {300,300},    \textquotedblleft  = {300,300},
%<blg>    \textquotedblright = {300,300},    \quotedblbase      = {200,600},
%<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},
%<ugm>     \quotesinglbase   = {300,700},   \quotedblbase      = {300,500},
%<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},
%<ugm>     \guilsinglleft    = {400,400},   \guilsinglright    = {300,600},
%<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},
%<ugm>     \guillemotleft    = {300,400},   \guillemotright    = {300,400},
%<m-t|pad|ppl|ugm>     \textexclamdown   = {100,   },   \textquestiondown  = {200,   },
%<cmr|ptm>     \textexclamdown   = {200,   },   \textquestiondown  = {200,   },
%<pmn>     \textexclamdown   = {-50,   },   \textquestiondown  = {-50,   },
%<m-t|ppl|ugm>     \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}
  }

%<*m-t|cmr|pmn>
\SetProtrusion
%<m-t>   [ name     = T2A-it-default,
%<cmr>   [ name     = cmr-it-T2A,
%<pmn>   [ name     = pmnj-it-T2A,
%<m-t>     load     = OT1-it   ]
%<cmr>     load     = cmr-it   ]
%<pmn>     load     = pmnj-it  ]
   { encoding = T2A,
%<cmr>     family   = cmr,
%<pmn>     family   = pmnj,
%<m-t|pmn>     shape    = {it,sl}  }
%<cmr>     shape    = it       }
   {
%<cmr>     \CYRA = {100,50},
%<pmn>     \CYRA = {50,  },
%<cmr>     \CYRB = {50,  },
%<cmr>     \CYRV = {50,  },
%<pmn>     \CYRV = {20,-50},
%<cmr>     \CYRG = {100, },
%<pmn>     \CYRG = {10,  },
%<cmr>     \CYRD = {50,  },
%<cmr>     \CYRE = {50,  },
%<pmn>     \CYRE = {20,-50},
%<cmr>     \CYRZH = {50,  },
%<cmr>     \CYRZ = {50,  },
%<pmn>     \CYRZ = {20,-50},
%<cmr>     \CYRI = {50,  },
%<pmn>     \CYRI = {  ,-30},
%<cmr>     \CYRISHRT = {50,  },
%<cmr>     \CYRK = {50,  },
%<pmn>     \CYRK = {20,  },
%<cmr>     \CYRL = {50,  },
%<cmr>     \CYRM = {50,  },
%<pmn>     \CYRM = {  ,-30},
%<cmr>     \CYRN = {50,  },
%<cmr>     \CYRO = {100, },
%<pmn>     \CYRO = {50,  },
%<cmr>     \CYRP = {50,  },
%<cmr>     \CYRR = {50,  },
%<pmn>     \CYRR = {20,-50},
%<cmr>     \CYRS = {100, },
%<pmn>     \CYRS = {50,  },
%<cmr>     \CYRT = {100, },
%<pmn>     \CYRT = {70,  },
%<cmr>     \CYRU = {100, },
%<pmn>     \CYRU = {50,  },
%<cmr>     \CYRF = {100, },
%<cmr>     \CYRH = {50,  },
%<cmr>     \CYRC = {50,  },
%<cmr>     \CYRCH = {100, },
%<cmr>     \CYRSH = {50,  },
%<cmr>     \CYRSHCH = {50,  },
%<cmr>     \CYRHRDSN = {100, },
%<cmr>     \CYRERY = {50,  },
%<cmr>     \CYRSFTSN = {50,  },
%<cmr>     \CYREREV = {50,  },
%<cmr>     \CYRYU = {50,  },
%<cmr>     \CYRYA = {50,  },
%<pmn>     \CYRYA = {  ,20},
%<pmn>     \cyrr = {-50,  },
%<m-t|pmn>      _ = {  ,100},
%<cmr>      _ = {100,200},
%<pmn>      031 = { ,-100}, % ffl
%<pmn>     \v t = { ,100},
%<m-t>     \textbackslash    = {100,200},   \quotedblbase      = {400,500},
%<cmr>     \textbackslash    = {300,300},   \quotedblbase      = {200,600},
%<pmn>     \textbackslash    = {100,150},   \quotedblbase      = {150,500},
%<m-t>     \guillemotleft    = {300,300},   \guillemotright    = {300,300},
%<cmr>     \guillemotleft    = {400,100},   \guillemotright    = {200,300},
%<pmn>     \guillemotleft    = {200,300},   \guillemotright    = {150,400},
%<m-t>     \textbraceleft    = {200,100},   \textbraceright    = {200,200},
%<cmr>     \textbraceleft    = {400,100},   \textbraceright    = {200,200},
%<pmn>     \textbraceleft    = {200,   },   \textbraceright    = {   ,200},
%<cmr>     \textquotedblleft = {500,300},
%<cmr>     \textless         = {300,100},   \textgreater       = {200,100}
%<pmn>     \textless         = {100,   },   \textgreater       = {   ,100}
  }

%</m-t|cmr|pmn>
%<*m-t|ptm>
\SetProtrusion
%<m-t>   [ name     = QX-it-default,
%<ptm>   [ name     = ptm-it-QX,
%<m-t>     load     = OT1-it ]
%<ptm>     load     = ptm-it ]
   { encoding = {QX},
%<ptm>     family   = {ptm,ptmx,ptmj},
     shape    = {it,sl}  }
   {
%<ptm>     009 = {  , 50}, % fk
     {=} = {100,100},
%<m-t>     \textunderscore   = {100,100},
%<ptm>     \textunderscore   = {100,150},
     \textbackslash    = {100,200},
     \quotedblbase     = {300,400},
%<m-t>     \guillemotleft    = {300,300},   \guillemotright    = {300,300},
%<ptm>     \guillemotleft    = {200,400},   \guillemotright    = {200,400},
     \textexclamdown   = {200,   },   \textquestiondown  = {200,   },
     \textbraceleft    = {200,100},   \textbraceright    = {200,200},
     \textless         = {100,100},   \textgreater       = {100,100},
     \textminus        = {200,200},   \textdegree        = {300,150},
%<m-t>     \copyright        = {100,100},   \textregistered    = {100,100}
%<ptm>     \textregistered   = {100,150},   \copyright         = {100,150},
%<ptm>     \textDelta        = { 70,   },   \textdelta         = {   , 50},
%<ptm>     \textpi           = { 50, 80},   \textmu            = {   , 80},
%<ptm>     \texteuro         = {200,   },   \textellipsis      = {100,200},
%<ptm>     \textquoteleft    = {500,400},   \textquoteright    = {500,400},
%<ptm>     \textquotedblleft = {500,300},   \textquotedblright = {400,400},
%<ptm>     \textapprox       = { 50, 50},   \textinfty         = {100,100},
%<ptm>     \textdagger       = {150,150},   \textdaggerdbl     = {100,100},
%<ptm>     \textdiv          = {150,150},   \textasciitilde    = { 80, 80},
%<ptm>     \texttimes        = {100,150},   \textpm            = { 50, 80},
%<ptm>     \textbullet       = {300,100},   \textperiodcentered = {300,300},
%<ptm>     \textquotesingle  = {500,500},   \textquotedbl      = {300,300},
%<ptm>     \textperthousand  = {    ,50}
   }

%</m-t|ptm>
%<*cmr|bch>
\SetProtrusion
%<cmr>   [ name = cmr-it-T5,
%<cmr>     load = cmr-it ]
%<bch>   [ name = bch-it-T5,
%<bch>     load = bch-it ]
   { encoding = T5,
%<bch>     family   = bch,
%<cmr>     family   = cmr,
     shape    = it }
   {
%<bch>      _ = {  ,100},
%<cmr>      _ = {100,200},
%<bch>     \textbackslash    = {150,150},
%<cmr>     \textbackslash    = {300,300},
%<bch>     \quotesinglbase   = {200,500},   \quotedblbase      = {150,500},
%<cmr>     \quotesinglbase   = {300,700},   \quotedblbase      = {200,600},
%<bch>     \guilsinglleft    = {300,400},   \guilsinglright    = {200,500},
%<cmr>     \guilsinglleft    = {500,300},   \guilsinglright    = {400,400},
%<bch>     \guillemotleft    = {200,300},   \guillemotright    = {150,400},
%<cmr>     \guillemotleft    = {400,100},   \guillemotright    = {200,300},
%<bch>     \textbraceleft    = {200,   },   \textbraceright    = {   ,200},
%<cmr>     \textbraceleft    = {400,100},   \textbraceright    = {200,200},
%<bch>     \textless         = {100,   },   \textgreater       = {   ,100}
%<cmr>     \textless         = {300,100},   \textgreater       = {200,100}
  }

%</cmr|bch>
%    \end{macrocode}
%\changes{v1.8}{2005/06/01}{verified settings for slanted Computer Modern Roman}
% Slanted is very similar to italic.
%    \begin{macrocode}
%<*cmr>
\SetProtrusion
   [ name     = cmr-sl,
     load     = cmr-it-OT1 ]
   { encoding = {OT1,OT4},
     family   = cmr,
     shape    = sl  }
   {
      L = {  ,50},
      f = { ,-50},
      - = {300, },
     \textendash = {400,  },  \textemdash = {300,  }
   }

\SetProtrusion
   [ name     = cmr-sl-T1,
     load     = cmr-it-T1 ]
   { encoding = {T1,LY1},
     family   = cmr,
     shape    = sl  }
   {
      L = {  ,50},
      f = { ,-50},
      - = {300, },
     \textendash = {400,  },  \textemdash = {300,  }
   }

\SetProtrusion
   [ name     = cmr-sl-T2A,
     load     = cmr-it-T2A ]
   { encoding = T2A,
     family   = cmr,
     shape    = sl  }
   {
      L = {  ,50},
      f = { ,-50},
      - = {300, },
     \textendash = {400,  },  \textemdash = {300,  }
   }

\SetProtrusion
   [ name     = cmr-sl-T5,
     load     = cmr-it-T5 ]
   { encoding = T5,
     family   = cmr,
     shape    = sl  }
   {
      L = {  ,50},
      f = { ,-50},
      - = {300, },
     \textendash = {400,  },  \textemdash = {300,  }
   }

\SetProtrusion
   [ name     = lmr-it-T1,
     load     = cmr-it-T1 ]
   { encoding = {T1,LY1},
     family   = lmr,
     shape    = {it,sl} }
   {
     \textquotedblleft  = { ,200},  \textquotedblright = { ,200},
     \quotesinglbase    = { ,400},  \quotedblbase      = { ,500}
   }

%    \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}
   }

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

%</pmn>
%<*ptm>
\SetProtrusion
   [ name     = ptm-it-LY1,
     load     = ptm-it-T1   ]
   { encoding = {LY1},
     family   = {ptm,ptmx,ptmj},
     shape    = {it,sl}  }
   {
     _                         = {100,100},
     \texttrademark            = {100,100},
     \textregistered           = {100,100},
     \textcopyright            = {100,100},
     \textdegree               = {300,100},
     \textminus                = {200,200},
     \textellipsis             = {100,200},
%    \texteuro                 = {   ,   }, % ?
     \textcent                 = {100,100},
     \textquotesingle          = {500,   },
     \textflorin               = {100, 70},
     \textdagger               = {150,150},
     \textdaggerdbl            = {100,100},
     \textbullet               = {150,150},
     \textonesuperior          = {150,100},
     \texttwosuperior          = {150, 50},
     \textthreesuperior        = {150, 50},
     \textparagraph            = {100,   },
     \textperiodcentered       = {500,300},
     \textonequarter           = { 50,   },
     \textonehalf              = { 50,   },
     \textplusminus            = {100,100},
     \textmultiply             = {150,150},
     \textdivide               = {150,150}
   }

%</ptm>
%    \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 (but
% we have to reset some characters).
%    \begin{macrocode}
%<*!(blg|ugm)>
\SetProtrusion
%<m-t>   [ name     = OT1-sc,
%<bch>   [ name     = bch-sc,
%<cmr>   [ name     = cmr-sc-OT1,
%<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-OT1 ]
%<pad>     load     = pad-default ]
%<pmn>     load     = pmnj-default ]
%<ppl>     load     = ppl-default ]
%<ptm>     load     = ptm-default ]
%<m-t|bch|pad|pmn>   { encoding = OT1,
%<cmr|ppl|ptm>   { encoding = {OT1,OT4},
%<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 = {  ,50}, % fl
%<ptm>   013 = {  ,80}, % fl
%<bch|pad|pmn>     o = {50,50},
%<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}
   }

%</!(blg|ugm)>
%<*m-t|cmr>
\SetProtrusion
%<m-t>   [ name     = T2A-sc,
%<cmr>   [ name     = cmr-sc-T2A,
%<m-t>     load     = T2A-default ]
%<cmr>     load     = cmr-T2A     ]
   { encoding = T2A,
%<cmr>     family   = cmr,
     shape    = sc }
   {
     \cyra = {50,50},
     \cyrg = {  ,50},
     \cyrt = {50,50},
     \cyry = {  ,50}
   }

%</m-t|cmr>
%<*m-t>
\SetProtrusion
   [ name     = QX-sc,
     load     = QX-default ]
   { encoding = QX,
     shape    = sc  }
   {
     a = {50,50},
     f = {  ,50},
     j = {50,  },
     l = {  ,50},
   013 = {  ,50}, % fl
     r = {  , 0},
     t = {50,50},
     y = {50,50}
   }

%</m-t>
%<*cmr|bch>
\SetProtrusion
%<bch>   [ name     = bch-sc-T5,
%<bch>     load     = bch-T5 ]
%<cmr>   [ name     = cmr-sc-T5,
%<cmr>     load     = cmr-T5 ]
   { encoding = T5,
%<bch>     family   = bch,
%<cmr>     family   = cmr,
     shape    = sc }
   {
     a = {50,50},
%<bch>     c = {50,  },
%<bch>     d = {  ,50},
     f = {  ,50},
%<bch>     g = {50,  },
%<bch>     j = {100, },
%<cmr>     j = {50,  },
     l = {  ,50},
%<bch>     o = {50,50},
%<bch>     q = { 0,  },
%<cmr>     r = {  , 0},
     t = {50,50},
     y = {50,50}
   }

%</cmr|bch>
%<*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}
%
%\subsubsection{Italic small caps}
% Minion provides real small caps in italics.
% The \pkg{slantsc} package calls them |scit|, Philipp Lehman's
% \pkg{fontinstallationguide} suggests |si|.
%    \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{Text companion}
%
% Finally the <TS1> encoding.
% Still quite incomplete for Times and especially Palatino. Anybody?
%\changes{v1.2}{2004/09/28}{add settings for Computer Modern Roman and
%                           Adobe Garamond in <TS1> encoding}
%    \begin{macrocode}
\SetProtrusion
%<m-t>   [ name     = textcomp ]
%<bch>   [ name     = bch-textcomp ]
%<blg>   [ name     = blg-textcomp ]
%<cmr>   [ name     = cmr-textcomp ]
%<pad>   [ name     = pad-textcomp ]
%<pmn>   [ name     = pmn-textcomp ]
%<ppl>   [ name     = ppl-textcomp ]
%<ptm>   [ name     = ptm-textcomp ]
%<ugm>   [ name     = ugm-textcomp ]
%<m-t>   { encoding = TS1      }
%<!m-t>   { encoding = TS1,
%<bch>     family   = bch }
%<blg>     family   = blg }
%<cmr>     family   = cmr }
%<pad>     family   = {pad,padx,padj} }
%<pmn>     family   = {pmnx,pmnj} }
%<ppl>     family   = {ppl,pplx,pplj} }
%<ptm>     family   = {ptm,ptmx,ptmj} }
%<ugm>     family   = ugm }
   {
%<blg>     \textquotestraightbase    = {400,500},
%<cmr>     \textquotestraightbase    = {300,300},
%<pad|pmn>     \textquotestraightbase    = {400,400},
%<blg>     \textquotestraightdblbase = {300,400},
%<cmr|pmn>     \textquotestraightdblbase = {300,300},
%<pad>     \textquotestraightdblbase = {400,400},
%<bch|cmr|pad|pmn|ugm>     \texttwelveudash          = {200,200},
%<bch|cmr|pad|pmn>     \textthreequartersemdash  = {150,150},
%<ugm>     \textthreequartersemdash  = {200,200},
%<blg>     \textquotesingle          = {500,600},
%<cmr|pmn>     \textquotesingle          = {300,400},
%<pad>     \textquotesingle          = {400,500},
%<ptm>     \textquotesingle          = {500,500},
%<ugm>     \textquotesingle          = {300,500},
%<bch|cmr|pmn>     \textasteriskcentered     = {200,300},
%<blg>     \textasteriskcentered     = {150,200},
%<pad>     \textasteriskcentered     = {300,300},
%<ugm>     \textasteriskcentered     = {100,200},
%<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},
%<blg|ugm>     \textminus                = {250,300},
%<bch|pad|pmn>     \textlbrackdbl            = {100,   },
%<blg>     \textlbrackdbl            = {200,   },
%<bch|pad|pmn>     \textrbrackdbl            = {   ,100},
%<blg>     \textrbrackdbl            = {   ,200},
%<pmn>     \textasciigrave           = {200,500},
%<bch|blg|cmr|pad|pmn>     \texttildelow             = {200,250},
%<pmn>     \textasciibreve           = {300,400},
%<pmn>     \textasciicaron           = {300,400},
%<pmn>     \textacutedbl             = {200,300},
%<pmn>     \textgravedbl             = {150,300},
%<bch|pmn|ugm>     \textdagger               = { 80, 80},
%<blg>     \textdagger               = {200,200},
%<cmr|pad>     \textdagger               = {100,100},
%<ptm>     \textdagger               = {150,150},
%<blg>     \textdaggerdbl            = {150,150},
%<cmr|pad|pmn>     \textdaggerdbl            = { 80, 80},
%<ptm>     \textdaggerdbl            = {100,100},
%<bch>     \textbardbl               = {100,100},
%<blg|ugm>     \textbardbl               = {150,150},
%<bch>     \textbullet               = {200,200},
%<blg>     \textbullet               = {400,500},
%<cmr|pad|pmn>     \textbullet               = {   ,100},
%<ptm>     \textbullet               = {150,150},
%<ugm>     \textbullet               = { 50,100},
%<bch|cmr|pmn>     \textcelsius              = { 50,   },
%<pad>     \textcelsius              = { 80,   },
%<bch>     \textflorin               = { 50, 50},
%<blg>     \textflorin               = {100,100},
%<pad|ugm>     \textflorin               = {   ,100},
%<pmn>     \textflorin               = { 50,100},
%<ptm>     \textflorin               = { 50, 70},
%<cmr>     \textcolonmonetary        = {   , 50},
%<pad|pmn>     \textcolonmonetary        = { 50,   },
%<pmn>     \textinterrobang          = {   ,100},
%<pmn>     \textinterrobangdown      = {100,   },
%<m-t|pad|ptm>     \texttrademark            = {100,100},
%<bch>     \texttrademark            = {150,150},
%<blg|cmr|ppl>     \texttrademark            = {200,200},
%<pmn>     \texttrademark            = { 50, 50},
%<ugm>     \texttrademark            = {100,150},
%<bch|ugm>     \textcent                 = { 50,   },
%<ptm>     \textcent                 = {100,100},
%<bch>     \textsterling             = { 50,   },
%<ugm>     \textsterling             = {   , 50},
%<bch>     \textbrokenbar            = {200,200},
%<blg>     \textbrokenbar            = {250,250},
%<ugm>     \textbrokenbar            = {200,300},
%<pmn>     \textasciidieresis        = {300,400},
%<m-t|bch|cmr|pad|ptm|ugm>     \textcopyright            = {100,100},
%<pmn>     \textcopyright            = {100,150},
%<ppl>     \textcopyright            = {200,200},
%<bch|cmr|ugm>     \textordfeminine          = {100,200},
%<pad|pmn>     \textordfeminine          = {200,200},
%<bch|cmr|pad|pmn|ugm>     \textlnot                 = {200,   },
%<blg>     \textlnot                 = {200,100},
%<m-t|bch|cmr|pad|ptm|ugm>     \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},
%<blg|ugm>     \textdegree               = {200,200},
%<cmr|pad>     \textdegree               = {400,400},
%<pmn>     \textdegree               = {150,400},
%<bch|cmr|pad|pmn|ugm>     \textpm                   = {150,200},
%<blg>     \textpm                   = {100,100},
%<ptm>     \textpm                   = { 50, 80},
%<bch|blg|ugm>     \texttwosuperior          = {100,200},
%<cmr>     \texttwosuperior          = { 50,100},
%<pad|pmn>     \texttwosuperior          = {200,200},
%<ptm>     \texttwosuperior          = { 50, 50},
%<bch|blg|ugm>     \textthreesuperior        = {100,200},
%<cmr>     \textthreesuperior        = { 50,100},
%<pad|pmn>     \textthreesuperior        = {200,200},
%<ptm>     \textthreesuperior        = { 50, 50},
%<pmn>     \textasciiacute           = {300,400},
%<bch|ugm>     \textmu                   = {   ,100},
%<bch|pad|pmn>     \textparagraph            = {   ,100},
%<bch|cmr|pad|pmn>     \textperiodcentered       = {300,400},
%<blg>     \textperiodcentered       = {400,500},
%<ptm>     \textperiodcentered       = {300,300},
%<ugm>     \textperiodcentered       = {200,500},
%<bch|blg|ugm>     \textonesuperior          = {200,300},
%<cmr|pad|pmn>     \textonesuperior          = {200,200},
%<ptm>     \textonesuperior          = {100,100},
%<bch|pad|pmn|ugm>     \textordmasculine         = {200,200},
%<blg|cmr>     \textordmasculine         = {100,200},
%<bch|cmr|pmn>     \texteuro                 = {100,   },
%<pad>     \texteuro                 = { 50,100},
%<bch>     \texttimes                = {200,200},
%<blg|ptm>     \texttimes                = {100,100},
%<cmr>     \texttimes                = {150,250},
%<pad>     \texttimes                = {100,150},
%<pmn>     \texttimes                = { 70,100},
%<ugm>     \texttimes                = {200,300},
%<bch|pad|pmn>     \textdiv                  = {150,200}
%<blg>     \textdiv                  = {100,100}
%<cmr>     \textdiv                  = {150,250}
%<ptm>     \textdiv                  = { 50,100},
%<ugm>     \textdiv                  = {200,300},
%<ptm>     \textperthousand          = {    ,50}
%<ugm>     \textsection              = {   ,100},
%<ugm>     \textonehalf              = { 50,100},
%<ugm>     \textonequarter           = { 50,100},
%<ugm>     \textthreequarters        = { 50,100},
%<ugm>     \textsurd                 = {   ,100}
%    \end{macrocode}
% Remaining slots in the source file.
%\iffalse
%    \textyen                     = {  ,  },
%    \texttwooldstyle             = {  ,  },
%    \textfiveoldstyle            = {  ,  },
%    \textsixoldstyle             = {  ,  },
%    \texteightoldstyle           = {  ,  },
%    \textnineoldstyle            = {  ,  },
%    \textleftarrow               = {  ,  },
%    \textrightarrow              = {  ,  },
%    \textblank                   = {  ,  },
%    \textdollar                  = {  ,  },
%    \textdblhyphen               = {  ,  },
%    \textdblhyphenchar           = {  ,  },
%    \textohm                     = {  ,  },
%    \textmho                     = {  ,  },
%    \textbigcircle               = {  ,  },
%    \textuparrow                 = {  ,  },
%    \textdownarrow               = {  ,  },
%    \textborn                    = {  ,  },
%    \textdied                    = {  ,  },
%    \textmarried                 = {  ,  },
%    \textdivorced                = {  ,  },
%    \textleaf                    = {  ,  },
%    \textmusicalnote             = {  ,  },
%    \textdollaroldstyle          = {  ,  },
%    \textcentoldstyle            = {  ,  },
%    \textwon                     = {  ,  },
%    \textnaira                   = {  ,  },
%    \textguarani                 = {  ,  },
%    \textpeso                    = {  ,  },
%    \textlira                    = {  ,  },
%    \textrecipe                  = {  ,  },
%    \textdong                    = {  ,  },
%    \textpertenthousand          = {  ,  },
%    \textpilcrow                 = {  ,  },
%    \textbaht                    = {  ,  },
%    \textnumero                  = {  ,  },
%    \textdiscount                = {  ,  },
%    \textestimated               = {  ,  },
%    \textopenbullet              = {  ,  },
%    \textservicemark             = {  ,  },
%    \textlquill                  = {  ,  },
%    \textrquill                  = {  ,  },
%    \textcopyleft                = {  ,  },
%    \textcircledP                = {  ,  },
%    \textreferencemark           = {  ,  },
%\fi
%    \begin{macrocode}
   }

%<*cmr|pad|pmn|ugm>
\SetProtrusion
%<cmr>   [ name     = cmr-textcomp-it ]
%<pad>   [ name     = pad-textcomp-it ]
%<pmn>   [ name     = pmn-textcomp-it ]
%<ugm>   [ name     = ugm-textcomp-it ]
   { encoding = TS1,
%<cmr>     family   = cmr,
%<pad>     family   = {pad,padx,padj},
%<pmn>     family   = {pmnx,pmnj},
%<ugm>     family   = ugm,
%<!ugm>     shape    = {it,sl} }
%<ugm>     shape    = it }
   {
%<cmr>     \textquotestraightbase    = {300,600},
%<pad|pmn>     \textquotestraightbase    = {400,400},
%<cmr>     \textquotestraightdblbase = {300,600},
%<pad>     \textquotestraightdblbase = {300,400},
%<pmn>     \textquotestraightdblbase = {300,300},
     \texttwelveudash          = {200,200},
%<cmr|pad|pmn>     \textthreequartersemdash  = {150,150},
%<ugm>     \textthreequartersemdash  = {200,200},
%<cmr>     \textquotesingle          = {600,300},
%<pad>     \textquotesingle          = {800,100},
%<pmn>     \textquotesingle          = {300,200},
%<ugm>     \textquotesingle          = {500,500},
%<cmr>     \textasteriskcentered     = {300,200},
%<pad>     \textasteriskcentered     = {500,100},
%<pmn>     \textasteriskcentered     = {200,300},
%<ugm>     \textasteriskcentered     = {300,150},
%<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},
%<ugm>     \textminus                = {250,300},
%<pad|pmn>     \textlbrackdbl            = {100,   },
%<pad|pmn>     \textrbrackdbl            = {   ,100},
%<pmn>     \textasciigrave           = {300,300},
%<cmr|pad|pmn>     \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},
%<ugm>     \textdagger               = { 80, 80},
%<cmr|pad>     \textdaggerdbl            = { 80, 80},
%<pmn>     \textdaggerdbl            = { 80, 50},
%<ugm>     \textbardbl               = {150,150},
%<cmr>     \textbullet               = {200,100},
%<pad>     \textbullet               = {300,   },
%<pmn>     \textbullet               = { 30, 70},
%<ugm>     \textbullet               = { 50,100},
%<cmr>     \textcelsius              = {100,   },
%<pad>     \textcelsius              = {200,   },
%<pmn>     \textcelsius              = { 50,-50},
%<pad>     \textflorin               = {100,   },
%<pmn>     \textflorin               = { 50,100},
%<ugm>     \textflorin               = {   ,100},
%<cmr>     \textcolonmonetary        = {150,   },
%<pad>     \textcolonmonetary        = {100,   },
%<pmn>     \textcolonmonetary        = { 50,-50},
%<cmr|pad>     \texttrademark            = {200,   },
%<pmn>     \texttrademark            = { 50,100},
%<ugm>     \texttrademark            = {150, 50},
%<ugm>     \textcent                 = { 50,   },
%<ugm>     \textsterling             = {   , 50},
%<ugm>     \textbrokenbar            = {200,300},
%<pmn>     \textasciidieresis        = {300,200},
%<cmr>     \textcopyright            = {100,   },
%<pad>     \textcopyright            = {200,100},
%<pmn>     \textcopyright            = {100,150},
%<ugm>     \textcopyright            = {300,   },
%<cmr>     \textordfeminine          = {100,100},
%<pmn>     \textordfeminine          = {200,200},
%<ugm>     \textordfeminine          = {100,200},
%<cmr|pad>     \textlnot                 = {300,   },
%<pmn|ugm>     \textlnot                 = {200,   },
%<cmr>     \textregistered           = {100,   },
%<pad>     \textregistered           = {200,100},
%<pmn>     \textregistered           = { 50,150},
%<ugm>     \textregistered           = {300,   },
%<pmn>     \textasciimacron          = {150,200},
%<cmr|pad>     \textdegree               = {500,100},
%<pmn>     \textdegree               = {150,150},
%<ugm>     \textdegree               = {300,200},
%<cmr>     \textpm                   = {150,100},
%<pad>     \textpm                   = {200,150},
%<pmn|ugm>     \textpm                   = {150,200},
%<cmr>     \textonesuperior          = {400,   },
%<pad>     \textonesuperior          = {300,100},
%<pmn>     \textonesuperior          = {200,100},
%<ugm>     \textonesuperior          = {300,300},
%<cmr>     \texttwosuperior          = {400,   },
%<pad>     \texttwosuperior          = {300,   },
%<pmn>     \texttwosuperior          = {200,100},
%<ugm>     \texttwosuperior          = {300,200},
%<cmr>     \textthreesuperior        = {400,   },
%<pad>     \textthreesuperior        = {300,   },
%<pmn>     \textthreesuperior        = {200,100},
%<ugm>     \textthreesuperior        = {300,200},
%<ugm>     \textmu                   = {   ,100},
%<pmn>     \textasciiacute           = {300,200},
%<cmr>     \textparagraph            = {200,   },
%<pmn>     \textparagraph            = {   ,100},
%<cmr>     \textperiodcentered       = {500,500},
%<pad|pmn|ugm>     \textperiodcentered       = {300,400},
%<cmr>     \textordmasculine         = {100,100},
%<pmn>     \textordmasculine         = {200,200},
%<ugm>     \textordmasculine         = {300,200},
%<cmr>     \texteuro                 = {200,   },
%<pad>     \texteuro                 = {100,   },
%<pmn>     \texteuro                 = {100,-50},
%<cmr>     \texttimes                = {200,200},
%<pad>     \texttimes                = {200,100},
%<pmn>     \texttimes                = { 70,100},
%<ugm>     \texttimes                = {200,300},
%<cmr|pad>     \textdiv                  = {200,200}
%<pmn>     \textdiv                  = {150,200}
%<ugm>     \textdiv                  = {200,300},
%<ugm>     \textsection              = {   ,200},
%<ugm>     \textonehalf              = { 50,100},
%<ugm>     \textonequarter           = { 50,100},
%<ugm>     \textthreequarters        = { 50,100},
%<ugm>     \textsurd                 = {   ,100}
   }

%</cmr|pad|pmn|ugm>
%    \end{macrocode}
%
%\subsubsection{Computer Modern math}
%
% Now to the math symbols for Computer Modern Roman. Definitions have been
% extracted from \file{fontmath.ltx}.
%\changes{v1.2}{2004/10/02}{add settings 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|' (also used for the \cmd\mathrm\ and
% \cmd\mathbf\ alphabets) is |OT1/cmr|, 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}
%\end{verbatim}
%
% \cmd\mathit\ (|OT1/cmr/m/it|) is also already set up.
%
% There are (for the moment) no settings for \cmd\mathsf\ and \cmd\mathtt.
%
% Math font `|letters|' (also used as \cmd\mathnormal) is declared as:
%\begin{verbatim}
%\DeclareSymbolFont{letters}    {OML}{cmm}{m}{it}
%\SetSymbolFont{letters}  {bold}{OML}{cmm}{b}{it}
%\end{verbatim}
%\changes{v1.6}{2004/12/26}{tune <CMR> math letters (<OML> encoding)}
%    \begin{macrocode}
%<*cmr>
\SetProtrusion
   [ name     = cmr-math-letters ]
   { encoding = OML,
     family   = cmm,
     series   = {m,b},
     shape    = it    }
   {
       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,100}, % \alpha
     "0C = { 50, 50}, % \beta
     "0D = {200,150}, % \gamma
     "0E = { 50, 50}, % \delta
     "0F = { 50, 50}, % \epsilon
     "10 = { 50,150}, % \zeta
     "12 = { 50,   }, % \theta
     "13 = {   ,100}, % \iota
     "14 = {   ,100}, % \kappa
     "15 = {100, 50}, % \lambda
     "16 = {   , 50}, % \mu
     "17 = {   , 50}, % \nu
     "18 = {   , 50}, % \xi
     "19 = { 50,100}, % \pi
     "1A = { 50, 50}, % \rho
     "1B = {   ,150}, % \sigma
     "1C = { 50,150}, % \tau
     "1D = { 50, 50}, % \upsilon
     "1F = { 50,100}, % \chi
     "20 = { 50, 50}, % \psi
     "21 = {   , 50}, % \omega
     "22 = {   , 50}, % \varepsilon
     "23 = {   , 50}, % \vartheta
     "24 = {   , 50}, % \varpi
     "25 = {100,   }, % \varrho
     "26 = {100,100}, % \varsigma
     "27 = { 50, 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
     "3A = {   ,500}, % ., \ldotp
     "3B = {   ,500}, % ,
     "3C = {200,100}, % <
     "3D = {300,400}, % /
     "3E = {100,200}, % >
     "3F = {200,200}, % \star
     "5B = {   ,100}, % \flat
     "5E = {200,200}, % \smile
     "5F = {200,200}, % \frown
     "7C = {100,   }, % \jmath
     "7D = {   ,100}  % \wp
%    \end{macrocode}
% Remaining slots in the source file.
%\iffalse
%    "11 = {   ,   }, % \eta
%    "1E = {   ,   }, % \phi
%    "40 = {   ,   }, % \partial
%    "5C = {   ,   }, % \natural
%    "5D = {   ,   }, % \sharp
%    "60 = {   ,   }, % \ell
%    "7B = {   ,   }, % \imath
%\fi
%    \begin{macrocode}
   }

%    \end{macrocode}
% Math font `|symbols|' (also used for the \cmd\mathcal\ alphabet) is declared
% as:
%\begin{verbatim}
%\DeclareSymbolFont{symbols}    {OMS}{cmsy}{m}{n}
%\SetSymbolFont{symbols}  {bold}{OMS}{cmsy}{b}{n}
%\end{verbatim}
%    \begin{macrocode}
\SetProtrusion
   [ name     = cmr-math-symbols ]
   { encoding = OMS,
     family   = cmsy,
     series   = {m,b},
     shape    = n  }
   {
       A = {150, 50}, % \mathcal
       C = {   ,100},
       D = {   , 50},
       F = { 50,150},
       I = {   ,100},
       J = {100,150},
       K = {   ,100},
       L = {100,   },
       M = { 50, 50},
       N = { 50,100},
       P = {   , 50},
       Q = { 50,   },
       R = {   , 50},
       T = { 50,150},
       V = { 50, 50},
       W = {   , 50},
       X = {100,100},
       Y = {100,   },
       Z = {100,150},
     "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 = {   ,400}, % \prime
     "31 = {100,100}, % \infty
     "32 = {150,100}, % \in
     "33 = {100,150}, % \ni
     "34 = {100,100}, % \triangle, \bigtriangleup
     "35 = {100,100}, % \bigtriangledown
     "38 = {   ,100}, % \forall
     "39 = {100,   }, % \exists
     "3A = {200,   }, % \neg
     "3E = {200,200}, % \top
     "3F = {200,200}, % \bot, \perp
     "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 = {400,   }, % \langle
     "69 = {   ,400}, % \rangle
     "6C = {100,100}, % \updownarrow
     "6D = {100,100}, % \Updownarrow
     "6E = {100,300}, % \, \backslash, \setminus
     "72 = {100,100}, % \nabla
     "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}
% Remaining slots in the source file.
%\iffalse
%    "36 = {   ,   }, % \not
%    "37 = {   ,   }, % \mapstochar
%    "3B = {   ,   }, % \emptyset
%    "3C = {   ,   }, % \Re
%    "3D = {   ,   }, % \Im
%    "40 = {   ,   }, % \aleph
%    "5B = {   ,   }, % \cup
%    "5C = {   ,   }, % \cap
%    "5D = {   ,   }, % \uplus
%    "6A = {   ,   }, % \arrowvert, \mid, \vert, |
%    "6B = {   ,   }, % \Arrowvert, \parallel, \Vert
%    "6F = {   ,   }, % \wr
%    "70 = {   ,   }, % \sqrtsign
%    "71 = {   ,   }, % \amalg
%    "73 = {   ,   }, % \smallint
%    "74 = {   ,   }, % \sqcup
%    "75 = {   ,   }, % \sqcap
%    "76 = {   ,   }, % \sqsubseteq
%    "77 = {   ,   }, % \sqsupseteq
%    "78 = {   ,   }, % \mathsection
%\fi
%    \begin{macrocode}
   }

%    \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}
%\iffalse
%\SetProtrusion
%   [ name     = cmr-math-largesymbols ]
%   { encoding = OMX,
%     family   = cmex }
%   {
%     "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
%  }
%\fi
%    \begin{macrocode}
%</cmr>
%</cfg-t>
%    \end{macrocode}
%
% \subsubsection{<AMS> symbols}
%
% Settings for the <AMS> math fonts (\pkg{amssymb}).
%\changes{v1.8}{2005/06/01}{settings for <AMS> math fonts}
%\changes{v1.9d}{2006/02/04}{tweak <AMS> settings}
%    \begin{macrocode}
%<*cfg-u>
%    \end{macrocode}
% Symbol font `a'.
%    \begin{macrocode}
%<*msa>
\SetProtrusion
   [ name     = AMS-a ]
   { encoding = U,
     family   = msa  }
   {
     "05  =  {150,250},  % \centerdot
     "06  =  {100,100},  % \lozenge
     "07  =  { 50, 50},  % \blacklozenge
     "08  =  { 50, 50},  % \circlearrowright
     "09  =  { 50, 50},  % \circlearrowleft
     "0A  =  {100,100},  % \rightleftharpoons
     "0B  =  {100,100},  % \leftrightharpoons
     "0D  =  {-50,200},  % \Vdash
     "0E  =  {-50,200},  % \Vvdash
     "0F  =  {-70,150},  % \vDash
     "10  =  {100,150},  % \twoheadrightarrow
     "11  =  {100,150},  % \twoheadleftarrow
     "12  =  { 50,100},  % \leftleftarrows
     "13  =  { 50, 80},  % \rightrightarrows
     "14  =  {120,120},  % \upuparrows
     "15  =  {120,120},  % \downdownarrows
     "16  =  {200,200},  % \upharpoonright
     "17  =  {200,200},  % \downharpoonright
     "18  =  {200,200},  % \upharpoonleft
     "19  =  {200,200},  % \downharpoonleft
     "1A  =  { 80,100},  % \rightarrowtail
     "1B  =  { 80,100},  % \leftarrowtail
     "1C  =  { 50, 50},  % \leftrightarrows
     "1D  =  { 50, 50},  % \rightleftarrows
     "1E  =  {250,   },  % \Lsh
     "1F  =  {   ,250},  % \Rsh
     "20  =  {100,100},  % \rightsquigarrow
     "21  =  {100,100},  % \leftrightsquigarrow
     "22  =  {100, 50},  % \looparrowleft
     "23  =  { 50,100},  % \looparrowright
     "24  =  { 50, 80},  % \circeq
     "25  =  {   ,100},  % \succsim
     "26  =  {   ,100},  % \gtrsim
     "27  =  {   ,100},  % \gtrapprox
     "28  =  {150, 50},  % \multimap
     "2B  =  {100,150},  % \doteqdot
     "2C  =  {100,150},  % \triangleq
     "2D  =  {100, 50},  % \precsim
     "2E  =  {100, 50},  % \lesssim
     "2F  =  { 50, 50},  % \lessapprox
     "30  =  {100, 50},  % \eqslantless
     "31  =  { 50, 50},  % \eqslantgtr
     "32  =  {100, 50},  % \curlyeqprec
     "33  =  { 50,100},  % \curlyeqsucc
     "34  =  {100, 50},  % \preccurlyeq
     "36  =  { 50,   },  % \leqslant
     "38  =  {   , 50},  % \backprime
     "39  =  {250,250},  % \dabar@ : the dash bar in \dash(left,right)arrow
     "3C  =  { 50,100},  % \succcurlyeq
     "3E  =  {   , 50},  % \geqslant
     "40  =  {   , 50},  % \sqsubset
     "41  =  { 50,   },  % \sqsupset
     "42  =  {   ,150},  % \vartriangleright, \rhd
     "43  =  {150,   },  % \vartriangleleft, \lhd
     "44  =  {   ,100},  % \trianglerighteq, \unrhd
     "45  =  {100,   },  % \trianglelefteq, \unlhd
     "46  =  {100,100},  % \bigstar
     "48  =  { 50, 50},  % \blacktriangledown
     "49  =  {   ,100},  % \blacktriangleright
     "4A  =  {100,   },  % \blacktriangleleft
     "4B  =  {   ,150},  % \dashrightarrow (the arrow)
     "4C  =  {150,   },  % \dashleftarrow
     "4D  =  { 50, 50},  % \vartriangle
     "4E  =  { 50, 50},  % \blacktriangle
     "4F  =  { 50, 50},  % \triangledown
     "50  =  { 50, 50},  % \eqcirc
     "56  =  {   ,150},  % \Rrightarrow
     "57  =  {150,   },  % \Lleftarrow
     "58  =  {100,300},  % \checkmark
     "5C  =  { 50, 50},  % \angle
     "5D  =  { 50, 50},  % \measuredangle
     "5E  =  { 50, 50},  % \sphericalangle
     "5F  =  {   , 50},  % \varpropto
     "60  =  {100,100},  % \smallsmile
     "61  =  {100,100},  % \smallfrown
     "62  =  { 50,   },  % \Subset
     "63  =  {   , 50},  % \Supset
     "66  =  {150,150},  % \curlywedge
     "67  =  {150,150},  % \curlyvee
     "68  =  { 50,150},  % \leftthreetimes
     "69  =  {100, 50},  % \rightthreetimes
     "6C  =  { 50, 50},  % \bumpeq
     "6D  =  { 50, 50},  % \Bumpeq
     "6E  =  {100,   },  % \lll
     "6F  =  {   ,100},  % \ggg
     "70  =  { 50,100},  % \ulcorner
     "71  =  {100, 50},  % \urcorner
     "75  =  {150,200},  % \dotplus
     "76  =  { 50,100},  % \backsim
     "78  =  { 50,100},  % \llcorner
     "79  =  {100, 50},  % \lrcorner
     "7C  =  {100,100},  % \intercal
     "7D  =  { 50, 50},  % \circledcirc
     "7E  =  { 50, 50},  % \circledast
     "7F  =  { 50, 50}   % \circleddash
%    \end{macrocode}
% Remaining slots in the source file.
%\iffalse
%    "00  =  {   ,   },  % \boxdot
%    "01  =  {   ,   },  % \boxplus
%    "02  =  {   ,   },  % \boxtimes
%    "03  =  {   ,   },  % \square
%    "04  =  {   ,   },  % \blacksquare
%    "0C  =  {   ,   },  % \boxminus
%    "29  =  {   ,   },  % \therefore
%    "2A  =  {   ,   },  % \because
%    "35  =  {   ,   },  % \leqq
%    "37  =  {   ,   },  % \lessgtr
%    "3A  =  {   ,   },  % \risingdotseq
%    "3B  =  {   ,   },  % \fallingdotseq
%    "3D  =  {   ,   },  % \geqq
%    "3F  =  {   ,   },  % \gtrless
%    "47  =  {   ,   },  % \between
%    "51  =  {   ,   },  % \lesseqgtr
%    "52  =  {   ,   },  % \gtreqless
%    "53  =  {   ,   },  % \lesseqqgtr
%    "54  =  {   ,   },  % \gtreqqless
%    "55  =  {   ,   },  % \yen
%    "59  =  {   ,   },  % \veebar
%    "5A  =  {   ,   },  % \barwedge
%    "5B  =  {   ,   },  % \doublebarwedge
%    "64  =  {   ,   },  % \Cup
%    "65  =  {   ,   },  % \Cap
%    "6A  =  {   ,   },  % \subseteqq
%    "6B  =  {   ,   },  % \supseteqq
%    "72  =  {   ,   },  % \circledR
%    "73  =  {   ,   },  % \circledS
%    "74  =  {   ,   },  % \pitchfork
%    "77  =  {   ,   },  % \backsimeq
%    "7A  =  {   ,   },  % \maltese
%    "7B  =  {   ,   },  % \complement
%\fi
%    \begin{macrocode}
   }

%</msa>
%    \end{macrocode}
% Symbol font `b'.
%    \begin{macrocode}
%<*msb>
\SetProtrusion
   [ name     = AMS-b ]
   { encoding = U,
     family   = msb  }
   {
       A  =  { 50, 50},  % \mathbb
       C  =  { 50, 50},
       G  =  {   , 50},
       L  =  {   , 50},
       P  =  {   , 50},
       R  =  {   , 50},
       T  =  {   , 50},
       V  =  { 50, 50},
       X  =  { 50, 50},
       Y  =  { 50, 50},
     "00  =  { 50, 50},  % \lvertneqq
     "01  =  { 50, 50},  % \gvertneqq
     "02  =  { 50, 50},  % \nleq
     "03  =  { 50, 50},  % \ngeq
     "04  =  {100, 50},  % \nless
     "05  =  { 50,150},  % \ngtr
     "06  =  {100, 50},  % \nprec
     "07  =  { 50,150},  % \nsucc
     "08  =  { 50, 50},  % \lneqq
     "09  =  { 50, 50},  % \gneqq
     "0A  =  {100,100},  % \nleqslant
     "0B  =  {100,100},  % \ngeqslant
     "0C  =  {100, 50},  % \lneq
     "0D  =  { 50,100},  % \gneq
     "0E  =  {100, 50},  % \npreceq
     "0F  =  { 50,100},  % \nsucceq
     "10  =  { 50,   },  % \precnsim
     "11  =  { 50, 50},  % \succnsim
     "12  =  { 50, 50},  % \lnsim
     "13  =  { 50, 50},  % \gnsim
     "14  =  { 50, 50},  % \nleqq
     "15  =  { 50, 50},  % \ngeqq
     "16  =  { 50, 50},  % \precneqq
     "17  =  { 50, 50},  % \succneqq
     "18  =  { 50, 50},  % \precnapprox
     "19  =  { 50, 50},  % \succnapprox
     "1A  =  { 50, 50},  % \lnapprox
     "1B  =  { 50, 50},  % \gnapprox
     "1C  =  {150,200},  % \nsim
     "1D  =  { 50, 50},  % \ncong
     "1E  =  {100,150},  % \diagup
     "1F  =  {100,150},  % \diagdown
     "20  =  {100, 50},  % \varsubsetneq
     "21  =  { 50,100},  % \varsupsetneq
     "22  =  {100, 50},  % \nsubseteqq
     "23  =  { 50,100},  % \nsupseteqq
     "24  =  {100, 50},  % \subsetneqq
     "25  =  { 50,100},  % \supsetneqq
     "26  =  {100, 50},  % \varsubsetneqq
     "27  =  { 50,100},  % \varsupsetneqq
     "28  =  {100, 50},  % \subsetneq
     "29  =  { 50,100},  % \supsetneq
     "2A  =  {100, 50},  % \nsubseteq
     "2B  =  { 50,100},  % \nsupseteq
     "2C  =  { 50,100},  % \nparallel
     "2D  =  {100,150},  % \nmid
     "2E  =  {150,150},  % \nshortmid
     "2F  =  {100,100},  % \nshortparallel
     "30  =  {   ,150},  % \nvdash
     "31  =  {   ,150},  % \nVdash
     "32  =  {   ,100},  % \nvDash
     "33  =  {   ,100},  % \nVDash
     "34  =  {   ,100},  % \ntrianglerighteq
     "35  =  {100,   },  % \ntrianglelefteq
     "36  =  {100,   },  % \ntriangleleft
     "37  =  {   ,100},  % \ntriangleright
     "38  =  {100,200},  % \nleftarrow
     "39  =  {100,200},  % \nrightarrow
     "3A  =  {100,100},  % \nLeftarrow
     "3B  =  { 50,100},  % \nRightarrow
     "3C  =  {100,100},  % \nLeftrightarrow
     "3D  =  {100,200},  % \nleftrightarrow
     "3E  =  { 50, 50},  % \divideontimes
     "3F  =  { 50, 50},  % \varnothing
     "60  =  {200,   },  % \Finv
     "61  =  {   , 50},  % \Game
     "68  =  {100,100},  % \eqsim
     "69  =  { 50,   },  % \beth
     "6A  =  { 50,   },  % \gimel
     "6B  =  {150,   },  % \daleth
     "6C  =  {200,   },  % \lessdot
     "6D  =  {   ,200},  % \gtrdot
     "6E  =  {100,200},  % \ltimes
     "6F  =  {150,100},  % \rtimes
     "70  =  { 50,100},  % \shortmid
     "71  =  { 50, 50},  % \shortparallel
     "72  =  {200,300},  % \smallsetminus
     "73  =  {100,200},  % \thicksim
     "74  =  { 50,100},  % \thickapprox
     "75  =  { 50, 50},  % \approxeq
     "76  =  { 50,100},  % \succapprox
     "77  =  { 50, 50},  % \precapprox
     "78  =  {100,100},  % \curvearrowleft
     "79  =  { 50,150},  % \curvearrowright
     "7A  =  { 50,200},  % \digamma
     "7B  =  {100, 50},  % \varkappa
     "7F  =  {200,   }   % \backepsilon
%    \end{macrocode}
% Remaining slots in the source file.
%\iffalse
%    "40  =  {   ,   },  % \nexists
%    "66  =  {   ,   },  % \mho
%    "67  =  {   ,   },  % \eth
%    "7C  =  {   ,   },  % \Bbbk
%    "7D  =  {   ,   },  % \hslash
%    "7E  =  {   ,   },  % \hbar
%\fi
%    \begin{macrocode}
   }

%</msb>
%    \end{macrocode}
% \subsubsection{Euler}
%
% Euler Roman font (package \pkg{euler}).
%\changes{v1.9e}{2006/07/28}{settings for Euler Roman font}
%    \begin{macrocode}
%<*eur>
\SetProtrusion
   [ name     = euler ]
   { encoding = U,
     family   = eur  }
   {
     "01  =  {100,100},
     "03  =  {100,150},
     "06  =  {   ,100},
     "07  =  {100,150},
     "08  =  {100,100},
     "0A  =  {100,100},
     "0B  =  {   , 50},
     "0C  =  {   ,100},
     "0D  =  {100,100},
     "0E  =  {   ,100},
     "0F  =  {100,100},
     "10  =  {100,100},
     "13  =  {   ,100},
     "14  =  {   ,100},
     "15  =  {   , 50},
     "16  =  {   , 50},
     "17  =  { 50,100},
     "18  =  { 50,100},
     "1A  =  {   , 50},
     "1B  =  {   , 50},
     "1C  =  { 50,100},
     "1D  =  { 50,100},
     "1E  =  { 50,100},
     "1F  =  { 50,100},
     "20  =  {   , 50},
     "21  =  {   , 50},
     "22  =  { 50,100},
     "24  =  {   , 50},
     "27  =  { 50,100},
       1  =  {100,100},
       7  =  { 50,100},
     "3A  =  {300,500},
     "3B  =  {200,400},
     "3C  =  {200,100},
     "3D  =  {200,200},
     "3E  =  {100,200},
       A  =  {   ,100},
       D  =  {   , 50},
       J  =  { 50,   },
       K  =  {   , 50},
       L  =  {   , 50},
       Q  =  {   , 50},
       T  =  { 50,   },
       X  =  { 50, 50},
       Y  =  { 50,   },
       h  =  {   , 50},
       k  =  {   , 50}
   }

%    \end{macrocode}
% Extended by the \pkg{eulervm} package.
%\changes{v1.9f}{2006/07/31}{fix: \texttt{euler-vm} did not load \texttt{euler} settings}
%    \begin{macrocode}
\SetProtrusion
   [ name     = euler-vm,
     load     = euler ]
   { encoding = U,
     family   = zeur  }
   {
     "28  =  {100,200},
     "29  =  {100,200},
     "2A  =  {100,150},
     "2B  =  {100,150},
     "2C  =  {200,300},
     "2D  =  {200,300},
     "2E  =  {   ,100},
     "2F  =  {100,   },
     "3F  =  {150,150},
     "5B  =  {   ,100},
     "5E  =  {100,100},
     "5F  =  {100,100},
     "80  =  {   , 50},
     "81  =  {200,250},
     "82  =  {100,200}
   }

%</eur>
%    \end{macrocode}
% Euler Script font (\pkg{eucal}).
%    \begin{macrocode}
%<*eus>
\SetProtrusion
   [ name     = euscript ]
   { encoding = U,
     family   = eus  }
   {
       A  =  {100,100},
       B  =  { 50,100},
       C  =  { 50, 50},
       D  =  { 50,100},
       E  =  { 50,100},
       F  =  { 50,   },
       G  =  { 50,   },
       H  =  {   ,100},
       K  =  {   , 50},
       L  =  {   ,150},
       M  =  {   , 50},
       N  =  {   , 50},
       O  =  { 50, 50},
       P  =  { 50, 50},
       T  =  {   ,100},
       U  =  {   , 50},
       V  =  { 50, 50},
       W  =  { 50, 50},
       X  =  { 50, 50},
       Y  =  { 50,   },
       Z  =  { 50,100},
     "00  =  {250,250},
     "18  =  {200,200},
     "3A  =  {200,150},
     "40  =  {   ,100},
     "5E  =  {100,100},
     "5F  =  {100,100},
     "66  =  { 50,   },
     "67  =  {   , 50},
     "6E  =  {200,200}
   }

\SetProtrusion
   [ name     = euscript-vm,
     load     = euscript ]
   { encoding = U,
     family   = zeus  }
   {
     "01  =  {600,600},
     "02  =  {200,200},
     "03  =  {200,200},
     "04  =  {200,200},
     "05  =  {150,150},
     "06  =  {200,200},
     "07  =  {200,200},
     "08  =  {100,100},
     "09  =  {100,100},
     "0A  =  {100,100},
     "0B  =  {100,100},
     "0C  =  {100,100},
     "0D  =  {100,100},
     "0E  =  {150,150},
     "0F  =  {100,100},
     "10  =  {150,150},
     "11  =  {100,100},
     "12  =  {150,100},
     "13  =  {100,150},
     "14  =  {150,100},
     "15  =  {100,150},
     "16  =  {200,100},
     "17  =  {100,200},
     "19  =  {150,150},
     "1A  =  {150,100},
     "1B  =  {100,150},
     "1C  =  {100,100},
     "1D  =  {100,100},
     "1E  =  {250,100},
     "1F  =  {100,250},
     "20  =  {150,200},
     "21  =  {150,200},
     "22  =  {150,150},
     "23  =  {150,150},
     "24  =  {100,200},
     "25  =  {150,150},
     "26  =  {150,150},
     "27  =  {100,100},
     "28  =  {100,100},
     "29  =  {100,150},
     "2A  =  {100,100},
     "2B  =  {100,100},
     "2C  =  {100,100},
     "2D  =  {150,150},
     "2E  =  {150,150},
     "2F  =  {100,100},
     "30  =  {100,100},
     "31  =  {100,100},
     "32  =  {100,100},
     "33  =  {100,100},
     "34  =  {100,100},
     "35  =  {100,100},
     "3E  =  {150,150},
     "3F  =  {150,150},
     "60  =  {   ,200},
     "61  =  {200,   },
     "62  =  {100,100},
     "63  =  {100,100},
     "64  =  {100,100},
     "65  =  {100,100},
     "68  =  {300,   },
     "69  =  {   ,300},
     "6C  =  {100,100},
     "6D  =  {100,100},
     "6F  =  {100,100},
     "72  =  {100,100},
     "73  =  {200,100},
     "76  =  {   ,100},
     "77  =  {100,   },
     "78  =  { 50, 50},
     "79  =  {100,100},
     "7A  =  {100,100},
     "7D  =  {150,150},
     "7E  =  {100,100},
     "A8  =  {100,100},
     "A9  =  {100,100},
     "AB  =  {200,200},
     "BA  =  {   ,200},
     "BB  =  {   ,200},
     "BD  =  {200,200},
     "DE  =  {200,200}
   }

%</eus>
%    \end{macrocode}
% Euler Fraktur font (\pkg{eufrak}).
%\changes{v1.9e}{2006/07/28}{complete settings for Euler Fraktur and Script fonts}
%    \begin{macrocode}
%<*euf>
\SetProtrusion
   [ name     = mathfrak ]
   { encoding = U,
     family   = euf  }
   {
       A  =  {   , 50},
       B  =  {   , 50},
       C  =  { 50, 50},
       D  =  {   , 80},
       E  =  { 50,   },
       G  =  {   , 50},
       L  =  {   , 80},
       O  =  {   , 50},
       T  =  {   , 80},
       X  =  { 80, 50},
       Z  =  { 80, 50},
       b  =  {   , 50},
       c  =  {   , 50},
       k  =  {   , 50},
       p  =  {   , 50},
       q  =  { 50,   },
       v  =  {   , 50},
       w  =  {   , 50},
       x  =  {   , 50},
       1  =  {100,100},
       2  =  { 80, 80},
       3  =  { 80, 50},
       4  =  { 80, 50},
       7  =  { 50, 50},
     "12  =  {500,500},
     "13  =  {500,500},
       !  =  {   ,200},
       '  =  {200,300},
       (  =  {200,   },
       )  =  {   ,200},
       *  =  {200,200},
       +  =  {200,250},
       -  =  {200,200},
      {,} =  {300,300},
       .  =  {400,400},
      {=} =  {200,200},
       :  =  {   ,200},
       ;  =  {   ,200},
       ]  =  {   ,200}
   }

%</euf>
%</cfg-u>
%    \end{macrocode}
%\subsubsection{Euro symbols}
%\changes{v1.9d}{2006/05/04}{settings for Euro symbols (Adobe, <ITC>, \pkg{marvosym})}
%\changes{v1.9e}{2006/07/05}{fix: forgotten comma in \file{mt-mvs.cfg};
%                            adapt to \pkg{marvosym}'s changed encoding}
% Settings for various Euro symbols (Adobe Euro fonts (packages \pkg{eurosans},
% \pkg{europs}), <ITC> Euro fonts (package \pkg{euroitc}) and \pkg{marvosym}\footnote{
%   Of course, there are many more symbols in this font. Feel free to contribute
%   protrusion settings!}).
%    \begin{macrocode}
%<*cfg-e>
\SetProtrusion
%<zpeu|euroitc>   { encoding = U,
%<mvs>   { encoding = {OT1,U},
%<zpeu>     family   = zpeu }
%<euroitc>     family   = {euroitc,euroitcs} }
%<mvs>     family   = mvs }
   {
%<zpeu>     E = {50, }
%<euroitc>     E = {100,50}
%<mvs>     164 = {50,50},   % \EUR
%<mvs>     068 = {50,-100}  % \EURdig
   }

%<*zpeu|euroitc>
\SetProtrusion
   { encoding = U,
%<zpeu>     family   = zpeu,
%<euroitc>     family   = {euroitc,euroitcs},
     shape    = it* }
   {
%<zpeu>     E = {100,-50}
%<euroitc>     E = {100,}
   }

%</zpeu|euroitc>
%<*zpeu>
\SetProtrusion
   { encoding = U,
     family   = {zpeus,eurosans} }
   {
     E = {100,50}
   }

\SetProtrusion
   { encoding = U,
     family   = {zpeus,eurosans},
     shape    = it* }
   {
     E = {200, }
   }

%</zpeu>
%</cfg-e>
%    \end{macrocode}
%
%\subsection{Interword spacing}\label{sub:conf-spacing}
%\GeneralChanges{Spacing}
%
% Default unit is space.
%
%    \begin{macrocode}
%<*m-t|cmr>
%%% -----------------------------------------------------------------------
%%% INTERWORD SPACING

%</m-t|cmr>
%<*m-t>
\SetExtraSpacing
   [ name = default ]
   { encoding = {OT1,T1,LY1,OT4,QX,T5} }
   {
%    \end{macrocode}
% These settings are only a first approximation. The following reasoning is from
% a mail from \contributor Ulrich Dirr <ud\at art-satz.de>^^A private mail, 2005/06/14
%\ifpdf\IfFileExists{justification.png}{^^A
% , who also provided the sample in figure~\ref{fig:example-spacing}^^A
%\changes{v2.2}{2007/04/05}{add sample}^^A
%   \begin{figure}
%     \caption{^^A
%       Example of interword spacing (from: M.~Siemoneit, \emph{Typographisches Gestalten}, Frankfurt/M. 1989).
%         ^^A Manfred Siemoneit, Typographisches Gestalten.
%         ^^A   Regeln und Tips f\"ur die richtige Gestaltung von Drucksachen,
%         ^^A   Frankfurt/M.: Polygraph Verlag, 1989
%       The numbers indicate the preference for shrinking the interword space.}
%     \label{fig:example-spacing}
%     \includegraphics[width=.66\textwidth]{justification.png}
%   \end{figure}^^A
%}\relax\fi.
% I~do not claim to have coped with the task.
%\todo{fix settings}
%
%\begin{quote}
% `The idea is -- analog to the tables for expansion and protrusion -- to
% have tables for optical reduction\slash expansion of spaces in dependence of the
% actual character so that the distance between words is optically equal.
%
% When reducing distances the (weighting) order is:
%\begin{itemize}
%  \item after commas
%    \begin{macrocode}
     {,} = { ,-500,500},
%    \end{macrocode}
%  \item in front of capitals which have optical more room on their left
%        side, \eg, `A', `J', `T', `V', `W', and `Y'
%        [this is not yet possible -- RS]
%  \item in front of capitals which have circle/oval shapes on their left
%        side, \eg, `C', `G', `O', and `Q'
%        [ditto -- RS]
%  \item after `r' (because of the bigger optical room on the righthand side)
%    \begin{macrocode}
      r  = { ,-300,300},
%    \end{macrocode}
%  \item\relax [before or] after lowercase characters with ascenders
%    \begin{macrocode}
      b  = { ,-200,200},
      d  = { ,-200,200},
      f  = { ,-200,200},
      h  = { ,-200,200},
      k  = { ,-200,200},
      l  = { ,-200,200},
      t  = { ,-200,200},
%    \end{macrocode}
%  \item\relax [before or] after lowercase characters with x-height plus descender
%        with additional optical space, \eg, `v', or `w'
%    \begin{macrocode}
      c  = { ,-100,100},
      p  = { ,-100,100},
      v  = { ,-100,100},
      w  = { ,-100,100},
      z  = { ,-100,100},
      x  = { ,-100,100},
      y  = { ,-100,100},
%    \end{macrocode}
%  \item\relax [before or] after lowercase characters with x-height plus descender
%        without additional optical space
%    \begin{macrocode}
      i  = { , 50, -50},
      m  = { , 50, -50},
      n  = { , 50, -50},
      u  = { , 50, -50},
%    \end{macrocode}
%  \item after colon and semicolon
%    \begin{macrocode}
      :  = { ,200,-200},
      ;  = { ,200,-200},
%    \end{macrocode}
%  \item after punctuation which ends a sentence, \eg, period, exclamation
%        mark, question mark
%    \begin{macrocode}
      .  = { ,250,-250},
      !  = { ,250,-250},
      ?  = { ,250,-250}
%    \end{macrocode}
%\end{itemize}
% The order has to be reversed when enlarging is needed.'
%\end{quote}
%    \begin{macrocode}
   }

%</m-t>
%    \end{macrocode}
% Questions are:
%\begin{itemize}
%  \item Is the result really better?
%  \item Is it overdone? (Try with a |factor| \textless\ 1000.)
%  \item Should the first parameter also be used? (Probably.)
%  \item What about quotation marks, parentheses etc.?
%\end{itemize}
%
% Furthermore, there seems to be a \pdftex\ bug with spacing in combination
% with a non-zero \cmd\spaceskip\
% (reported by \contributor Axel Berger <Axel_Berger\at b.maus.de>):
%  ^^A dctt, `myheadings, markboth', 2008/10/06, MID: <200810062134.a58193@b.maus.de>
%\todo{report \pdftex\ bug}
%\begin{verbatim}
%\parfillskip0pt
%\rightskip0pt plus 1em
%\spaceskip\fontdimen2\font
% test test\par
%\pdfadjustinterwordglue2
%\stbscode\font`t=-50
% test test
%\bye
%\end{verbatim}
% Some more characters in <T2A>.\footnote{Contributed by
%                     \contributor Karl Karlsson <karl-karlsson\at yandex.ru>.}
%\changes{v2.3e}{2009/10/28}{settings for <T2A> encoding (contributed by
%                            \contributor Karl Karlsson <karl-karlsson\at yandex.ru>)}
%                                                       ^^A private mail, 2009/10/21
%    \begin{macrocode}
%<*cmr>
\SetExtraSpacing
   [ name     = T2A,
     load     = default ]
   { encoding = T2A,
     family   = cmr }
   {
      \cyrg  = { ,-300,300},
      \cyrb  = { ,-200,200},
      \cyrk  = { ,-200,200},
      \cyrs  = { ,-100,100},
      \cyrr  = { ,-100,100},
      \cyrh  = { ,-100,100},
      \cyru  = { ,-100,100},
      \cyrt  = { , 50, -50},
      \cyrp  = { , 50, -50},
      \cyri  = { , 50, -50},
      \cyrishrt  = { , 50, -50},
   }

%    \end{macrocode}
%
% \subsubsection{Nonfrenchspacing}
% The following settings simulate \cmd\nonfrenchspacing\ (since space factors
% will be ignored when spacing adjustment is in effect). They may be used for
% English contexts.
%
% From the \TeX book:
%\begin{quote}
%                                                                   `If the
% space factor $f$ is different from 1000, the interword glue is computed as
% follows:  Take the normal space glue for the current font, and add the
% extra space if $f\ge2000$.
%  [\,\dots]
% Then the stretch component is multiplied by $f/1000$, while the shrink
% component is multiplied by $1000/f$.'
%\end{quote}
% The `extra space' (\fontdim7) for Computer Modern Roman is a third of
% \fontdim2, \ie, 333.
%    \begin{macrocode}
\SetExtraSpacing
   [ name     = nonfrench-cmr,
     load     = default,
     context  = nonfrench ]
   { encoding = {OT1,T1,LY1,OT4,QX,T5},
     family   = cmr }
   {
%    \end{macrocode}
% \file{latex.ltx} has:
%\begin{verbatim}[morekeywords={[1]{\nonfrenchspacing}}]
%\def\nonfrenchspacing{
%  \sfcode`\. 3000
%  \sfcode`\? 3000
%  \sfcode`\! 3000
%\end{verbatim}
%    \begin{macrocode}
     . = {333,2000,-667},
     ? = {333,2000,-667},
     ! = {333,2000,-667},
%    \end{macrocode}
%\begin{verbatim}
%  \sfcode`\: 2000
%\end{verbatim}
%    \begin{macrocode}
     : = {333,1000,-500},
%    \end{macrocode}
%\begin{verbatim}
%  \sfcode`\; 1500
%\end{verbatim}
%    \begin{macrocode}
     ; = {   , 500,-333},
%    \end{macrocode}
%\begin{verbatim}
%  \sfcode`\, 1250
%\end{verbatim}
%    \begin{macrocode}
    {,}= {   , 250,-200}
%    \end{macrocode}
%\begin{verbatim}
%}
%\end{verbatim}
%    \begin{macrocode}
   }

%</cmr>
%    \end{macrocode}
% \pkg{fontinst}, however, which is also used to create the \pkg{psnfss} font
% metrics, sets \fontdim7 to 240 by default. Therefore, the fallback settings
% use this value for the first component.
%    \begin{macrocode}
%<*m-t>
\SetExtraSpacing
   [ name     = nonfrench-default,
     load     = default,
     context  = nonfrench ]
   { encoding = {OT1,T1,LY1,OT4,QX,T5} }
   {
     . = {240,2000,-667},
     ? = {240,2000,-667},
     ! = {240,2000,-667},
     : = {240,1000,-500},
     ; = {   , 500,-333},
    {,}= {   , 250,-200}
   }

%    \end{macrocode}
%
% \subsection{Additional kerning}
%\GeneralChanges{Kerning}
%
% Default unit is \EM{1}.
%
%    \begin{macrocode}
%%% -----------------------------------------------------------------------
%%% ADDITIONAL KERNING

%    \end{macrocode}
% A dummy list to be loaded when no context is active.
%    \begin{macrocode}
\SetExtraKerning
   [ name = empty ]
   { encoding = {OT1,T1,T2A,LY1,OT4,QX,T5,TS1} }
   { }

%    \end{macrocode}
%
%\subsubsection{French}
%
% The ratio of \fontdim2 to \fontdim6 varies for different fonts, so that
% either the kerning of the colon (which should be a space, \ie, \fontdim2) or
% that of the other punctuation characters (\TeX's \cmd\thinspace, \ie, one
% sixth of \fontdim6) may be inaccurate, depending on which |unit| we choose
% (|space| or |1em|). For Times, for example, a thin space would be 665. I
% don't know whether French typography really wants a thin space, or rather (as
% it happens to turn out with <CMR>) half a space.
% (Wikipedia\footnote{\url{http://fr.wikipedia.org/wiki/Espace_typographique}, 5 July 2007.}
% claims it should be a quarter of an em, which seems too much to me; then
% again, it also says that this \emph{was} a thin space in French typography.)
%    \begin{macrocode}
\SetExtraKerning
   [ name     = french-default,
     context  = french,
     unit     = space   ]
   { encoding = {OT1,T1,LY1} }
   {
     :  = {1000,}, % = \fontdimen2
     ;  = {500, }, % ~ \thinspace
     !  = {500, },
     ?  = {500, }
   }

%    \end{macrocode}
% These settings have the disadvantage that a word following a left guillemet
% will not be hyphenated. This might be fixed in \pdftex.
%    \begin{macrocode}
\SetExtraKerning
   [ name     = french-guillemets,
     context  = french-guillemets,
     load     = french-default,
     unit     = space   ]
   { encoding = {T1,LY1} }
   {
    \guillemotleft  = { ,800}, % = 0.8\fontdimen2
    \guillemotright = {800, }
   }

\SetExtraKerning
   [ name     = french-guillemets-OT1,
     context  = french-guillemets,
     load     = french-default,
     unit     = space   ]
   { encoding = OT1     }
   { }

%    \end{macrocode}
%
%\subsubsection{Turkish}
%
%    \begin{macrocode}
\SetExtraKerning
   [ name     = turkish,
     context  = turkish ]
   { encoding = {OT1,T1,LY1} }
   {
     :  = {167, }, % = \thinspace
     !  = {167, },
    {=} = {167, }
   }

%</m-t>
%</config>
%    \end{macrocode}
%^^A\changes{v2.0}{2006/12/28}{remove \texttt{letterspacing} settings}
%
%\ifpdf
%\GeneralChanges{Documentation}
%^^A The OpenType configuration files are outsourced to an external file,
%^^A since they are typeset with \luatex.
%
%\newwrite          \utftmp
%\immediate\openout \utftmp=microtype-utf.tmp
%\immediate\write   \utftmp{\string\setcounter{section}{\the\c@section}}
%\immediate\write   \utftmp{\string\setcounter{CodelineNo}{\the\c@CodelineNo}}
%\immediate\write   \utftmp{\string\setcounter{page}{\the\c@page}}
%\immediate\write   \utftmp{\string\setcounter{footnote}{\the\c@footnote}}
%\immediate\closeout\utftmp
%
%\InputIfFileExists{microtype.tmp}\relax{\def\utfsectioni{1}\def\utfsectionii{1}}
%
%\IfFileExists{microtype-utf.pdf}
%   {\includepdf[pages=-,
%                addtotoc={1,section,1,OpenType configuration files,sec:OpenType,
%                          \utfsectioni,subsection,2,Character inheritance,sub:OT-inheritance,
%                          \utfsectionii,subsection,2,Character protrusion,sub:OT-protrusion}]
%               {microtype-utf.pdf}}
%   {\section{OpenType configuration settings}
%       To view the OpenType configuration settings, first typeset
%       \file{microtype-utf.dtx} with \luatex.}
%
%\GeneralChanges*
%\else
% \fallbacktext{The original documentation\footnote{
%     \ctanurl{macros/latex/contrib/microtype/microtype.pdf}.}
%   also includes the OpenType configuration files.}
%\fi
%
%\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 specify 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}

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

\bigskip
\newlength{\MTln}
\newcommand*\teststring
  {ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789}
\settowidth{\MTln}{\teststring}
\microtypesetup{expansion=true}

\parbox{1.05\MTln}{\teststring\linebreak\\
                   \teststring}\par\bigskip
\parbox{0.95\MTln}{\teststring}

\end{document}
%</test>
%    \end{macrocode}
% Needless to say that things may always be improved. For suggestions, mail to
% \mailtoRS.
%
% ^^A -------------------------------------------------------------------------
%
% \newpage
% \appendix
% \AppendixSettings
% \GeneralChanges{Documentation}
%
%\changes{v2.5}{2013/02/23}{include \file{microtype-logo.dtx} and \file{microtype-lssample.dtx}}
% \InputIfFileExists{microtype-logo.dtx}\relax\relax
% \InputIfFileExists{microtype-lssample.dtx}\relax\relax
%
% \PrintChanges
%
% ^^A -------------------------------------------------------------------------
%\makeatother
%
% \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{10748}
%
% \Finale
%
\endinput
%
% -----------------------------------------------------------------------------

 *** Typesetting the documentation ***

  The documentation of this package (microtype.pdf) can be found on CTAN,
  if it isn't already installed in your TeX system, so there should be no
  need to re-typeset it.
  If you still want to do this, there are some requirements to consider
  and some steps to follow:

#  (1) In microtype.ins, uncomment the lines:
%\generate{\makefile{microtype-gind.ist}{docist}}
#      and
%\generate{\makefile{microtype-doc.sty}{docsty}}
#  (2) Install the package by running:
pdflatex microtype.ins
#  (3) Extract microtype-lssample.dtx and microtype-logo.dtx from
#      microtype.pdf (ie., from the file you are about to recreate ...).
#      This can be done, eg., with Adobe Reader or with the pdftk tool.
#  (4) Run
pdflatex microtype.dtx
pdflatex microtype.dtx
#      [ The following fonts are required:
#        - Bitstream Charter
#        - Bitstream LetterGothic
#        - Adobe Source Sans Pro
#        - Adobe Wittenberger Fraktur MT (alternatively yfrak)
#        - Adobe Zapf Chancery (alternatively URW Zapf Chancery)
#        - Adobe Kepler MM (for microtype-logo.dtx, input by microtype.dtx)
#        - Adobe Caslon (for microtype-lssample.dtx, input by microtype.dtx) ]
#  (5) Run
makeindex -s microtype-gind.ist microtype
#  (6) Run
makeindex -s gglo.ist -o microtype.gls microtype.glo microtype-utf.glo
#  (7) Run
lualatex microtype-utf.dtx
#      [ The following fonts are required:
#        - Bitstream Charter (Type 1)
#        - Bitstream LetterGothic (Type 1)
#        - Adobe Source Sans Pro (Type 1)
#        - Latin Modern Roman (OpenType)
#        - Charis SIL (OpenType)
#        - TeX Gyre Pagella (OpenType) ]
#  (8) Run
pdflatex microtype.dtx
#  (9) Run
makeindex -s microtype-gind.ist microtype
# (10) Run
makeindex -s gglo.ist -o microtype.gls microtype.glo microtype-utf.glo
# (11) Run
pdflatex microtype.dtx
#
# That's it, although I still may have forgotten some things ...
%
% -- RS
% -----------------------------------------------------------------------------
%
% vim: ts=2:sw=2:et:
%
