CentOS: fix error: LaTeX Error: File `iftex.sty’ not found.


Sample error:

[root@tutorialspots pdf]# pandoc -f epub --pdf-engine=xelatex "file.epub" -o "file.pdf"
Error producing PDF.
! LaTeX Error: File `iftex.sty' not found.

Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: sty)

Enter file name:
! Emergency stop.
<read *>

l.9 \ifPDFTeX

Fix:
Step 1:
Find package contains file `iftex.sty’:

[root@tutorialspots pdf]# yum whatprovides '*/iftex.sty' --disablerepo=mariadb
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.fra1.de.leaseweb.net
 * epel: mirror.23m.com
 * extras: centosmirror.netcup.net
 * remi-php72: mirror.dogado.de
 * remi-safe: mirror.dogado.de
 * updates: centosmirror.netcup.net
2:texlive-iftex-svn29654.0.2-45.el7.noarch : Am I running under pdfTeX, XeTeX or LuaTeX?
Repo        : base
Matched from:
Filename    : /usr/share/texlive/texmf-dist/tex/generic/iftex/iftex.sty

Step 2:
yum install texlive-iftex

[root@tutorialspots pdf]# yum install texlive-iftex
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.fra1.de.leaseweb.net
 * epel: mirror.23m.com
 * extras: centosmirror.netcup.net
 * remi-php72: mirror.dogado.de
 * remi-safe: mirror.dogado.de
 * updates: centosmirror.netcup.net
http://yum.mariadb.org/10.3/centos7-amd64/repodata/repomd.xml: [Errno 14] HTTP Error 404 - Not Found
Trying other mirror.
To address this issue please refer to the below wiki article

https://wiki.centos.org/yum-errors

If above article doesn't help to resolve this issue please use https://bugs.centos.org/.

Resolving Dependencies
--> Running transaction check
---> Package texlive-iftex.noarch 2:svn29654.0.2-45.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

============================================================================================================================================================================
 Package                                    Arch                                Version                                             Repository                         Size
============================================================================================================================================================================
Installing:
 texlive-iftex                              noarch                              2:svn29654.0.2-45.el7                               base                               19 k

Transaction Summary
============================================================================================================================================================================
Install  1 Package

Total download size: 19 k
Installed size: 2.5 k
Is this ok [y/d/N]: y
Downloading packages:
texlive-iftex-svn29654.0.2-45.el7.noarch.rpm                                                                                                         |  19 kB  00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : 2:texlive-iftex-svn29654.0.2-45.el7.noarch                                                                                                               1/1
  Verifying  : 2:texlive-iftex-svn29654.0.2-45.el7.noarch                                                                                                               1/1

Installed:
  texlive-iftex.noarch 2:svn29654.0.2-45.el7

Complete!

Leave a Reply