2

I am trying to compile a LaTeX into PDF with TexStudio and MikTek 2.9 on my windows 10 PC:

\documentclass{comjnl}
\usepackage{amsmath}
\begin{document}
    x
\end{document}

but I systematically get an error at line 189 of pdftexcmds.sty:

! Undefined control sequence.
l.189 \ifluatex

In the logs, I also see:

LaTeX Warning: You have requested, on input line 186, version
  `2019/11/07' of package iftex, but only version
  `2013/04/04 v0.2 Provides if(tex) conditional for PDFTeX, XeTeX,
  and LuaTeX' is available.

I have just reinstalled MikTex from scratch. The installed iftex version has been packaged on 10/11/2019.

Is this a bug? How can I solve this?

P.S. This issue does not happen when I use document class article or when I don't use package amsmath.

2 Answers2

0

Following Ulrike's comment, I had not performed updates as a user (but I had done it as an admin). Then, I had to install iftex, refresh the database via MikTex's console and the issue is now gone.

0

I had the same issue where adding any \usepackage{<packageName>} before the \begin{document} statement would lead to the above error. I tried installing pdftexcmds and iftex packages by

mpm --admin --install=<packageName>

in a terminal with admin privileges, but it didn't help.

What I ended up doing was to uninstall the MiKTeX I had installed via Chocolatey by choco uninstall miktex and then uninstall the second MiKTeX installation which was still in my C:\Program Files\MiKTeX 2.9\miktex for some reason!. then I deleted the MiKTeX folders in:

  1. C:\Users\<userName>\AppData\Roaming
  2. C:\Users\<userName>\AppData\Local

and then I reinstalled MiKTeX through chocolatey by

choco install MiKTeX

it seems that my MiKTeX installation was messed up and a complete uninstall and a fresh reinstallation solves the above weird error!

Foad
  • 893