I just updated to TeXLive 2014 and when compiling the following code using either XeLaTeX or LuaLaTeX I get an error:

\setsansfont{Latin Modern Sans}[Scale=MatchLowercase]
\textsf{Example text}

The error:

! Undefined control sequence.
\__fontspec_calc_scale:n ..._tmpb_dim }\fp_div:Nn 
                                                  \l__fontspec_tmpa_fp {\l__...
l.3 ...font{Latin Modern Sans}[Scale=MatchLowercase]

If I remove the [Scale=MatchLowercase] bit then it compiles. If I use other font features (eg Numbers=Uppercase) it works. It's just the Scale command with either MatchLowercase or MatchUppercase that causes the error.

The font does not seem to matter nor does setting the sans or main font.

  • That's a known bug (fontspec uses a now deprecated command). It will hopefully be corrected soon. – Ulrike Fischer Jun 19 '14 at 22:11
  • @UlrikeFischer Ah, I didn't see the bug mentioned anywhere, thanks. – bfootdav Jun 19 '14 at 22:26
  • 2
    The version of fontspec now on CTAN has fixed this problem. – Thérèse Jun 26 '14 at 1:35

fontspec uses the deprecated function \fp_div:Nn that has been removed from the base code. The removed function appears only once. Until the bug is fixed you can define the missing function:

\usepackage{fontspec}[2014/06/01] % the fix is just for this version

\cs_new_protected:Npn \fp_div:Nn #1 #2
   \fp_set:Nn #1 { #1/#2 }

\setsansfont{Latin Modern Sans}[Scale=MatchLowercase]
\textsf{Example text}
|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.