diff options
Diffstat (limited to 'Master/texmf-dist/tex/generic')
-rw-r--r-- | Master/texmf-dist/tex/generic/oberdiek/etexcmds.sty | 40 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/oberdiek/ifluatex.sty | 167 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/oberdiek/ifpdf.sty | 4 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/oberdiek/luatex-loader.sty | 118 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/oberdiek/luatex.sty | 419 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/oberdiek/magicnum.sty | 286 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/oberdiek/pdfcol.sty | 26 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/oberdiek/pdftexcmds.sty | 372 |
8 files changed, 1107 insertions, 325 deletions
diff --git a/Master/texmf-dist/tex/generic/oberdiek/etexcmds.sty b/Master/texmf-dist/tex/generic/oberdiek/etexcmds.sty index 0389fbc2ccb..b8c5d1f6c07 100644 --- a/Master/texmf-dist/tex/generic/oberdiek/etexcmds.sty +++ b/Master/texmf-dist/tex/generic/oberdiek/etexcmds.sty @@ -86,7 +86,7 @@ \fi \expandafter\x\csname ver@etexcmds.sty\endcsname \ProvidesPackage{etexcmds}% - [2007/09/09 v1.1 Prefix for e-TeX command names (HO)] + [2007/12/12 v1.2 Prefix for e-TeX command names (HO)] \begingroup \catcode123 1 % { \catcode125 2 % } @@ -115,6 +115,11 @@ \TMP@EnsureCode{46}{12}% . \TMP@EnsureCode{47}{12}% / \TMP@EnsureCode{61}{12}% = +\edef\etexcmds@AtEnd{% + \etexcmds@AtEnd + \escapechar\the\escapechar\relax +} +\escapechar=92 % backslash \begingroup\expandafter\expandafter\expandafter\endgroup \expandafter\ifx\csname RequirePackage\endcsname\relax \input infwarerr.sty\relax @@ -123,7 +128,6 @@ \fi \newif\ifetex@unexpanded \begingroup -\escapechar=92 % backslash \edef\x{\string\unexpanded}% \edef\y{\meaning\unexpanded}% \ifx\x\y @@ -154,6 +158,38 @@ \fi \fi \fi +\newif\ifetex@expanded +\begingroup +\edef\x{\string\expanded}% +\edef\y{\meaning\expanded}% +\ifx\x\y + \endgroup + \let\etex@expanded\expanded + \etex@expandedtrue +\else + \edef\y{\meaning\normalexpanded}% + \ifx\x\y + \endgroup + \let\etex@expanded\normalexpanded + \etex@expandedtrue + \else + \edef\y{\meaning\@@expanded}% + \ifx\y + \endgroup + \let\etex@expanded\@@expanded + \etex@expandedtrue + \else + \endgroup + \@PackageInfoNoLine{etexcmds}{% + Could not find \string\expanded.\MessageBreak + That can mean that you are not using pdfTeX 1.50 or\MessageBreak + that some package has redefined \string\expanded.\MessageBreak + In the latter case, load this package earlier% + }% + \etex@expandedfalse + \fi + \fi +\fi \etexcmds@AtEnd \endinput %% diff --git a/Master/texmf-dist/tex/generic/oberdiek/ifluatex.sty b/Master/texmf-dist/tex/generic/oberdiek/ifluatex.sty new file mode 100644 index 00000000000..7272b7eeaa7 --- /dev/null +++ b/Master/texmf-dist/tex/generic/oberdiek/ifluatex.sty @@ -0,0 +1,167 @@ +%% +%% This is file `ifluatex.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% ifluatex.dtx (with options: `package') +%% +%% This is a generated file. +%% +%% Copyright (C) 2007 by Heiko Oberdiek <oberdiek@uni-freiburg.de> +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either +%% version 1.3 of this license or (at your option) any later +%% version. The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of +%% LaTeX version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status "maintained". +%% +%% This Current Maintainer of this work is Heiko Oberdiek. +%% +%% This work consists of the main source file ifluatex.dtx +%% and the derived files +%% ifluatex.sty, ifluatex.pdf, ifluatex.ins, ifluatex.drv, +%% ifluatex-test1.tex. +%% +\begingroup + \catcode44 12 % , + \catcode45 12 % - + \catcode46 12 % . + \catcode58 12 % : + \catcode64 11 % @ + \expandafter\let\expandafter\x\csname ver@ifluatex.sty\endcsname + \ifcase 0% + \ifx\x\relax % plain + \else + \ifx\x\empty % LaTeX + \else + 1% + \fi + \fi + \else + \catcode35 6 % # + \catcode123 1 % { + \catcode125 2 % } + \expandafter\ifx\csname PackageInfo\endcsname\relax + \def\x#1#2{% + \immediate\write-1{Package #1 Info: #2.}% + }% + \else + \def\x#1#2{\PackageInfo{#1}{#2, stopped}}% + \fi + \x{ifluatex}{The package is already loaded}% + \endgroup + \expandafter\endinput + \fi +\endgroup +\begingroup + \catcode35 6 % # + \catcode40 12 % ( + \catcode41 12 % ) + \catcode44 12 % , + \catcode45 12 % - + \catcode46 12 % . + \catcode47 12 % / + \catcode58 12 % : + \catcode64 11 % @ + \catcode123 1 % { + \catcode125 2 % } + \expandafter\ifx\csname ProvidesPackage\endcsname\relax + \def\x#1#2#3[#4]{\endgroup + \immediate\write-1{Package: #3 #4}% + \xdef#1{#4}% + }% + \else + \def\x#1#2[#3]{\endgroup + #2[{#3}]% + \ifx#1\relax + \xdef#1{#3}% + \fi + }% + \fi +\expandafter\x\csname ver@ifluatex.sty\endcsname +\ProvidesPackage{ifluatex}% + [2007/12/12 v1.0 Provides the ifluatex switch (HO)] +\begingroup + \catcode123 1 % { + \catcode125 2 % } + \def\x{\endgroup + \expandafter\edef\csname ifluatex@AtEnd\endcsname{% + \catcode35 \the\catcode35\relax + \catcode64 \the\catcode64\relax + \catcode123 \the\catcode123\relax + \catcode125 \the\catcode125\relax + }% + }% +\x +\catcode35 6 % # +\catcode64 11 % @ +\catcode123 1 % { +\catcode125 2 % } +\def\TMP@EnsureCode#1#2{% + \edef\ifluatex@AtEnd{% + \ifluatex@AtEnd + \catcode#1 \the\catcode#1\relax + }% + \catcode#1 #2\relax +} +\TMP@EnsureCode{10}{12}% ^^J +\TMP@EnsureCode{44}{12}% , +\TMP@EnsureCode{45}{12}% - +\TMP@EnsureCode{46}{12}% . +\TMP@EnsureCode{47}{12}% / +\TMP@EnsureCode{58}{12}% : +\TMP@EnsureCode{61}{12}% = +\TMP@EnsureCode{94}{7}% ^ +\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 + therefore package loading is aborted.% + }% + \endgroup + \ifluatex@AtEnd + \expandafter\endinput + \fi +\endgroup +\newif\ifluatex +\begingroup\expandafter\expandafter\expandafter\endgroup +\expandafter\ifx\csname luatexversion\endcsname\relax +\else + \luatextrue +\fi +\begingroup + \expandafter\ifx\csname PackageInfo\endcsname\relax + \def\x#1#2{% + \immediate\write-1{Package #1 Info: #2.}% + }% + \else + \let\x\PackageInfo + \expandafter\let\csname on@line\endcsname\empty + \fi + \x{ifluatex}{LuaTeX \ifluatex\else not \fi detected}% +\endgroup +\ifluatex@AtEnd +\endinput +%% +%% End of file `ifluatex.sty'. diff --git a/Master/texmf-dist/tex/generic/oberdiek/ifpdf.sty b/Master/texmf-dist/tex/generic/oberdiek/ifpdf.sty index 1d1e3965afc..b94902260bc 100644 --- a/Master/texmf-dist/tex/generic/oberdiek/ifpdf.sty +++ b/Master/texmf-dist/tex/generic/oberdiek/ifpdf.sty @@ -85,7 +85,7 @@ \fi \expandafter\x\csname ver@ifpdf.sty\endcsname \ProvidesPackage{ifpdf}% - [2007/09/09 v1.5 Provides the ifpdf switch (HO)] + [2007/12/12 v1.6 Provides the ifpdf switch (HO)] \begingroup \catcode123 1 % { \catcode125 2 % } @@ -110,7 +110,6 @@ \catcode#1 #2\relax } \TMP@EnsureCode{10}{12}% ^^J -\TMP@EnsureCode{39}{12}% ' \TMP@EnsureCode{44}{12}% , \TMP@EnsureCode{45}{12}% - \TMP@EnsureCode{46}{12}% . @@ -119,7 +118,6 @@ \TMP@EnsureCode{60}{12}% < \TMP@EnsureCode{61}{12}% = \TMP@EnsureCode{94}{7}% ^ -\TMP@EnsureCode{96}{12}% ` \begingroup \expandafter\ifx\csname ifpdf\endcsname\relax \else diff --git a/Master/texmf-dist/tex/generic/oberdiek/luatex-loader.sty b/Master/texmf-dist/tex/generic/oberdiek/luatex-loader.sty new file mode 100644 index 00000000000..52d39a888aa --- /dev/null +++ b/Master/texmf-dist/tex/generic/oberdiek/luatex-loader.sty @@ -0,0 +1,118 @@ +%% +%% This is file `luatex-loader.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% luatex.dtx (with options: `loader') +%% +%% This is a generated file. +%% +%% Copyright (C) 2007 by Heiko Oberdiek <oberdiek@uni-freiburg.de> +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either +%% version 1.3 of this license or (at your option) any later +%% version. The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of +%% LaTeX version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status "maintained". +%% +%% This Current Maintainer of this work is Heiko Oberdiek. +%% +%% This work consists of the main source file luatex.dtx +%% and the derived files +%% luatex.sty, luatex.pdf, luatex.ins, luatex.drv, luatex-loader.sty, +%% luatex-test1.tex, luatex-test2.tex, luatex-test3.tex, +%% luatex-test4.tex, luatex-test5.tex, oberdiek.luatex.lua. +%% +\begingroup + \catcode44 12 % , + \catcode45 12 % - + \catcode46 12 % . + \catcode58 12 % : + \catcode64 11 % @ + \expandafter\let\expandafter\x\csname ver@luatex-loader.sty\endcsname + \ifcase 0% + \ifx\x\relax % plain + \else + \ifx\x\empty % LaTeX + \else + 1% + \fi + \fi + \else + \catcode35 6 % # + \catcode123 1 % { + \catcode125 2 % } + \expandafter\ifx\csname PackageInfo\endcsname\relax + \def\x#1#2{% + \immediate\write-1{Package #1 Info: #2.}% + }% + \else + \def\x#1#2{\PackageInfo{#1}{#2, stopped}}% + \fi + \x{luatex-loader}{The package is already loaded}% + \endgroup + \expandafter\endinput + \fi +\endgroup +\begingroup + \catcode35 6 % # + \catcode40 12 % ( + \catcode41 12 % ) + \catcode44 12 % , + \catcode45 12 % - + \catcode46 12 % . + \catcode47 12 % / + \catcode58 12 % : + \catcode64 11 % @ + \catcode123 1 % { + \catcode125 2 % } + \expandafter\ifx\csname ProvidesPackage\endcsname\relax + \def\x#1#2#3[#4]{\endgroup + \immediate\write-1{Package: #3 #4}% + \xdef#1{#4}% + }% + \else + \def\x#1#2[#3]{\endgroup + #2[{#3}]% + \ifx#1\relax + \xdef#1{#3}% + \fi + }% + \fi +\expandafter\x\csname ver@luatex-loader.sty\endcsname +\ProvidesPackage{luatex-loader}% + [2007/12/12 v0.1 Lua module loader (HO)] + +\begingroup + \catcode10 12 % ^^J + \catcode34 12 % " + \catcode39 12 % ' + \catcode40 12 % ( + \catcode41 12 % ) + \catcode44 12 % , + \catcode46 12 % . + \catcode61 12 % = + \catcode95 12 % _ (other!) + \catcode96 12 % ` + \endlinechar=10 % + \directlua0{% + do + local script = "oberdiek.luatex.lua" + local file = kpse.find_file(script, "texmfscripts") + if file then + texio.write_nl("(" .. file .. ")") + dofile(file) + else + error("File `" .. script .. "' not found") + end + end + }% +\endgroup% +\endinput +%% +%% End of file `luatex-loader.sty'. diff --git a/Master/texmf-dist/tex/generic/oberdiek/luatex.sty b/Master/texmf-dist/tex/generic/oberdiek/luatex.sty new file mode 100644 index 00000000000..649b32dcd1a --- /dev/null +++ b/Master/texmf-dist/tex/generic/oberdiek/luatex.sty @@ -0,0 +1,419 @@ +%% +%% This is file `luatex.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% luatex.dtx (with options: `package') +%% +%% This is a generated file. +%% +%% Copyright (C) 2007 by Heiko Oberdiek <oberdiek@uni-freiburg.de> +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either +%% version 1.3 of this license or (at your option) any later +%% version. The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of +%% LaTeX version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status "maintained". +%% +%% This Current Maintainer of this work is Heiko Oberdiek. +%% +%% This work consists of the main source file luatex.dtx +%% and the derived files +%% luatex.sty, luatex.pdf, luatex.ins, luatex.drv, luatex-loader.sty, +%% luatex-test1.tex, luatex-test2.tex, luatex-test3.tex, +%% luatex-test4.tex, luatex-test5.tex, oberdiek.luatex.lua. +%% +\begingroup + \catcode44 12 % , + \catcode45 12 % - + \catcode46 12 % . + \catcode58 12 % : + \catcode64 11 % @ + \expandafter\let\expandafter\x\csname ver@luatex.sty\endcsname + \ifcase 0% + \ifx\x\relax % plain + \else + \ifx\x\empty % LaTeX + \else + 1% + \fi + \fi + \else + \catcode35 6 % # + \catcode123 1 % { + \catcode125 2 % } + \expandafter\ifx\csname PackageInfo\endcsname\relax + \def\x#1#2{% + \immediate\write-1{Package #1 Info: #2.}% + }% + \else + \def\x#1#2{\PackageInfo{#1}{#2, stopped}}% + \fi + \x{luatex}{The package is already loaded}% + \endgroup + \expandafter\endinput + \fi +\endgroup +\begingroup + \catcode35 6 % # + \catcode40 12 % ( + \catcode41 12 % ) + \catcode44 12 % , + \catcode45 12 % - + \catcode46 12 % . + \catcode47 12 % / + \catcode58 12 % : + \catcode64 11 % @ + \catcode123 1 % { + \catcode125 2 % } + \expandafter\ifx\csname ProvidesPackage\endcsname\relax + \def\x#1#2#3[#4]{\endgroup + \immediate\write-1{Package: #3 #4}% + \xdef#1{#4}% + }% + \else + \def\x#1#2[#3]{\endgroup + #2[{#3}]% + \ifx#1\relax + \xdef#1{#3}% + \fi + }% + \fi +\expandafter\x\csname ver@luatex.sty\endcsname +\ProvidesPackage{luatex}% + [2007/12/12 v0.1 LuaTeX basic definition package (HO)] +\begingroup + \catcode123 1 % { + \catcode125 2 % } + \def\x{\endgroup + \expandafter\edef\csname LuT@AtEnd\endcsname{% + \catcode35 \the\catcode35\relax + \catcode64 \the\catcode64\relax + \catcode123 \the\catcode123\relax + \catcode125 \the\catcode125\relax + }% + }% +\x +\catcode35 6 % # +\catcode64 11 % @ +\catcode123 1 % { +\catcode125 2 % } +\def\TMP@EnsureCode#1#2{% + \edef\LuT@AtEnd{% + \LuT@AtEnd + \catcode#1 \the\catcode#1\relax + }% + \catcode#1 #2\relax +} +\TMP@EnsureCode{10}{12}% ^^J +\TMP@EnsureCode{34}{12}% " +\TMP@EnsureCode{36}{3}% $ +\TMP@EnsureCode{39}{12}% ' +\TMP@EnsureCode{40}{12}% ( +\TMP@EnsureCode{41}{12}% ) +\TMP@EnsureCode{42}{12}% * +\TMP@EnsureCode{43}{12}% + +\TMP@EnsureCode{44}{12}% , +\TMP@EnsureCode{45}{12}% - +\TMP@EnsureCode{46}{12}% . +\TMP@EnsureCode{47}{12}% / +\TMP@EnsureCode{60}{12}% < +\TMP@EnsureCode{61}{12}% = +\TMP@EnsureCode{62}{12}% > +\TMP@EnsureCode{95}{12}% _ (other!) +\TMP@EnsureCode{96}{12}% ` +\begingroup\expandafter\expandafter\expandafter\endgroup +\expandafter\ifx\csname RequirePackage\endcsname\relax + \input infwarerr.sty\relax + \input ifluatex.sty\relax +\else + \RequirePackage{infwarerr}[2007/09/09]% + \RequirePackage{ifluatex}[2007/12/12]% +\fi +\ifluatex +\else + \@PackageError{luatex}{% + This package may only be run using LuaTeX% + }\@ehc + \LuT@AtEnd + \expandafter\endinput +\fi +\begingroup\expandafter\expandafter\expandafter\endgroup +\expandafter\ifx\csname RequirePackage\endcsname\relax +\else + \RequirePackage{etex}[1998/03/26]% +\fi +\begingroup\expandafter\expandafter\expandafter\endgroup +\expandafter\ifx\csname et@xins\endcsname\relax + \@PackageWarningNoLine{luatex}{% + Support for eTeX is not loaded (etex.src)% + }% +\else + \def\LuT@temp#1{% + \ifnum\count27#1=32768 % + \count27#1=65536 % + \fi + }% + \LuT@temp0% + \LuT@temp1% + \LuT@temp2% + \LuT@temp3% + \LuT@temp4% + \LuT@temp5% + \LuT@temp6% + \let\newcount\globcount + \let\newdimen\globdimen + \let\newskip\globskip + \let\newbox\globbox +\fi +\expandafter\ifx\csname @empty\endcsname\relax + \def\@empty{}% +\fi +\expandafter\ifx\csname @gobble\endcsname\relax + \long\def\@gobble#1{}% +\fi +\expandafter\ifx\csname @firstofone\endcsname\relax + \long\def\@firstofone#1{#1}% +\fi +\expandafter\ifx\csname @firstoftwo\endcsname\relax + \long\def\@firstoftwo#1#2{#1}% +\fi +\expandafter\ifx\csname @car\endcsname\relax + \def\@car#1#2\@nil{#1}% +\fi +\expandafter\ifx\csname @cdr\endcsname\relax + \def\@cdr#1#2\@nil{#2}% +\fi +\expandafter\ifx\csname @ifstar\endcsname\relax + \def\@ifstar#1{% + \@ifnextchar*{\@firstoftwo{#1}}% + }% + \long\def\@ifnextchar#1#2#3{% + \let\reserved@d=#1% + \def\reserved@a{#2}% + \def\reserved@b{#3}% + \futurelet\@let@token\@ifnch + }% + \def\@ifnch{% + \ifx\@let@token\@sptoken + \let\reserved@c\@xifnch + \else + \ifx\@let@token\reserved@d + \let\reserved@c\reserved@a + \else + \let\reserved@c\reserved@b + \fi + \fi + \reserved@c + }% + \let\LuT@temp\:% + \def\:{\let\@sptoken= }% + \: % explicit space + \def\:{\@xifnch}% + \expandafter\def\: {% + \futurelet\@let@token\@ifnch + }% + \let\:\LuT@temp +\fi +\expandafter\ifx\csname @tempcnta\endcsname\relax + \csname newcount\endcsname\@tempcnta +\fi +\expandafter\ifx\csname @tempcntb\endcsname\relax + \csname newcount\endcsname\@tempcntb +\fi +\begingroup\expandafter\expandafter\expandafter\endgroup +\expandafter\ifx\csname newcommand\endcsname\relax + \def\LuT@newcommand#1[#2]#3{% + \ifx#1\@undefined + \let#1\relax + \else + \ifx#1\relax + \else + \@PackageError{luatex}{% + \string#1 is already defined.\MessageBreak + Redefinition is skipped% + }\@ehc + \fi + \fi + \ifx#1\relax + \ifcase#2 % + \def#1{#3}% + \or + \def#1##1{#3}% + \or + \def#1##1##2{#3}% + \or + \def#1##1##2##3{#3}% + \or + \@INTERNAL@ERROR + \fi + \fi + }% +\else + \def\LuT@newcommand{\newcommand*}% +\fi +\newcount\LuT@AllocLuaState +\LuT@AllocLuaState=\z@ +\LuT@newcommand\newluastate[1]{% + \ifnum\LuT@AllocLuaState<65535 % + \global\advance\LuT@AllocLuaState\@ne + \allocationnumber\LuT@AllocLuaState + \global\chardef#1=\allocationnumber + \wlog{\string#1=\string\luastate\the\allocationnumber}% + \else + \errmessage{No room for a new \string\luastate}% + \fi +} +\newcount\LuT@AllocAttribute +\LuT@AllocAttribute=\m@ne +\LuT@newcommand\newattribute[1]{% + \ifnum\LuT@AllocAttribute<65535 % + \global\advance\LuT@AllocAttribute\@ne + \allocationnumber\LuT@AllocAttribute + \global\attributedef#1=\allocationnumber + \unsetattribute{#1}% + \wlog{\string#1=\string\attribute\the\allocationnumber}% + \else + \errmessage{No room for a new \string\attribute}% + \fi +} +\LuT@newcommand\setattribute[2]{% + #1=\numexpr#2\relax +} +\LuT@newcommand\unsetattribute[1]{% + #1=\m@ne +} +\newcount\LuT@AllocCatcodeTable +\LuT@AllocCatcodeTable=\m@ne +\newcount\CatcodeTableStack +\CatcodeTableStack=\z@ +\LuT@newcommand\newcatcodetable[1]{% + \ifnum\LuT@AllocCatcodeTable<1114110 % 0x10FFFF is maximal \chardef + % or < 268435455 % 2^28 - 1 + \global\advance\LuT@AllocCatcodeTable by\tw@ + \allocationnumber=\LuT@AllocCatcodeTable + \global\chardef#1=\allocationnumber + \wlog{% + \string#1=\string\catcodetable\the\allocationnumber + }% + \else + \errmessage{No room for a new \string\catcodetable}% + \fi +}% +\LuT@newcommand\IncCatcodeTableStack[0]{% + \ifnum\CatcodeTableStack<268435454 % + \global\advance\CatcodeTableStack by\tw@ + \else + \@PackageError{luatex}{% + Catcode table stack overflow% + }\@ehd + \fi +} +\LuT@newcommand\DecCatcodeTableStack[0]{% + \ifnum\CatcodeTableStack>\z@ + \global\advance\CatcodeTableStack by-2 % + \else + \@PackageError{luatex}{% + Catcode table stack is empty% + }\@ehd + \fi +} +\LuT@newcommand\SetCatcodeRange[3]{% + \edef\LuT@temp{% + \noexpand\@tempcnta=\the\@tempcnta + \noexpand\@tempcntb=\the\@tempcntb + \noexpand\count@=\the\count@ + \relax + }% + \@tempcnta=\numexpr#1\relax + \@tempcntb=\numexpr#2\relax + \count@=\numexpr#3\relax + \loop + \unless\ifnum\@tempcnta>\@tempcntb + \catcode\@tempcnta=\count@ + \advance\@tempcnta by \@ne + \repeat + \LuT@temp +} +\newcatcodetable\CatcodeTableIniTeX +\newcatcodetable\CatcodeTableString +\newcatcodetable\CatcodeTableOther +\newcatcodetable\CatcodeTableLaTeX +\initcatcodetable\CatcodeTableIniTeX +\begingroup + \def\@makeother#1{\catcode#1=12\relax}% + \@firstofone{% + \catcodetable\CatcodeTableIniTeX + \begingroup + \SetCatcodeRange{0}{8}{15}% + \catcode9=10 % tab + \catcode11=15 % + \catcode12=13 % form feed + \SetCatcodeRange{14}{31}{15}% + \catcode35=6 % hash + \catcode36=3 % dollar + \catcode38=4 % ampersand + \catcode94=7 % circumflex + \catcode95=8 % underscore + \catcode123=1 % brace left + \catcode125=2 % brace right + \catcode126=13 % tilde + \catcode127=15 % + \savecatcodetable\CatcodeTableLaTeX + \endgroup + \@makeother{0}% nul + \@makeother{13}% carriage return + \@makeother{37}% percent + \@makeother{92}% backslash + \@makeother{127}% + \SetCatcodeRange{65}{90}{12}% A-Z + \SetCatcodeRange{97}{122}{12}% a-z + \savecatcodetable\CatcodeTableString + \@makeother{32}% space + \savecatcodetable\CatcodeTableOther + \endgroup +}% +\def\LuT@NumStackEmpty{0} +\let\LuT@NumStack\LuT@NumStackEmpty +\LuT@newcommand\PushCatcodeTableNumStack[0]{% + \xdef\LuT@NumStack{% + {\the\catcodetable}\LuT@NumStack + }% +} +\LuT@newcommand\PopCatcodeTableNumStack[0]{% + \ifx\LuT@NumStack\LuT@NumStackEmpty + \@PackageWarning{luatex}{Empty catcode table number stack}% + \catcodetable\z@ + \else + \catcodetable=\expandafter\@car\LuT@NumStack\@nil\relax + \xdef\LuT@NumStack{% + \expandafter\@cdr\LuT@NumStack\@nil + }% + \fi +} +\LuT@newcommand\BeginCatcodeRegime[1]{% + \PushCatcodeTableNumStack + \catcodetable=\numexpr#1\relax + \IncCatcodeTableStack + \savecatcodetable\CatcodeTableStack + \catcodetable\CatcodeTableStack +} +\LuT@newcommand\EndCatcodeRegime[0]{% + \DecCatcodeTableStack + \PopCatcodeTableNumStack +} +\begingroup\expandafter\expandafter\expandafter\endgroup +\expandafter\ifx\csname RequirePackage\endcsname\relax + \input luatex-loader.sty\relax +\else + \RequirePackage{luatex-loader}[2007/12/12]% +\fi +\LuT@AtEnd +\endinput +%% +%% End of file `luatex.sty'. diff --git a/Master/texmf-dist/tex/generic/oberdiek/magicnum.sty b/Master/texmf-dist/tex/generic/oberdiek/magicnum.sty new file mode 100644 index 00000000000..5262b191af6 --- /dev/null +++ b/Master/texmf-dist/tex/generic/oberdiek/magicnum.sty @@ -0,0 +1,286 @@ +%% +%% This is file `magicnum.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% magicnum.dtx (with options: `package') +%% +%% This is a generated file. +%% +%% Copyright (C) 2007 by Heiko Oberdiek <oberdiek@uni-freiburg.de> +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either +%% version 1.3 of this license or (at your option) any later +%% version. The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of +%% LaTeX version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status "maintained". +%% +%% This Current Maintainer of this work is Heiko Oberdiek. +%% +%% This work consists of the main source file magicnum.dtx +%% and the derived files +%% magicnum.sty, magicnum.pdf, magicnum.ins, magicnum.drv, magicnum.txt, +%% magicnum-test1.tex, magicnum-test2.tex, magicnum-test3.tex, +%% magicnum.lua, oberdiek.magicnum.lua. +%% +\begingroup + \catcode44 12 % , + \catcode45 12 % - + \catcode46 12 % . + \catcode58 12 % : + \catcode64 11 % @ + \expandafter\let\expandafter\x\csname ver@magicnum.sty\endcsname + \ifcase 0% + \ifx\x\relax % plain + \else + \ifx\x\empty % LaTeX + \else + 1% + \fi + \fi + \else + \catcode35 6 % # + \catcode123 1 % { + \catcode125 2 % } + \expandafter\ifx\csname PackageInfo\endcsname\relax + \def\x#1#2{% + \immediate\write-1{Package #1 Info: #2.}% + }% + \else + \def\x#1#2{\PackageInfo{#1}{#2, stopped}}% + \fi + \x{magicnum}{The package is already loaded}% + \endgroup + \expandafter\endinput + \fi +\endgroup +\begingroup + \catcode35 6 % # + \catcode40 12 % ( + \catcode41 12 % ) + \catcode44 12 % , + \catcode45 12 % - + \catcode46 12 % . + \catcode47 12 % / + \catcode58 12 % : + \catcode64 11 % @ + \catcode123 1 % { + \catcode125 2 % } + \expandafter\ifx\csname ProvidesPackage\endcsname\relax + \def\x#1#2#3[#4]{\endgroup + \immediate\write-1{Package: #3 #4}% + \xdef#1{#4}% + }% + \else + \def\x#1#2[#3]{\endgroup + #2[{#3}]% + \ifx#1\relax + \xdef#1{#3}% + \fi + }% + \fi +\expandafter\x\csname ver@magicnum.sty\endcsname +\ProvidesPackage{magicnum}% + [2007/12/12 v1.0 Magic numbers (HO)] +\begingroup + \catcode123 1 % { + \catcode125 2 % } + \def\x{\endgroup + \expandafter\edef\csname magicnum@AtEnd\endcsname{% + \catcode35 \the\catcode35\relax + \catcode64 \the\catcode64\relax + \catcode123 \the\catcode123\relax + \catcode125 \the\catcode125\relax + }% + }% +\x +\catcode35 6 % # +\catcode64 11 % @ +\catcode123 1 % { +\catcode125 2 % } +\def\TMP@EnsureCode#1#2{% + \edef\magicnum@AtEnd{% + \magicnum@AtEnd + \catcode#1 \the\catcode#1\relax + }% + \catcode#1 #2\relax +} +\TMP@EnsureCode{34}{12}% " +\TMP@EnsureCode{40}{12}% ( +\TMP@EnsureCode{41}{12}% ) +\TMP@EnsureCode{42}{12}% * +\TMP@EnsureCode{44}{12}% , +\TMP@EnsureCode{45}{12}% - +\TMP@EnsureCode{46}{12}% . +\TMP@EnsureCode{47}{12}% / +\TMP@EnsureCode{62}{12}% > +\begingroup\expandafter\expandafter\expandafter\endgroup +\expandafter\ifx\csname newcommand\endcsname\relax + \expandafter\ifx\csname magicnum\endcsname\relax + \else + \input infwarerr.sty\relax + \@PackageErrorNoLine{magicnum}{% + \string\magicnum\space is already defined% + }\@ehc + \fi +\else + \newcommand*{\magicnum}{}% +\fi +\begingroup\expandafter\expandafter\expandafter\endgroup +\expandafter\ifx\csname luatexversion\endcsname\relax + \begingroup\expandafter\expandafter\expandafter\endgroup + \expandafter\ifx\csname ifcsname\endcsname\relax + \def\magicnum#1{% + \expandafter\ifx\csname MG@#1\endcsname\relax + \else + \csname MG@#1\endcsname + \fi + }% + \else + \begingroup + \edef\x{\endgroup + \def\noexpand\magicnum##1{% + \expandafter\noexpand\csname + ifcsname\endcsname MG@##1\noexpand\endcsname + \noexpand\csname MG@##1% + \noexpand\expandafter\noexpand\endcsname + \expandafter\noexpand\csname fi\endcsname + }% + }% + \x + \fi +\else + \begingroup\expandafter\expandafter\expandafter\endgroup + \expandafter\ifx\csname RequirePackage\endcsname\relax + \input luatex.sty\relax + \else + \RequirePackage{luatex}[2007/12/12]% + \fi + \def\magicnum#1{% + \directlua0{% + require("oberdiek.magicnum")% + oberdiek.magicnum.get(% + "\luaescapestring{#1}",\number\CatcodeTableString + )% + }% + }% + \magicnum@AtEnd + \expandafter\endinput +\fi +\begingroup\expandafter\expandafter\expandafter\endgroup +\expandafter\ifx\csname detokenize\endcsname\relax + \def\magicnum@add#1#2#3{% + \expandafter\magicnum@@add + \csname MG@#1.#2\expandafter\endcsname + \csname MG@#1.#3\endcsname + {#3}{#2}% + }% + \def\magicnum@@add#1#2#3#4{% + \def#1{#3}% + \def#2{#4}% + \edef#1{% + \expandafter\strip@prefix\meaning#1% + }% + \edef#2{% + \expandafter\strip@prefix\meaning#2% + }% + }% + \expandafter\ifx\csname strip@prefix\endcsname\relax + \def\strip@prefix#1->{}% + \fi +\else + \def\magicnum@add#1#2#3{% + \expandafter\edef\csname MG@#1.#2\endcsname{% + \detokenize{#3}% + }% + \expandafter\edef\csname MG@#1.#3\endcsname{% + \detokenize{#2}% + }% + }% +\fi +\magicnum@add{tex.catcode}{escape}{0} +\magicnum@add{tex.catcode}{begingroup}{1} +\magicnum@add{tex.catcode}{endgroup}{2} +\magicnum@add{tex.catcode}{math}{3} +\magicnum@add{tex.catcode}{align}{4} +\magicnum@add{tex.catcode}{eol}{5} +\magicnum@add{tex.catcode}{parameter}{6} +\magicnum@add{tex.catcode}{superscript}{7} +\magicnum@add{tex.catcode}{subscript}{8} +\magicnum@add{tex.catcode}{ignore}{9} +\magicnum@add{tex.catcode}{space}{10} +\magicnum@add{tex.catcode}{letter}{11} +\magicnum@add{tex.catcode}{other}{12} +\magicnum@add{tex.catcode}{active}{13} +\magicnum@add{tex.catcode}{comment}{14} +\magicnum@add{tex.catcode}{invalid}{15} +\magicnum@add{etex.grouptype}{bottomlevel}{0} +\magicnum@add{etex.grouptype}{simple}{1} +\magicnum@add{etex.grouptype}{hbox}{2} +\magicnum@add{etex.grouptype}{adjustedhbox}{3} +\magicnum@add{etex.grouptype}{vbox}{4} +\magicnum@add{etex.grouptype}{align}{5} +\magicnum@add{etex.grouptype}{noalign}{6} +\magicnum@add{etex.grouptype}{output}{8} +\magicnum@add{etex.grouptype}{math}{9} +\magicnum@add{etex.grouptype}{disc}{10} +\magicnum@add{etex.grouptype}{insert}{11} +\magicnum@add{etex.grouptype}{vcenter}{12} +\magicnum@add{etex.grouptype}{mathchoice}{13} +\magicnum@add{etex.grouptype}{semisimple}{14} +\magicnum@add{etex.grouptype}{mathshift}{15} +\magicnum@add{etex.grouptype}{mathleft}{16} +\magicnum@add{etex.iftype}{none}{0} +\magicnum@add{etex.iftype}{char}{1} +\magicnum@add{etex.iftype}{cat}{2} +\magicnum@add{etex.iftype}{num}{3} +\magicnum@add{etex.iftype}{dim}{4} +\magicnum@add{etex.iftype}{odd}{5} +\magicnum@add{etex.iftype}{vmode}{6} +\magicnum@add{etex.iftype}{hmode}{7} +\magicnum@add{etex.iftype}{mmode}{8} +\magicnum@add{etex.iftype}{inner}{9} +\magicnum@add{etex.iftype}{void}{10} +\magicnum@add{etex.iftype}{hbox}{11} +\magicnum@add{etex.iftype}{vbox}{12} +\magicnum@add{etex.iftype}{x}{13} +\magicnum@add{etex.iftype}{eof}{14} +\magicnum@add{etex.iftype}{true}{15} +\magicnum@add{etex.iftype}{false}{16} +\magicnum@add{etex.iftype}{case}{17} +\magicnum@add{etex.iftype}{defined}{18} +\magicnum@add{etex.iftype}{csname}{19} +\magicnum@add{etex.iftype}{fontchar}{20} +\magicnum@add{etex.nodetype}{none}{-1} +\magicnum@add{etex.nodetype}{char}{0} +\magicnum@add{etex.nodetype}{hlist}{1} +\magicnum@add{etex.nodetype}{vlist}{2} +\magicnum@add{etex.nodetype}{rule}{3} +\magicnum@add{etex.nodetype}{ins}{4} +\magicnum@add{etex.nodetype}{mark}{5} +\magicnum@add{etex.nodetype}{adjust}{6} +\magicnum@add{etex.nodetype}{ligature}{7} +\magicnum@add{etex.nodetype}{disc}{8} +\magicnum@add{etex.nodetype}{whatsit}{9} +\magicnum@add{etex.nodetype}{math}{10} +\magicnum@add{etex.nodetype}{glue}{11} +\magicnum@add{etex.nodetype}{kern}{12} +\magicnum@add{etex.nodetype}{penalty}{13} +\magicnum@add{etex.nodetype}{unset}{14} +\magicnum@add{etex.nodetype}{maths}{15} +\magicnum@add{etex.interactionmode}{batch}{0} +\magicnum@add{etex.interactionmode}{nonstop}{1} +\magicnum@add{etex.interactionmode}{scroll}{2} +\magicnum@add{etex.interactionmode}{errorstop}{3} +\magicnum@add{luatex.pdfliteral.mode}{setorigin}{0} +\magicnum@add{luatex.pdfliteral.mode}{page}{1} +\magicnum@add{luatex.pdfliteral.mode}{direct}{2} +\magicnum@AtEnd +\endinput +%% +%% End of file `magicnum.sty'. diff --git a/Master/texmf-dist/tex/generic/oberdiek/pdfcol.sty b/Master/texmf-dist/tex/generic/oberdiek/pdfcol.sty index b73c5aa53f4..cf5175c5b01 100644 --- a/Master/texmf-dist/tex/generic/oberdiek/pdfcol.sty +++ b/Master/texmf-dist/tex/generic/oberdiek/pdfcol.sty @@ -25,7 +25,7 @@ %% This work consists of the main source file pdfcol.dtx %% and the derived files %% pdfcol.sty, pdfcol.pdf, pdfcol.ins, pdfcol.drv, pdfcol-test1.tex, -%% pdfcol-test2.tex, pdfcol-test3.tex. +%% pdfcol-test2.tex, pdfcol-test3.tex, pdfcol-test4.tex. %% \begingroup \catcode44 12 % , @@ -85,7 +85,7 @@ \fi \expandafter\x\csname ver@pdfcol.sty\endcsname \ProvidesPackage{pdfcol}% - [2007/09/09 v1.0 Maintaining additional color stacks for pdfTeX (HO)] + [2007/12/12 v1.2 Maintaining additional color stacks for pdfTeX (HO)] \begingroup \catcode123 1 % { \catcode125 2 % } @@ -128,9 +128,16 @@ \RequirePackage{#1}[{#2}]% }% \fi +\newif\ifPDFCOL@luacolor +\begingroup\expandafter\expandafter\expandafter\endgroup +\expandafter\ifx\csname ver@luacolor.sty\endcsname\relax + \PDFCOL@luacolorfalse +\else + \PDFCOL@luacolortrue +\fi \PDFCOL@RequirePackage{infwarerr}[2007/09/09] \PDFCOL@RequirePackage{ifpdf}[2007/09/09] -\ifpdf +\ifcase\ifpdf\ifPDFCOL@luacolor 1\fi\else 1\fi0 % \def\PDFCOL@Message{% \@PackageWarningNoLine{pdfcol}% }% @@ -140,7 +147,12 @@ \@PackageInfoNoLine{pdfcol}% }% \PDFCOL@Message{% - Interface disabled because of missing PDF mode of pdfTeX% + Interface disabled because of % + \ifPDFCOL@luacolor + package `luacolor'% + \else + missing PDF mode of pdfTeX% + \fi }% \fi \ifpdfcolAvailable @@ -230,6 +242,9 @@ \pdfcol@ErrorNoStack{#1}% }% }% + \def\pdfcolSetCurrentColor{% + \pdfcolorstack\@pdfcolorstack set{\current@color}% + }% \def\pdfcolSetCurrent#1{% \ifx\\#1\\% \pdfcolorstack\@pdfcolorstack current\relax @@ -273,6 +288,9 @@ \def\pdfcolSwitchStack#1{% \PDFCOL@Disabled }% + \def\pdfcolSetCurrentColor{% + \PDFCOL@Disabled + }% \def\pdfcolSetCurrent#1{% \PDFCOL@Disabled }% diff --git a/Master/texmf-dist/tex/generic/oberdiek/pdftexcmds.sty b/Master/texmf-dist/tex/generic/oberdiek/pdftexcmds.sty index f9a16b5bc2e..6ff76866446 100644 --- a/Master/texmf-dist/tex/generic/oberdiek/pdftexcmds.sty +++ b/Master/texmf-dist/tex/generic/oberdiek/pdftexcmds.sty @@ -24,7 +24,8 @@ %% %% This work consists of the main source file pdftexcmds.dtx %% and the derived files -%% pdftexcmds.sty, pdftexcmds.pdf, pdftexcmds.ins, pdftexcmds.drv. +%% pdftexcmds.sty, pdftexcmds.pdf, pdftexcmds.ins, pdftexcmds.drv, +%% oberdiek.pdftexcmds.lua, pdftexcmds.lua. %% \begingroup \catcode44 12 % , @@ -84,7 +85,7 @@ \fi \expandafter\x\csname ver@pdftexcmds.sty\endcsname \ProvidesPackage{pdftexcmds}% - [2007/11/12 v0.2 LuaTeX support for pdfTeX utility functions (HO)] + [2007/12/12 v0.3 LuaTeX support for pdfTeX utility functions (HO)] \begingroup \catcode123 1 % { \catcode125 2 % } @@ -108,6 +109,7 @@ }% \catcode#1 #2\relax } +\TMP@EnsureCode{10}{12}% ^^J \TMP@EnsureCode{33}{12}% ! \TMP@EnsureCode{34}{12}% " \TMP@EnsureCode{39}{12}% ' @@ -123,6 +125,7 @@ \TMP@EnsureCode{60}{12}% < \TMP@EnsureCode{61}{12}% = \TMP@EnsureCode{62}{12}% > +\TMP@EnsureCode{94}{7}% ^ (superscript) \TMP@EnsureCode{95}{12}% _ (other) \TMP@EnsureCode{126}{12}% ~ (other) \begingroup\expandafter\expandafter\expandafter\endgroup @@ -188,383 +191,120 @@ \pdftexcmds@AtEnd \expandafter\endinput \fi -\chardef\pdftexcmds@luastate=0 % +\begingroup\expandafter\expandafter\expandafter\endgroup +\expandafter\ifx\csname RequirePackage\endcsname\relax + \input luatex-loader.sty\relax +\else + \RequirePackage{luatex-loader}[2007/12/12]% +\fi +\directlua0{% + require("oberdiek.pdftexcmds")% +} \begingroup\expandafter\expandafter\expandafter\endgroup \expandafter\ifx\csname newtoks\endcsname\relax \toksdef\pdftexcmds@toks=0 % \else \csname newtoks\endcsname\pdftexcmds@toks \fi -\begingroup - \escapechar=92 % - \edef\\{\string\\}% - \catcode35=12 % # - \catcode37=12\relax - \directlua\pdftexcmds@luastate{ - pdftexcmds = {} - function pdftexcmds.strcmp(A, B) - if A == B then - tex.write("0") - elseif A < B then - tex.write("-1") - else - tex.write("1") - end - end - function pdftexcmds.utf8_to_byte(str) - local i = 0 - local n = string.len(str) - local t = {} - while i < n do - i = i + 1 - local a = string.byte(str, i) - if a < 128 then - table.insert(t, string.char(a)) - else - if a >= 192 and i < n then - i = i + 1 - local b = string.byte(str, i) - if b < 128 or b >= 192 then - i = i - 1 - elseif a == 194 then - table.insert(t, string.char(b)) - elseif a == 195 then - table.insert(t, string.char(b + 64)) - end - end - end - end - return table.concat(t) - end - function pdftexcmds.escapehex(str, mode) - if mode == "byte" then - str = pdftexcmds.utf8_to_byte(str) - end - tex.write((string.gsub(str, ".", - function (ch) - return string.format("%02X", string.byte(ch)) - end - ))) - end - function pdftexcmds.unescapehex(str, mode) - local a = 0 - local first = true - local result = {} - for i = 1, string.len(str), 1 do - local ch = string.byte(str, i) - if ch >= 48 and ch <= 57 then - ch = ch - 48 - elseif ch >= 65 and ch <= 70 then - ch = ch - 55 - elseif ch >= 97 and ch <= 102 then - ch = ch - 87 - else - ch = nil - end - if ch then - if first then - a = ch * 16 - first = false - else - table.insert(result, a + ch) - first = true - end - end - end - if not first then - table.insert(result, a) - end - if mode == "byte" then - local utf8 = {} - for i, a in ipairs(result) do - if a < 128 then - table.insert(utf8, a) - else - if a < 192 then - table.insert(utf8, 194) - a = a - 128 - else - table.insert(utf8, 195) - a = a - 192 - end - table.insert(utf8, a + 128) - end - end - result = utf8 - end - tex.settoks(pdftexcmds.toks, string.char(unpack(result))) - end - function pdftexcmds.escapestring(str, mode) - if mode == "byte" then - str = pdftexcmds.utf8_to_byte(str) - end - tex.write((string.gsub(str, ".", - function (ch) - local b = string.byte(ch) - if b < 33 or b > 126 then - return string.format("\\%.3o", b) - end - if b == 40 or b == 41 or b == 92 then - return "\\" .. ch - end - return nil - end - ))) - end - function pdftexcmds.escapename(str, mode) - if mode == "byte" then - str = pdftexcmds.utf8_to_byte(str) - end - tex.write((string.gsub(str, ".", - function (ch) - local b = string.byte(ch) - if b == 0 then - return "" - end - if b <= 32 or b >= 127 - or b == 35 or b == 37 or b == 40 or b == 41 - or b == 47 or b == 60 or b == 62 or b == 91 - or b == 93 or b == 123 or b == 125 then - return string.format("#%.2X", b) - else - return nil - end - end - ))) - end - function pdftexcmds.filesize(filename) - local foundfile = kpse.find_file(filename, "tex", true) - if foundfile then - local size = lfs.attributes(foundfile, "size") - if size then - tex.write(size) - end - end - end - function pdftexcmds.filemoddate(filename) - local foundfile = kpse.find_file(filename, "tex", true) - if foundfile then - local date = lfs.attributes(foundfile, "modification") - if date then - local d = os.date("*t", date) - if d.sec >= 60 then - d.sec = 59 - end - local u = os.date("!*t", date) - local off = 60 * (d.hour - u.hour) + d.min - u.min - if d.year ~= u.year then - if d.year > u.year then - off = off + 1440 - else - off = off - 1440 - end - elseif d.yday ~= u.yday then - if d.yday > u.yday then - off = off + 1440 - else - off = off - 1440 - end - end - local timezone - if off == 0 then - timezone = "Z" - else - local hours = math.floor(off / 60) - local mins = math.abs(off - hours * 60) - timezone = string.format("%+03d'%02d'", hours, mins) - end - tex.write(string.format("D:%04d%02d%02d%02d%02d%02d%s", - d.year, d.month, d.day, d.hour, d.min, d.sec, timezone)) - end - end - end - function pdftexcmds.filedump(offset, length, filename) - length = tonumber(length) - if length and length > 0 then - local foundfile = kpse.find_file(filename, "tex", true) - if foundfile then - offset = tonumber(offset) - if not offset then - offset = 0 - end - local filehandle = io.open(foundfile, "r") - if filehandle then - if offset > 0 then - filehandle:seek("set", offset) - end - local dump = filehandle:read(length) - pdftexcmds.escapehex(dump) - end - end - end - end - function pdftexcmds.mdfivesum(str, mode) - if mode == "byte" then - str = pdftexcmds.utf8_to_byte(str) - end - pdftexcmds.escapehex(md5.sum(str)) - end - function pdftexcmds.filemdfivesum(filename) - local foundfile = kpse.find_file(filename, "tex", true) - if foundfile then - local filehandle = io.open(foundfile, "r") - if filehandle then - local contents = filehandle:read("*a") - pdftexcmds.escapehex(md5.sum(contents)) - end - end - end - function pdftexcmds.shellescape() - if os.execute then - tex.write("1") - else - tex.write("0") - end - end - function pdftexcmds.system(cmdline) - pdftexcmds.systemexitstatus = nil - texio.write_nl("log", "system(" .. cmdline .. ") ") - if os.execute then - texio.write("log", "executed.") - pdftexcmds.systemexitstatus = os.execute(cmdline) - else - texio.write("log", "disabled.") - end - end - function pdftexcmds.lastsystemstatus() - local result = tonumber(pdftexcmds.systemexitstatus) - if result then - local x = math.floor(result / 256) - tex.write(result - 256 * math.floor(result / 256)) - end - end - function pdftexcmds.lastsystemexit() - local result = tonumber(pdftexcmds.systemexitstatus) - if result then - tex.write(math.floor(result / 256)) - end - end - function pdftexcmds.pipe(cmdline) - local result - pdftexcmds.systemexitstatus = nil - texio.write_nl("log", "pipe(" .. cmdline ..") ") - if io.popen then - texio.write("log", "executed.") - local handle = io.popen(cmdline, "r") - if handle then - result = handle:read("*a") - handle:close() - end - else - texio.write("log", "disabled.") - end - if result then - tex.settoks(pdftexcmds.toks, result) - else - tex.settoks(pdftexcmds.toks, "") - end - end - } -\endgroup \long\def\pdf@strcmp#1#2{% - \directlua\pdftexcmds@luastate{% - pdftexcmds.strcmp("\luaescapestring{#1}",% + \directlua0{% + oberdiek.pdftexcmds.strcmp("\luaescapestring{#1}",% "\luaescapestring{#2}")% }% }% \long\def\pdf@escapehex#1{% - \directlua\pdftexcmds@luastate{% - pdftexcmds.escapehex("\luaescapestring{#1}", "byte")% + \directlua0{% + oberdiek.pdftexcmds.escapehex("\luaescapestring{#1}", "byte")% }% }% \long\def\pdf@escapehexnative#1{% - \directlua\pdftexcmds@luastate{% - pdftexcmds.escapehex("\luaescapestring{#1}")% + \directlua0{% + oberdiek.pdftexcmds.escapehex("\luaescapestring{#1}")% }% }% \def\pdf@unescapehex#1{% \the\expandafter\pdftexcmds@toks - \directlua\pdftexcmds@luastate{% - pdftexcmds.toks="pdftexcmds@toks"% - pdftexcmds.unescapehex("\luaescapestring{#1}", "byte")% + \directlua0{% + oberdiek.pdftexcmds.toks="pdftexcmds@toks"% + oberdiek.pdftexcmds.unescapehex("\luaescapestring{#1}", "byte")% }% }% \def\pdf@unescapehexnative#1{% \the\expandafter\pdftexcmds@toks - \directlua\pdftexcmds@luastate{% - pdftexcmds.toks="pdftexcmds@toks"% - pdftexcmds.unescapehex("\luaescapestring{#1}")% + \directlua0{% + oberdiek.pdftexcmds.toks="pdftexcmds@toks"% + oberdiek.pdftexcmds.unescapehex("\luaescapestring{#1}")% }% }% \long\def\pdf@escapestring#1{% - \directlua\pdftexcmds@luastate{% - pdftexcmds.escapestring("\luaescapestring{#1}", "byte")% + \directlua0{% + oberdiek.pdftexcmds.escapestring("\luaescapestring{#1}", "byte")% }% } \long\def\pdf@escapename#1{% - \directlua\pdftexcmds@luastate{% - pdftexcmds.escapename("\luaescapestring{#1}", "byte")% + \directlua0{% + oberdiek.pdftexcmds.escapename("\luaescapestring{#1}", "byte")% }% } \long\def\pdf@escapenamenative#1{% - \directlua\pdftexcmds@luastate{% - pdftexcmds.escapename("\luaescapestring{#1}")% + \directlua0{% + oberdiek.pdftexcmds.escapename("\luaescapestring{#1}")% }% } \def\pdf@filesize#1{% - \directlua\pdftexcmds@luastate{% - pdftexcmds.filesize("\luaescapestring{#1}")% + \directlua0{% + oberdiek.pdftexcmds.filesize("\luaescapestring{#1}")% }% } \def\pdf@filemoddate#1{% - \directlua\pdftexcmds@luastate{% - pdftexcmds.filemoddate("\luaescapestring{#1}")% + \directlua0{% + oberdiek.pdftexcmds.filemoddate("\luaescapestring{#1}")% }% } \def\pdf@filedump#1#2#3{% - \directlua\pdftexcmds@luastate{% - pdftexcmds.filedump("\luaescapestring{\number#1}",% + \directlua0{% + oberdiek.pdftexcmds.filedump("\luaescapestring{\number#1}",% "\luaescapestring{\number#2}",% "\luaescapestring{#3}")% }% }% \long\def\pdf@mdfivesum#1{% - \directlua\pdftexcmds@luastate{% - pdftexcmds.mdfivesum("\luaescapestring{#1}", "byte")% + \directlua0{% + oberdiek.pdftexcmds.mdfivesum("\luaescapestring{#1}", "byte")% }% }% \long\def\pdf@mdfivesumnative#1{% - \directlua\pdftexcmds@luastate{% - pdftexcmds.mdfivesum("\luaescapestring{#1}")% + \directlua0{% + oberdiek.pdftexcmds.mdfivesum("\luaescapestring{#1}")% }% }% \def\pdf@filemdfivesum#1{% - \directlua\pdftexcmds@luastate{% - pdftexcmds.filemdfivesum("\luaescapestring{#1}")% + \directlua0{% + oberdiek.pdftexcmds.filemdfivesum("\luaescapestring{#1}")% }% }% \def\pdf@shellescape{% - \directlua\pdftexcmds@luastate{% - pdftexcmds.shellescape()% + \directlua0{% + oberdiek.pdftexcmds.shellescape()% }% } \def\pdf@system#1{% - \directlua\pdftexcmds@luastate{% - pdftexcmds.system("\luaescapestring{#1}")% + \directlua0{% + oberdiek.pdftexcmds.system("\luaescapestring{#1}")% }% } \def\pdf@lastsystemstatus{% - \directlua\pdftexcmds@luastate{% - pdftexcmds.lastsystemstatus()% + \directlua0{% + oberdiek.pdftexcmds.lastsystemstatus()% }% } \def\pdf@lastsystemexit{% - \directlua\pdftexcmds@luastate{% - pdftexcmds.lastsystemexit()% + \directlua0{% + oberdiek.pdftexcmds.lastsystemexit()% }% } \ifnum0% - \directlua\pdftexcmds@luastate{% + \directlua0{% if io.popen then % tex.write("1")% end% @@ -572,9 +312,9 @@ =1 % \def\pdf@pipe#1{% \the\expandafter\pdftexcmds@toks - \directlua\pdftexcmds@luastate{% - pdftexcmds.toks="pdftexcmds@toks"% - pdftexcmds.pipe("\luaescapestring{#1}")% + \directlua0{% + oberdiek.pdftexcmds.toks="pdftexcmds@toks"% + oberdiek.pdftexcmds.pipe("\luaescapestring{#1}")% }% }% \fi |