3

I use MiKTeX on windows and am currently having trouble loading expl3. I recently updated the LaTeX3 packages. The following code is sufficient to generate the error:

\documentclass{article}
\usepackage{expl3}
\begin{document}
test
\end{document}

To which latex replies:

! Missing = inserted for \ifnum.
<to be read again> 
                   -
l.3     \begin
              {document}

I uninstalled and reinstalled both l3kernel and l3packages. MiKTeX Package Manager reports that l3kernel is "Packaged on" 2018-11-22 and "Installed on" 2018-12-05 and that l3packages is "Packaged on" 2018-10-18 and "Installed on" 2018-12-05. Maybe the issue has to do with the different dates they are "Packaged on"? I haven't looked at the diff between the two versions.

Anyways, throwing a \tracingall in before \usepackage{expl3} I get:

.... 40 megabyes of text
\@ifl@t@r #1#2->\ifnum \expandafter \@parse@version #1//00\@nil <\expandafter \
@parse@version #2//00\@nil \expandafter \@secondoftwo \else \expandafter \@firs
toftwo \fi 
#1<-\ver@expl3.sty 
#2<-
{\ifnum: (level 1) entered on line 9}
{\expandafter}

\ver@expl3.sty ->2018-11-19 L3 programming layer (loader) 

\@parse@version #1/#2/#3#4#5\@nil ->#1#2#3#4 
#1<-2018-11-19 L3 programming layer (loader) 
#2<-
#3<-0
#4<-0
#5<-
! Missing = inserted for \ifnum.
<to be read again> 
                   -

So the issue is that the innermost macro of \@ifpackagelater called \@ifl@ter is expecting expl3 to report its date as e.g., 2018/11/19 but it's reported as 2018-11-19 with dashes instead of slashes. For now, I can get code to run by saying:

\documentclass{article}
\makeatletter
\let\save@ifl@ter\@ifl@ter
\def\@ifl@ter#1#2#3#4#5{}  % Temporarily dummy out \@ifl@ter
\usepackage{expl3}         % load package
\let\@ifl@ter\save@ifl@ter % Restore \@ifl@ter
% This would break with the same error as before:
%\@ifpackagelater{expl3}{10/10/2018}{\message{yes}}{\message{no}} 
\makeatother

\begin{document}
test
\end{document}
Hood Chatham
  • 5,467

1 Answers1

7

The LaTeX kernel got updated in April, 2017 to use the ISO 8601 date format yyyy-mm-dd instead of a format Frank invented :)

You have to update your LaTeX kernel to a newer version so that the date format in expl3 works. It's always better to update all packages together, or these conflicts might happen.


If you can't update for whatever reason, you can use the newer date parser (code tested with an up-to-date (Dec 6th, 2018) expl3 with the LaTeX kernel of TeXLive 2015):

\documentclass{article}

\makeatletter
\def\@ifl@t@r#1#2{%
  \ifnum\expandafter\@parse@version@#1//00\@nil<%
        \expandafter\@parse@version@#2//00\@nil
    \expandafter\@secondoftwo
  \else
    \expandafter\@firstoftwo
  \fi}
\def\@parse@version@#1{\@parse@version0#1}
\def\@parse@version#1/#2/#3#4#5\@nil{%
\@parse@version@dash#1-#2-#3#4\@nil
}
\def\@parse@version@dash#1-#2-#3#4#5\@nil{%
  \if\relax#2\relax\else#1\fi#2#3#4 }
\makeatother

\usepackage{expl3}

\begin{document}

hello

\end{document}