diff options
Diffstat (limited to 'Master/texmf-dist/tex/generic/oberdiek/ifluatex.sty')
-rw-r--r-- | Master/texmf-dist/tex/generic/oberdiek/ifluatex.sty | 114 |
1 files changed, 65 insertions, 49 deletions
diff --git a/Master/texmf-dist/tex/generic/oberdiek/ifluatex.sty b/Master/texmf-dist/tex/generic/oberdiek/ifluatex.sty index 30e604e2c7e..88905e0a284 100644 --- a/Master/texmf-dist/tex/generic/oberdiek/ifluatex.sty +++ b/Master/texmf-dist/tex/generic/oberdiek/ifluatex.sty @@ -88,7 +88,7 @@ \fi \expandafter\x\csname ver@ifluatex.sty\endcsname \ProvidesPackage{ifluatex}% - [2009/04/10 v1.1 Provides the ifluatex switch (HO)] + [2009/04/17 v1.2 Provides the ifluatex switch (HO)] \begingroup \catcode123 1 % { \catcode125 2 % } @@ -121,29 +121,32 @@ \TMP@EnsureCode{46}{12}% . \TMP@EnsureCode{47}{12}% / \TMP@EnsureCode{58}{12}% : +\TMP@EnsureCode{60}{12}% < \TMP@EnsureCode{61}{12}% = \TMP@EnsureCode{94}{7}% ^ \TMP@EnsureCode{96}{12}% ` +\begingroup\expandafter\expandafter\expandafter\endgroup +\expandafter\ifx\csname PackageError\endcsname\relax + \def\ifluatex@Error#1#2{% + \begingroup + \newlinechar=10 % + \def\MessageBreak{^^J}% + \edef\x{\errhelp{#2}}% + \x + \errmessage{Package ifluatex Error: #1}% + \endgroup + }% +\else + \def\ifluatex@Error{% + \PackageError{ifluatex}% + }% +\fi \begingroup \expandafter\ifx\csname ifluatex\endcsname\relax \else \edef\i/{\expandafter\string\csname ifluatex\endcsname}% - \expandafter\ifx\csname PackageError\endcsname\relax - \def\x#1#2{% - \edef\z{#2}% - \expandafter\errhelp\expandafter{\z}% - \errmessage{Package ifluatex Error: #1}% - }% - \def\y{^^J}% - \newlinechar=10 % - \else - \def\x#1#2{% - \PackageError{ifluatex}{#1}{#2}% - }% - \def\y{\MessageBreak}% - \fi - \x{Name clash, \i/ is already defined}{% - Incompatible versions of \i/ can cause problems,\y + \ifluatex@Error{Name clash, \i/ is already defined}{% + Incompatible versions of \i/ can cause problems,\MessageBreak therefore package loading is aborted.% }% \endgroup @@ -151,57 +154,35 @@ \expandafter\endinput \fi \endgroup -\begingroup - \expandafter\ifx\csname newif\endcsname\relax - \def\x#1#2{#1}% - \else - \def\x#1#2{#2}% - \fi -\expandafter\endgroup\x -{% - \let\ifluatex\iffalse - \def\luatextrue{% - \let\ifluatex\iftrue - }% - \def\luatexfalse{% - \let\luatexfalse - }% -}{% - \csname newif\endcsname\ifluatex -} +\let\ifluatex\iffalse \begingroup\expandafter\expandafter\expandafter\endgroup \expandafter\ifx\csname luatexversion\endcsname\relax \else - \luatextrue + \expandafter\let\csname ifluatex\expandafter\endcsname + \csname iftrue\endcsname \fi \ifluatex \else \begingroup\expandafter\expandafter\expandafter\endgroup \expandafter\ifx\csname directlua\endcsname\relax \else - \luatextrue + \expandafter\let\csname ifluatex\expandafter\endcsname + \csname iftrue\endcsname \begingroup \newlinechar=10 % \endlinechar=\newlinechar % - \ifcase0% + \ifnum0% \directlua{% if tex.enableprimitives then tex.enableprimitives('ifluatex', {'luatexversion'}) - else tex.print('1') end }% - \ifx\ifluatexluatexversion\@undefined 1\fi % - \relax % - \global\let\luatexversion\ifluatexluatexversion + \ifx\ifluatexluatexversion\@undefined\else 1\fi % + =11 % + \global\let\luatexversion\ifluatexluatexversion % \else % - \expandafter\ifx\csname PackageError\endcsname\relax % - \def\PackageError#1#2#3{% - \errhelp{#3}% - \errmessage{Package `#1' Error: #2}% - }% - \fi % - \PackageError{ifluatex}{% + \ifluatex@Error{% Missing \string\luatexversion% }{% Update LuaTeX.% @@ -210,6 +191,41 @@ \endgroup % \fi \fi +\ifluatex + \begingroup\expandafter\expandafter\expandafter\endgroup + \expandafter\ifx\csname luatexrevision\endcsname\relax + \ifnum\luatexversion<36 % + \else + \begingroup + \ifx\luatexrevision\relax + \let\luatexrevision\@undefined + \fi + \newlinechar=10 % + \endlinechar=\newlinechar % + \ifcase0% + \directlua{% + if tex.enableprimitives then + tex.enableprimitives('ifluatex', {'luatexrevision'}) + else + tex.print('1') + end + }% + \ifx\ifluatexluatexrevision\@undefined 1\fi % + \relax % + \global\let\luatexrevision\ifluatexluatexrevision + \fi + \endgroup + \fi + \begingroup\expandafter\expandafter\expandafter\endgroup + \expandafter\ifx\csname luatexrevision\endcsname\relax + \ifluatex@Error{% + Missing \string\luatexrevision% + }{% + Update LuaTeX.% + }% + \fi + \fi +\fi \begingroup \expandafter\ifx\csname PackageInfo\endcsname\relax \def\x#1#2{% |