[Tex/LaTex] Loading microtype before or after the font

microtype

According to the answer given here, the microtype package should be loaded after the font, since microtype "needs to know what fonts are in use at the time that it is loaded". I am, however, not able to detect any difference between loading microtype before and after setting the font. I also notice that in the MWE below, the mt-*.cfg file for EB Garamond is loaded after fontspec, even if microtype is loaded first.

Does this mean that it simply doesn't matter when microtype is loaded?

\documentclass{article}
\usepackage{microtype,polyglossia}
    \setdefaultlanguage{english}
\usepackage{blindtext,fontspec}
    \setmainfont{EB Garamond}
\begin{document}
\Blinddocument
\end{document}

(simplified and abbreviated output below)
This is XeTeX, Version 3.1415926-2.5-0.9999.3 (TeX Live 2013/W32TeX)
(c:/texlive2013/texmf-dist/tex/latex/microtype/microtype.sty)
(c:/texlive2013/texmf-dist/tex/latex/microtype/microtype.cfg)
(c:/texlive2013/texmf-dist/tex/latex/polyglossia/polyglossia.sty)
(c:/texlive2013/texmf-dist/tex/latex/fontspec/fontspec.sty)
(c:/texlive2013/texmf-dist/tex/latex/fontspec/fontspec.cfg)
(c:/texlive2013/texmf-dist/tex/latex/ebgaramond/mt-EBGaramond.cfg)

Best Answer

microtype can be loaded at any time as the actual font setup is deferred until the end of the preamble. The restriction that the package should be loaded after the fonts dates back to very old microtype versions (older than v1.9a (2005/12/05)). (I've fixed this in the answer you link to.)

There are only two caveats concerning loading order (see "Hints and Caveats"), none of which apply to your case, just mentioning them for completeness' sake:

  • when loading microtype with the babel option, load babel first
  • with luatex, load fontspec first (only the package, not necessarily the fonts)
Related Question