20

I am asked to use the latest acmart style for my paper. However, when I downloaded the template and tried to compile the sample text, it failed with message ! LaTeX Error: File iftex.sty not found.

My command is: > pdflatex sample-sigplan.tex (also tried latex) and the package and template I downloaded is https://www.acm.org/publications/proceedings-template and the acmart.cls is from http://www.sigplan.org/sites/default/files/acmart/current/acmart.cls

My system is Ubuntu 14.04. How to fix it?

1
  • 1
    google.co.uk/search?q=iftex.sty shows multiple links to the file, just save it in the same folder as your document. (however it is contained in miktex and texlive so you should have it in your tex system, or could add it by updating via the tex package manager) Commented Sep 21, 2017 at 21:19

4 Answers 4

26

iftex.sty is part of the texlive-generic-extra package:

sudo apt-get install texlive-generic-extra
4

In Ubuntu 19.10, iftex is now part of texlive-plain-generic:

sudo apt-get install texlive-plain-generic
2

I had the same issue. Create a file called iftex.sty and put it in your document folder. The contents of the file should be

%%
%% This is file `iftex.sty',

%% 
%%   __________________________________
%%   Copyright © 2010–2013 Persian TeX Group
%% 
%%   License information appended.
%% 
%% 
\csname iftexloaded\endcsname
\let\iftexloaded\endinput
\expandafter\ifx\csname ProvidesPackage\endcsname\relax\else
  \ProvidesPackage{iftex}
    [2013/04/04 v0.2 Provides if(tex) conditional for PDFTeX, XeTeX, and LuaTeX]
\fi
\def\RequirePDFTeX{%
  \ifPDFTeX\else
    \begingroup
      \errorcontextlines=-1\relax
      \newlinechar=10\relax
      \errmessage{^^J
      ********************************************^^J
      * PDFTeX is required to compile this document.^^J
      * Sorry!^^J
      ********************************************}%
    \endgroup
  \fi}
\def\RequireXeTeX{%
  \ifXeTeX\else
    \begingroup
      \errorcontextlines=-1\relax
      \newlinechar=10\relax
      \errmessage{^^J
      ********************************************^^J
      * XeTeX is required to compile this document.^^J
      * Sorry!^^J
      ********************************************}%
    \endgroup
  \fi}
\def\RequireLuaTeX{%
  \ifLuaTeX\else
    \begingroup
      \errorcontextlines=-1\relax
      \newlinechar=10\relax
      \errmessage{^^J
      ********************************************^^J
      * LuaTeX is required to compile this document.^^J
      * Sorry!^^J
      ********************************************}%
    \endgroup
  \fi}
\expandafter\ifx\csname ifPDFTeX\endcsname\relax\else
  \expandafter\endinput
\fi
\expandafter\ifx\csname ifXeTeX\endcsname\relax\else
  \expandafter\endinput
\fi
\expandafter\ifx\csname ifLuaTeX\endcsname\relax\else
  \expandafter\endinput
\fi
\newif\ifPDFTeX
\begingroup\expandafter\expandafter\expandafter\endgroup
\expandafter\ifx\csname pdfmatch\endcsname\relax
  \PDFTeXfalse
\else
  \PDFTeXtrue
\fi
\newif\ifXeTeX
\begingroup\expandafter\expandafter\expandafter\endgroup
\expandafter\ifx\csname XeTeXinterchartoks\endcsname\relax
  \XeTeXfalse
\else
  \XeTeXtrue
\fi
\newif\ifLuaTeX
\begingroup\expandafter\expandafter\expandafter\endgroup
\expandafter\ifx\csname directlua\endcsname\relax
  \LuaTeXfalse
\else
  \LuaTeXtrue
\fi
%% 
%% Copyright © 2010–2013      by Persian TeX Group     <[email protected]>
%% 
%% Distributable under the LaTeX Project Public License,
%% version 1.3c or higher (your choice). The latest version of
%% this license is at: http://www.latex-project.org/lppl.txt
%% 
%% This work is "maintained" (as per LPPL maintenance status)
%% by Persian TeX Group.
%% 
%% 
%% 
%% 
%%
%% End of file `iftex.sty'.
2
  • I've been struggling with this issue for hours. Since I don't have admin rights and the all *tex universe is very opaque to me, this answer eventually resolved it. For the record, I put the code above in ~/texmf/tex/iftex.sty rather than in the document directory.
    – dariober
    Commented May 20, 2022 at 10:44
  • Better yet: if you keep a ~/localtexmf folder registered with your tex installation, put it there. I'm on Windows, so that is `C:\Dropbox\localtexmf`` in mine.
    – user101089
    Commented Jun 8, 2022 at 18:44
0

You may want to try running "MikTex Update (Admin)" first to update your packages. It worked out for the same problem on my computer.

You must log in to answer this question.

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