texlive[52711] Master/texmf-dist: iftex (9nov19)

commits+karl at tug.org commits+karl at tug.org
Sat Nov 9 23:02:15 CET 2019


Revision: 52711
          http://tug.org/svn/texlive?view=revision&revision=52711
Author:   karl
Date:     2019-11-09 23:02:15 +0100 (Sat, 09 Nov 2019)
Log Message:
-----------
iftex (9nov19)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/generic/iftex/iftex.pdf
    trunk/Master/texmf-dist/doc/generic/iftex/iftex.tex
    trunk/Master/texmf-dist/tex/generic/iftex/iftex.sty

Modified: trunk/Master/texmf-dist/doc/generic/iftex/iftex.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/generic/iftex/iftex.tex
===================================================================
--- trunk/Master/texmf-dist/doc/generic/iftex/iftex.tex	2019-11-09 22:02:02 UTC (rev 52710)
+++ trunk/Master/texmf-dist/doc/generic/iftex/iftex.tex	2019-11-09 22:02:15 UTC (rev 52711)
@@ -39,7 +39,7 @@
 
 For compatibility with earlier packages which did not all use the same
 naming convention all these conditionals are provided in two forms, a
-lowercase name \verb|\iffootex| and a mixed case name \verb|\ifooTeX|.
+lowercase name \verb|\iffootex| and a mixed case name \verb|\iffooTeX|.
 
 \item a command \verb|RequireFooTeX| which checks that \textsf{footex}
   is being used, and stops the run with an error message if a
@@ -181,4 +181,19 @@
 by their original authors and recommended for Japanese documents that
 need fine control over the Japanese \TeX\ system in use.
 
+\section{Compatibility with \textsf{scrbase}}
+The \textsf{scrbase} package (which is automatically included in the
+popular \textsf{KOMA-Script} classes) by default defines
+\verb|\ifpdftex| and \verb|\ifVTeX| with a different syntax.  If you
+use the \textsf{scrbase} option \verb|internalonly| then
+\textsf{scrbase} will not define these and the definitions as
+described here will take effect. This is recommended and will not
+affect any \textsf{scrbase} package code as internally
+\textsf{scrbase} uses private versions of those commands prefixed with
+\verb|\scr@|.  However this package detects if the \textsf{scrbase}
+definitions are in effect and if so does not redefine them, for
+compatibility with existing documents. The \textsf{iftex} versions
+will still be available under the names \verb|\ifPDFTeX| and
+\verb|\ifvtex|.
+
 \end{document}

Modified: trunk/Master/texmf-dist/tex/generic/iftex/iftex.sty
===================================================================
--- trunk/Master/texmf-dist/tex/generic/iftex/iftex.sty	2019-11-09 22:02:02 UTC (rev 52710)
+++ trunk/Master/texmf-dist/tex/generic/iftex/iftex.sty	2019-11-09 22:02:15 UTC (rev 52711)
@@ -30,7 +30,7 @@
 % ProvidesPackage declaration in LaTeX
 \begingroup\expandafter\expandafter\expandafter\endgroup
 \expandafter\ifx\csname ProvidesPackage\endcsname\relax\else
-  \ProvidesPackage{iftex}[2019/11/04 v1.0b TeX engine tests]
+  \ProvidesPackage{iftex}[2019/11/07 v1.0c TeX engine tests]
 \fi
 
 % Save @ catcode, to restore at end, not needed in LaTeX.
@@ -54,7 +54,8 @@
 
 
 % eTeX \protected if available.
-\ifx\protected\@undefined
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname protected\endcsname\relax
   \let\IFTEX at protected\relax
 \else
   \let\IFTEX at protected\protected
@@ -68,7 +69,7 @@
   \catcode41 12 % )
   \catcode44 12 % ,
   \catcode46 12 % .
-  \ifx\directlua\@undefined\else
+  \expandafter\ifx\csname directlua\endcsname\relax\else
     \directlua{tex.enableprimitives("IFTEX@", {"detokenize","protected"})}
   \fi
   }
@@ -99,7 +100,8 @@
   \csname if#2\endcsname}
 
 % etex (should always be true in latex based formats)
-\ifx\numexpr\@undefined
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname numexpr\endcsname\relax
   \IFTEX at let{etex}{false}
 \else
   \IFTEX at let{etex}{true}
@@ -108,7 +110,8 @@
 
 % pdftex (including in dvi mode)
 \IFTEX at let{IFTEX at savedpdftex}{pdftex}
-\ifx\pdftexversion\@undefined
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname pdftexversion\endcsname\relax
   \IFTEX at let{pdftex}{false}
 \else
   \IFTEX at let{pdftex}{true}
@@ -116,7 +119,8 @@
 \IFTEX at let{PDFTeX}{pdftex}
 
 % xetex
-\ifx\XeTeXrevision\@undefined
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname XeTeXrevision\endcsname\relax
   \IFTEX at let{xetex}{false}
 \else
   \IFTEX at let{xetex}{true}
@@ -125,7 +129,8 @@
 
 
 % luatex (including luahbtex)
-\ifx\directlua\@undefined
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname directlua\endcsname\relax
   \IFTEX at let{luatex}{false}
 \else
   \IFTEX at let{luatex}{true}
@@ -132,11 +137,13 @@
 \fi
 \IFTEX at let{LuaTeX}{luatex}
 
+
 % luahbtex (or luatex + luaharfbuzz)
 % Use luaharfbuzz test rather than status.luatex_engine=="luahbtex"
 % for issue #2.
 \IFTEX at let{luahbtex}{false}
-\ifx\directlua\@undefined
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname directlua\endcsname\relax
 \else
   \directlua{\IFTEX at detokenize{
    if(pcall(require, 'luaharfbuzz')) then
@@ -149,7 +156,8 @@
 
 
 % ptex (including all variants)
-\ifx\kanjiskip\@undefined
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname kanjiskip\endcsname\relax
   \IFTEX at let{ptex}{false}
 \else
   \IFTEX at let{ptex}{true}
@@ -165,7 +173,8 @@
 \IFTEX at let{upTeX}{uptex}
 
 % ptex-ng
-\ifx\ngbanner\@undefined
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname ngbanner\endcsname\relax
   \IFTEX at let{ptexng}{false}
 \else
   \IFTEX at let{ptexng}{true}
@@ -174,7 +183,8 @@
 
 % vtex
 \IFTEX at let{IFTEX at savedVTeX}{VTeX}
-\ifx\VTeXversion\@undefined
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname VTeXversion\endcsname\relax
   \IFTEX at let{vtex}{false}
 \else
   \IFTEX at let{vtex}{true}
@@ -184,7 +194,8 @@
 % aleph
 \IFTEX at let{alephtex}{false}
 \ifptex\else
-\ifx\omathchardef\@undefined
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname omathchardef\endcsname\relax
 \else
   \IFTEX at let{alephtex}{true}
 \fi
@@ -193,7 +204,8 @@
 
 
 % tutex (LuaTeX or XeTeX)
-\ifx\Umathchardef\@undefined
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname Umathchardef\endcsname\relax
   \IFTEX at let{tutex}{false}
 \else
   \IFTEX at let{tutex}{true}
@@ -200,14 +212,18 @@
 \fi
 \IFTEX at let{TUTeX}{tutex}
 
-
-
 % Output mode 
 % declare with as if with \newif
 \def\pdftrue{\let\ifpdf\iftrue}
 \def\pdffalse{\let\ifpdf\iffalse}
 \pdffalse
-\ifx\directlua\undefined
+\ifluatex
+\directlua{\IFTEX at detokenize{
+if (tex.outputmode or tex.pdfoutput or 0) > 0 then
+  tex.print('\\pdftrue')
+end
+}}
+\else
 \begingroup\expandafter\expandafter\expandafter\endgroup
 \expandafter\ifx\csname pdfoutput\endcsname\relax
 \ifvtex
@@ -220,12 +236,6 @@
     \pdftrue
   \fi
 \fi
-\else
-\directlua{\IFTEX at detokenize{
-if (tex.outputmode or tex.pdfoutput or 0) > 0 then
-  tex.print('\\pdftrue')
-end
-}}
 \fi
 
 



More information about the tex-live-commits mailing list