texlive[44791] Master/texmf-dist: microtype (8jul17)

commits+karl at tug.org commits+karl at tug.org
Fri Jul 14 01:12:08 CEST 2017


Revision: 44791
          http://tug.org/svn/texlive?view=revision&revision=44791
Author:   karl
Date:     2017-07-14 01:12:08 +0200 (Fri, 14 Jul 2017)
Log Message:
-----------
microtype (8jul17)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/microtype/README.md
    trunk/Master/texmf-dist/doc/latex/microtype/microtype.pdf
    trunk/Master/texmf-dist/source/latex/microtype/microtype-utf.dtx
    trunk/Master/texmf-dist/source/latex/microtype/microtype.dtx
    trunk/Master/texmf-dist/source/latex/microtype/microtype.ins
    trunk/Master/texmf-dist/tex/latex/microtype/letterspace.sty
    trunk/Master/texmf-dist/tex/latex/microtype/microtype-luatex.def
    trunk/Master/texmf-dist/tex/latex/microtype/microtype-pdftex.def
    trunk/Master/texmf-dist/tex/latex/microtype/microtype-xetex.def
    trunk/Master/texmf-dist/tex/latex/microtype/microtype.cfg
    trunk/Master/texmf-dist/tex/latex/microtype/microtype.lua
    trunk/Master/texmf-dist/tex/latex/microtype/microtype.sty
    trunk/Master/texmf-dist/tex/latex/microtype/mt-CharisSIL.cfg

Modified: trunk/Master/texmf-dist/doc/latex/microtype/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/microtype/README.md	2017-07-13 23:11:24 UTC (rev 44790)
+++ trunk/Master/texmf-dist/doc/latex/microtype/README.md	2017-07-13 23:12:08 UTC (rev 44791)
@@ -4,7 +4,7 @@
 
 **Subliminal refinements towards typographical perfection**
 
-  (v2.6a -- 2016/05/14)
+  (v2.7 -- 2017/07/07)
 
 
 Overview
@@ -76,5 +76,5 @@
 (2) the identification string is changed.
 
 ------------------------------------------------------
-Copyright (c) 2004--2016  R Schlicht `<w.m.l at gmx.net>`
+Copyright (c) 2004--2017  R Schlicht `<w.m.l at gmx.net>`
 ------------------------------------------------------

Modified: trunk/Master/texmf-dist/doc/latex/microtype/microtype.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/source/latex/microtype/microtype-utf.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/microtype/microtype-utf.dtx	2017-07-13 23:11:24 UTC (rev 44790)
+++ trunk/Master/texmf-dist/source/latex/microtype/microtype-utf.dtx	2017-07-13 23:12:08 UTC (rev 44791)
@@ -2,11 +2,11 @@
 % ^^A messages to WinEdt:
 % !Mode:: "TeX:DTX:UK"
 % !smartQuote:: "English"
-% !DTXversion:: "2.6a"
+% !DTXversion:: "2.7"
 % ------------------------------------------------------------------------
 %                       The `microtype' package
 %         Subliminal refinements towards typographical perfection
-%           Copyright (c) 2004--2016 R Schlicht <w.m.l at gmx.net>
+%           Copyright (c) 2004--2017 R Schlicht <w.m.l at 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
@@ -27,9 +27,9 @@
 %
 \ProvidesFile
 %<*driver>
-    {\jobname.dtx}[2016/05/14 v2.6a]
+    {\jobname.dtx}[2017/07/07 v2.7]
 %</driver>
-%<CharisSIL>  {mt-CharisSIL.cfg}[2013/03/13 v1.0 microtype config. file: Charis SIL (RS)]
+%<CharisSIL>  {mt-CharisSIL.cfg}[2017/07/07 v1.1 microtype config. file: Charis SIL (RS)]
 %<LatinModernRoman>  {mt-LatinModernRoman.cfg}[2013/03/13 v1.0 microtype config. file: Latin Modern Roman (RS)]
 %<PalatinoLinotype>  {mt-PalatinoLinotype.cfg}[2012/03/10 v1.0 microtype config. file: Palatino Linotype and similar fonts (LBD)]
 %<*driver>
@@ -140,7 +140,7 @@
 %   \item {\LMR
 %           Latin Modern Roman}
 %   \item {\CharisSIL
-%           Charis <SIL>}\footnote{Available at \url{http://scripts.sil.org/CharisSILfont}.}
+%           Charis <SIL>}\footnote{Available at \url{http://software.sil.org/charis}.}
 %   \item {\PalatinoLinotype
 %           Palatino Linotype}\footnote{These settings have been contributed by
 %                                       \contributor Loren B. Davis <davislo\at eecs.oregonstate.edu>.}
@@ -985,10 +985,53 @@
 %}
 %    \begin{macrocode}
    }
+%    \end{macrocode}
+% The small caps glyph names in Charis <SIL> have changed with version 5.0
+% of the font. We try to get the names right both with \luatex\ (where we
+% can simply query the font version) and with \xetex\ (where we check for
+% glyph name).
+%\changes{v2.7}{2017/07/06}{automatically choose correct names for Charis SIL small caps
+%                            (reported by `\contributor ltcomdata <@\at @>')}
+%                            ^^A https://tex.stackexchange.com/questions/324294/
+%    \begin{macrocode}
 
+ % quick and dirty -- maybe we'll promote this to a
+ % regular key some time
+\define at key{MT at pr@c}{command}{\csname #1\endcsname}
+
+ % glyph names have changed with version 5.0 of Charis SIL:
+ % before: /a.SC, /b.SC, ...
+ % after:  /a.sc, /b.sc, ...
+\ifx\MT at lua\@undefined
+  \gdef\MT at get@CHARIS at SC{
+    % test whether glyph "a.sc" exists
+    \ifnum\numexpr\XeTeXglyphindex "a.sc"\relax > 0
+      \gdef\MT at CHARIS@SC{sc}%
+    \else
+      \gdef\MT at CHARIS@SC{SC}%
+    \fi
+  }
+\else
+  \gdef\MT at get@CHARIS at SC{
+    \gdef\MT at CHARIS@SC{\MT at lua{
+      % check font version
+% --  why doesn't this work?:
+%     f = font.getfont(font.current());
+%     i = fontloader.info(f.filename);
+%     if (tonumber(i.version) < 5) then;
+      if (tonumber(fontloader.info(font.getfont(font.current()).filename).version) < 5) then;
+        tex.print("SC");
+      else;
+        tex.print("sc");
+      end
+    }}
+  }
+\fi
+
 \SetProtrusion
    [ name     = Charis-sc,
-     load     = Charis-default   ]
+     load     = Charis-default,
+     command  = {MT at get@CHARIS at SC} ]
    { encoding = {EU1,EU2,TU},
      family   = Charis SIL,
      shape    = {sc}  }
@@ -997,24 +1040,24 @@
 %{\setmacrofont\CharisSIL
 %    \begin{macrocode}
     % ᴀ = {100,100}, % etc., doesn't work with \textsc
-     /a.SC = {100,100},
-     /c.SC = {50,  },
-     /d.SC = {  ,50},
-     /f.SC = {  ,50},
-     /g.SC = {50,  },
-     /j.SC = {100, },
-     /k.SC = {  ,50},
-     /l.SC = {  ,50},
-   /f_l.SC = {  ,50},
-     /o.SC = {50,50},
-    /oe.SC = {50,  },
-     /q.SC = {50,70},
-     /r.SC = {  ,50},
-     /t.SC = {50,100},
-     /v.SC = {50,50},
-     /w.SC = {50,50},
-     /x.SC = {50,50},
-     /y.SC = {50,50}
+     /a.\MT at CHARIS@SC = {100,100},
+     /c.\MT at CHARIS@SC = {50,  },
+     /d.\MT at CHARIS@SC = {  ,50},
+     /f.\MT at CHARIS@SC = {  ,50},
+     /g.\MT at CHARIS@SC = {50,  },
+     /j.\MT at CHARIS@SC = {100, },
+     /k.\MT at CHARIS@SC = {  ,50},
+     /l.\MT at CHARIS@SC = {  ,50},
+   /f_l.\MT at CHARIS@SC = {  ,50},
+     /o.\MT at CHARIS@SC = {50,50},
+    /oe.\MT at CHARIS@SC = {50,  },
+     /q.\MT at CHARIS@SC = {50,70},
+     /r.\MT at CHARIS@SC = {  ,50},
+     /t.\MT at CHARIS@SC = {50,100},
+     /v.\MT at CHARIS@SC = {50,50},
+     /w.\MT at CHARIS@SC = {50,50},
+     /x.\MT at CHARIS@SC = {50,50},
+     /y.\MT at CHARIS@SC = {50,50}
 %    \end{macrocode}
 %}
 %    \begin{macrocode}

Modified: trunk/Master/texmf-dist/source/latex/microtype/microtype.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/microtype/microtype.dtx	2017-07-13 23:11:24 UTC (rev 44790)
+++ trunk/Master/texmf-dist/source/latex/microtype/microtype.dtx	2017-07-13 23:12:08 UTC (rev 44791)
@@ -2,11 +2,11 @@
 % ^^A messages to WinEdt:
 % !Mode:: "TeX:DTX:UK"
 % !smartQuote:: "English"
-% !DTXversion:: "2.6a"
+% !DTXversion:: "2.7"
 % ------------------------------------------------------------------------
 %                       The `microtype' package
 %         Subliminal refinements towards typographical perfection
-%           Copyright (c) 2004--2016 R Schlicht <w.m.l at gmx.net>
+%           Copyright (c) 2004--2017 R Schlicht <w.m.l at 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
@@ -38,7 +38,7 @@
 %<luatex-def>  {microtype-luatex.def}
 %<xetex-def>  {microtype-xetex.def}
 %<*package|letterspace|m-t|pdftex-def|luatex-def|xetex-def>
-  [2016/05/14 v2.6a
+  [2017/07/07 v2.7
 %<package>   Micro-typographical refinements
 %<letterspace>   Robust letterspacing
 %<m-t>   microtype main configuration file
@@ -48,6 +48,17 @@
 %<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.7",
+%<luafile>    date         = "2017/07/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)]
@@ -172,12 +183,12 @@
   \def\match{\textbullet}
   \usepackage{amssymb} % \varnothing
   \let\OrigTeX\TeX
-  \def\TeX{\textoractual{\OrigTeX}{TeX}}
+  \DeclareRobustCommand\TeX{\textoractual{\OrigTeX}{TeX}}
   \setlength\textheight{49\baselineskip}
 \else
   \def\bfdefault{b}
   \def\Module#1{{\color{theblue}\textoractual{$\langle$}{<}\textit{#1}\textoractual{$\rangle$}{>}}}
-  \def\TeX{\textoractual{T\kern-.1em\lower.4ex\hbox{E}\kern-.075emX\@}{TeX}}
+  \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 at mathfonts\fontsize\sf at size\z@\math at fontsfalse\selectfont A}%
     \vss}}}{La}\kern-.075em\TeX}
@@ -430,6 +441,7 @@
 \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}%
@@ -530,7 +542,7 @@
 % fancy PDF document
 \ifpdf
   \ifx\eTeXversion\@undefined \else % errors when not using etex (conflict with multicol)
-    \ifx\pdfcolorstack\@undefined   % no longer required with pdftex 1.40
+    \ifnum\pdftexversion < 140      % no longer required with pdftex 1.40
       \usepackage{pdfcolmk}
   \fi\fi
   \usepackage[bookmarks,bookmarksopen,pdfdisplaydoctitle,
@@ -547,7 +559,7 @@
     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--2016 R Schlicht\012%
+    pdfcopyright={\textcopyright\ 2004--2017 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%
@@ -701,17 +713,15 @@
      \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}{pdfTeX}}
-\DeclareRobustCommand\luatex{\texorpdfstring{Lua\kern-.05em\TeX}{LuaTeX}}
-\DeclareRobustCommand\etex{\mbox{e-\kern-.075em\TeX}}
+\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}
-\def\xe{% also reflect the initial `X'?
-  \textoractual{\@reflect{X}\lower.4ex\hbox{\kern-.066em\@reflect{E}}}{Xe}}
-\DeclareRobustCommand\xetex{\xe\kern-.1em\TeX}
-\def\texlive{\TeX~Live}
-\def\miktex{MiK\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\,}
@@ -769,10 +779,10 @@
 %\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.
+% \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.
@@ -792,7 +802,7 @@
 % other extensions (see section~\ref{sec:lettersp}).
 %
 %\bigskip\noindent
-% This package is copyright \textcopyright\ 2004\kern.09em--2016 R Schlicht.
+% This package is copyright \textcopyright\ 2004\kern.09em--2017 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},
@@ -965,7 +975,7 @@
 % 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, in <DVI>
+% 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
@@ -1007,6 +1017,7 @@
 % 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}
@@ -1049,12 +1060,12 @@
 %    & $\geq$  1.20  & <DVI>       & ! & ? & _ & _ & _ & _\\
 %    &               & <PDF>       & ! & ! & ! & _ & _ & _\\
 %    & $\geq$  1.40  & <DVI>       & ! & ? & _ & ? & ? & _\\
-%    &               & <PDF>       & ! & ! & ! & ? & ? & ?\,\textsuperscript{\itshape a}\\
+%    &               & <PDF>       & ! & ! & ! & ? & ? & ?\\^^A\,\textsuperscript{\itshape a}\\
 %\cmidrule(r){1-3}
 % \luatex ^^A we will have to re-model kerning, spacing and tracking with \luatex
 %    & $\geq$  0.30  & <DVI>       & ! & ? & _ & _ & _ & _\\
 %    &               & <PDF>       & ! & ! & ! & _ & _ & _\\
-%    & $\geq$  0.62  & <DVI>       & ! & ? & _ & _ & _ & _\\
+%    & $\geq$  0.62  & <DVI>       & ! & ? & ?\,\textsuperscript{\itshape a} & _ & _ & ?\,\textsuperscript{\itshape a}\\
 %    &               & <PDF>       & ! & ! & ! & _ & _ & ?\\
 %\cmidrule(r){1-3}
 % \let\textoractual\@firstoftwo ^^A why?
@@ -1068,7 +1079,8 @@
 % ? = not enabled\quad
 % _ = not available
 %\hfill
-% \textit{a}\quad $\geq$ 1.40.4 recommended
+% ^^A \textit{a}\quad $\geq$ 1.40.4 recommended
+% \textit{a}\quad for legacy (<TFM>) fonts only
 %\vskip3pt
 %\end{minipage}^^A
 %}\kern-\dimexpr\fboxsep+\fboxrule\relax ^^A end \fcolorbox
@@ -1116,8 +1128,8 @@
 % instances of the fonts may be calculated automatically and at run-time instead
 % of the user having to prepare the instances 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>; otherwise, it will be disabled.
-% If \opt{auto} is set to false, the fonts for all expansion steps must exist
+% and the output mode is <PDF>.
+% 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?)
@@ -1127,7 +1139,8 @@
 %
 %\changes{v1.9}{2005/08/27}{add remark about Type\,1 fonts required for
 %                           automatic font expansion}
-% Automatic font expansion does not work with bitmap fonts. Therefore, if you
+%\changes{v2.7}{2017/07/06}{add remark about automatic font expansion with \texttt{dvilualatex}}
+% With \pdftex, automatic font expansion does not work with bitmap fonts. Therefore, if you
 % are using the Computer Modern Roman fonts in <T1> encoding,
 %\iffalse
 % \footnote{
@@ -1135,7 +1148,10 @@
 %     no other way related than that both start with a `T' and end with a `1'.}
 %\fi
 % you should either install the \pkg{cm-super} fonts or use the Latin Modern
-% fonts (package \pkg{lmodern}).
+% fonts (package \pkg{lmodern}). With \luatex, automatic expansion even works
+% in <DVI> mode, however, because postprocessing programs like |dvips| or
+% |dvipdfmx| are (at the moment of this writing) not capable of dealing with
+% OpenType fonts, only for legacy fonts.
 %
 %\medskip
 %\Describe{Option}{stretch}{:integer}[20]
@@ -1185,6 +1201,7 @@
 % to +1000.
 %
 %
+%\enlargethispage{2\baselineskip} ^^A layout
 %\subsection{Miscellaneous options}\label{sub:options-misc}
 %
 %\Describe{Option}{DVIoutput}{true,*false}
@@ -1521,14 +1538,14 @@
 % 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 with an asterisk will be translated immediately
+% 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 both settings for
-% the current family (say, |T1/cmr///|) and settings for italic fonts in the
-% normal weight (|T1//m/it/|) exist, those for the |cmr| family would
-% apply.
+% 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.
@@ -1908,6 +1925,8 @@
 % is, whenever a particular character appears in the text, the specified
 % kerning will be inserted, regardless of which character precedes resp.
 % follows it.
+% (Put in another way, this feature allows to modify the left or right
+% \textit{sidebearings} of specific glyphs.)
 %
 %\emptypdfpageresources ^^A layers of letterspacing illustration
 %
@@ -1914,8 +1933,12 @@
 % 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|'. This restriction of \pdftex\
-% will hopefully be lifted some time.
+% 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 http://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
@@ -2114,7 +2137,7 @@
 %      & <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|)}
+%                                    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|)
@@ -2131,26 +2154,27 @@
 %      & 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|),
-%                                           <FPL> Neu (|fp9x|, |fp9j|)}
+%                                           \pkg{newpx}, <FPL> Neu (|fp9x|, |fp9j|)}
 %      & <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{qfonts}/QuasiTimes, \TeX\ Gyre Termes (|qtm|),
+%                                        \pkg{newtx}, \pkg{tempora}}
 %      & <OT1>, <OT4>, <T1>, <LY1>, <QX>, (<TS1>)\fnref{fn:incmpl}
 %      & n, it, (sl)\fnref{fn:it-sl}, sc \\
 % Latin Modern Roman
-%      & <EU1/2>, <TU> [Latin, Greek]
+%      & <EU1>/<2>, <TU> [Latin, Greek]
 %      & n, it, (sl)\fnref{fn:it-sl}\\
 % Charis <SIL>
-%      & <EU1/2>, <TU> [Latin, Cyrillic, Greek]
+%      & <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]
+%      & <EU1>/<2>, <TU> [Latin, Cyrillic, Greek]
 %      & n, it, sc, si\\
 %\fi
 % Palatino Linotype\footnote{Aliases: \TeX\ Gyre Pagella, Palatino <LT> Std, Palatino}
-%      & <EU1/2>, <TU> [Latin]
+%      & <EU1>/<2>, <TU> [Latin]
 %      & n, it, sc\\
 % Computer Modern math (|cmsy|, |cmm|)\footnote{Aliases: Latin Modern (|lmsy|, |lmm|)}
 %      & <OML>/<OMS>
@@ -2771,6 +2795,7 @@
 %  \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>,
@@ -2779,11 +2804,15 @@
 %  \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>,
@@ -2790,7 +2819,7 @@
 %  \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 http://tex.stackexchange.com/users/215/seamus
+%  \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>,
@@ -2797,21 +2826,28 @@
 %  \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 http://tex.stackexchange.com/users/17609/razorxsr
-% `\contributor Dave              <@\at @>', ^^A http://tex.stackexchange.com/users/15562/dave
+% `\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 http://tex.stackexchange.com/users/9391/uli
-%  \contributor Sam Mason         <sam\at samason.me.uk>, ^^A http://tex.stackexchange.com/users/16433/sam-mason
-% `\contributor kleenstar         <@\at @>', ^^A http://tex.stackexchange.com/users/56468/kleenstar
-% `\contributor Henning           <@\at @>', ^^A http://tex.stackexchange.com/users/64603/henning
+% `\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 http://tex.stackexchange.com/users/16809/max
-% `\contributor HcN               <@\at @>'  ^^A http://tex.stackexchange.com/users/87090/hcn
+% `\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>,
 % and
-%  \contributor Will Robertson    <will\at wspr.io>.
+% `\contributor jcr               <@\at @>'. ^^A https://tex.stackexchange.com/users/56514/jcr
 %
 %
 %\iffalse
@@ -2885,7 +2921,7 @@
 % \bibitem[\pdftex\ manual]{pdftexman}
 %   \thanh, Sebastian Rahtz, Hans Hagen, Hartmut Henkel, Pawe\l\ Jackowski, Martin Schr\"oder,
 %   \emph{The \pdftex\ user manual},
-%   \newblock 25 April 2016.
+%   \newblock 20 April 2017.
 %   \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}
@@ -2903,13 +2939,13 @@
 % \bibitem[\pkg{fontspec}]{fontspec}
 %   Will Robertson, Khaled Hosny,
 %    \emph{The \pkg{fontspec} package: Font selection for \xe\LaTeX\ and Lua\LaTeX},
-%    \newblock 1 February 2016.
+%    \newblock 31 March 2017.
 %    \newblock (\ctanpkgurl{fontspec})
 %
 % \bibitem[\pkg{luaotfload}]{luaotfload}
 %   \'Elie Roux, Khaled Hosny, Philipp Gesang,
 %    \emph{The \pkg{luaotfload} package},
-%    \newblock 21 April 2016.
+%    \newblock 29 January 2017.
 %    \newblock (\ctanpkgurl{luaotfload})
 %
 % \bibitem[\pkg{pdfcprot}]{pdfcprot}
@@ -2960,10 +2996,16 @@
 %
 %\begin{History}
 %
-%\VersionDate{\expandafter\@gobble\fileversion}{\filedate}
+%\Version{\expandafter\@gobble\fileversion}{\filedate}
+%  \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\ 0.85
+%  \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|'
@@ -3081,7 +3123,6 @@
 %        \refsection{\ref{sub:options-cmd}}
 %  \item Protrusion settings for <T5> encoded Charter
 %
-%\ifcmr\else\pagebreak\fi ^^A layout
 %\Version{1.9}{2005/10/28}
 %  \item New command \cs{DisableLigatures} to disable ligatures
 %        (\pdftex\ $\geq$ 1.30)
@@ -3288,24 +3329,24 @@
 %\DoNotIndex{\eplain,\usepkg at pkg}                                            ^^A eplain
 %\DoNotIndex{\@backslashchar,\@cclv,\@cclvi,\@classoptionslist,\@currext,
 %  \@currname,\@defaultunits,\@empty,\@expandtwoargs,\@firstofone,\@firstoftwo,
-%  \@gobble,\@gobbletwo,\@ifl at aded,\@ifpackagelater,\@ifpackageloaded,\@ifstar,
-%  \@ifundefined,\@let at token,\@m,\@makeother,\@minus,\@nameuse,\@ne,\@nil,\@nnil,
-%  \@onelevel at sanitize,\@onlypreamble,\@percentchar,\@pkgextension,\@plus,
-%  \@ptionlist,\@removeelement,\@secondoftwo,\@spaces,\@sptoken,\@tempa,\@tempb,
-%  \@tempc,\@tempcnta,\@tempcntb,\@tempdima,\@typeset at protect,\@undefined,
-%  \@unprocessedoptions,\@unusedoptionlist,\@xobeysp,\check at icr,\color at begingroup,
-%  \color at endgroup,\g at addto@macro,\hmode at bgroup,\m at ne,\maybe at ic,\maybe at ic@,
-%  \nfss at text,\not at math@alphabet,\on at line,\p@,\set at display@protect,\strip at prefix,
-%  \strip at pt,\tw@,\z@,\z at skip,\zap at space,\active,\documentclass,\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 at update,\cf at encoding,\f at encoding}
+%  \@gobble,\@gobbletwo,\@ifclassloaded,\@ifl at t@r,\@ifl at aded,\@ifpackagelater,
+%  \@ifpackageloaded,\@ifstar,\@ifundefined,\@let at token,\@m,\@makeother,
+%  \@minus,\@nameuse,\@ne,\@nil,\@nnil,\@onelevel at sanitize,\@onlypreamble,
+%  \@percentchar,\@pkgextension,\@plus,\@ptionlist,\@removeelement,\@secondoftwo,
+%  \@spaces,\@sptoken,\@tempa,\@tempb,\@tempc,\@tempcnta,\@tempcntb,\@tempdima,
+%  \@typeset at protect,\@undefined,\@unprocessedoptions,\@unusedoptionlist,
+%  \@xobeysp,\check at icr,\color at begingroup,\color at endgroup,\g at addto@macro,
+%  \hmode at bgroup,\m at ne,\maybe at ic,\maybe at ic@,\nfss at text,\not at math@alphabet,
+%  \on at line,\p@,\set at display@protect,\strip at prefix,\strip at pt,\tw@,\z@,\z at skip,
+%  \zap at space,\active,\documentclass,\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 at update,\cf at encoding,\f at encoding}
 %^^A\DoNotIndex{\add at accent,\curr at fontshape,\define at newfont,\do at subst@correction,
-%^^A  \f at size,\font at name,\glb at currsize,\normalfont,\pickup at font,\selectfont,
-%^^A  \set at fontsize,\showhyphens}                                            ^^A latex
+%^^A  \every at math@size,\f at size,\font at name,\glb at currsize,\glb at settings,\normalfont,
+%^^A  \pickup at font,\selectfont,\set at fontsize,\showhyphens}                   ^^A latex
 %\DoNotIndex{\normalpdfoutput,\normalpdftexversion,\normalpdftexrevision}    ^^A tex live 2004
 %\DoNotIndex{\foreign at language,\languagename,\select at language,\shorthandoff} ^^A babel
 %\DoNotIndex{\percentsign}                                                   ^^A babel/spanish,galician,mexican
@@ -3704,9 +3745,8 @@
 %</plain>
 %    \end{macrocode}
 %\end{macro}
-%\begin{macro}{\MT at maybe@etex}
-%\changes{v2.2}{2007/05/01}{use catcode trickery}
-%\changes{v2.3a}{2007/12/29}{removed}
+%\changes{v2.2}{2007/05/01}{use catcode trickery for \etex\ test}
+%^^A\changes{v2.3a}{2007/12/29}{removed} ^^A \MT at maybe@etex
 % For definitions that depend on \etex\ features.
 %    \begin{macrocode}
 \ifcase 0%
@@ -3722,7 +3762,6 @@
 %<debug>^^Q not
 %<debug>  etex}
 %    \end{macrocode}
-%\end{macro}
 %\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
@@ -3899,7 +3938,8 @@
 % \item + \cmd\directlua\ without state number ($\geq$~0.36)
 % \item + \cmd\letterspacefont\ ($\geq$~0.62)
 % \item + almost all of the \pdftex\ primitives have been renamed ($\geq$~0.85)
-% \item + \cmd\protrusionboundary\ [not yet supported] ($\geq$~0.90)
+% \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)}
@@ -3915,14 +3955,17 @@
 %\changes{v2.3d}{2009/03/25}{update for \luatex\ 0.36}
 %    \begin{macrocode}
 \def\MT at lua{\directlua}
-\def\MT at luatex@no{4}
-\ifnum\luatexversion<85
-  \def\MT at luatex@no{3}
-  \ifnum\luatexversion<62
-    \def\MT at luatex@no{2}
-    \ifnum\luatexversion<36
-      \def\MT at lua{\directlua0}
-      \def\MT at luatex@no{1}
+\def\MT at luatex@no{5}
+\ifnum\luatexversion<90
+  \def\MT at luatex@no{4}
+  \ifnum\luatexversion<85
+    \def\MT at luatex@no{3}
+    \ifnum\luatexversion<62
+      \def\MT at luatex@no{2}
+      \ifnum\luatexversion<36
+        \def\MT at lua{\directlua0}
+        \def\MT at luatex@no{1}
+      \fi
     \fi
   \fi
 \fi
@@ -4160,12 +4203,14 @@
 %\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 at telecom-bretagne.eu>
-% We use the \pkg{luatexbase} package to load the module.
+% 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>
-\RequirePackage{luatexbase}
+\@ifl at t@r\fmtversion{2016/01/01}\relax{\RequirePackage{luatexbase}}
 %    \end{macrocode}
-% Additionally, we load \pkg{luaotfload}, because some of its functions are
+% 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.
@@ -4172,7 +4217,7 @@
 %\changes{v2.6}{2013/06/19}{load \pkg{luaotfload} with \luatex}
 %    \begin{macrocode}
 \RequirePackage{luaotfload}
-\RequireLuaModule{microtype}
+\MT at lua{require("microtype")}
 %</luatex-def>
 %    \end{macrocode}
 % Here it begins. The module was contributed by \'Elie Roux.
@@ -4181,18 +4226,6 @@
 %    \begin{macrocode}
 %<*luafile>
 
-microtype        = microtype or {}
-local microtype  = microtype
-microtype.module = {
-    name         = "microtype",
-    version      = "2.6a",
-    date         = "2016/05/14",
-    description  = "microtype module.",
-    author       = "E. Roux, R. Schlicht and P. Gesang",
-    copyright    = "E. Roux, R. Schlicht and P. Gesang",
-    license      = "LPPL",
-}
-
 local err, warn, info, log = luatexbase.provides_module(microtype.module)
 microtype.warning = warn
 
@@ -4200,8 +4233,14 @@
 local match      = string.match
 local tex_write  = tex.write
 
+local catpackage
+if luatexbase.registernumber then
+  catpackage = luatexbase.registernumber("catcodetable at atletter") -- LaTeX
+else
+  catpackage = luatexbase.catcodetables.CatcodeTableAtletter   -- luatexbase
+end
 function microtype.sprint (...)
-  tex.sprint(luatexbase.catcodetables['latex-package'], ...)
+  tex.sprint(catpackage, ...)
 end
 
 %</luafile>
@@ -4985,6 +5024,17 @@
     Disabling `\MT at MT', since it wouldn't work}%
   \MT at 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 at 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 at setup@}
 %\changes{v1.9a}{2005/11/21}{defer setup until the end of the preamble}
 %\changes{v1.9e}{2006/07/06}{empty \cs{MT at setup@} after use
@@ -5052,7 +5102,7 @@
 % Beginning with \pdftex\ version 1.21b together with \file{ledpatch.sty} as of
 % 2005/06/02 (v0.4), character protrusion will work at last.
 %
-% Peter Wilson was so kind to provide the \cmd\l at dunhbox@line\ hook in
+% \contributor Peter Wilson <herries.press\at earthlink.net> was so kind to provide the \cmd\l at 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\
@@ -5153,6 +5203,30 @@
 %    \end{macrocode}
 %\end{macro}
 %\end{macro}
+%\begin{macro}{\MT at maybe@gobble at with@tikz}
+%\begin{macro}{\MT at 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 at 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 at 12g2000pri.googlegroups.com>, 2009/11/02
+%\changes{v2.7}{2016/06/08}{compatibility with \pkg{tikz} (again)}
+% If \cmd\tikz at 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 at afteraftergroup}, and we
+% don't need it for \letterspace.
+%    \begin{macrocode}
+%<*package>
+\let\MT at maybe@gobble at with@tikz\@firstofone
+\def\MT at tikz@setup{%
+  \def\MT at maybe@gobble at with@tikz{%
+    \ifnum\tikz at expandcount>\z@
+      \expandafter\@gobble
+    \else
+      \expandafter\@firstofone
+    \fi}}
+%    \end{macrocode}
+%\end{macro}
+%\end{macro}
 %\begin{macro}{\MT at setupfont@hook}
 % This hook will be executed every time a font is set up (inside a group).
 %
@@ -5166,7 +5240,6 @@
 % (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}
-%<*package>
 \def\MT at setupfont@hook{%
 %    \end{macrocode}
 %\iffalse
@@ -5230,6 +5303,7 @@
   \MT at with@package at T{tex4ht}    \MT at if@true
   \MT at with@package at T{mathastext}\MT at if@true
   \ifMT at if@\MT at restore@p at h\fi
+  \MT at with@package at T{tikz}\MT at tikz@setup
 }
 %    \end{macrocode}
 %\end{macro}
@@ -5301,7 +5375,7 @@
   \MT at with@package at T{hyperref}{%
     \pdfstringdefDisableCommands{%
 %<*package>
-      \let\pickup at font\MT at orig@pickupfont
+      \MT at ltx@pickupfont
       \let\textmicrotypecontext\@secondoftwo
       \let\microtypecontext\@gobble
 %</package>
@@ -5378,6 +5452,7 @@
     \fi}%
 %</plain>
 %<*package>
+  \MT at with@package at T{tikz}\MT at tikz@setup
 %    \end{macrocode}
 %\changes{v2.1}{2007/01/15}{compatibility with \pkg{pinyin}: disable \microtype\ in \cmd\py at macron\
 %                           (reported by \contributor Sven Naumann <svenau\at gmx.net>)}
@@ -5394,14 +5469,14 @@
     \let\MT at orig@py at macron\py at macron
     \@ifpackagelater{pinyin}{2005/08/11}{% 4.6.0
       \def\py at macron#1#2{%
-        \let\pickup at font\MT at orig@pickupfont
+        \MT at ltx@pickupfont
         \MT at orig@py at macron{#1}{#2}%
-        \let\pickup at font\MT at pickupfont}%
+        \MT at MT@pickupfont}%
     }{%
       \def\py at macron#1{%
-        \let\pickup at font\MT at orig@pickupfont
+        \MT at ltx@pickupfont
         \MT at orig@py at macron{#1}%
-        \let\pickup at font\MT at pickupfont}%
+        \MT at MT@pickupfont}%
     }%
   }%
 %</package>
@@ -5531,6 +5606,7 @@
 %                                                               ^^A private mail, 2008/04/14
 %    \begin{macrocode}
   \xdef\MT at font@copy{\csname\MT@@font/\MT at pr@context/\MT at ex@context\endcsname}%
+  \expandafter\ifx\MT at font@copy\relax
 %    \end{macrocode}
 %\end{macro}
 %\begin{macro}{\MT at font@orig}
@@ -5537,7 +5613,6 @@
 % \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}
-  \expandafter\ifx\MT at font@copy\relax
     \edef\MT at font@orig{\csname\expandafter\string\font at name @orig\endcsname}%
     \expandafter\ifx\MT at font@orig\relax
       \MT at exp@two at c\MT at glet\MT at font@orig\font at name
@@ -5875,7 +5950,7 @@
   \MT at if@list at exists{%
     \ifMT at nofamily
       \MT at ifdefined@n at TF{\MT at encoding-\MT at family-settings}\relax{%
-        \MT at info@nl{Loading generic settings for font family\MessageBreak
+        \MT at info@nl{Loading generic protrusion settings for font family\MessageBreak
                     `\MT at family' (encoding: \MT at encoding).\MessageBreak
                     For optimal results, create family-specific settings.\MessageBreak
                     See the microtype manual for details}%
@@ -6555,11 +6630,14 @@
 %\end{macro}
 %\end{macro}
 %\begin{macro}{\MT at reset@ef at codes}
-% However, this is only necessary for versions prior to~1.20.
+% 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 at requires@pdftex4{
+%<pdftex-def>\MT at requires@pdftex4
+%<luatex-def>\MT at requires@luatex5
+{
   \def\MT at reset@ef at codes{%
     \ifnum\MT at ex@factor@=\@m \else
       \MT at reset@ef at codes@
@@ -6566,13 +6644,8 @@
     \fi
   }
 }{
-%</pdftex-def>
-%    \end{macrocode}
-% ^^A this is SO wrong!
-%\todo{do it right for \luatex}
-%    \begin{macrocode}
   \let\MT at reset@ef at codes\MT at reset@ef at codes@
-%<pdftex-def>}
+}
 %    \end{macrocode}
 %\end{macro}
 %\begin{macro}{\MT at ex@split at val}
@@ -7134,13 +7207,10 @@
 %\end{macro}
 % Stuff to be done after the letterspace group. The \letterspace\ package
 % only adjusts the kerning.
-%\changes{v2.6}{2014/09/07}{fix: ensure to set up math fonts (reported by \contributor kleenstar <@\at @>)}
-%                           ^^A http://tex.stackexchange.com/questions/187655/microtype-gives-wrong-letterspacing-in-math-mode
 %    \begin{macrocode}
     \MT at afteraftergroup{%
       \MT at set@curr at os
       \MT at set@curr at ok
-      \MT at glet\noexpand\glb at currsize\noexpand\@empty
       \noexpand\MT at tr@outer at r
     }%
 %</pdftex-def|luatex-def>
@@ -7156,12 +7226,14 @@
 %\changes{v2.5a}{2013/05/15}{fix: get outer kerning and spacing of nested letterspacing right}
 %    \begin{macrocode}
 \def\MT at afteraftergroup#1{%
-  \MT at ifdefined@n at TF{MT at aftergroup@\number\currentgrouplevel}\relax{%
-  \MT at exp@cs\xdef{MT at aftergroup@\number\currentgrouplevel}%
-    {\MT at exp@cs\MT at glet{MT at aftergroup@\number\currentgrouplevel}\noexpand\@undefined#1}%
-  \expandafter\aftergroup\expandafter\aftergroup\MT at exp@cs\aftergroup
-    {MT at aftergroup@\number\currentgrouplevel}%
-  }%
+%<!letterspace>  \MT at maybe@gobble at with@tikz{%
+    \MT at ifdefined@n at TF{MT at aftergroup@\number\currentgrouplevel}\relax{%
+      \MT at exp@cs\xdef{MT at aftergroup@\number\currentgrouplevel}%
+        {\MT at exp@cs\MT at glet{MT at aftergroup@\number\currentgrouplevel}\noexpand\@undefined#1}%
+      \expandafter\aftergroup\expandafter\aftergroup\MT at exp@cs\aftergroup
+        {MT at aftergroup@\number\currentgrouplevel}%
+    }%
+%<!letterspace>  }%
 }
 %</pdftex-def|luatex-def|letterspace>
 %    \end{macrocode}
@@ -7169,13 +7241,16 @@
 %\begin{macro}{\MT at ls@fontspec at colon}
 %\begin{macro}{\MT at ls@fontspec at 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 at ls@fontspec at colon#1:#2:#3\@nil{#1:#2}
+\def\MT at ls@fontspec at colon#1:#2:#3:#4\@nil{\ifx\\#3\\#1:#2\else#1:#2:#3\fi}
 \def\MT at ls@fontspec at font#1 #2\@nil{%
-  "\MT at ls@fontspec at colon#1::\@nil
+  "\MT at ls@fontspec at colon#1:::\relax\@nil
     kernfactor=\MT at minus \ifnum\MT at letterspace@=1000 1\else 0.%
          \ifnum\MT at minus\MT at letterspace@<100 0\fi
          \ifnum\MT at minus\MT at letterspace@<10  0\fi
@@ -7267,11 +7342,19 @@
 % another text switch, of course).
 %\changes{v2.5}{2012/11/14}{fix: ensure to set up math fonts (reported by \contributor RazorXsr <@\at @>)}
 %                           ^^A http://tex.stackexchange.com/questions/82686/settracking-in-the-math-environment
-% Still, we have to (globally) ensure that math fonts are set up again.
+%\changes{v2.6}{2014/09/07}{fix: ensure to set up math fonts (reported by \contributor kleenstar <@\at @>)}
+%                           ^^A http://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>)}
+% Setting \cmd\glb at currsize\ to \cmd\@empty\ (our previous solution) could
+% throw us into an infinite loop (\eg, with the \pkg{psnfss} packages,
+% via \cmd\every at math@size), so we issue \cmd\glb at settings\ instead.
 %    \begin{macrocode}
 \DeclareRobustCommand\lsstyle{%
   \not at math@alphabet\lsstyle\textls
-  \MT at glet\glb at currsize\@empty
+%<pdftex-def|luatex-def>  \MT at maybe@gobble at with@tikz{\aftergroup\glb at settings}%
 %<pdftex-def|luatex-def>  \def\MT at feat{tr}%
   \let\MT at tracking\MT at set@tr at codes
   \selectfont
@@ -7300,7 +7383,6 @@
 %\changes{v2.2}{2007/02/25}{always defined}
 %\changes{v2.3}{2007/11/03}{redone: extract outer kerns from current letterspacing
 %                           amount}
-%\begin{macro}{\MT at lslig}
 % 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}
@@ -7316,7 +7398,6 @@
 }
 %    \end{macrocode}
 %\end{macro}
-%\end{macro}
 %\begin{macro}{\MT at ls@basefont}
 %\begin{macro}{\MT at get@ls at basefont}
 %\changes{v2.1}{2007/01/19}{redone: use \cmd\pdfmatch\ to make it bullet-proof}
@@ -7509,32 +7590,15 @@
 }
 %    \end{macrocode}
 %\end{macro}
+%\begin{macro}{\MT at tr@outer at next}
 %\begin{macro}{\MT at tr@outer at r}
-%\changes{v2.3e}{2009/11/02}{compatibility with \pkg{tikz} (first reported by
-%                           \contributor Christian Stark <cstark\at gmx.de>)}       ^^A MID: <7d81lgF2ad3ckU1 at 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 at 12g2000pri.googlegroups.com>, 2009/11/02
 % \microtype\ also adjusts spacing.
-% If \cmd\tikz at expandcount\ is greater than zero, we're inside or at the end of
-% a \pkg{tikz} node, where we don't want to do anything, lest we disturb
-% \pkg{tikz}.
-%    \begin{macrocode}
-\MT at addto@setup{%
-  \@ifpackageloaded{tikz}
-    {\def\MT at tr@outer at r{%
-       \ifnum\tikz at expandcount>\z@ \else
-         \expandafter\MT at tr@outer at r@\fi}}
-    {\let\MT at tr@outer at r\MT at tr@outer at r@}}
-%    \end{macrocode}
-%\end{macro}
-%\begin{macro}{\MT at tr@outer at next}
-%\begin{macro}{\MT at tr@outer at r@}
 % 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 at tr@outer at r@{%
-  \futurelet\MT at tr@outer at next\MT at tr@outer at r@@
+\def\MT at tr@outer at r{%
+  \futurelet\MT at tr@outer at next\MT at tr@outer at r@
 }
 %    \end{macrocode}
 %\end{macro}
@@ -7552,9 +7616,9 @@
 }
 %    \end{macrocode}
 %\end{macro}
-%\begin{macro}{\MT at tr@outer at r@@}
+%\begin{macro}{\MT at tr@outer at r@}
 %    \begin{macrocode}
-\def\MT at tr@outer at r@@{%
+\def\MT at tr@outer at r@{%
   \def\MT at temp*{}%
 %    \end{macrocode}
 % Don't adjust in math mode.
@@ -7586,7 +7650,7 @@
 %    \begin{macrocode}
         \ifhmode\unkern\fi\egroup
         \MT at set@curr at ok \MT at set@curr at os
-        \def\MT at temp*{\afterassignment\MT at tr@outer at r@\let\MT at temp=}%
+        \def\MT at temp*{\afterassignment\MT at tr@outer at r\let\MT at temp=}%
       \else
 %    \end{macrocode}
 % If the next token is \cmd\maybe at ic\ (from an enclosing text command), we
@@ -7610,7 +7674,7 @@
 % doesn't read beyond our group).
 %    \begin{macrocode}
           \MT at if@outer at next\check at icr{%
-            \def\MT at temp*{\aftergroup\MT at tr@outer at r@\check at icr\let\MT at temp=}%
+            \def\MT at temp*{\aftergroup\MT at tr@outer at r\check at icr\let\MT at temp=}%
           }{%
             \MT at if@outer at next\@sptoken{%
               \def\MT at temp* {\ifhmode\hskip\MT at outer@space
@@ -7648,7 +7712,7 @@
 %\begin{macro}{\MT at tr@outer at icr@}
 % Helper macros for the italic correction mess.
 %    \begin{macrocode}
-\def\MT at tr@outer at icr{\afterassignment\MT at tr@outer at icr@\MT at tr@outer at r@}
+\def\MT at tr@outer at icr{\afterassignment\MT at tr@outer at icr@\MT at tr@outer at r}
 \def\MT at tr@outer at icr@{%
   \let\@let at token= \MT at tr@outer at next
   \maybe at ic@
@@ -8841,7 +8905,7 @@
 %\end{macro}
 %\begin{macro}{\MT at is@xchar}
 %\changes{v2.6}{2016/04/23}{update for \pkg{fontspec}'s <TU> encoding}
-% With \pkg{fontspec}'s <TU> encoding, glyphs numbers may be up to four digits.
+% With \pkg{fontspec}'s <TU> encoding, glyph numbers may be up to four digits.
 %\SpecialEscapechar{\/}
 %    \begin{macrocode}
       /def/MT at is@xchar##1|##2\CHAR"##3##4/relax{%
@@ -8895,6 +8959,20 @@
     \expandafter\def\expandafter\MT at char\expandafter{\csname\expandafter
                     \string\csname\MT at encoding\endcsname
                     \MT at detokenize@n{#1}-\MT at 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 at is@uni at comp\MT at char\iffontchar\else\fi\relax
+    \fi
     \expandafter\expandafter\expandafter\MT at is@letter\MT at char\relax\relax
 %    \end{macrocode}
 % Again, \pkg{xunicode}.
@@ -8910,6 +8988,14 @@
 }
 %    \end{macrocode}
 %\end{macro}
+%\begin{macro}{MT at is@uni at comp}
+% Helper for \cs{DeclareUnicodeComposite}.
+%    \begin{macrocode}
+\def\MT at is@uni at comp#1\iffontchar#2\else#3\fi\relax{%
+  \ifx\\#2\\\else\edef\MT at 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 at is@mathchar} defined accordingly, analogous to \cs{MT at is@char} above,
 % to pick up the last two tokens (the \cmd\meaning\ of a \cmd\mathchardef'ed
@@ -9211,11 +9297,18 @@
 %    \end{macrocode}
 %\end{macro}
 %\begin{macro}{\MT at pickupfont}
-% Remember the patched command for later.
+%\begin{macro}{\MT at MT@pickupfont}
+%\begin{macro}{\MT at ltx@pickupfont}
+% Remember the patched command, because we may have to disable
+% ourselves in certain situations.
 %    \begin{macrocode}
   \let\MT at pickupfont\pickup at font
+  \def\MT at MT@pickupfont {\let\pickup at font\MT at pickupfont}%
+  \def\MT at ltx@pickupfont{\let\pickup at font\MT at orig@pickupfont}%
 %    \end{macrocode}
 %\end{macro}
+%\end{macro}
+%\end{macro}
 %\begin{macro}{\do at subst@correction}
 % Additionally, we hook into \cmd\do at subst@correction, which is called if
 % a substitution has taken place, to record the name of the ersatz font.
@@ -9245,9 +9338,9 @@
 %    \begin{macrocode}
   \let\MT at orig@add at accent\add at accent
   \def\add at accent#1#2{%
-    \let\pickup at font\MT at orig@pickupfont
+    \MT at ltx@pickupfont
     \MT at orig@add at accent{#1}{#2}%
-    \let\pickup at font\MT at pickupfont
+    \MT at MT@pickupfont
   }%
 %</package>
 }
@@ -11016,12 +11109,18 @@
       }{%
 %    \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 at ifdefined@n at T{MT@\MT at permutelist @\@tempa\MT at extra@context}{%
-          \MT at warning{\@nameuse{MT at abbr@\MT at permutelist} list
-            `\@nameuse{MT@\MT at permutelist @name}' will override list\MessageBreak
-            `\@nameuse{MT@\MT at permutelist @\@tempa\MT at extra@context}'
-            for font `\@tempa'}%
+          \MT at ifstreq{\csname MT@\MT at permutelist @\@tempa\MT at extra@context\endcsname}%
+             {\csname MT@\MT at permutelist @\csname MT@\MT at permutelist @name\endcsname @load\endcsname}%
+              \relax{%
+            \MT at warning{\@nameuse{MT at abbr@\MT at permutelist} list
+              `\@nameuse{MT@\MT at permutelist @name}' will override list\MessageBreak
+              `\@nameuse{MT@\MT at permutelist @\@tempa\MT at extra@context}'
+              for font `\@tempa'}%
+          }%
         }%
 %<debug>\MT at dinfo@nl{1}{initialising: use list for font \@tempa
 %<debug>                \ifx\MT at extra@context\@empty\else\MessageBreak
@@ -11089,7 +11188,8 @@
 %\end{macro}
 %\begin{macro}{\MT at check@range@}
 % \cmd\@tempb\ and \cmd\@tempc\ are lower resp. upper bound of the new range,
-% \meta{\#2} and \meta{\#3} those of the existing 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 at check@range@#1#2#3{%
   \MT at ifdim{#2}=\m at ne{%
@@ -11131,9 +11231,13 @@
     }%
   }%
   \ifMT at if@
-    \MT at warning{\@nameuse{MT at abbr@\MT at permutelist} list
-      `\@nameuse{MT@\MT at permutelist @name}' will override\MessageBreak
-      list `#3' for font \@tempa,\MessageBreak size \@tempb}%
+    \MT at ifstreq{#3}%
+        {\csname MT@\MT at permutelist @\csname MT@\MT at permutelist @name\endcsname @load\endcsname}%
+        \relax{%
+      \MT at warning{\@nameuse{MT at abbr@\MT at permutelist} list
+        `\@nameuse{MT@\MT at 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.
@@ -12039,12 +12143,14 @@
 %    \begin{macrocode}
     \let\MT at auto\@empty
     \ifMT at auto
-%<pdftex-def>      \MT at requires@pdftex4{%
 %    \end{macrocode}
 %\end{macro}
-% We turn off automatic expansion if output mode is <DVI>.
+% We turn off automatic expansion if output mode is <DVI> and we're running \pdftex.
 %\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 at requires@pdftex4{%
         \ifnum\pdfoutput<\@ne
           \ifMT at opt@auto
             \MT at error{%
@@ -12056,7 +12162,9 @@
           \fi
           \MT at autofalse
         \else
+%</pdftex-def>
           \def\MT at auto{autoexpand}%
+%<*pdftex-def>
         \fi
 %    \end{macrocode}
 % Also, if \pdftex\ is too old.
@@ -12064,7 +12172,6 @@
 %                            version is too old for \texttt{autoexpand}}
 %\changes{v1.6}{2004/12/23}{disable automatic expansion for old \pdftex\ versions}
 %    \begin{macrocode}
-%<*pdftex-def>
       }{%
         \MT at error{%
           The pdftex version you are using is too old for\MessageBreak
@@ -12075,12 +12182,10 @@
         \MT at autofalse
         \def\MT at auto{1000 }%
       }%
-%</pdftex-def>
     \else
 %    \end{macrocode}
 % No automatic expansion.
 %    \begin{macrocode}
-%<*pdftex-def>
       \MT at requires@pdftex4\relax{%
         \def\MT at auto{1000 }%
       }%
@@ -12136,6 +12241,9 @@
 %\end{macro}
 %\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.)
 %    \begin{macrocode}
     \CheckCommand*\showhyphens[1]{\setbox0\vbox{%
       \color at begingroup\everypar{}\parfillskip\z at skip
@@ -12316,27 +12424,32 @@
 %    \end{macrocode}
 %\begin{macro}{\MT at warn@tracking at DVI}
 %\changes{v2.2}{2007/02/11}{warning when letterspacing in DVI mode}
-% We issue a warning, when letterspacing in <DVI> mode, since it will probably
+%\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 at warn@tracking at DVI{%
+%<letterspace>      \MT at pdf@or at lua{%
       \MT at 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 at glet\MT at warn@tracking at DVI\relax
     }%
   \else
+%</pdftex-def|letterspace>
     \def\MT at warn@tracking at DVI{%
       \ifnum\pdfprotrudechars<\@ne \global\pdfprotrudechars\@ne \fi
       \MT at glet\MT at warn@tracking at DVI\relax
     }%
-  \fi
+%<pdftex-def|letterspace>  \fi
 %    \end{macrocode}
 %\end{macro}
 %    \begin{macrocode}
@@ -12503,6 +12616,8 @@
 % ^^A -------------------------------------------------------------------------
 %\NoIndexing  ^^A from now on, don't bother indexing
 %
+%\newpage
+%
 %\section{Configuration files}
 %\changes{v1.6}{2005/01/24}{restructure \file{dtx} file}
 %
@@ -12623,13 +12738,12 @@
 %    \begin{macrocode}
 %%% -----------------------------------------------------------------------
 %%% FONT VARIANTS AND ALIASES
-
 %    \end{macrocode}
 % These are the variants I happen to be using (expert encoding, oldstyle
 % numerals, swashes, alternative, display, inferior and superior numerals):
 %    \begin{macrocode}
+
 \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),
@@ -12639,16 +12753,28 @@
 %
 %\bigskip\noindent
 % Fonts that are `the same':
-% The \pkg{fontspec} package will use |lmr| by default, whose EU1/2/TU encoding
-% is declared in \file{mt-LatinModernRoman.cfg}.
-%\changes{v2.5}{2012/08/23}{declare \texttt{lmr} as alias of Latin Modern Roman
-%                           (OpenType version)}
+% 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}
-\ifMT at fontspec
-\DeclareMicrotypeAlias{lmr} {Latin Modern Roman}
-\else
-\DeclareMicrotypeAlias{lmr} {cmr}  % lmodern
+
+\MT at if@false
+\ifx\UnicodeEncodingName\@undefined\else
+  \MT at ifstreq{\encodingdefault}{\UnicodeEncodingName}\MT at if@true\relax
 \fi
+\ifMT at fontspec\MT at if@true\fi
+\ifMT at if@
+\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
@@ -12665,10 +12791,10 @@
 %    \begin{macrocode}
 \DeclareMicrotypeAlias{lmsy}{cmsy}
 \DeclareMicrotypeAlias{lmm} {cmm}
-\DeclareMicrotypeAlias{aer} {cmr}  % ae
-\DeclareMicrotypeAlias{zer} {cmr}  % zefonts
-\DeclareMicrotypeAlias{cmor}{cmr}  % eco
-\DeclareMicrotypeAlias{hfor}{cmr}  % hfoldsty
+\DeclareMicrotypeAlias{aer} {cmr}        % ae
+\DeclareMicrotypeAlias{zer} {cmr}        % zefonts
+\DeclareMicrotypeAlias{cmor}{cmr}        % eco
+\DeclareMicrotypeAlias{hfor}{cmr}        % hfoldsty
 %    \end{macrocode}
 % The packages \pkg{pxfonts} and \pkg{txfonts} fonts inherit Palatino and Times
 % settings respectively,
@@ -12678,17 +12804,39 @@
 %\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}
-\DeclareMicrotypeAlias{pxr} {ppl}  % pxfonts
-\DeclareMicrotypeAlias{qpl} {ppl}  % TeX Gyre Pagella (formerly: qfonts/QuasiPalatino)
+\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} %   "
-\DeclareMicrotypeAlias{txr} {ptm}  % txfonts
-\DeclareMicrotypeAlias{qtm} {ptm}  % TeX Gyre Termes (formerly: qfonts/QuasiTimes)
+\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}{ppl}       % newpxtext
+\DeclareMicrotypeAlias{zplosf}{ppl}      %    "
+\DeclareMicrotypeAlias{zpltlf}{ppl}      %    "
+\DeclareMicrotypeAlias{zpltosf}{ppl}     %    "
+\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}{ptm}       % newtxtext
+\DeclareMicrotypeAlias{ntxosf}{ptm}      %    "
+\DeclareMicrotypeAlias{ntxtlf}{ptm}      %    "
+\DeclareMicrotypeAlias{ntxtosf}{ptm}     %    "
+%    \end{macrocode}
+% The \pkg{tempora} package.
+%\changes{v2.7}{2017/02/25}{declare aliases for \pkg{tempora}}
+%    \begin{macrocode}
+\DeclareMicrotypeAlias{Tempora-TLF}{ptm} % tempora
+\DeclareMicrotypeAlias{Tempora-TOsF}{ptm}%    "
+\DeclareMicrotypeAlias{qtm} {ptm}        % TeX Gyre Termes (formerly: qfonts/QuasiTimes)
+%    \end{macrocode}
 % The OpenType versions:
 %
 %\changes{v2.5}{2012/03/29}{declare TeX Gyre Pagella, Asana Math, Palatino <LT> Std, and Palatino
@@ -12708,8 +12856,8 @@
 %\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}  %   "
+\DeclareMicrotypeAlias{zeur}{eur}        % Euler VM
+\DeclareMicrotypeAlias{zeus}{eus}        %    "
 %    \end{macrocode}
 % MicroPress's Charter version (\pkg{chmath}).
 %\changes{v2.2}{2007/06/08}{declare \texttt{chr} (\pkg{chmath}) as an alias of \texttt{bch}
@@ -12716,15 +12864,21 @@
 %                           (reported by \contributor Geoff Vallis <gkv\at Princeton.EDU>)}
 %                                                            ^^A private mail, 2007/06/07
 %    \begin{macrocode}
-\DeclareMicrotypeAlias{chr} {bch}  % CH Math
+\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
-\DeclareMicrotypeAlias{mdugm}{ugm} % mathdesign/URW Garamond
+\DeclareMicrotypeAlias{mdbch}{bch}       % mathdesign/Charter
+\DeclareMicrotypeAlias{mdugm}{ugm}       % mathdesign/URW Garamond
 %    \end{macrocode}
 % The \pkg{garamondx} package, an extension of <URW> Garamond, providing
 % small caps and oldstyle figures.
@@ -12731,21 +12885,21 @@
 %\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}  %    "
+\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
+\DeclareMicrotypeAlias{ulg} {blg}        % URW LetterGothic -> Bitstream LetterGothic12Pitch
 %    \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
+\DeclareMicrotypeAlias{zpeus}   {zpeu}   % Adobe Euro sans -> serif
+\DeclareMicrotypeAlias{eurosans}{zpeu}   % Adobe Euro sans -> serif
+\DeclareMicrotypeAlias{euroitcs}{euroitc}% ITC Euro sans -> serif
 
 %    \end{macrocode}
 %
@@ -16491,7 +16645,7 @@
 
 %</cmr>
 %    \end{macrocode}
-% \pkg{fontinst}, however, which is also used to create the \pkg{PSNFSS} font
+% \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}
@@ -16779,7 +16933,7 @@
 %   Grave accent  \`     Left brace    \{     Vertical bar  \|
 %   Right brace   \}     Tilde         \~}
 %
-% \CheckSum{10449}
+% \CheckSum{10549}
 %
 % \Finale
 %

Modified: trunk/Master/texmf-dist/source/latex/microtype/microtype.ins
===================================================================
--- trunk/Master/texmf-dist/source/latex/microtype/microtype.ins	2017-07-13 23:11:24 UTC (rev 44790)
+++ trunk/Master/texmf-dist/source/latex/microtype/microtype.ins	2017-07-13 23:12:08 UTC (rev 44791)
@@ -100,12 +100,12 @@
 \declarepostamble\emptypostamble
 \endpostamble
 
+% ------------------------------------------------------------------------
+
 \def\makefile#1#2{\file{#1}{\from{microtype.dtx}{#2}}}
 \def\makecfg#1#2{\makefile{mt-#2.cfg}{config,cfg-#1,#2}}
 \def\makeutfcfg#1{\file{mt-#1.cfg}{\from{microtype-utf.dtx}{#1}}}
 
-% ------------------------------------------------------------------------
-
 \usedir{tex/latex/microtype}
 \let\MetaPrefix\DoubleperCent
 \let\DEBUG\empty

Modified: trunk/Master/texmf-dist/tex/latex/microtype/letterspace.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/microtype/letterspace.sty	2017-07-13 23:11:24 UTC (rev 44790)
+++ trunk/Master/texmf-dist/tex/latex/microtype/letterspace.sty	2017-07-13 23:12:08 UTC (rev 44791)
@@ -33,7 +33,7 @@
 \NeedsTeXFormat{LaTeX2e}
 \ProvidesPackage
   {letterspace}
-  [2016/05/14 v2.6a
+  [2017/07/07 v2.7
    Robust letterspacing
    (RS)]
 \def\MT at MT
@@ -308,16 +308,16 @@
   \fi
 }
 \def\MT at afteraftergroup#1{%
-  \MT at ifdefined@n at TF{MT at aftergroup@\number\currentgrouplevel}\relax{%
-  \MT at exp@cs\xdef{MT at aftergroup@\number\currentgrouplevel}%
-    {\MT at exp@cs\MT at glet{MT at aftergroup@\number\currentgrouplevel}\noexpand\@undefined#1}%
-  \expandafter\aftergroup\expandafter\aftergroup\MT at exp@cs\aftergroup
-    {MT at aftergroup@\number\currentgrouplevel}%
-  }%
+    \MT at ifdefined@n at TF{MT at aftergroup@\number\currentgrouplevel}\relax{%
+      \MT at exp@cs\xdef{MT at aftergroup@\number\currentgrouplevel}%
+        {\MT at exp@cs\MT at glet{MT at aftergroup@\number\currentgrouplevel}\noexpand\@undefined#1}%
+      \expandafter\aftergroup\expandafter\aftergroup\MT at exp@cs\aftergroup
+        {MT at aftergroup@\number\currentgrouplevel}%
+    }%
 }
-\def\MT at ls@fontspec at colon#1:#2:#3\@nil{#1:#2}
+\def\MT at ls@fontspec at colon#1:#2:#3:#4\@nil{\ifx\\#3\\#1:#2\else#1:#2:#3\fi}
 \def\MT at ls@fontspec at font#1 #2\@nil{%
-  "\MT at ls@fontspec at colon#1::\@nil
+  "\MT at ls@fontspec at colon#1:::\relax\@nil
     kernfactor=\MT at minus \ifnum\MT at letterspace@=1000 1\else 0.%
          \ifnum\MT at minus\MT at letterspace@<100 0\fi
          \ifnum\MT at minus\MT at letterspace@<10  0\fi
@@ -328,7 +328,6 @@
 \def\MT at set@lsfont{\MT at exp@two at c\let\font at name\MT at lsfont}
 \DeclareRobustCommand\lsstyle{%
   \not at math@alphabet\lsstyle\textls
-  \MT at glet\glb at currsize\@empty
   \let\MT at tracking\MT at set@tr at codes
   \selectfont
 }
@@ -510,11 +509,13 @@
 {%
   \ifnum\pdfoutput<\@ne
     \def\MT at warn@tracking at DVI{%
+      \MT at pdf@or at lua{%
       \MT at 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}%
+      }\relax
       \MT at glet\MT at warn@tracking at DVI\relax
     }%
   \else

Modified: trunk/Master/texmf-dist/tex/latex/microtype/microtype-luatex.def
===================================================================
--- trunk/Master/texmf-dist/tex/latex/microtype/microtype-luatex.def	2017-07-13 23:11:24 UTC (rev 44790)
+++ trunk/Master/texmf-dist/tex/latex/microtype/microtype-luatex.def	2017-07-13 23:12:08 UTC (rev 44791)
@@ -30,19 +30,22 @@
 %%
 \ProvidesFile
   {microtype-luatex.def}
-  [2016/05/14 v2.6a
+  [2017/07/07 v2.7
    Definitions specific to
    luatex
    (RS)]
 \def\MT at lua{\directlua}
-\def\MT at luatex@no{4}
-\ifnum\luatexversion<85
-  \def\MT at luatex@no{3}
-  \ifnum\luatexversion<62
-    \def\MT at luatex@no{2}
-    \ifnum\luatexversion<36
-      \def\MT at lua{\directlua0}
-      \def\MT at luatex@no{1}
+\def\MT at luatex@no{5}
+\ifnum\luatexversion<90
+  \def\MT at luatex@no{4}
+  \ifnum\luatexversion<85
+    \def\MT at luatex@no{3}
+    \ifnum\luatexversion<62
+      \def\MT at luatex@no{2}
+      \ifnum\luatexversion<36
+        \def\MT at lua{\directlua0}
+        \def\MT at luatex@no{1}
+      \fi
     \fi
   \fi
 \fi
@@ -51,9 +54,9 @@
   #1{\ifnum
   \MT at luatex@no
     <#1 \expandafter\@secondoftwo\else\expandafter\@firstoftwo\fi}
-\RequirePackage{luatexbase}
+\@ifl at t@r\fmtversion{2016/01/01}\relax{\RequirePackage{luatexbase}}
 \RequirePackage{luaotfload}
-\RequireLuaModule{microtype}
+\MT at lua{require("microtype")}
 \def\MT at ifint#1{\csname\MT at lua{microtype.if_int([[#1]])}\endcsname}
 \def\MT at ifdimen#1{\csname\MT at lua{microtype.if_dimen([[#1]])}\endcsname}
 \def\MT at ifstreq#1#2{\csname\MT at lua{microtype.if_str_eq([[#1]],[[#2]])}\endcsname}
@@ -141,7 +144,7 @@
   \MT at if@list at exists{%
     \ifMT at nofamily
       \MT at ifdefined@n at TF{\MT at encoding-\MT at family-settings}\relax{%
-        \MT at info@nl{Loading generic settings for font family\MessageBreak
+        \MT at info@nl{Loading generic protrusion settings for font family\MessageBreak
                     `\MT at family' (encoding: \MT at encoding).\MessageBreak
                     For optimal results, create family-specific settings.\MessageBreak
                     See the microtype manual for details}%
@@ -306,7 +309,16 @@
   \MT at do@font{\efcode\MT at font\@tempcnta=#1\relax}%
 }
 \def\MT at reset@ef at codes@{\MT at set@all at ex\MT at ex@factor@}
+\MT at requires@luatex5
+{
+  \def\MT at reset@ef at codes{%
+    \ifnum\MT at ex@factor@=\@m \else
+      \MT at reset@ef at codes@
+    \fi
+  }
+}{
   \let\MT at reset@ef at codes\MT at reset@ef at codes@
+}
 \def\MT at ex@split at val#1\relax{%
   \@tempcntb=#1\relax
   \ifnum\MT at ex@factor@=\@m \else
@@ -442,7 +454,6 @@
     \MT at afteraftergroup{%
       \MT at set@curr at os
       \MT at set@curr at ok
-      \MT at glet\noexpand\glb at currsize\noexpand\@empty
       \noexpand\MT at tr@outer at r
     }%
   \fi
@@ -449,16 +460,18 @@
   }%
 }
 \def\MT at afteraftergroup#1{%
-  \MT at ifdefined@n at TF{MT at aftergroup@\number\currentgrouplevel}\relax{%
-  \MT at exp@cs\xdef{MT at aftergroup@\number\currentgrouplevel}%
-    {\MT at exp@cs\MT at glet{MT at aftergroup@\number\currentgrouplevel}\noexpand\@undefined#1}%
-  \expandafter\aftergroup\expandafter\aftergroup\MT at exp@cs\aftergroup
-    {MT at aftergroup@\number\currentgrouplevel}%
+  \MT at maybe@gobble at with@tikz{%
+    \MT at ifdefined@n at TF{MT at aftergroup@\number\currentgrouplevel}\relax{%
+      \MT at exp@cs\xdef{MT at aftergroup@\number\currentgrouplevel}%
+        {\MT at exp@cs\MT at glet{MT at aftergroup@\number\currentgrouplevel}\noexpand\@undefined#1}%
+      \expandafter\aftergroup\expandafter\aftergroup\MT at exp@cs\aftergroup
+        {MT at aftergroup@\number\currentgrouplevel}%
+    }%
   }%
 }
-\def\MT at ls@fontspec at colon#1:#2:#3\@nil{#1:#2}
+\def\MT at ls@fontspec at colon#1:#2:#3:#4\@nil{\ifx\\#3\\#1:#2\else#1:#2:#3\fi}
 \def\MT at ls@fontspec at font#1 #2\@nil{%
-  "\MT at ls@fontspec at colon#1::\@nil
+  "\MT at ls@fontspec at colon#1:::\relax\@nil
     kernfactor=\MT at minus \ifnum\MT at letterspace@=1000 1\else 0.%
          \ifnum\MT at minus\MT at letterspace@<100 0\fi
          \ifnum\MT at minus\MT at letterspace@<10  0\fi
@@ -494,7 +507,7 @@
 \def\MT at set@lsfont{\MT at exp@two at c\let\font at name\MT at lsfont}
 \DeclareRobustCommand\lsstyle{%
   \not at math@alphabet\lsstyle\textls
-  \MT at glet\glb at currsize\@empty
+  \MT at maybe@gobble at with@tikz{\aftergroup\glb at settings}%
   \def\MT at feat{tr}%
   \let\MT at tracking\MT at set@tr at codes
   \selectfont
@@ -599,19 +612,13 @@
     \fi
   \fi
 }
-\MT at addto@setup{%
-  \@ifpackageloaded{tikz}
-    {\def\MT at tr@outer at r{%
-       \ifnum\tikz at expandcount>\z@ \else
-         \expandafter\MT at tr@outer at r@\fi}}
-    {\let\MT at tr@outer at r\MT at tr@outer at r@}}
-\def\MT at tr@outer at r@{%
-  \futurelet\MT at tr@outer at next\MT at tr@outer at r@@
+\def\MT at tr@outer at r{%
+  \futurelet\MT at tr@outer at next\MT at tr@outer at r@
 }
 \def\MT at if@outer at next#1{%
   \ifx\MT at tr@outer at next#1\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi
 }
-\def\MT at tr@outer at r@@{%
+\def\MT at tr@outer at r@{%
   \def\MT at temp*{}%
   \ifmmode \else
     \ifnum\currentgrouptype=10 \else
@@ -620,7 +627,7 @@
       \expandafter\ifcat\expandafter\noexpand\csname MT at tr@outer at next\endcsname\egroup
         \ifhmode\unkern\fi\egroup
         \MT at set@curr at ok \MT at set@curr at os
-        \def\MT at temp*{\afterassignment\MT at tr@outer at r@\let\MT at temp=}%
+        \def\MT at temp*{\afterassignment\MT at tr@outer at r\let\MT at temp=}%
       \else
         \MT at if@outer at next\maybe at ic{%
           \MT at set@curr at ok \MT at set@curr at os
@@ -627,7 +634,7 @@
           \def\MT at temp*{\afterassignment\MT at tr@outer at icr\let\MT at temp=}%
         }{%
           \MT at if@outer at next\check at icr{%
-            \def\MT at temp*{\aftergroup\MT at tr@outer at r@\check at icr\let\MT at temp=}%
+            \def\MT at temp*{\aftergroup\MT at tr@outer at r\check at icr\let\MT at temp=}%
           }{%
             \MT at if@outer at next\@sptoken{%
               \def\MT at temp* {\ifhmode\hskip\MT at outer@space
@@ -650,7 +657,7 @@
   \fi\fi
   \MT at temp*%
 }
-\def\MT at tr@outer at icr{\afterassignment\MT at tr@outer at icr@\MT at tr@outer at r@}
+\def\MT at tr@outer at icr{\afterassignment\MT at tr@outer at icr@\MT at tr@outer at r}
 \def\MT at tr@outer at icr@{%
   \let\@let at token= \MT at tr@outer at next
   \maybe at ic@
@@ -1105,20 +1112,7 @@
     \fi
     \let\MT at auto\@empty
     \ifMT at auto
-        \ifnum\pdfoutput<\@ne
-          \ifMT at opt@auto
-            \MT at 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 at autofalse
-        \else
           \def\MT at auto{autoexpand}%
-        \fi
-    \else
     \fi
     \ifMT at selected
       \let\MT at set@ex at codes\MT at set@ex at codes@s
@@ -1207,21 +1201,10 @@
   \def\MT at setup@spacing {\MT at error@doesnt at work{spacing}}
 \def\MT at setup@warntracking
 {%
-  \ifnum\pdfoutput<\@ne
     \def\MT at warn@tracking at DVI{%
-      \MT at 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 at glet\MT at warn@tracking at DVI\relax
-    }%
-  \else
-    \def\MT at warn@tracking at DVI{%
       \ifnum\pdfprotrudechars<\@ne \global\pdfprotrudechars\@ne \fi
       \MT at glet\MT at warn@tracking at DVI\relax
     }%
-  \fi
   \ifnum\MT at letterspace=\m at ne
     \let\MT at letterspace\MT at letterspace@default
   \else

Modified: trunk/Master/texmf-dist/tex/latex/microtype/microtype-pdftex.def
===================================================================
--- trunk/Master/texmf-dist/tex/latex/microtype/microtype-pdftex.def	2017-07-13 23:11:24 UTC (rev 44790)
+++ trunk/Master/texmf-dist/tex/latex/microtype/microtype-pdftex.def	2017-07-13 23:12:08 UTC (rev 44791)
@@ -30,7 +30,7 @@
 %%
 \ProvidesFile
   {microtype-pdftex.def}
-  [2016/05/14 v2.6a
+  [2017/07/07 v2.7
    Definitions specific to
    pdftex
    (RS)]
@@ -234,7 +234,7 @@
   \MT at if@list at exists{%
     \ifMT at nofamily
       \MT at ifdefined@n at TF{\MT at encoding-\MT at family-settings}\relax{%
-        \MT at info@nl{Loading generic settings for font family\MessageBreak
+        \MT at info@nl{Loading generic protrusion settings for font family\MessageBreak
                     `\MT at family' (encoding: \MT at encoding).\MessageBreak
                     For optimal results, create family-specific settings.\MessageBreak
                     See the microtype manual for details}%
@@ -416,7 +416,8 @@
   \MT at do@font{\efcode\MT at font\@tempcnta=#1\relax}%
 }
 \def\MT at reset@ef at codes@{\MT at set@all at ex\MT at ex@factor@}
-\MT at requires@pdftex4{
+\MT at requires@pdftex4
+{
   \def\MT at reset@ef at codes{%
     \ifnum\MT at ex@factor@=\@m \else
       \MT at reset@ef at codes@
@@ -684,7 +685,6 @@
     \MT at afteraftergroup{%
       \MT at set@curr at os
       \MT at set@curr at ok
-      \MT at glet\noexpand\glb at currsize\noexpand\@empty
       \noexpand\MT at tr@outer at r
     }%
   \fi
@@ -691,11 +691,13 @@
   }%
 }
 \def\MT at afteraftergroup#1{%
-  \MT at ifdefined@n at TF{MT at aftergroup@\number\currentgrouplevel}\relax{%
-  \MT at exp@cs\xdef{MT at aftergroup@\number\currentgrouplevel}%
-    {\MT at exp@cs\MT at glet{MT at aftergroup@\number\currentgrouplevel}\noexpand\@undefined#1}%
-  \expandafter\aftergroup\expandafter\aftergroup\MT at exp@cs\aftergroup
-    {MT at aftergroup@\number\currentgrouplevel}%
+  \MT at maybe@gobble at with@tikz{%
+    \MT at ifdefined@n at TF{MT at aftergroup@\number\currentgrouplevel}\relax{%
+      \MT at exp@cs\xdef{MT at aftergroup@\number\currentgrouplevel}%
+        {\MT at exp@cs\MT at glet{MT at aftergroup@\number\currentgrouplevel}\noexpand\@undefined#1}%
+      \expandafter\aftergroup\expandafter\aftergroup\MT at exp@cs\aftergroup
+        {MT at aftergroup@\number\currentgrouplevel}%
+    }%
   }%
 }
 \def\MT at get@tr at opt{%
@@ -727,7 +729,7 @@
 \def\MT at set@lsfont{\MT at exp@two at c\let\font at name\MT at lsfont}
 \DeclareRobustCommand\lsstyle{%
   \not at math@alphabet\lsstyle\textls
-  \MT at glet\glb at currsize\@empty
+  \MT at maybe@gobble at with@tikz{\aftergroup\glb at settings}%
   \def\MT at feat{tr}%
   \let\MT at tracking\MT at set@tr at codes
   \selectfont
@@ -841,19 +843,13 @@
     \fi
   \fi
 }
-\MT at addto@setup{%
-  \@ifpackageloaded{tikz}
-    {\def\MT at tr@outer at r{%
-       \ifnum\tikz at expandcount>\z@ \else
-         \expandafter\MT at tr@outer at r@\fi}}
-    {\let\MT at tr@outer at r\MT at tr@outer at r@}}
-\def\MT at tr@outer at r@{%
-  \futurelet\MT at tr@outer at next\MT at tr@outer at r@@
+\def\MT at tr@outer at r{%
+  \futurelet\MT at tr@outer at next\MT at tr@outer at r@
 }
 \def\MT at if@outer at next#1{%
   \ifx\MT at tr@outer at next#1\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi
 }
-\def\MT at tr@outer at r@@{%
+\def\MT at tr@outer at r@{%
   \def\MT at temp*{}%
   \ifmmode \else
     \ifnum\currentgrouptype=10 \else
@@ -862,7 +858,7 @@
       \expandafter\ifcat\expandafter\noexpand\csname MT at tr@outer at next\endcsname\egroup
         \ifhmode\unkern\fi\egroup
         \MT at set@curr at ok \MT at set@curr at os
-        \def\MT at temp*{\afterassignment\MT at tr@outer at r@\let\MT at temp=}%
+        \def\MT at temp*{\afterassignment\MT at tr@outer at r\let\MT at temp=}%
       \else
         \MT at if@outer at next\maybe at ic{%
           \MT at set@curr at ok \MT at set@curr at os
@@ -869,7 +865,7 @@
           \def\MT at temp*{\afterassignment\MT at tr@outer at icr\let\MT at temp=}%
         }{%
           \MT at if@outer at next\check at icr{%
-            \def\MT at temp*{\aftergroup\MT at tr@outer at r@\check at icr\let\MT at temp=}%
+            \def\MT at temp*{\aftergroup\MT at tr@outer at r\check at icr\let\MT at temp=}%
           }{%
             \MT at if@outer at next\@sptoken{%
               \def\MT at temp* {\ifhmode\hskip\MT at outer@space
@@ -892,7 +888,7 @@
   \fi\fi
   \MT at temp*%
 }
-\def\MT at tr@outer at icr{\afterassignment\MT at tr@outer at icr@\MT at tr@outer at r@}
+\def\MT at tr@outer at icr{\afterassignment\MT at tr@outer at icr@\MT at tr@outer at r}
 \def\MT at tr@outer at icr@{%
   \let\@let at token= \MT at tr@outer at next
   \maybe at ic@

Modified: trunk/Master/texmf-dist/tex/latex/microtype/microtype-xetex.def
===================================================================
--- trunk/Master/texmf-dist/tex/latex/microtype/microtype-xetex.def	2017-07-13 23:11:24 UTC (rev 44790)
+++ trunk/Master/texmf-dist/tex/latex/microtype/microtype-xetex.def	2017-07-13 23:12:08 UTC (rev 44791)
@@ -30,7 +30,7 @@
 %%
 \ProvidesFile
   {microtype-xetex.def}
-  [2016/05/14 v2.6a
+  [2017/07/07 v2.7
    Definitions specific to
    xetex
    (RS)]
@@ -126,7 +126,7 @@
   \MT at if@list at exists{%
     \ifMT at nofamily
       \MT at ifdefined@n at TF{\MT at encoding-\MT at family-settings}\relax{%
-        \MT at info@nl{Loading generic settings for font family\MessageBreak
+        \MT at info@nl{Loading generic protrusion settings for font family\MessageBreak
                     `\MT at family' (encoding: \MT at encoding).\MessageBreak
                     For optimal results, create family-specific settings.\MessageBreak
                     See the microtype manual for details}%

Modified: trunk/Master/texmf-dist/tex/latex/microtype/microtype.cfg
===================================================================
--- trunk/Master/texmf-dist/tex/latex/microtype/microtype.cfg	2017-07-13 23:11:24 UTC (rev 44790)
+++ trunk/Master/texmf-dist/tex/latex/microtype/microtype.cfg	2017-07-13 23:12:08 UTC (rev 44791)
@@ -40,7 +40,7 @@
 %%
 \ProvidesFile
   {microtype.cfg}
-  [2016/05/14 v2.6a
+  [2017/07/07 v2.7
    microtype main configuration file
    (RS)]
 
@@ -112,40 +112,57 @@
 
 \DeclareMicrotypeVariants{x,j,w,a,d,0,1}
 
-\ifMT at fontspec
-\DeclareMicrotypeAlias{lmr} {Latin Modern Roman}
-\else
-\DeclareMicrotypeAlias{lmr} {cmr}  % lmodern
+\MT at if@false
+\ifx\UnicodeEncodingName\@undefined\else
+  \MT at ifstreq{\encodingdefault}{\UnicodeEncodingName}\MT at if@true\relax
 \fi
+\ifMT at fontspec\MT at if@true\fi
+\ifMT at if@
+\DeclareMicrotypeAlias{lmr}{Latin Modern Roman}
+  \else
+\DeclareMicrotypeAlias{lmr}{cmr}         % lmodern
+\fi
 \DeclareMicrotypeAlias{lmsy}{cmsy}
 \DeclareMicrotypeAlias{lmm} {cmm}
-\DeclareMicrotypeAlias{aer} {cmr}  % ae
-\DeclareMicrotypeAlias{zer} {cmr}  % zefonts
-\DeclareMicrotypeAlias{cmor}{cmr}  % eco
-\DeclareMicrotypeAlias{hfor}{cmr}  % hfoldsty
-\DeclareMicrotypeAlias{pxr} {ppl}  % pxfonts
-\DeclareMicrotypeAlias{qpl} {ppl}  % TeX Gyre Pagella (formerly: qfonts/QuasiPalatino)
-\DeclareMicrotypeAlias{fp9x}{pplx} % FPL Neu
-\DeclareMicrotypeAlias{fp9j}{pplj} %   "
-\DeclareMicrotypeAlias{txr} {ptm}  % txfonts
-\DeclareMicrotypeAlias{qtm} {ptm}  % TeX Gyre Termes (formerly: qfonts/QuasiTimes)
+\DeclareMicrotypeAlias{aer} {cmr}        % ae
+\DeclareMicrotypeAlias{zer} {cmr}        % zefonts
+\DeclareMicrotypeAlias{cmor}{cmr}        % eco
+\DeclareMicrotypeAlias{hfor}{cmr}        % hfoldsty
+\DeclareMicrotypeAlias{pxr} {ppl}        % pxfonts
+\DeclareMicrotypeAlias{qpl} {ppl}        % TeX Gyre Pagella (formerly: qfonts/QuasiPalatino)
+\DeclareMicrotypeAlias{fp9x}{pplx}       % FPL Neu
+\DeclareMicrotypeAlias{fp9j}{pplj}       %    "
+\DeclareMicrotypeAlias{zpllf}{ppl}       % newpxtext
+\DeclareMicrotypeAlias{zplosf}{ppl}      %    "
+\DeclareMicrotypeAlias{zpltlf}{ppl}      %    "
+\DeclareMicrotypeAlias{zpltosf}{ppl}     %    "
+\DeclareMicrotypeAlias{txr} {ptm}        % txfonts
+\DeclareMicrotypeAlias{ntxlf}{ptm}       % newtxtext
+\DeclareMicrotypeAlias{ntxosf}{ptm}      %    "
+\DeclareMicrotypeAlias{ntxtlf}{ptm}      %    "
+\DeclareMicrotypeAlias{ntxtosf}{ptm}     %    "
+\DeclareMicrotypeAlias{Tempora-TLF}{ptm} % tempora
+\DeclareMicrotypeAlias{Tempora-TOsF}{ptm}%    "
+\DeclareMicrotypeAlias{qtm} {ptm}        % TeX Gyre Termes (formerly: qfonts/QuasiTimes)
 \DeclareMicrotypeAlias{TeX Gyre Pagella}{Palatino Linotype}
 \DeclareMicrotypeAlias{Palatino LT Std} {Palatino Linotype}
 \DeclareMicrotypeAlias{Palatino}        {Palatino Linotype}
 \DeclareMicrotypeAlias{Asana Math}      {Palatino Linotype}
-\DeclareMicrotypeAlias{zeur}{eur}  % Euler VM
-\DeclareMicrotypeAlias{zeus}{eus}  %   "
-\DeclareMicrotypeAlias{chr} {bch}  % CH Math
-\DeclareMicrotypeAlias{mdbch}{bch} % mathdesign/Charter
-\DeclareMicrotypeAlias{mdugm}{ugm} % mathdesign/URW Garamond
-\DeclareMicrotypeAlias{zgmx}{ugm}  % garamondx
-\DeclareMicrotypeAlias{zgmj}{ugm}  %    "
-\DeclareMicrotypeAlias{zgmI}{ugm}  %    "
-\DeclareMicrotypeAlias{zgmq}{ugm}  %    "
-\DeclareMicrotypeAlias{ulg} {blg}  % URW LetterGothic -> Bitstream LetterGothic12Pitch
-\DeclareMicrotypeAlias{zpeus}   {zpeu}    % Adobe Euro sans -> serif
-\DeclareMicrotypeAlias{eurosans}{zpeu}    % Adobe Euro sans -> serif
-\DeclareMicrotypeAlias{euroitcs}{euroitc} % ITC Euro sans -> serif
+\DeclareMicrotypeAlias{zeur}{eur}        % Euler VM
+\DeclareMicrotypeAlias{zeus}{eus}        %    "
+\DeclareMicrotypeAlias{chr} {bch}        % CH Math
+\DeclareMicrotypeAlias{XCharter-TLF} {bch} % XCharter
+\DeclareMicrotypeAlias{XCharter-TOsF}{bch} %    "
+\DeclareMicrotypeAlias{mdbch}{bch}       % mathdesign/Charter
+\DeclareMicrotypeAlias{mdugm}{ugm}       % mathdesign/URW Garamond
+\DeclareMicrotypeAlias{zgmx}{ugm}        % garamondx
+\DeclareMicrotypeAlias{zgmj}{ugm}        %    "
+\DeclareMicrotypeAlias{zgmI}{ugm}        %    "
+\DeclareMicrotypeAlias{zgmq}{ugm}        %    "
+\DeclareMicrotypeAlias{ulg} {blg}        % URW LetterGothic -> Bitstream LetterGothic12Pitch
+\DeclareMicrotypeAlias{zpeus}   {zpeu}   % Adobe Euro sans -> serif
+\DeclareMicrotypeAlias{eurosans}{zpeu}   % Adobe Euro sans -> serif
+\DeclareMicrotypeAlias{euroitcs}{euroitc}% ITC Euro sans -> serif
 
 %%% -----------------------------------------------------------------------
 %%% INTERACTION WITH THE `babel' PACKAGE

Modified: trunk/Master/texmf-dist/tex/latex/microtype/microtype.lua
===================================================================
--- trunk/Master/texmf-dist/tex/latex/microtype/microtype.lua	2017-07-13 23:11:24 UTC (rev 44790)
+++ trunk/Master/texmf-dist/tex/latex/microtype/microtype.lua	2017-07-13 23:12:08 UTC (rev 44791)
@@ -30,13 +30,12 @@
 --   (Bugs are mine.)
 -- ------------------------------------------------------------------------ 
 --
-
 microtype        = microtype or {}
 local microtype  = microtype
 microtype.module = {
     name         = "microtype",
-    version      = "2.6a",
-    date         = "2016/05/14",
+    version      = "2.7",
+    date         = "2017/07/07",
     description  = "microtype module.",
     author       = "E. Roux, R. Schlicht and P. Gesang",
     copyright    = "E. Roux, R. Schlicht and P. Gesang",
@@ -50,8 +49,14 @@
 local match      = string.match
 local tex_write  = tex.write
 
+local catpackage
+if luatexbase.registernumber then
+  catpackage = luatexbase.registernumber("catcodetable at atletter") -- LaTeX
+else
+  catpackage = luatexbase.catcodetables.CatcodeTableAtletter   -- luatexbase
+end
 function microtype.sprint (...)
-  tex.sprint(luatexbase.catcodetables['latex-package'], ...)
+  tex.sprint(catpackage, ...)
 end
 
 local function if_int(s)

Modified: trunk/Master/texmf-dist/tex/latex/microtype/microtype.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/microtype/microtype.sty	2017-07-13 23:11:24 UTC (rev 44790)
+++ trunk/Master/texmf-dist/tex/latex/microtype/microtype.sty	2017-07-13 23:12:08 UTC (rev 44791)
@@ -29,7 +29,7 @@
 \NeedsTeXFormat{LaTeX2e}
 \ProvidesPackage
   {microtype}
-  [2016/05/14 v2.6a
+  [2017/07/07 v2.7
    Micro-typographical refinements
    (RS)]
 \def\MT at MT
@@ -410,6 +410,11 @@
   \MT at warning@nl{Detected the `wordcount' utility.\MessageBreak
     Disabling `\MT at MT', since it wouldn't work}%
   \MT at clear@options\endinput}\relax
+\@ifclassloaded{minimal}{%
+  \MT at 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
 \let\MT at setup@\@empty
 \def\MT at addto@setup{\g at addto@macro\MT at setup@}
 \def\MT at with@package at T#1{\@ifpackageloaded{#1}\@firstofone\@gobble}
@@ -432,6 +437,14 @@
   }\relax
 }
 \ifMT at fontspec\MT at fontspec@setup\fi
+\let\MT at maybe@gobble at with@tikz\@firstofone
+\def\MT at tikz@setup{%
+  \def\MT at maybe@gobble at with@tikz{%
+    \ifnum\tikz at expandcount>\z@
+      \expandafter\@gobble
+    \else
+      \expandafter\@firstofone
+    \fi}}
 \def\MT at setupfont@hook{%
   \ifMT at fontspec\MT at font\fi
   \MT at if@false
@@ -446,6 +459,7 @@
   \MT at with@package at T{tex4ht}    \MT at if@true
   \MT at with@package at T{mathastext}\MT at if@true
   \ifMT at if@\MT at restore@p at h\fi
+  \MT at with@package at T{tikz}\MT at tikz@setup
 }
 \MT at addto@setup{%
   \MT at with@package at T{pdfcprot}{%
@@ -484,7 +498,7 @@
   \MT at if@false
   \MT at with@package at T{hyperref}{%
     \pdfstringdefDisableCommands{%
-      \let\pickup at font\MT at orig@pickupfont
+      \MT at ltx@pickupfont
       \let\textmicrotypecontext\@secondoftwo
       \let\microtypecontext\@gobble
       \def\lsstyle{\pdfstringdefWarn\lsstyle}%
@@ -511,18 +525,19 @@
     \soulregister\lsstyle 0%
     \soulregister\textls  1%
   }%
+  \MT at with@package at T{tikz}\MT at tikz@setup
   \MT at with@package at T{pinyin}{%
     \let\MT at orig@py at macron\py at macron
     \@ifpackagelater{pinyin}{2005/08/11}{% 4.6.0
       \def\py at macron#1#2{%
-        \let\pickup at font\MT at orig@pickupfont
+        \MT at ltx@pickupfont
         \MT at orig@py at macron{#1}{#2}%
-        \let\pickup at font\MT at pickupfont}%
+        \MT at MT@pickupfont}%
     }{%
       \def\py at macron#1{%
-        \let\pickup at font\MT at orig@pickupfont
+        \MT at ltx@pickupfont
         \MT at orig@py at macron{#1}%
-        \let\pickup at font\MT at pickupfont}%
+        \MT at MT@pickupfont}%
     }%
   }%
 }
@@ -1128,6 +1143,10 @@
     \expandafter\def\expandafter\MT at char\expandafter{\csname\expandafter
                     \string\csname\MT at encoding\endcsname
                     \MT at detokenize@n{#1}-\MT at detokenize@n{#2}\endcsname}%
+    \ifx\UnicodeEncodingName\@undefined\else
+      \expandafter\expandafter\expandafter
+        \MT at is@uni at comp\MT at char\iffontchar\else\fi\relax
+    \fi
     \expandafter\expandafter\expandafter\MT at is@letter\MT at char\relax\relax
     \ifnum\MT at char@ < \z@
       \ifMT at xunicode
@@ -1138,6 +1157,9 @@
     \fi
   \fi
 }
+\def\MT at is@uni at comp#1\iffontchar#2\else#3\fi\relax{%
+  \ifx\\#2\\\else\edef\MT at char{\iffontchar#2\fi}\fi
+}
 \def\MT at set@listname{%
   \edef\MT at curr@list at name{\@nameuse{MT at abbr@\MT at feat} list\noexpand\MessageBreak
     `\@nameuse{MT@\MT at feat @c at name}'}%
@@ -1240,14 +1262,16 @@
     \endgroup
   }%
   \let\MT at pickupfont\pickup at font
+  \def\MT at MT@pickupfont {\let\pickup at font\MT at pickupfont}%
+  \def\MT at ltx@pickupfont{\let\pickup at font\MT at orig@pickupfont}%
   \g at addto@macro\do at subst@correction
     {\edef\MT at font{\csname\curr at fontshape/\f at size\endcsname}%
      \MT at glet@nc{MT at subst@\expandafter\string\font at name}\MT at font}%
   \let\MT at orig@add at accent\add at accent
   \def\add at accent#1#2{%
-    \let\pickup at font\MT at orig@pickupfont
+    \MT at ltx@pickupfont
     \MT at orig@add at accent{#1}{#2}%
-    \let\pickup at font\MT at pickupfont
+    \MT at MT@pickupfont
   }%
 }
 \def\MT at check@font{\MT at exp@one at n\MT at in@clist\MT at font\MT at font@list}
@@ -1893,10 +1917,14 @@
           \MT at tempsize
       }{%
         \MT at ifdefined@n at T{MT@\MT at permutelist @\@tempa\MT at extra@context}{%
-          \MT at warning{\@nameuse{MT at abbr@\MT at permutelist} list
-            `\@nameuse{MT@\MT at permutelist @name}' will override list\MessageBreak
-            `\@nameuse{MT@\MT at permutelist @\@tempa\MT at extra@context}'
-            for font `\@tempa'}%
+          \MT at ifstreq{\csname MT@\MT at permutelist @\@tempa\MT at extra@context\endcsname}%
+             {\csname MT@\MT at permutelist @\csname MT@\MT at permutelist @name\endcsname @load\endcsname}%
+              \relax{%
+            \MT at warning{\@nameuse{MT at abbr@\MT at permutelist} list
+              `\@nameuse{MT@\MT at permutelist @name}' will override list\MessageBreak
+              `\@nameuse{MT@\MT at permutelist @\@tempa\MT at extra@context}'
+              for font `\@tempa'}%
+          }%
         }%
       }%
       \MT at xdef@n{MT@\MT at permutelist @\@tempa\MT at extra@context}%
@@ -1957,9 +1985,13 @@
     }%
   }%
   \ifMT at if@
-    \MT at warning{\@nameuse{MT at abbr@\MT at permutelist} list
-      `\@nameuse{MT@\MT at permutelist @name}' will override\MessageBreak
-      list `#3' for font \@tempa,\MessageBreak size \@tempb}%
+    \MT at ifstreq{#3}%
+        {\csname MT@\MT at permutelist @\csname MT@\MT at permutelist @name\endcsname @load\endcsname}%
+        \relax{%
+      \MT at warning{\@nameuse{MT at abbr@\MT at permutelist} list
+        `\@nameuse{MT@\MT at permutelist @name}' will override\MessageBreak
+        list `#3' for font \@tempa,\MessageBreak size \@tempb}%
+    }%
     \expandafter\MT at tlist@break
   \fi
 }

Modified: trunk/Master/texmf-dist/tex/latex/microtype/mt-CharisSIL.cfg
===================================================================
--- trunk/Master/texmf-dist/tex/latex/microtype/mt-CharisSIL.cfg	2017-07-13 23:11:24 UTC (rev 44790)
+++ trunk/Master/texmf-dist/tex/latex/microtype/mt-CharisSIL.cfg	2017-07-13 23:12:08 UTC (rev 44791)
@@ -38,7 +38,7 @@
 %% ------------------------------------------------------------------------ 
 %%
 \ProvidesFile
-  {mt-CharisSIL.cfg}[2013/03/13 v1.0 microtype config. file: Charis SIL (RS)]
+  {mt-CharisSIL.cfg}[2017/07/07 v1.1 microtype config. file: Charis SIL (RS)]
 
 %%% -----------------------------------------------------------------------
 %%% INHERITANCE
@@ -448,32 +448,62 @@
      χ = {50,50},
    }
 
+ % quick and dirty -- maybe we'll promote this to a
+ % regular key some time
+\define at key{MT at pr@c}{command}{\csname #1\endcsname}
+
+ % glyph names have changed with version 5.0 of Charis SIL:
+ % before: /a.SC, /b.SC, ...
+ % after:  /a.sc, /b.sc, ...
+\ifx\MT at lua\@undefined
+  \gdef\MT at get@CHARIS at SC{
+    % test whether glyph "a.sc" exists
+    \ifnum\numexpr\XeTeXglyphindex "a.sc"\relax > 0
+      \gdef\MT at CHARIS@SC{sc}%
+    \else
+      \gdef\MT at CHARIS@SC{SC}%
+    \fi
+  }
+\else
+  \gdef\MT at get@CHARIS at SC{
+    \gdef\MT at CHARIS@SC{\MT at lua{
+      % check font version
+      if (tonumber(fontloader.info(font.getfont(font.current()).filename).version) < 5) then;
+        tex.print("SC");
+      else;
+        tex.print("sc");
+      end
+    }}
+  }
+\fi
+
 \SetProtrusion
    [ name     = Charis-sc,
-     load     = Charis-default   ]
+     load     = Charis-default,
+     command  = {MT at get@CHARIS at SC} ]
    { encoding = {EU1,EU2,TU},
      family   = Charis SIL,
      shape    = {sc}  }
    {
     % ᴀ = {100,100}, % etc., doesn't work with \textsc
-     /a.SC = {100,100},
-     /c.SC = {50,  },
-     /d.SC = {  ,50},
-     /f.SC = {  ,50},
-     /g.SC = {50,  },
-     /j.SC = {100, },
-     /k.SC = {  ,50},
-     /l.SC = {  ,50},
-   /f_l.SC = {  ,50},
-     /o.SC = {50,50},
-    /oe.SC = {50,  },
-     /q.SC = {50,70},
-     /r.SC = {  ,50},
-     /t.SC = {50,100},
-     /v.SC = {50,50},
-     /w.SC = {50,50},
-     /x.SC = {50,50},
-     /y.SC = {50,50}
+     /a.\MT at CHARIS@SC = {100,100},
+     /c.\MT at CHARIS@SC = {50,  },
+     /d.\MT at CHARIS@SC = {  ,50},
+     /f.\MT at CHARIS@SC = {  ,50},
+     /g.\MT at CHARIS@SC = {50,  },
+     /j.\MT at CHARIS@SC = {100, },
+     /k.\MT at CHARIS@SC = {  ,50},
+     /l.\MT at CHARIS@SC = {  ,50},
+   /f_l.\MT at CHARIS@SC = {  ,50},
+     /o.\MT at CHARIS@SC = {50,50},
+    /oe.\MT at CHARIS@SC = {50,  },
+     /q.\MT at CHARIS@SC = {50,70},
+     /r.\MT at CHARIS@SC = {  ,50},
+     /t.\MT at CHARIS@SC = {50,100},
+     /v.\MT at CHARIS@SC = {50,50},
+     /w.\MT at CHARIS@SC = {50,50},
+     /x.\MT at CHARIS@SC = {50,50},
+     /y.\MT at CHARIS@SC = {50,50}
    }
 
 \endinput



More information about the tex-live-commits mailing list