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}
  • 1
    Tha LaTeX kernel got updated and replaced the date format from dd/mm/yyyy to dd-mm-yyyy. You probably should update the LaTeX kernel as well. – Phelype Oleinik Dec 6 at 18:41
  • How do I do that? Does mpm have an entry for the latex kernel? Searching for "kernel" the only package that turns up is l3kernel. – Hood Chatham Dec 6 at 18:44
  • 2
    @HoodChatham It will be listed just as latex – Joseph Wright Dec 6 at 18:47
  • 3
    run the update manager as user and as admin. – Ulrike Fischer Dec 6 at 18:47
  • 1
    Probably related: tex.stackexchange.com/q/422176/35864 – moewe Dec 6 at 20:32

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}
  • \begin{nitpick}You did mean yyyy-mm-dd, didn't you? \end{nitpick} – Harald Hanche-Olsen Dec 6 at 19:26
  • @HaraldHanche-Olsen \begin{thanks} Oops, you're right :) \end{thanks} – Phelype Oleinik Dec 6 at 19:34
  • I think the YYYY-MM-DD format has been supported since 2017 (latex-project.org/news/latex2e-news/ltnews27.pdf). latexrelease may also help here. – moewe Dec 6 at 20:33
  • @moewe Indeed. I hadn't found this ltnews before. Thanks :) – Phelype Oleinik Dec 6 at 21:29
  • 1
    nice to see my inventions being commented on :-) but I made more important ones I hope – Frank Mittelbach Dec 8 at 13:18

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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