Skip to content
tex engine detection
TeX Lua
Branch: master
Clone or download
Latest commit 16d6e42 Nov 8, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
testfiles-plain more l3build check config Oct 26, 2019
testfiles test against csnames being relaxed Nov 7, 2019
LICENCE no md extension on LICENCE, better formatting in github UI as it isn'… Oct 25, 2019
config-etex-plain.lua more l3build check config Oct 26, 2019
config-plain.lua more l3build check config Oct 26, 2019
ifetex.sty use iftex instead Oct 26, 2019
ifpdf.sty add ifpdf.sty wrapper (removing from oberdiek bundle) Oct 27, 2019
iftex.tex clarify wording Nov 8, 2019
ifvtex.sty define the vtex specific ifs to false in other engines Oct 27, 2019
ifxetex.sty use iftex instead Oct 26, 2019


TeX Engine Detection

This iftex package provides a suite of commands for detecting different TeX variants.

For each supported engine, tests are provided of the form

\ifpdftex which is true if PDFTeX is in use and \RequirePDFTeX which stops the run with an error message if PDFTeX is not being used.

The package (which works with plain TeX as well as LaTeX) has tests for:

eTeX, PDFTeX, XeTeX, LuaTeX, LuaHBTeX, pTeX, upTeX, pTeX-ng, VTeX, Aleph.

In addition, an \iftutex test is true for XeTeX and LuaTeX, and an \ifpdf test is provided to test the PDF or DVI output mode.

Compatibility Packages

In addition to the main iftex.sty package, small wrapper packages are provided

ifetex.sty ifluatex.sty ifvtex.sty ifxetex.sty ifpdf.sty

These include iftex and in some cases emulate some additional commands to allow these packages to replace the original packages in TeX distributions. It is recommended that new documents do not use these packages, but instead load iftex.sty directly.

This package may be used on any format (it may be loaded into initex) it does not assume LaTeX.

This is a merger and simplification of several packages Based on a suggestion of Norbert Preining

  • ifetex: Martin Scharrer
  • ifxetex: Will Robertson
  • iftex: Persian TeX Group / Vafa Khalighi
  • ifluatex, ifvtex: Heiko Oberdiek
  • ifptex: Takayuki Yato
  • ifpdf: Heiko Oberdiek and LaTeX3 Project

The existing if(u)ptex packages do far more extensive testing to distinguish different variants which are not copied here.

A document specifically for Japanese texts may need the finer grained tests of the ifptex package which has tests for particular versions of the pTeX (Japanese TeX) variant in use, and for the mode that is active.

This generic package only has coarser tests for the tex variant in use, so is sufficient for example to distinguish upTeX from pTeX, and to distinguish both of those from LuaTeX.

You can’t perform that action at this time.