如何修复 iftex.sty 未找到问题?

如何修复 iftex.sty 未找到问题?

我被要求使用最新的acmart样式来撰写论文。但是,当我下载模板并尝试编写示例文本时,它失败并显示消息! LaTeX Error: File iftex.sty not found

我的命令是:(> pdflatex sample-sigplan.tex也试过latex)我下载的包和模板是https://www.acm.org/publications/proceedings-template 并且acmart.cls来自http://www.sigplan.org/sites/default/files/acmart/current/acmart.cls

我的系统是 Ubuntu 14.04。该如何修复?

答案1

iftex.sty是该包的一部分texlive-generic-extra

sudo apt-get install texlive-generic-extra

答案2

在 Ubuntu 19.10 中,iftex现在是texlive-plain-generic

sudo apt-get install texlive-plain-generic

答案3

我遇到了同样的问题。创建一个名为的文件iftex.sty并将其放在您的文档文件夹中。文件的内容应该

%%
%% 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'.

答案4

您可能希望先尝试运行“MikTex Update (Admin)”来更新您的软件包。它解决了我电脑上的相同问题。

相关内容