summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/oberdiek/pdftexcmds.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/generic/oberdiek/pdftexcmds.sty')
-rw-r--r--Master/texmf-dist/tex/generic/oberdiek/pdftexcmds.sty267
1 files changed, 214 insertions, 53 deletions
diff --git a/Master/texmf-dist/tex/generic/oberdiek/pdftexcmds.sty b/Master/texmf-dist/tex/generic/oberdiek/pdftexcmds.sty
index 2f9f7a582dd..76c56299899 100644
--- a/Master/texmf-dist/tex/generic/oberdiek/pdftexcmds.sty
+++ b/Master/texmf-dist/tex/generic/oberdiek/pdftexcmds.sty
@@ -8,7 +8,7 @@
%%
%% This is a generated file.
%%
-%% Copyright (C) 2007, 2009, 2010 by
+%% Copyright (C) 2007, 2009-2011 by
%% Heiko Oberdiek <heiko.oberdiek at googlemail.com>
%%
%% This work may be distributed and/or modified under the
@@ -32,16 +32,21 @@
%% and the derived files
%% pdftexcmds.sty, pdftexcmds.pdf, pdftexcmds.ins, pdftexcmds.drv,
%% pdftexcmds-test1.tex, pdftexcmds-test2.tex,
+%% pdftexcmds-test-shell.tex, pdftexcmds-test-escape.tex,
%% oberdiek.pdftexcmds.lua, pdftexcmds.lua.
%%
-\begingroup
- \catcode44 12 % ,
- \catcode45 12 % -
- \catcode46 12 % .
- \catcode58 12 % :
- \catcode64 11 % @
- \catcode123 1 % {
- \catcode125 2 % }
+\begingroup\catcode61\catcode48\catcode32=10\relax%
+ \catcode13=5 % ^^M
+ \endlinechar=13 %
+ \catcode35=6 % #
+ \catcode39=12 % '
+ \catcode44=12 % ,
+ \catcode45=12 % -
+ \catcode46=12 % .
+ \catcode58=12 % :
+ \catcode64=11 % @
+ \catcode123=1 % {
+ \catcode125=2 % }
\expandafter\let\expandafter\x\csname ver@pdftexcmds.sty\endcsname
\ifx\x\relax % plain-TeX, first loading
\else
@@ -49,7 +54,6 @@
\ifx\x\empty % LaTeX, first loading,
% variable is initialized, but \ProvidesPackage not yet seen
\else
- \catcode35 6 % #
\expandafter\ifx\csname PackageInfo\endcsname\relax
\def\x#1#2{%
\immediate\write-1{Package #1 Info: #2.}%
@@ -61,21 +65,24 @@
\aftergroup\endinput
\fi
\fi
-\endgroup
-\begingroup
- \catcode35 6 % #
- \catcode40 12 % (
- \catcode41 12 % )
- \catcode44 12 % ,
- \catcode45 12 % -
- \catcode46 12 % .
- \catcode47 12 % /
- \catcode58 12 % :
- \catcode64 11 % @
- \catcode91 12 % [
- \catcode93 12 % ]
- \catcode123 1 % {
- \catcode125 2 % }
+\endgroup%
+\begingroup\catcode61\catcode48\catcode32=10\relax%
+ \catcode13=5 % ^^M
+ \endlinechar=13 %
+ \catcode35=6 % #
+ \catcode39=12 % '
+ \catcode40=12 % (
+ \catcode41=12 % )
+ \catcode44=12 % ,
+ \catcode45=12 % -
+ \catcode46=12 % .
+ \catcode47=12 % /
+ \catcode58=12 % :
+ \catcode64=11 % @
+ \catcode91=12 % [
+ \catcode93=12 % ]
+ \catcode123=1 % {
+ \catcode125=2 % }
\expandafter\ifx\csname ProvidesPackage\endcsname\relax
\def\x#1#2#3[#4]{\endgroup
\immediate\write-1{Package: #3 #4}%
@@ -94,33 +101,46 @@
\fi
\expandafter\x\csname ver@pdftexcmds.sty\endcsname
\ProvidesPackage{pdftexcmds}%
- [2010/04/01 v0.9 Utility functions of pdfTeX for LuaTeX (HO)]
-\begingroup
- \catcode123 1 % {
- \catcode125 2 % }
+ [2011/04/10 v0.14 Utilities of pdfTeX for LuaTeX (HO)]%
+\begingroup\catcode61\catcode48\catcode32=10\relax%
+ \catcode13=5 % ^^M
+ \endlinechar=13 %
+ \catcode123=1 % {
+ \catcode125=2 % }
+ \catcode64=11 % @
\def\x{\endgroup
\expandafter\edef\csname pdftexcmds@AtEnd\endcsname{%
- \catcode35 \the\catcode35\relax
- \catcode64 \the\catcode64\relax
- \catcode123 \the\catcode123\relax
- \catcode125 \the\catcode125\relax
+ \endlinechar=\the\endlinechar\relax
+ \catcode13=\the\catcode13\relax
+ \catcode32=\the\catcode32\relax
+ \catcode35=\the\catcode35\relax
+ \catcode61=\the\catcode61\relax
+ \catcode64=\the\catcode64\relax
+ \catcode123=\the\catcode123\relax
+ \catcode125=\the\catcode125\relax
}%
}%
-\x
-\catcode35 6 % #
-\catcode64 11 % @
-\catcode123 1 % {
-\catcode125 2 % }
+\x\catcode61\catcode48\catcode32=10\relax%
+\catcode13=5 % ^^M
+\endlinechar=13 %
+\catcode35=6 % #
+\catcode64=11 % @
+\catcode123=1 % {
+\catcode125=2 % }
\def\TMP@EnsureCode#1#2{%
\edef\pdftexcmds@AtEnd{%
\pdftexcmds@AtEnd
- \catcode#1 \the\catcode#1\relax
+ \catcode#1=\the\catcode#1\relax
}%
- \catcode#1 #2\relax
+ \catcode#1=#2\relax
}
+\TMP@EnsureCode{0}{12}%
+\TMP@EnsureCode{1}{12}%
+\TMP@EnsureCode{2}{12}%
\TMP@EnsureCode{10}{12}% ^^J
\TMP@EnsureCode{33}{12}% !
\TMP@EnsureCode{34}{12}% "
+\TMP@EnsureCode{38}{4}% &
\TMP@EnsureCode{39}{12}% '
\TMP@EnsureCode{40}{12}% (
\TMP@EnsureCode{41}{12}% )
@@ -132,8 +152,9 @@
\TMP@EnsureCode{47}{12}% /
\TMP@EnsureCode{58}{12}% :
\TMP@EnsureCode{60}{12}% <
-\TMP@EnsureCode{61}{12}% =
\TMP@EnsureCode{62}{12}% >
+\TMP@EnsureCode{91}{12}% [
+\TMP@EnsureCode{93}{12}% ]
\TMP@EnsureCode{94}{7}% ^ (superscript)
\TMP@EnsureCode{95}{12}% _ (other)
\TMP@EnsureCode{96}{12}% `
@@ -141,17 +162,26 @@
\edef\pdftexcmds@AtEnd{%
\pdftexcmds@AtEnd
\escapechar=\number\escapechar\relax
+ \noexpand\endinput
}
\escapechar=92 %
\begingroup\expandafter\expandafter\expandafter\endgroup
\expandafter\ifx\csname RequirePackage\endcsname\relax
- \input infwarerr.sty\relax
- \input ifluatex.sty\relax
- \input ltxcmds.sty\relax
+ \def\TMP@RequirePackage#1[#2]{%
+ \begingroup\expandafter\expandafter\expandafter\endgroup
+ \expandafter\ifx\csname ver@#1.sty\endcsname\relax
+ \input #1.sty\relax
+ \fi
+ }%
+ \TMP@RequirePackage{infwarerr}[2007/09/09]%
+ \TMP@RequirePackage{ifluatex}[2010/03/01]%
+ \TMP@RequirePackage{ltxcmds}[2010/12/02]%
+ \TMP@RequirePackage{ifpdf}[2010/09/13]%
\else
\RequirePackage{infwarerr}[2007/09/09]%
\RequirePackage{ifluatex}[2010/03/01]%
- \RequirePackage{ltxcmds}[2009/12/12]%
+ \RequirePackage{ltxcmds}[2010/12/02]%
+ \RequirePackage{ifpdf}[2010/09/13]%
\fi
\ifluatex
\else
@@ -229,7 +259,10 @@
\endlinechar=\newlinechar
\pdftexcmds@directlua{%
if tex.enableprimitives then
- tex.enableprimitives('pdf@', {'primitive', 'ifprimitive'})
+ tex.enableprimitives(
+ 'pdf@',
+ {'primitive', 'ifprimitive', 'pdfdraftmode'}
+ )
tex.enableprimitives('', {'luaescapestring'})
end
}%
@@ -364,24 +397,146 @@
\ifluatex
\else
\pdf@isprimitive
- \pdftexcmds@AtEnd
- \expandafter\endinput
\fi
+\let\pdftexcmds@temp\ltx@zero %
+\ltx@IfUndefined{pdfdraftmode}{%
+ \@PackageInfoNoLine{pdftexcmds}{\ltx@backslashchar pdfdraftmode not found}%
+}{%
+ \ifpdf
+ \let\pdftexcmds@temp\ltx@one
+ \@PackageInfoNoLine{pdftexcmds}{\ltx@backslashchar pdfdraftmode found}%
+ \else
+ \@PackageInfoNoLine{pdftexcmds}{%
+ \ltx@backslashchar pdfdraftmode is ignored in DVI mode%
+ }%
+ \fi
+}
+\ifcase\pdftexcmds@temp
+ \let\pdf@draftmode\ltx@zero
+ \let\pdf@ifdraftmode\ltx@secondoftwo
+ \def\pdftexcmds@setdraftmode#1{}%
+\else
+ \let\pdftexcmds@draftmode\pdfdraftmode
+ \def\pdf@ifdraftmode{%
+ \ifnum\pdftexcmds@draftmode=\ltx@one
+ \expandafter\ltx@firstoftwo
+ \else
+ \expandafter\ltx@secondoftwo
+ \fi
+ }%
+ \def\pdf@draftmode{%
+ \ifnum\pdftexcmds@draftmode=\ltx@one
+ \expandafter\ltx@one
+ \else
+ \expandafter\ltx@zero
+ \fi
+ }%
+ \def\pdftexcmds@setdraftmode#1{%
+ \pdftexcmds@draftmode=#1\relax
+ }%
+\fi
+\def\pdf@setdraftmode#1{%
+ \begingroup
+ \count\ltx@cclv=#1\relax
+ \edef\x{\endgroup
+ \noexpand\pdftexcmds@@setdraftmode{\the\count\ltx@cclv}%
+ }%
+ \x
+}
+\def\pdftexcmds@@setdraftmode#1{%
+ \ifcase#1 %
+ \pdftexcmds@setdraftmode{#1}%
+ \or
+ \pdftexcmds@setdraftmode{#1}%
+ \else
+ \@PackageWarning{pdftexcmds}{%
+ \string\pdf@setdraftmode: Ignoring\MessageBreak
+ invalid value `#1'%
+ }%
+ \fi
+}
+\ifluatex
+\else
+ \expandafter\pdftexcmds@AtEnd
+\fi%
\begingroup\expandafter\expandafter\expandafter\endgroup
\expandafter\ifx\csname RequirePackage\endcsname\relax
- \input luatex-loader.sty\relax
+ \def\TMP@RequirePackage#1[#2]{%
+ \begingroup\expandafter\expandafter\expandafter\endgroup
+ \expandafter\ifx\csname ver@#1.sty\endcsname\relax
+ \input #1.sty\relax
+ \fi
+ }%
+ \TMP@RequirePackage{luatex-loader}[2009/04/10]%
\else
\RequirePackage{luatex-loader}[2009/04/10]%
\fi
\pdftexcmds@directlua{%
require("oberdiek.pdftexcmds")%
}
+\begingroup
+ \def\x{2011/04/10 v0.14}%
+ \ltx@onelevel@sanitize\x
+ \edef\y{%
+ \pdftexcmds@directlua{%
+ if oberdiek.pdftexcmds.getversion then %
+ oberdiek.pdftexcmds.getversion()%
+ end%
+ }%
+ }%
+ \ifx\x\y
+ \else
+ \@PackageError{pdftexcmds}{%
+ Wrong version of lua module.\MessageBreak
+ Package version: \x\MessageBreak
+ Lua module: \y
+ }\@ehc
+ \fi
+\endgroup
\begingroup\expandafter\expandafter\expandafter\endgroup
\expandafter\ifx\csname newtoks\endcsname\relax
\toksdef\pdftexcmds@toks=0 %
\else
\csname newtoks\endcsname\pdftexcmds@toks
\fi
+\def\pdftexcmds@Patch{0}
+
+\ifnum\luatexversion>40 %
+ \ifnum\luatexversion<66 %
+ \def\pdftexcmds@Patch{1}%
+ \fi
+\fi
+\ifcase\pdftexcmds@Patch
+ \catcode`\&=14 %
+\else
+ \catcode`\&=9 %
+ \def\pdftexcmds@PatchDecode#1\@nil{%
+ \pdftexcmds@DecodeA#1^^A^^A\@nil{}%
+ }%
+ \def\pdftexcmds@DecodeA#1^^A^^A#2\@nil#3{%
+ \ifx\relax#2\relax
+ \ltx@ReturnAfterElseFi{%
+ \pdftexcmds@DecodeB#3#1^^A^^B\@nil{}%
+ }%
+ \else
+ \ltx@ReturnAfterFi{%
+ \pdftexcmds@DecodeA#2\@nil{#3#1^^@}%
+ }%
+ \fi
+ }%
+ \def\pdftexcmds@DecodeB#1^^A^^B#2\@nil#3{%
+ \ifx\relax#2\relax%
+ \ltx@ReturnAfterElseFi{%
+ \ltx@zero
+ #3#1%
+ }%
+ \else
+ \ltx@ReturnAfterFi{%
+ \pdftexcmds@DecodeB#2\@nil{#3#1^^A}%
+ }%
+ \fi
+ }%
+\fi
\ifnum\luatexversion<36 %
\else
\catcode`\0=9 %
@@ -404,18 +559,22 @@
}%
}%
\def\pdf@unescapehex#1{%
+& \romannumeral\expandafter\pdftexcmds@PatchDecode
\the\expandafter\pdftexcmds@toks
\directlua0{%
oberdiek.pdftexcmds.toks="pdftexcmds@toks"%
- oberdiek.pdftexcmds.unescapehex("\luaescapestring{#1}", "byte")%
+ oberdiek.pdftexcmds.unescapehex("\luaescapestring{#1}", "byte", \pdftexcmds@Patch)%
}%
+& \@nil
}%
\def\pdf@unescapehexnative#1{%
+& \romannumeral\expandafter\pdftexcmds@PatchDecode
\the\expandafter\pdftexcmds@toks
\directlua0{%
oberdiek.pdftexcmds.toks="pdftexcmds@toks"%
- oberdiek.pdftexcmds.unescapehex("\luaescapestring{#1}")%
+ oberdiek.pdftexcmds.unescapehex("\luaescapestring{#1}", \pdftexcmds@Patch)%
}%
+& \@nil
}%
\long\def\pdf@escapestring#1{%
\directlua0{%
@@ -493,14 +652,16 @@
}%
=1 %
\def\pdf@pipe#1{%
+& \romannumeral\expandafter\pdftexcmds@PatchDecode
\the\expandafter\pdftexcmds@toks
\pdftexcmds@directlua{%
oberdiek.pdftexcmds.toks="pdftexcmds@toks"%
- oberdiek.pdftexcmds.pipe("\luaescapestring{#1}")%
+ oberdiek.pdftexcmds.pipe("\luaescapestring{#1}", \pdftexcmds@Patch)%
}%
+& \@nil
}%
\fi
-\pdftexcmds@AtEnd
+\pdftexcmds@AtEnd%
\endinput
%%
%% End of file `pdftexcmds.sty'.