Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am suddenly getting the following error when trying to compile my document with LuaLaTeX and my simple question is: what does it mean?

LuaTeX error (font expansion): font has been expanded with different expansion step.

I tried this as a possible solution but it did not change anything.

I am saying "suddenly" because when I was compiling the same document on another machine last night, it worked fine. The only possible difference I can come up with is that the other machine might not have had the very latest version of fontspec or microtype, but the one where the error occurs does (via MiKTeX).

At this point, I don't want to create a mimimal code example, I'd just like to understand what that error means so I can try and trace it. But here is how I load the relevant packages:

\usepackage[
  activate={false,nocompatibility},
  final,
 ]{microtype}

\usepackage{fontspec}
\newfontfeature{Microtype}{protrusion=default;expansion=default;}
\setmainfont[Microtype,Ligatures=TeX,Renderer=Basic]{Times New Roman}

I should add that the error disappears when I deactivate the microtype package.

And this is the relevant part of the logfile:

LaTeX Font Info:    Checking defaults for OML/cmm/m/it on input line 4.
LaTeX Font Info:    ... okay on input line 4.
LaTeX Font Info:    Checking defaults for T1/cmr/m/n on input line 4.
LaTeX Font Info:    ... okay on input line 4.
LaTeX Font Info:    Checking defaults for OT1/cmr/m/n on input line 4.
LaTeX Font Info:    ... okay on input line 4.
LaTeX Font Info:    Checking defaults for OMS/cmsy/m/n on input line 4.
LaTeX Font Info:    ... okay on input line 4.
LaTeX Font Info:    Checking defaults for OMX/cmex/m/n on input line 4.
LaTeX Font Info:    ... okay on input line 4.
LaTeX Font Info:    Checking defaults for U/cmr/m/n on input line 4.
LaTeX Font Info:    ... okay on input line 4.
LaTeX Font Info:    Checking defaults for EU2/lmr/m/n on input line 4.
LaTeX Font Info:    ... okay on input line 4.
LaTeX Font Info:    Checking defaults for T3/cmr/m/n on input line 4.
LaTeX Font Info:    Try loading font information for T3+cmr on input line 4.
 ("C:/Program Files/MiKTeX 2.9/tex/latex/tipa/t3cmr.fd"
File: t3cmr.fd 2001/12/31 TIPA font definitions
)
LaTeX Font Info:    ... okay on input line 4.
luaotfload | load font: auto-selecting default features for script: dflt (was l
atn)
luaotfload | load font: font family='timesnewroman', subfamily='regular' found:
 times.ttf
LaTeX Info: Redefining \microtypecontext on input line 4.
Package microtype Info: Generating PDF output.
Package microtype Info: Character protrusion enabled (level 2).
Package microtype Info: Using default protrusion set `alltext'.
Package microtype Info: Automatic font expansion enabled (level 2),
(microtype)             stretch: 20, shrink: 20, step: 1, non-selected.
Package microtype Info: Using default expansion set `basictext'.
Package microtype Info: No adjustment of tracking.
Package microtype Info: No adjustment of spacing.
Package microtype Info: No adjustment of kerning.
Package microtype Info: Loading generic settings for font family
(microtype)             `TimesNewRoman' (encoding: EU2).
(microtype)             For optimal results, create family-specific settings.
(microtype)             See the microtype manual for details.

! LuaTeX error (font expansion): font has been expanded with different expansio
n step.
<to be read again> 
                   relax 
l.4 \begin{document}




Here is how much of LuaTeX's memory you used:
 31786 strings out of 495011
 125171,1144653 words of node,token memory allocated 1001 words of node memory still in use:
    nodes
   avail lists: 1:2,2:29,3:1,4:9,5:2,6:2,7:1,9:1,11:1
 34213 multiletter control sequences out of 65536+200000
 31 fonts using 6322279 bytes
 65i,1n,95p,886b,696s stack positions out of 5000i,500n,10000p,200000b,50000s
!  ==> Fatal error occurred, no output PDF file produced!
share|improve this question

1 Answer 1

up vote 8 down vote accepted

As pointed out in this answer, you should not mix microtype's interface with that of fontspec (resp. luaotfload). Either use:

\usepackage{fontspec}
\usepackage[activate,final]{microtype}
\setmainfont[Ligatures=TeX,Renderer=Basic]{Times New Roman}

or:

\usepackage{fontspec}
\newfontfeature{Microtype}{protrusion=default;expansion=default;}
\setmainfont[Microtype,Ligatures=TeX,Renderer=Basic]{Times New Roman}

(In your case, fontspec wants to expand the font with a step of 5, while microtype uses a step of 1, which causes the error.)

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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