summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/pdftexcmds/pdftexcmds.dtx
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2020-06-05 03:02:48 +0000
committerNorbert Preining <norbert@preining.info>2020-06-05 03:02:48 +0000
commitf51a463b880756f6a989cac367c3d99fb1373719 (patch)
tree05acf2595be1af2b548896487426646955e36a8c /macros/latex/contrib/pdftexcmds/pdftexcmds.dtx
parent6c90555ebb89f41cc4dfb6cf3ee6bfaa8107650e (diff)
CTAN sync 202006050302
Diffstat (limited to 'macros/latex/contrib/pdftexcmds/pdftexcmds.dtx')
-rw-r--r--macros/latex/contrib/pdftexcmds/pdftexcmds.dtx432
1 files changed, 17 insertions, 415 deletions
diff --git a/macros/latex/contrib/pdftexcmds/pdftexcmds.dtx b/macros/latex/contrib/pdftexcmds/pdftexcmds.dtx
index c7002222ea..7e9de4e558 100644
--- a/macros/latex/contrib/pdftexcmds/pdftexcmds.dtx
+++ b/macros/latex/contrib/pdftexcmds/pdftexcmds.dtx
@@ -1,12 +1,12 @@
% \iffalse meta-comment
%
% File: pdftexcmds.dtx
-% Version: 2019/11/24 v0.31
+% Version: 2020-06-04 v0.32
% Info: Utility functions of pdfTeX for LuaTeX
%
% Copyright (C)
% 2007, 2009-2011 Heiko Oberdiek
-% 2016-2019 Oberdiek Package Support Group
+% 2016-2020 Oberdiek Package Support Group
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either
@@ -86,7 +86,7 @@
\input docstrip.tex
\Msg{************************************************************************}
\Msg{* Installation}
-\Msg{* Package: pdftexcmds 2019/11/24 v0.31 Utility functions of pdfTeX for LuaTeX (HO)}
+\Msg{* Package: pdftexcmds 2020-06-04 v0.32 Utility functions of pdfTeX for LuaTeX (HO)}
\Msg{************************************************************************}
\keepsilent
@@ -98,7 +98,7 @@
This is a generated file.
Project: pdftexcmds
-Version: 2019/11/24 v0.31
+Version: 2020-06-04 v0.32
Copyright (C)
2007, 2009-2011 Heiko Oberdiek
@@ -147,10 +147,6 @@ and the derived files
% \file{pdftexcmds-test2.tex}{\from{pdftexcmds.dtx}{test2}}%
% \file{pdftexcmds-test-shell.tex}{\from{pdftexcmds.dtx}{test-shell}}%
% \file{pdftexcmds-test-escape.tex}{\from{pdftexcmds.dtx}{test-escape}}%
- \nopreamble
- \nopostamble
-% \usedir{source/latex/pdftexcmds/catalogue}%
-% \file{pdftexcmds.xml}{\from{pdftexcmds.dtx}{catalogue}}%
}
\def\MetaPrefix{-- }
\def\defaultpostamble{%
@@ -200,7 +196,7 @@ and the derived files
%<*driver>
\NeedsTeXFormat{LaTeX2e}
\ProvidesFile{pdftexcmds.drv}%
- [2019/11/24 v0.31 Utility functions of pdfTeX for LuaTeX (HO)]%
+ [2020-06-04 v0.32 Utility functions of pdfTeX for LuaTeX (HO)]%
\documentclass{ltxdoc}
\usepackage{holtxdoc}[2011/11/22]
\usepackage{paralist}
@@ -219,26 +215,11 @@ and the derived files
% \fi
%
%
-% \CharacterTable
-% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
-% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
-% Digits \0\1\2\3\4\5\6\7\8\9
-% Exclamation \! Double quote \" Hash (number) \#
-% Dollar \$ Percent \% Ampersand \&
-% Acute accent \' Left paren \( Right paren \)
-% Asterisk \* Plus \+ Comma \,
-% Minus \- Point \. Solidus \/
-% Colon \: Semicolon \; Less than \<
-% Equals \= Greater than \> Question mark \?
-% Commercial at \@ Left bracket \[ Backslash \\
-% Right bracket \] Circumflex \^ Underscore \_
-% Grave accent \` Left brace \{ Vertical bar \|
-% Right brace \} Tilde \~}
%
% \GetFileInfo{pdftexcmds.drv}
%
% \title{The \xpackage{pdftexcmds} package}
-% \date{2019/11/24 v0.31}
+% \date{2020-06-04 v0.32}
% \author{Heiko Oberdiek\thanks
% {Please report any issues at \url{https://github.com/ho-tex/pdftexcmds/issues}}}
%
@@ -616,7 +597,7 @@ and the derived files
\fi
\expandafter\x\csname ver@pdftexcmds.sty\endcsname
\ProvidesPackage{pdftexcmds}%
- [2019/11/24 v0.31 Utility functions of pdfTeX for LuaTeX (HO)]%
+ [2020-06-04 v0.32 Utility functions of pdfTeX for LuaTeX (HO)]%
% \end{macrocode}
%
% \subsection{Catcodes}
@@ -1156,7 +1137,7 @@ and the derived files
\fi
\fi
\begingroup
- \def\x{2019/11/24 v0.31}%
+ \def\x{2020-06-04 v0.32}%
\ltx@onelevel@sanitize\x
\edef\y{%
\pdftexcmds@directlua{%
@@ -1563,7 +1544,7 @@ local pdftexcmds = oberdiek.pdftexcmds or {}
oberdiek.pdftexcmds = pdftexcmds
local systemexitstatus
function pdftexcmds.getversion()
- tex.write("2019/11/24 v0.31")
+ tex.write("2020-06-04 v0.32")
end
% \end{macrocode}
%
@@ -1859,7 +1840,7 @@ function pdftexcmds.elapsedtime()
if val > 2147483647 then
val = 2147483647
end
- tex.write(string.format("%d", val))
+ tex.write(string.format("%d", math.floor(val)))
end
% \end{macrocode}
%
@@ -1952,389 +1933,7 @@ end
% \begin{macrocode}
%</lua>
% \end{macrocode}
-%
-% \section{Test}
-%
-% \subsection{Catcode checks for loading}
-%
-% \begin{macrocode}
-%<*test1>
-% \end{macrocode}
-% \begin{macrocode}
-\catcode`\{=1 %
-\catcode`\}=2 %
-\catcode`\#=6 %
-\catcode`\@=11 %
-\expandafter\ifx\csname count@\endcsname\relax
- \countdef\count@=255 %
-\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 loop\endcsname\relax
- \expandafter\@firstofone
-\else
- \expandafter\@gobble
-\fi
-{%
- \def\loop#1\repeat{%
- \def\body{#1}%
- \iterate
- }%
- \def\iterate{%
- \body
- \let\next\iterate
- \else
- \let\next\relax
- \fi
- \next
- }%
- \let\repeat=\fi
-}%
-\def\RestoreCatcodes{}
-\count@=0 %
-\loop
- \edef\RestoreCatcodes{%
- \RestoreCatcodes
- \catcode\the\count@=\the\catcode\count@\relax
- }%
-\ifnum\count@<255 %
- \advance\count@ 1 %
-\repeat
-
-\def\RangeCatcodeInvalid#1#2{%
- \count@=#1\relax
- \loop
- \catcode\count@=15 %
- \ifnum\count@<#2\relax
- \advance\count@ 1 %
- \repeat
-}
-\def\RangeCatcodeCheck#1#2#3{%
- \count@=#1\relax
- \loop
- \ifnum#3=\catcode\count@
- \else
- \errmessage{%
- Character \the\count@\space
- with wrong catcode \the\catcode\count@\space
- instead of \number#3%
- }%
- \fi
- \ifnum\count@<#2\relax
- \advance\count@ 1 %
- \repeat
-}
-\def\space{ }
-\expandafter\ifx\csname LoadCommand\endcsname\relax
- \def\LoadCommand{\input pdftexcmds.sty\relax}%
-\fi
-\def\Test{%
- \RangeCatcodeInvalid{0}{47}%
- \RangeCatcodeInvalid{58}{64}%
- \RangeCatcodeInvalid{91}{96}%
- \RangeCatcodeInvalid{123}{255}%
- \catcode`\@=12 %
- \catcode`\\=0 %
- \catcode`\%=14 %
- \LoadCommand
- \RangeCatcodeCheck{0}{36}{15}%
- \RangeCatcodeCheck{37}{37}{14}%
- \RangeCatcodeCheck{38}{47}{15}%
- \RangeCatcodeCheck{48}{57}{12}%
- \RangeCatcodeCheck{58}{63}{15}%
- \RangeCatcodeCheck{64}{64}{12}%
- \RangeCatcodeCheck{65}{90}{11}%
- \RangeCatcodeCheck{91}{91}{15}%
- \RangeCatcodeCheck{92}{92}{0}%
- \RangeCatcodeCheck{93}{96}{15}%
- \RangeCatcodeCheck{97}{122}{11}%
- \RangeCatcodeCheck{123}{255}{15}%
- \RestoreCatcodes
-}
-\Test
-\csname @@end\endcsname
-\end
-% \end{macrocode}
-% \begin{macrocode}
-%</test1>
-% \end{macrocode}
-%
-% \subsection{Test for \cs{pdf@isprimitive}}
-%
-% \begin{macrocode}
-%<*test2>
-\catcode`\{=1 %
-\catcode`\}=2 %
-\catcode`\#=6 %
-\catcode`\@=11 %
-\input pdftexcmds.sty\relax
-\def\msg#1{%
- \begingroup
- \escapechar=92 %
- \immediate\write16{#1}%
- \endgroup
-}
-\long\def\test#1#2#3#4{%
- \begingroup
- #4%
- \def\str{%
- Test \string\pdf@isprimitive
- {\string #1}{\string #2}{...}: %
- }%
- \pdf@isprimitive{#1}{#2}{%
- \ifx#3Y%
- \msg{\str true ==> OK.}%
- \else
- \errmessage{\str false ==> FAILED}%
- \fi
- }{%
- \ifx#3Y%
- \errmessage{\str true ==> FAILED}%
- \else
- \msg{\str false ==> OK.}%
- \fi
- }%
- \endgroup
-}
-\test\relax\relax Y{}
-\test\foobar\relax Y{\let\foobar\relax}
-\test\foobar\relax N{}
-\test\hbox\hbox Y{}
-\test\foobar@hbox\hbox Y{\let\foobar@hbox\hbox}
-\test\if\if Y{}
-\test\if\ifx N{}
-\test\ifx\if N{}
-\test\par\par Y{}
-\test\hbox\par N{}
-\test\par\hbox N{}
-\csname @@end\endcsname\end
-%</test2>
-% \end{macrocode}
-%
-% \subsection{Test for \cs{pdf@shellescape}}
-%
-% \begin{macrocode}
-%<*test-shell>
-\catcode`\{=1 %
-\catcode`\}=2 %
-\catcode`\#=6 %
-\catcode`\@=11 %
-\input pdftexcmds.sty\relax
-\def\msg#{\immediate\write16}
-\def\MaybeEnd{}
-\ifx\luatexversion\UnDeFiNeD
-\else
- \ifnum\luatexversion<68 %
- \ifx\pdf@shellescape\@undefined
- \msg{SHELL=U}%
- \msg{OK (LuaTeX < 0.68)}%
- \else
- \msg{SHELL=defined}%
- \errmessage{Failed (LuaTeX < 0.68)}%
- \fi
- \def\MaybeEnd{\csname @@end\endcsname\end}%
- \fi
-\fi
-\MaybeEnd
-\ifx\pdf@shellescape\@undefined
- \msg{SHELL=U}%
-\else
- \msg{SHELL=\number\pdf@shellescape}%
-\fi
-\ifx\expected\@undefined
-\else
- \ifx\expected\relax
- \msg{EXPECTED=U}%
- \ifx\pdf@shellescape\@undefined
- \msg{OK}%
- \else
- \errmessage{Failed}%
- \fi
- \else
- \msg{EXPECTED=\number\expected}%
- \ifnum\pdf@shellescape=\expected\relax
- \msg{OK}%
- \else
- \errmessage{Failed}%
- \fi
- \fi
-\fi
-\csname @@end\endcsname\end
-%</test-shell>
-% \end{macrocode}
-%
-% \subsection{Test for escape functions}
-%
-% \begin{macrocode}
-%<*test-escape>
-\catcode`\{=1 %
-\catcode`\}=2 %
-\catcode`\#=6 %
-\catcode`\^=7 %
-\catcode`\@=11 %
-\errorcontextlines=1000 %
-\input pdftexcmds.sty\relax
-\def\msg#1{%
- \begingroup
- \escapechar=92 %
- \immediate\write16{#1}%
- \endgroup
-}
-% \end{macrocode}
-% \begin{macrocode}
-\begingroup
- \catcode`\@=11 %
- \countdef\count@=255 %
- \def\space{ }%
- \long\def\@whilenum#1\do #2{%
- \ifnum #1\relax
- #2\relax
- \@iwhilenum{#1\relax#2\relax}%
- \fi
- }%
- \long\def\@iwhilenum#1{%
- \ifnum #1%
- \expandafter\@iwhilenum
- \else
- \expandafter\ltx@gobble
- \fi
- {#1}%
- }%
- \gdef\AllBytes{}%
- \count@=0 %
- \catcode0=12 %
- \@whilenum\count@<256 \do{%
- \lccode0=\count@
- \ifnum\count@=32 %
- \xdef\AllBytes{\AllBytes\space}%
- \else
- \lowercase{%
- \xdef\AllBytes{\AllBytes^^@}%
- }%
- \fi
- \advance\count@ by 1 %
- }%
-\endgroup
-% \end{macrocode}
-% \begin{macrocode}
-\def\AllBytesHex{%
- 000102030405060708090A0B0C0D0E0F%
- 101112131415161718191A1B1C1D1E1F%
- 202122232425262728292A2B2C2D2E2F%
- 303132333435363738393A3B3C3D3E3F%
- 404142434445464748494A4B4C4D4E4F%
- 505152535455565758595A5B5C5D5E5F%
- 606162636465666768696A6B6C6D6E6F%
- 707172737475767778797A7B7C7D7E7F%
- 808182838485868788898A8B8C8D8E8F%
- 909192939495969798999A9B9C9D9E9F%
- A0A1A2A3A4A5A6A7A8A9AAABACADAEAF%
- B0B1B2B3B4B5B6B7B8B9BABBBCBDBEBF%
- C0C1C2C3C4C5C6C7C8C9CACBCCCDCECF%
- D0D1D2D3D4D5D6D7D8D9DADBDCDDDEDF%
- E0E1E2E3E4E5E6E7E8E9EAEBECEDEEEF%
- F0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF%
-}
-\ltx@onelevel@sanitize\AllBytesHex
-\expandafter\lowercase\expandafter{%
- \expandafter\def\expandafter\AllBytesHexLC
- \expandafter{\AllBytesHex}%
-}
-\begingroup
- \catcode`\#=12 %
- \xdef\AllBytesName{%
- #01#02#03#04#05#06#07#08#09#0A#0B#0C#0D#0E#0F%
- #10#11#12#13#14#15#16#17#18#19#1A#1B#1C#1D#1E#1F%
- #20!"#23$#25&'#28#29*+,-.#2F%
- 0123456789:;#3C=#3E?%
- @ABCDEFGHIJKLMNO%
- PQRSTUVWXYZ#5B\ltx@backslashchar#5D^_%
- `abcdefghijklmno%
- pqrstuvwxyz#7B|#7D\string~#7F%
- #80#81#82#83#84#85#86#87#88#89#8A#8B#8C#8D#8E#8F%
- #90#91#92#93#94#95#96#97#98#99#9A#9B#9C#9D#9E#9F%
- #A0#A1#A2#A3#A4#A5#A6#A7#A8#A9#AA#AB#AC#AD#AE#AF%
- #B0#B1#B2#B3#B4#B5#B6#B7#B8#B9#BA#BB#BC#BD#BE#BF%
- #C0#C1#C2#C3#C4#C5#C6#C7#C8#C9#CA#CB#CC#CD#CE#CF%
- #D0#D1#D2#D3#D4#D5#D6#D7#D8#D9#DA#DB#DC#DD#DE#DF%
- #E0#E1#E2#E3#E4#E5#E6#E7#E8#E9#EA#EB#EC#ED#EE#EF%
- #F0#F1#F2#F3#F4#F5#F6#F7#F8#F9#FA#FB#FC#FD#FE#FF%
- }%
-\endgroup
-\ltx@onelevel@sanitize\AllBytesName
-\edef\AllBytesFromName{\expandafter\ltx@gobble\AllBytes}
-\begingroup
- \def\|{|}%
- \edef\%{\ltx@percentchar}%
- \catcode`\|=0 %
- \catcode`\#=12 %
- \catcode`\~=12 %
- \catcode`\\=12 %
- |xdef|AllBytesString{%
- \000\001\002\003\004\005\006\007\010\011\012\013\014\015\016\017%
- \020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037%
- \040!"#$|%&'\(\)*+,-./%
- 0123456789:;<=>?%
- @ABCDEFGHIJKLMNO%
- PQRSTUVWXYZ[\\]^_%
- `abcdefghijklmno%
- pqrstuvwxyz{||}~\177%
- \200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217%
- \220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237%
- \240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257%
- \260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277%
- \300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317%
- \320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337%
- \340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357%
- \360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377%
- }%
-|endgroup
-\ltx@onelevel@sanitize\AllBytesString
-% \end{macrocode}
-% \begin{macrocode}
-\def\Test#1#2#3{%
- \begingroup
- \expandafter\expandafter\expandafter\def
- \expandafter\expandafter\expandafter\TestResult
- \expandafter\expandafter\expandafter{%
- #1{#2}%
- }%
- \ifx\TestResult#3%
- \else
- \newlinechar=10 %
- \msg{Expect:^^J#3}%
- \msg{Result:^^J\TestResult}%
- \errmessage{\string#2 -\string#1-> \string#3}%
- \fi
- \endgroup
-}
-\def\test#1#2#3{%
- \edef\TestFrom{#2}%
- \edef\TestExpect{#3}%
- \ltx@onelevel@sanitize\TestExpect
- \Test#1\TestFrom\TestExpect
-}
-\test\pdf@unescapehex{74657374}{test}
-\begingroup
- \catcode0=12 %
- \catcode1=12 %
- \test\pdf@unescapehex{740074017400740174}{t^^@t^^At^^@t^^At}%
-\endgroup
-\Test\pdf@escapehex\AllBytes\AllBytesHex
-\Test\pdf@unescapehex\AllBytesHex\AllBytes
-\Test\pdf@escapename\AllBytes\AllBytesName
-\Test\pdf@escapestring\AllBytes\AllBytesString
-% \end{macrocode}
-% \begin{macrocode}
-\csname @@end\endcsname\end
-%</test-escape>
-% \end{macrocode}
-%
-% \section{Installation}
+%% \section{Installation}
%
% \subsection{Download}
%
@@ -2354,7 +1953,7 @@ end
% \item[\CTANinstall{install/macros/latex/contrib/pdftexcmds.tds.zip}]
% \end{description}
% \emph{TDS} refers to the standard ``A Directory Structure
-% for \TeX\ Files'' (\CTAN{tds/tds.pdf}). Directories
+% for \TeX\ Files'' (\CTANpkg{tds}). Directories
% with \xfile{texmf} in their name are usually organized this way.
%
% \subsection{Bundle installation}
@@ -2457,8 +2056,8 @@ end
% \subsection{Refresh file name databases}
%
% If your \TeX~distribution
-% (\teTeX, \mikTeX, \dots) relies on file name databases, you must refresh
-% these. For example, \teTeX\ users run \verb|texhash| or
+% (\TeX\,Live, \mikTeX, \dots) relies on file name databases, you must refresh
+% these. For example, \TeX\,Live\ users run \verb|texhash| or
% \verb|mktexlsr|.
%
% \subsection{Some details for the interested}
@@ -2654,6 +2253,9 @@ end
% the same as in \hologo{pdfTeX} in the 8bit
% range and not drop all non ascii characters.
% \end{Version}
+% \begin{Version}{2020-06-04 v0.32}
+% \item Updated pdftexcmds.elapsedtime to lua 5.3 (issue 4).
+% \end{Version}
% \end{History}
%
% \PrintIndex