diff options
author | Karl Berry <karl@freefriends.org> | 2019-11-09 22:02:15 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2019-11-09 22:02:15 +0000 |
commit | 831f2a88bd131f4e2c57aae1b4bcebf6eeb154e0 (patch) | |
tree | f0b9ab694d2e989e11abe489393df53fad9a1247 /Master/texmf-dist | |
parent | 10d861afad1277f7e626e21428f00537eeab6d0a (diff) |
iftex (9nov19)
git-svn-id: svn://tug.org/texlive/trunk@52711 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist')
-rw-r--r-- | Master/texmf-dist/doc/generic/iftex/iftex.pdf | bin | 201807 -> 233649 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/generic/iftex/iftex.tex | 17 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/iftex/iftex.sty | 54 |
3 files changed, 48 insertions, 23 deletions
diff --git a/Master/texmf-dist/doc/generic/iftex/iftex.pdf b/Master/texmf-dist/doc/generic/iftex/iftex.pdf Binary files differindex c46ce713ae4..97c093e87ff 100644 --- a/Master/texmf-dist/doc/generic/iftex/iftex.pdf +++ b/Master/texmf-dist/doc/generic/iftex/iftex.pdf diff --git a/Master/texmf-dist/doc/generic/iftex/iftex.tex b/Master/texmf-dist/doc/generic/iftex/iftex.tex index 67703b93c5b..8e13546e770 100644 --- a/Master/texmf-dist/doc/generic/iftex/iftex.tex +++ b/Master/texmf-dist/doc/generic/iftex/iftex.tex @@ -39,7 +39,7 @@ engine (or a compatible extension) is being used. 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 @@ tests for p\TeX\ variants and this package does \emph{not} replace the 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} diff --git a/Master/texmf-dist/tex/generic/iftex/iftex.sty b/Master/texmf-dist/tex/generic/iftex/iftex.sty index 4c1923c2c1d..8ee4a0fe796 100644 --- a/Master/texmf-dist/tex/generic/iftex/iftex.sty +++ b/Master/texmf-dist/tex/generic/iftex/iftex.sty @@ -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@protected\relax \else \let\IFTEX@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@let{etex}{false} \else \IFTEX@let{etex}{true} @@ -108,7 +110,8 @@ % pdftex (including in dvi mode) \IFTEX@let{IFTEX@savedpdftex}{pdftex} -\ifx\pdftexversion\@undefined +\begingroup\expandafter\expandafter\expandafter\endgroup +\expandafter\ifx\csname pdftexversion\endcsname\relax \IFTEX@let{pdftex}{false} \else \IFTEX@let{pdftex}{true} @@ -116,7 +119,8 @@ \IFTEX@let{PDFTeX}{pdftex} % xetex -\ifx\XeTeXrevision\@undefined +\begingroup\expandafter\expandafter\expandafter\endgroup +\expandafter\ifx\csname XeTeXrevision\endcsname\relax \IFTEX@let{xetex}{false} \else \IFTEX@let{xetex}{true} @@ -125,18 +129,21 @@ % luatex (including luahbtex) -\ifx\directlua\@undefined +\begingroup\expandafter\expandafter\expandafter\endgroup +\expandafter\ifx\csname directlua\endcsname\relax \IFTEX@let{luatex}{false} \else \IFTEX@let{luatex}{true} \fi \IFTEX@let{LuaTeX}{luatex} + % luahbtex (or luatex + luaharfbuzz) % Use luaharfbuzz test rather than status.luatex_engine=="luahbtex" % for issue #2. \IFTEX@let{luahbtex}{false} -\ifx\directlua\@undefined +\begingroup\expandafter\expandafter\expandafter\endgroup +\expandafter\ifx\csname directlua\endcsname\relax \else \directlua{\IFTEX@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@let{ptex}{false} \else \IFTEX@let{ptex}{true} @@ -165,7 +173,8 @@ \IFTEX@let{upTeX}{uptex} % ptex-ng -\ifx\ngbanner\@undefined +\begingroup\expandafter\expandafter\expandafter\endgroup +\expandafter\ifx\csname ngbanner\endcsname\relax \IFTEX@let{ptexng}{false} \else \IFTEX@let{ptexng}{true} @@ -174,7 +183,8 @@ % vtex \IFTEX@let{IFTEX@savedVTeX}{VTeX} -\ifx\VTeXversion\@undefined +\begingroup\expandafter\expandafter\expandafter\endgroup +\expandafter\ifx\csname VTeXversion\endcsname\relax \IFTEX@let{vtex}{false} \else \IFTEX@let{vtex}{true} @@ -184,7 +194,8 @@ % aleph \IFTEX@let{alephtex}{false} \ifptex\else -\ifx\omathchardef\@undefined +\begingroup\expandafter\expandafter\expandafter\endgroup +\expandafter\ifx\csname omathchardef\endcsname\relax \else \IFTEX@let{alephtex}{true} \fi @@ -193,21 +204,26 @@ % tutex (LuaTeX or XeTeX) -\ifx\Umathchardef\@undefined +\begingroup\expandafter\expandafter\expandafter\endgroup +\expandafter\ifx\csname Umathchardef\endcsname\relax \IFTEX@let{tutex}{false} \else \IFTEX@let{tutex}{true} \fi \IFTEX@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@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@detokenize{ -if (tex.outputmode or tex.pdfoutput or 0) > 0 then - tex.print('\\pdftrue') -end -}} \fi |