12

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)
  • mt-EBGaramond.cfg is not loaded here even if microtype is loaded second. I can't detect a difference but for a different reason: mt-EBGaramond.cfg is not loaded either way. However, I had to change your code to get it to compile and use EB Garamond 12 as the font name. So maybe that makes a difference? – cfr Feb 24 '14 at 17:36
  • 1
    @cfr I don't understand. mt-EBGaramond.cfg is not loaded? According to the log, it is, as seen in my MWE. I also don't understand what you mean by "maybe that makes a difference?" – Sverre Feb 24 '14 at 17:55
  • What I mean is: when I compile your code, it is not loaded. Except that I had to alter your code to get it to compile. Without the 12 I just get errors. With the 12, it compiles but it never loads the cfg file regardless. It is in your log, but not mine! – cfr Feb 24 '14 at 22:13
  • Since you’re using XeTeX with microtype you should know about the limitations this combination has. – Crissov Feb 25 '14 at 7:59
  • @cfr I see. That's a problem at your end, since the EB Garamond font is supposed to load without specifying the optical size. But this has nothing to do with my microtype question, so let's leave that aside. @Crissov I do, but pdflatex is not an option for me, since I need to use larger fonts. And lualatex has other limitations, such as not being able to compile with pstricks. – Sverre Feb 25 '14 at 12:13
9

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)
|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.