%%
%% This is file `letterspace.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% microtype.dtx  (with options: `letterspace,plain')
%% 
%% ------------------------------------------------------------------------
%% 
%%                       The `microtype' package
%%         Subliminal refinements towards typographical perfection
%%           Copyright (c) 2004--2013 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-xetex.def,
%% microtype-luatex.def, microtype.lua and letterspace.sty.
%% 
%% ------------------------------------------------------------------------
%%   This is a stand-alone version that only provides the letterspacing
%%   commands. Do not use this package together with the `microtype' package.
%%   Please refer to section 7 of the `microtype' documentation.
%% ------------------------------------------------------------------------ 
%%
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage
  {letterspace}
  [2013/05/23 v2.5a
   Robust letterspacing
  (RS)]
\def\MT@MT
  {letterspace}
\let\MT@restore@catcodes\@empty
\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{24} {9}% ^^X (ignore)
\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}% >
\MT@fix@catcode{94} {7}% ^ (superscript)
\MT@fix@catcode{96}{12}% `
\newcommand*\lsstyle{}
\newcommand\textls[2][]{}
\def\textls#1#{}
\newcommand*\lslig[1]{#1}
\def\MT@warning{\PackageWarning\MT@MT}
\def\MT@warning@nl#1{\MT@warning{#1\@gobble}}
\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
\def\MT@requires@latex#1{%
  \ifnum\MT@plain<#1 \expandafter\@secondoftwo\else\expandafter\@firstoftwo\fi
}
\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
\def\MT@clear@options{%
  \MT@requires@latex1{%
  \AtEndOfPackage{\let\@unprocessedoptions\relax\MT@restore@catcodes}%
  \let\CurrentOption\@empty
  }\relax
}
\ifx\normalpdftexversion\@undefined \else
  \let\pdftexversion \normalpdftexversion
  \let\pdftexrevision\normalpdftexrevision
  \let\pdfoutput     \normalpdfoutput
\fi
\let\MT@engine\relax
\def\MT@engine@tooold{0}
\ifx\pdftexversion\@undefined \else
  \ifx\pdftexversion\relax \else
    \def\MT@engine{pdf}
    \let\MT@pdf@or@lua\@firstoftwo
    \ifnum\pdftexversion > 139 \def\MT@engine@tooold{1}\fi
    \ifx\directlua\@undefined \else
      \ifx\directlua\relax \else
        \def\MT@engine{lua}
        \let\MT@pdf@or@lua\@secondoftwo
        \ifnum\luatexversion < 62 \def\MT@engine@tooold{0}\fi
      \fi
    \fi
  \fi
\fi
\ifnum
  \MT@engine@tooold=\z@
  \MT@warning@nl{You
    \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
      are using a \MT@engine tex version older than
        \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%
    \fi
      .\MessageBreak I will quit now}
  \MT@clear@options
\endinput\fi
\RequirePackage{keyval}[1997/11/10]
\def\MT@tr@min{-\@m}
\let\MT@tr@max\@m
\let\MT@letterspace\m@ne
\def\MT@letterspace@default{100}
\def\MT@glet{\global\let}
\def\MT@exp@cs#1#2{\expandafter#1\csname#2\endcsname}
\def\MT@edef@n{\MT@exp@cs\edef}
\def\MT@exp@one@n#1#2{\expandafter#1\expandafter{#2}}
\def\MT@exp@two@c#1{\expandafter\expandafter\expandafter#1\expandafter}
\def\MT@ifdefined@c@TF#1{%
^^X  \ifdefined#1\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi
}
\def\MT@ifdefined@n@T#1{%
^^X  \ifcsname#1\endcsname\expandafter\@firstofone\else\expandafter\@gobble\fi
}
\def\MT@ifdefined@n@TF#1{%
^^X  \ifcsname#1\endcsname\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi
}
\begingroup
\catcode`\%=12
\catcode`\&=14
\gdef\MT@ifempty#1{&
  \if %#1%&
    \expandafter\@firstoftwo
  \else
    \expandafter\@secondoftwo
  \fi
}
\endgroup
\MT@pdf@or@lua{
\def\MT@ifint#1{%
  \ifcase\pdfmatch{^-*[0-9]+ *$}{#1}\relax
    \expandafter\@secondoftwo
  \else
    \expandafter\@firstoftwo
  \fi
}
}{
\def\MT@ifint#1{%
  \if!\ifnum9<1#1!\else?\fi
    \expandafter\@firstoftwo
  \else
    \expandafter\@secondoftwo
  \fi
}
}
\def\MT@map@clist@n#1#2{%
  \ifx\@empty#1\else
    \def\MT@clist@function##1{#2}%
    \MT@map@clist@#1,\@nil,\@nnil
  \fi
}
\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{}
\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
\def\MT@while@num#1#2#3{%
  \@tempcnta#1\relax
  \MT@loop #3%
    \advance\@tempcnta \@ne
    \ifnum\@tempcnta < #2\MT@repeat
}
\def\MT@do@font{\MT@while@num\z@
  \@cclvi
}
\MT@requires@latex1{
\let\MT@setup@\@empty
\def\MT@addto@setup{\g@addto@macro\MT@setup@}
}{\let\MT@addto@setup\@firstofone}
\def\MT@with@package@T#1{\@ifpackageloaded{#1}\@firstofone\@gobble}
\MT@addto@setup{%
  \MT@requires@latex2{
  \MT@with@package@T{hyperref}{%
    \pdfstringdefDisableCommands{%
      \def\lsstyle{\pdfstringdefWarn\lsstyle}%
      \def\textls#1#{\pdfstringdefWarn\textls}%
    }%
  }%
  }\relax
  \MT@requires@latex2{
  \MT@with@package@T{soul}{%
    \soulregister\lsstyle 0%
    \soulregister\textls  1%
  }%
  }{\ifx\SOUL@\@undefined\else
      \soulregister\lsstyle 0%
      \soulregister\textls  1%
    \fi}%
}
\let\MT@tracking
  \relax
\def\MT@set@tr@codes{%
  \MT@ifdefined@c@TF\MT@letterspace@\relax{\let\MT@letterspace@\MT@letterspace}%
  \ifnum\MT@letterspace@=\z@
    \MT@set@tr@zero
  \else
    \MT@warn@tracking@DVI
    \xdef\MT@lsfont{\csname\expandafter\string\font@name
                           /\number\MT@letterspace@ ls\endcsname}%
    \expandafter\ifx\MT@lsfont\relax
      \MT@get@ls@basefont
      \global\expandafter\letterspacefont\MT@lsfont\font@name\MT@letterspace@
      % spacing = {<letterspace amount>*,,}
      \fontdimen2\MT@lsfont=\dimexpr\numexpr 1000+\MT@letterspace@\relax sp
                                            * \fontdimen2\MT@lsfont/1000\relax
      % no ligatures = {f}
      \tagcode\MT@lsfont`f=\m@ne
      \MT@do@font{\lpcode\MT@lsfont\@tempcnta=\numexpr\MT@letterspace@/2\relax
                  \rpcode\MT@lsfont\@tempcnta=\numexpr\MT@letterspace@/2\relax}%
    \fi
    \aftergroup\MT@set@lsfont
    \xdef\MT@set@curr@ls{\def\noexpand\MT@curr@ls{\MT@letterspace@}}%
    \aftergroup\MT@set@curr@ls
    \ifx\MT@ls@adjust\@empty
      % \textls : outer kerning = {*,*} ; \textls* : outer kerning = {0,0}
      \MT@outer@kern=-\dimexpr\MT@letterspace@ sp * \fontdimen6\font@name/2000\relax
      \MT@ls@outer@k
      \xdef\MT@set@curr@ok{\MT@outer@kern=\the\MT@outer@kern\relax}%
      \MT@afteraftergroup{%
        \MT@set@curr@ok
        \noexpand\MT@ls@outer@k
      }%
    \fi
  \fi
}
\def\MT@afteraftergroup#1{%
  \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}%
  }%
}
\MT@requires@latex2{
\def\MT@set@lsfont{\MT@exp@two@c\let\font@name\MT@lsfont}
\DeclareRobustCommand\lsstyle{%
  \not@math@alphabet\lsstyle\textls
  \let\glb@currsize\@empty
  \let\MT@tracking\MT@set@tr@codes
  \selectfont
}
}{
\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
}
\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}}%
}
\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
    \MT@exp@two@c\let\font@name\MT@ls@basefont
  \fi
}
\def\MT@set@lsbasefont{\MT@exp@two@c\let\font@name\MT@ls@basefont}
\def\MT@set@tr@zero{%
  \xdef\MT@ls@basefont{\csname\expandafter\string\font@name @base\endcsname}%
  \expandafter\ifx\MT@ls@basefont\relax \else
    \aftergroup\MT@set@lsbasefont
  \fi
}
\DeclareRobustCommand\textls{%
  \@ifstar{\let\MT@ls@adjust@\MT@ls@adjust@empty\MT@textls}%
          {\let\MT@ls@adjust@\MT@ls@adjust@relax\MT@textls}%
}
\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
}
\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@
}
\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
}
\newdimen\MT@outer@kern
\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
}
\MT@requires@latex2{
\MT@addto@setup{%
  \@ifpackageloaded{CJK}{%
    \@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}}%
    \@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}}}%
  }{%
    \def\MT@orig@pickupfont{\expandafter\ifx\font@name\relax\define@newfont\fi}%
  }%
  \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%
    }%
  \fi
  \g@addto@macro\pickup@font{\begingroup}%
  \MT@with@package@T{trace}{\g@addto@macro\pickup@font{\conditionally@traceoff}}%
  \g@addto@macro\pickup@font{%
      \escapechar\m@ne
      \MT@tracking
    \endgroup
  }%
}
}\relax
\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}}%
}
}\relax
\MT@requires@latex1{
\MT@map@clist@n{%
    letterspace}{%
  \define@key{MT}{#1}[\csname MT@#1@default\endcsname]{%
    \def\@tempa{##1 }%
    \MT@ifint\@tempa
      {\MT@edef@n{MT@#1}{\@tempa}}%
      {\MT@optwarn@nan{##1}{#1}}%
  }%
}
}\relax
\MT@requires@latex1{
\def\MT@ProcessOptionsWithKV#1{%
  \let\@tempc\relax
  \let\MT@temp\@empty
  \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}}}%
  }{\edef\MT@temp{\noexpand\setkeys{#1}%
                    {\csname usepkg@options@\usepkg@pkg\endcsname}}}
  \MT@temp
  \MT@clear@options
}
\def\MT@getkey#1=#2\@nil{#1}
\MT@ProcessOptionsWithKV{MT}
}\relax
\MT@addto@setup
{%
  \ifnum\pdfoutput<\@ne
    \def\MT@warn@tracking@DVI{%
      \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}%
      \MT@glet\MT@warn@tracking@DVI\relax
    }%
  \else
    \def\MT@warn@tracking@DVI{%
      \ifnum\pdfprotrudechars<\@ne \global\pdfprotrudechars\@ne \fi
      \MT@glet\MT@warn@tracking@DVI\relax
    }%
  \fi
  \ifnum\MT@letterspace=\m@ne
    \let\MT@letterspace\MT@letterspace@default
  \else
    \MT@ls@too@large\MT@letterspace
  \fi
}
\MT@requires@latex1{
\AtBeginDocument{\MT@setup@ \MT@glet\MT@setup@\@empty}
}\relax
\MT@restore@catcodes
\endinput
%%
%% End of file `letterspace.sty'.
