35

With TeX Live 2017, microtype has started producing dozens of unknown slot number warnings. This does not happen with TeX Live 2016 (fully updated). Here is an MWE:

\documentclass{article}
\usepackage{fontspec}
\setmainfont{Georgia}
\usepackage[english]{babel}
\usepackage{microtype}
\begin{document}
Test.
\end{document}

This produces dozens of warnings, starting with these two:

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


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

The list goes all the way to z, and might include every accented character. I get the same error with Cardo,Gentium Plus, and Times New Roman (all the fonts I tested).

This seems to be a bug.

jcr
  • 753
  • 2
    I can confirm this, unfortunately –  Jun 06 '17 at 17:05
  • I had this problem, too, but it is gone now. Does microtype have a public repository and a bug tracker, e.g. on github? I could not find it and it is not mentione on the CTAN page https://www.ctan.org/pkg/microtype – matth Jul 18 '17 at 10:32
  • I have the same error message with texlive2021, after an update a month ago!!! – tatojo Jun 25 '21 at 23:56

1 Answers1

22

This is due to a change in how latex declares legacy (LICR) input for unicode characters (the warnings only crop up with TU encoding, i.e., with xelatex or lualatex, and only for microtype settings that contain LICR input – in your case, the default settings).

EDIT: This issue has been fixed with version 2.7 of microtype.


Solution for older versions of the microtype package:

\makeatletter
\def\MT@is@composite#1#2\relax{%
  \ifx\\#2\\\else
    \expandafter\def\expandafter\MT@char\expandafter{\csname\expandafter
                    \string\csname\MT@encoding\endcsname
                    \MT@detokenize@n{#1}-\MT@detokenize@n{#2}\endcsname}%
    % 3 lines added:
    \ifx\UnicodeEncodingName\@undefined\else
      \expandafter\expandafter\expandafter\MT@is@uni@comp\MT@char\iffontchar\else\fi\relax
    \fi
    \expandafter\expandafter\expandafter\MT@is@letter\MT@char\relax\relax
    \ifnum\MT@char@ < \z@
      \ifMT@xunicode
        \edef\MT@char{\MT@exp@two@c\MT@strip@prefix\meaning\MT@char>\relax}%
          \expandafter\MT@exp@two@c\expandafter\MT@is@charx\expandafter
            \MT@char\MT@charxstring\relax\relax\relax\relax\relax
      \fi
    \fi
  \fi
}
% new:
\def\MT@is@uni@comp#1\iffontchar#2\else#3\fi\relax{%
  \ifx\\#2\\\else\edef\MT@char{\iffontchar#2\fi}\fi
}
\makeatother
Robert
  • 14,181
  • 1
  • 52
  • 77
  • Thank you. This works. Please let us know here when the package is updated. – jcr Jun 07 '17 at 18:01
  • There seems to be another issue, I'm getting pdfTeX error (font expansion): auto expansion is only possible with scalable fonts. with texlive 2017 in file that compiled with texlive 2016 and the fonts MyriadPro. I just don't have the time to build a MWE. – Keks Dose Jun 09 '17 at 08:46
  • @KeksDose This means that you are using a non-Type 1 font. See here, e.g.: https://tex.stackexchange.com/questions/10706/pdftex-error-font-expansion-auto-expansion-is-only-possible-with-scalable, especially Ulrike's answer – Robert Jun 09 '17 at 14:08
  • @Robert File works with texlive 2016 or if I comment out the microtype package with texlive 2017. I'll investigate asap. – Keks Dose Jun 09 '17 at 14:10
  • @Robert There is an issue with my /texmf-local tree, I've been asking this question: https://tex.stackexchange.com/q/374154/4736 – Keks Dose Jun 09 '17 at 15:48
  • 1
    @Robert OK, was a stupid question and no connection to microtype. I forgot to enable the map files of my local tree! – Keks Dose Jun 09 '17 at 16:48
  • 3
    @Robert I have microtype 2.7a but still get the errors - the microtype package seems to have something that looks like your fix. I use LuaLaTeX – Jean-Michaël Celerier Jul 07 '18 at 10:24
  • For reference I am using the Bergamo Std font. – Jean-Michaël Celerier Jul 07 '18 at 10:52
  • 1
    As @Jean-MichaëlCelerier said, the answer does not prevent the errors in all cases with version 2.7a where the workaround is no help neither. For compatibility issues with siunitx, you need to load the package textcomp. – strpeter Oct 30 '18 at 10:12
  • @Jean-MichaëlCelerier The Bergamo Std font does not contain the glyphs for which you get the warnings, so it's not a result of this previous bug, but indeed expected behaviour. For the fix I would refer you to this answer. – Robert Oct 30 '18 at 15:49
  • @strpeter See my comment ^^^^. – Robert Oct 30 '18 at 15:51
  • 3
    I have the same error message with texlive2021, after an update a month ago!!! – tatojo Jun 25 '21 at 23:56
  • @tatojo (1) it's not an error but a warning. (2) which font are you using? (3) did you check the answer I linked to two comments above yours? – Robert Jun 26 '21 at 14:19
  • @Robert, I don't get pdf, before the texlive update everything was ok. Using TeXGyre Pagella. Yes, I tried your sggestion, didn't help. I think they modify somehow microtype, but can't find what! Some long and complex files stopped to compile!!! Sad! – tatojo Jun 27 '21 at 03:31
  • 1
    @tatojo well, if your document doesn't compile anymore, then that's a different issue. I suggest you ask a new question including a minimal example and the error message you get. BTW, microtype was last updated in March. – Robert Jun 27 '21 at 14:07