7

LuaLaTeX from MacTeX 2017 (TeX Live 2017) is giving me a bunch of microtype warnings on this MWE using the Lato font:

\documentclass{article}

\usepackage{fontspec}
\usepackage{microtype}

\setmainfont{Lato}

\begin{document}

Foo

\end{document}

The output from lualatex mwe.tex has a bunch of warnings such as:

Package microtype Warning: Unknown slot number of character
(microtype)                `\u A'
(microtype)                in font encoding `TU' in inheritance list
(microtype)                `microtype.cfg/375(protrusion)'.

I never got these warnings with MacTeX 2016. I have read many TeX.se answers, most notably the question where it is suggested that microtype 2.7 will fix this problem, but I have updated MacTeX, including microtype 2.7, and I am still getting these warnings.

How should I get rid of these warnings?

Thanks!

dsedivec
  • 1,163
  • I can confirm that I get the same with an up to date tl2017 – David Carlisle Jul 15 '17 at 20:55
  • 1
    The Lato Font doesn't have the characters listed in the warnings, for instance \H u and \r u, just to mention two. This seems the source for the issue (I'm not saying it isn't an issue). – egreg Jul 15 '17 at 21:03
  • 1
    @egreg I suspect the the issue is that the TU setup now detects that and so makes \r{u} use the trailing combining ring accent character rather than the declared slot, but not sure what microtype is supposed to do to detect that. – David Carlisle Jul 15 '17 at 21:10
  • @DavidCarlisle The Lato font doesn't have the combining ring accent either (nor the other combining accents); this is possibly the problem. – egreg Jul 15 '17 at 21:14

3 Answers3

6

EDIT: As mentioned by @Finley Huaxin, microtype now (since version 3.0) contains generic basic settings to which you may alias any font with a restricted glyph set: \DeclareMicrotypeAlias{<font>}{TU-basic}. (For the Lato font and some others, this is already included in microtype.cfg)


Original answer: As @egreg and @David have said, the Lato font doesn't include these characters, so you get the warnings because microtype loads the default inheritance list from microtype.cfg.

While David's solution surely rids you of the warnings, the proper(TM) way would be to declare dedicated character inheritance settings for the font. You can put the following in your preamble or in a file called mt-Lato.cfg, which would then be loaded automatically:

\DeclareCharacterInheritance
   { encoding = {TU,EU1,EU2},
     family   = {Lato} }
   { A = {\`A,\'A,\^A,\~A,\"A,\r A,\k A},
     a = {\`a,\'a,\^a,\~a,\"a,\r a,\k a},
     C = {\'C,\c C},
     c = {\'c,\c c},
     D = {\DH},
     d = {\dj},
     E = {\`E,\'E,\^E,\"E,\k E},
     e = {\`e,\'e,\^e,\"e,\k e},
     I = {\`I,\'I,\^I,\"I},
     i = {\`i,\'i,\^i,\"i,\i},
     L = {\L},
     l = {\l},
     N = {\'N,\~N},
     n = {\'n,\~n},
     O = {\O,\`O,\'O,\^O,\~O,\"O},
     o = {\o,\`o,\'o,\^o,\~o,\"o},
     S = {\'S,\v S},
     s = {\'s,\v s},
     U = {\`U,\'U,\^U,\"U},
     u = {\`u,\'u,\^u,\"u},
     Y = {\'Y,\"Y},
     y = {\'y,\"y},
     Z = {\'Z,\.Z,\v Z},
     z = {\'z,\.z,\v z}
   }
Robert
  • 14,181
  • 1
  • 52
  • 77
5

If you literally just want to get rid of the warning you can do

\documentclass{article}

\usepackage{fontspec}
\usepackage{microtype}

\setmainfont{Lato}

\makeatletter
\def\MT@warn@unknown{}
\makeatother

\begin{document}


\r{u}

Foo 

\end{document}

This however doesn't address the underlying issue that the font doesn't have these accents or pre-composed accented characters. However if your document doesn't use those characters that probably isn't a problem.

David Carlisle
  • 757,742
  • 1
    @dsedivec probably you should report it yes although apart from just not warning in this case there isn't a lot microtype can do. \r{u} just makes a u as the font doesn't have a ring accent, so given that the character can't be typeset at all microtype hasn't got a chance to fine-tune its setting. – David Carlisle Jul 15 '17 at 21:41
2

I find with the latest version, \DeclareCharacterInheritance seems not working properly, at least for me. But the Microtype package updated in 2022 clearly gives a solution that works in my case.

If you receive lots of warnings like the above, and you are running LuaTEX or XETEX, this probably means that the font you are using contains less glyphs than are defined in the default protrusion and/or inheritance settings. For such fonts, the microtype package defines basic inheritance settings to which you may alias your font (the generic protrusion settings will still be loaded). Try adding the line:

\DeclareMicrotypeAlias{〈your font〉}{TU-basic}

I added this syntax to my preamble and the warnings eventually disappear. If not works, update version first.

  • 1
    Italian Garamond contains even less glyphs than Lato, that's why you still get warnings. So in this case, the \DeclareMicrotypeAlias solution is perfectly fine. – Robert May 30 '22 at 23:25