3

There is one error with the combination of spanish babel, pdfx package, and LuaLaTex engine, how it is very easy to test with this MWE:

\documentclass{article}

\usepackage[spanish]{babel} 

\usepackage{amsmath}
\usepackage{pdfx}   

\begin{document}

\begin{equation*}
P_{\max}=0.1
\end{equation*}

\end{document}

The .log contains

! Illegal unit of measure (pt inserted).
<to be read again> 
/
l.11 P_{\max
          }=0.1
? 
! Missing number, treated as zero.
<to be read again> 
\xdef 
l.11 P_{\max
          }=0.1
? 
! Illegal unit of measure (pt inserted).
<to be read again> 
\xdef 
l.11 P_{\max
          }=0.1
? 
! Illegal unit of measure (pt inserted).
<to be read again> 
/
l.11 P_{\max
          }=0.1
? 
! Missing = inserted for ifdim.
<to be read again> 
/
l.11 P_{\max
          }=0.1
? 
! Missing number, treated as zero.
<to be read again> 
/
l.11 P_{\max
          }=0.1
? 

and a stream of similar complaints all for the same single line.

8
  • What exactly is the error? The document compiles fine for me when I run it with LuaLaTeX (or pdfLaTeX, as a matter of fact I get an error about CreationDate is not properly supported; PDF validation may fail. with XeLaTeX). The output looks OK as well (I get "máx" for \max and "0,1" for 0.1) but I assume that is intended if spanish is passed to babel. Can you please include the relevant bits of your .log file and a screenshot of the output (if appropriate).
    – moewe
    Commented May 24, 2019 at 15:25
  • Thanks for the .log. The only relevant difference I could spot on first glance is that my pdfx package is older than yours. I'll investigate ... edit: Yup. Updated pdfx (which wasn't up to date for some reason) and I can now reproduce the error.
    – moewe
    Commented May 24, 2019 at 15:35
  • At least my incompetence in keeping my packages up to date strongly suggests that pdfx is the culprit. I had pdfx v1.6.1 and things worked, after an update to v1.6.3 things don't work any more. So it probably broke in between those two versions.
    – moewe
    Commented May 24, 2019 at 15:42
  • 1
    pdfx added some code to change mathaccents and this breaks with spanish. You could add \unaccentedoperators as a workaround. Commented May 24, 2019 at 16:22
  • 1
    @JavierBezos pdfx has added a \pdfx@mathaccentV and then redefines mathaccentV. Commented May 24, 2019 at 16:23

1 Answer 1

4

It's a bug in spanish, which has popped up after a change in pdfx. As a workaround, after loading babel, write:

\makeatletter
\def\es@fetchenc{%
  \begingroup
    \count@\escapechar \escapechar=\m@ne
      \edef\es@a{\expandafter\string\the\textfont\mathgroup}%
      \expandafter\split@name\es@a////\@nil
    \escapechar=\count@
    \@expandtwoargs\in@{////}{\f@size}%
    \ifin@\else
      \PackageError{spanish}{%
        Non-NFSS font name. The current math font (\es@a)\MessageBreak
        doesn't follow the NFSS conventions. I'll use the\MessageBreak
        default \string\i\space for \string\dotlessi,
        but expect a wrong output.}%
      {Find where this font has been (re)defined, and fix it.}%
      \def\f@encoding{OT1}%
    \fi
  \bbl@exp{\endgroup\def\\\f@encoding{\f@encoding}}}
\makeatother
1
  • The workaround resolves the problem. I'm going to accept the solution and I'm going to vote up Commented May 24, 2019 at 17:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .