[latex3-commits] [git/LaTeX3-latex3-iftex] luatex-prim: Avoid defining eTeX primitives in LuaTeX (1eed1b4)

Marcel Fabian Krüger zauguin at gmail.com
Sun Oct 27 12:47:15 CET 2019


Repository : https://github.com/latex3/iftex
On branch  : luatex-prim
Link       : https://github.com/latex3/iftex/commit/1eed1b4c066176293eecfb6498b332193563f268

>---------------------------------------------------------------

commit 1eed1b4c066176293eecfb6498b332193563f268
Author: Marcel Fabian Krüger <zauguin at gmail.com>
Date:   Sun Oct 27 12:47:15 2019 +0100

    Avoid defining eTeX primitives in LuaTeX


>---------------------------------------------------------------

1eed1b4c066176293eecfb6498b332193563f268
 iftex.sty | 23 +++++++++--------------
 1 file changed, 9 insertions(+), 14 deletions(-)

diff --git a/iftex.sty b/iftex.sty
index cdbc632..453b088 100644
--- a/iftex.sty
+++ b/iftex.sty
@@ -54,14 +54,6 @@
 }
 
 
-% make sure \detokenize and \protected are available in lualatex,
-% but avoid defining them after the package if not already defined.
-\ifx\directlua\@undefined\else
-  \let\IFTEX at detokenize\detokenize
-  \let\IFTEX at protected\protected
-  \directlua{tex.enableprimitives("", {"detokenize","protected"})}
-\fi
-
 % eTeX \protected if available.
 \ifx\protected\@undefined
   \let\IFTEX at protected\relax
@@ -70,6 +62,13 @@
 \fi
 
 
+% make sure \detokenize and \protected are available in lualatex,
+% but avoid defining them after the package if not already defined.
+\ifx\directlua\@undefined\else
+  \directlua{tex.enableprimitives("IFTEX@", {"detokenize","protected"})}
+\fi
+
+
 % \Require... commands that stop if the wrong engine detected.
 \IFTEX at protected\def\RequireeTeX{\IFTEX at Require\ifetex{eTeX}\fi}
 \IFTEX at protected\def\RequirePDFTeX{\IFTEX at Require\ifpdftex{pdfTeX}\fi}
@@ -134,7 +133,7 @@
 \IFTEX at let{luahbtex}{false}
 \ifx\directlua\@undefined
 \else
-  \directlua{\detokenize{
+  \directlua{\IFTEX at detokenize{
    if(pcall(require, 'luaharfbuzz')) then
      tex.print("\\let\\ifluahbtex\\iftrue ")
    end
@@ -216,7 +215,7 @@
   \fi
 \fi
 \else
-\directlua{\detokenize{
+\directlua{\IFTEX at detokenize{
 if (tex.outputmode or tex.pdfoutput or 0) > 0 then
   tex.print('\\pdftrue')
 end
@@ -224,8 +223,4 @@ end
 \fi
 
 % restore things
-\ifx\directlua\@undefined\else
-  \let\detokenize\IFTEX at detokenize
-  \let\protected\IFTEX at protected
-\fi
 \catcode64 \IFTEX at atcatcode





More information about the latex3-commits mailing list