From 447c94ee79e6bd2ecba4c822e4c07763b492747e Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Mon, 25 Nov 2019 03:00:40 +0000 Subject: CTAN sync 201911250300 --- macros/latex/contrib/attachfile2/README.md | 11 + macros/latex/contrib/attachfile2/attachfile2.dtx | 3296 ++++++++++++++++++++ macros/latex/contrib/attachfile2/attachfile2.pdf | Bin 0 -> 443676 bytes macros/latex/contrib/caption/CHANGELOG | 18 +- macros/latex/contrib/caption/README | 11 +- macros/latex/contrib/caption/caption.dtx | 929 ++---- macros/latex/contrib/caption/caption.ins | 15 +- macros/latex/contrib/caption/caption3.dtx | 723 ++--- macros/latex/contrib/caption/newfloat.dtx | 2074 ------------ macros/latex/contrib/caption/newfloat.pdf | Bin 111038 -> 0 bytes macros/latex/contrib/caption/subcaption.dtx | 6 +- macros/latex/contrib/caption/subcaption.pdf | Bin 154500 -> 154507 bytes macros/latex/contrib/epstopdf-pkg/README.md | 20 + macros/latex/contrib/epstopdf-pkg/epstopdf.dtx | 1595 ++++++++++ macros/latex/contrib/epstopdf-pkg/epstopdf.pdf | Bin 0 -> 360058 bytes macros/latex/contrib/footnoterange/README | 2 +- .../footnoterange/footnoterange-example.pdf | Bin 82980 -> 82896 bytes .../latex/contrib/footnoterange/footnoterange.dtx | 42 +- .../latex/contrib/footnoterange/footnoterange.pdf | Bin 319711 -> 320112 bytes macros/latex/contrib/newfloat/CHANGELOG | 13 + macros/latex/contrib/newfloat/README | 38 + macros/latex/contrib/newfloat/SUMMARY | 1 + macros/latex/contrib/newfloat/newfloat.dtx | 2076 ++++++++++++ macros/latex/contrib/newfloat/newfloat.ins | 42 + macros/latex/contrib/newfloat/newfloat.pdf | Bin 0 -> 112077 bytes macros/latex/contrib/oberdiek/README.txt | 6 +- macros/latex/contrib/oberdiek/accsupp.dtx | 8 - macros/latex/contrib/oberdiek/accsupp.pdf | Bin 162282 -> 154721 bytes macros/latex/contrib/oberdiek/aliascnt.dtx | 8 - macros/latex/contrib/oberdiek/aliascnt.pdf | Bin 112951 -> 104955 bytes macros/latex/contrib/oberdiek/alphalph.dtx | 8 - macros/latex/contrib/oberdiek/alphalph.pdf | Bin 209306 -> 201277 bytes macros/latex/contrib/oberdiek/askinclude.dtx | 8 - macros/latex/contrib/oberdiek/askinclude.pdf | Bin 278793 -> 269928 bytes macros/latex/contrib/oberdiek/atbegshi.dtx | 8 - macros/latex/contrib/oberdiek/atbegshi.pdf | Bin 246424 -> 236604 bytes macros/latex/contrib/oberdiek/atenddvi.dtx | 8 - macros/latex/contrib/oberdiek/atenddvi.pdf | Bin 105613 -> 98072 bytes macros/latex/contrib/oberdiek/attachfile2.dtx | 3290 ------------------- macros/latex/contrib/oberdiek/attachfile2.pdf | Bin 276137 -> 0 bytes macros/latex/contrib/oberdiek/atveryend.dtx | 8 - macros/latex/contrib/oberdiek/atveryend.pdf | Bin 197514 -> 189909 bytes macros/latex/contrib/oberdiek/auxhook.dtx | 8 - macros/latex/contrib/oberdiek/auxhook.pdf | Bin 114769 -> 107125 bytes macros/latex/contrib/oberdiek/bigintcalc.dtx | 8 - macros/latex/contrib/oberdiek/bigintcalc.pdf | Bin 351208 -> 342725 bytes macros/latex/contrib/oberdiek/bitset.dtx | 8 - macros/latex/contrib/oberdiek/bitset.pdf | Bin 351764 -> 343843 bytes macros/latex/contrib/oberdiek/bmpsize.dtx | 8 - macros/latex/contrib/oberdiek/bmpsize.pdf | Bin 357514 -> 327858 bytes macros/latex/contrib/oberdiek/bookmark.dtx | 8 - macros/latex/contrib/oberdiek/bookmark.pdf | Bin 299439 -> 291294 bytes macros/latex/contrib/oberdiek/catchfile.dtx | 8 - macros/latex/contrib/oberdiek/catchfile.pdf | Bin 152384 -> 144464 bytes macros/latex/contrib/oberdiek/centernot.dtx | 8 - macros/latex/contrib/oberdiek/centernot.pdf | Bin 176160 -> 168421 bytes macros/latex/contrib/oberdiek/chemarr.dtx | 8 - macros/latex/contrib/oberdiek/chemarr.pdf | Bin 102642 -> 94824 bytes macros/latex/contrib/oberdiek/classlist.dtx | 8 - macros/latex/contrib/oberdiek/classlist.pdf | Bin 107108 -> 99155 bytes macros/latex/contrib/oberdiek/colonequals.dtx | 8 - macros/latex/contrib/oberdiek/colonequals.pdf | Bin 112582 -> 104917 bytes macros/latex/contrib/oberdiek/dvipscol.dtx | 8 - macros/latex/contrib/oberdiek/dvipscol.pdf | Bin 99025 -> 90869 bytes macros/latex/contrib/oberdiek/embedfile.dtx | 10 +- macros/latex/contrib/oberdiek/embedfile.pdf | Bin 222803 -> 215085 bytes macros/latex/contrib/oberdiek/engord.dtx | 8 - macros/latex/contrib/oberdiek/engord.pdf | Bin 141815 -> 134331 bytes macros/latex/contrib/oberdiek/enparen.dtx | 8 - macros/latex/contrib/oberdiek/enparen.pdf | Bin 133925 -> 125599 bytes macros/latex/contrib/oberdiek/eolgrab.dtx | 8 - macros/latex/contrib/oberdiek/eolgrab.pdf | Bin 144686 -> 136589 bytes macros/latex/contrib/oberdiek/epstopdf.dtx | 1602 ---------- macros/latex/contrib/oberdiek/epstopdf.pdf | Bin 189232 -> 0 bytes macros/latex/contrib/oberdiek/etexcmds.dtx | 8 - macros/latex/contrib/oberdiek/etexcmds.pdf | Bin 138132 -> 130586 bytes macros/latex/contrib/oberdiek/fibnum.dtx | 8 - macros/latex/contrib/oberdiek/fibnum.pdf | Bin 157945 -> 150055 bytes macros/latex/contrib/oberdiek/flags.dtx | 8 - macros/latex/contrib/oberdiek/flags.pdf | Bin 112156 -> 104391 bytes macros/latex/contrib/oberdiek/gettitlestring.dtx | 8 - macros/latex/contrib/oberdiek/gettitlestring.pdf | Bin 150722 -> 142935 bytes macros/latex/contrib/oberdiek/grfext.dtx | 8 - macros/latex/contrib/oberdiek/grfext.pdf | Bin 156996 -> 149210 bytes macros/latex/contrib/oberdiek/hologo.dtx | 8 - macros/latex/contrib/oberdiek/hologo.pdf | Bin 403350 -> 393723 bytes macros/latex/contrib/oberdiek/holtxdoc.dtx | 8 - macros/latex/contrib/oberdiek/holtxdoc.pdf | Bin 134008 -> 126245 bytes macros/latex/contrib/oberdiek/hopatch.dtx | 8 - macros/latex/contrib/oberdiek/hopatch.pdf | Bin 134663 -> 126726 bytes macros/latex/contrib/oberdiek/hycolor.dtx | 8 - macros/latex/contrib/oberdiek/hycolor.pdf | Bin 233432 -> 225842 bytes macros/latex/contrib/oberdiek/hypbmsec.dtx | 8 - macros/latex/contrib/oberdiek/hypbmsec.pdf | Bin 122186 -> 114241 bytes macros/latex/contrib/oberdiek/hypcap.dtx | 8 - macros/latex/contrib/oberdiek/hypcap.pdf | Bin 119579 -> 111664 bytes macros/latex/contrib/oberdiek/hypdestopt.dtx | 8 - macros/latex/contrib/oberdiek/hypdestopt.pdf | Bin 139813 -> 131914 bytes macros/latex/contrib/oberdiek/hypdoc.dtx | 8 - macros/latex/contrib/oberdiek/hypdoc.pdf | Bin 165867 -> 157732 bytes macros/latex/contrib/oberdiek/hypgotoe.dtx | 8 - macros/latex/contrib/oberdiek/hypgotoe.pdf | Bin 117331 -> 109506 bytes macros/latex/contrib/oberdiek/hyphsubst.dtx | 8 - macros/latex/contrib/oberdiek/hyphsubst.pdf | Bin 135952 -> 127698 bytes macros/latex/contrib/oberdiek/ifdraft.dtx | 8 - macros/latex/contrib/oberdiek/ifdraft.pdf | Bin 101300 -> 93125 bytes macros/latex/contrib/oberdiek/iflang.dtx | 8 - macros/latex/contrib/oberdiek/iflang.pdf | Bin 164990 -> 157246 bytes macros/latex/contrib/oberdiek/infwarerr.dtx | 8 - macros/latex/contrib/oberdiek/infwarerr.pdf | Bin 156081 -> 148627 bytes macros/latex/contrib/oberdiek/inputenx.dtx | 8 - macros/latex/contrib/oberdiek/inputenx.pdf | Bin 778189 -> 770095 bytes macros/latex/contrib/oberdiek/intcalc.dtx | 8 - macros/latex/contrib/oberdiek/intcalc.pdf | Bin 327184 -> 317624 bytes macros/latex/contrib/oberdiek/kvdefinekeys.dtx | 8 - macros/latex/contrib/oberdiek/kvdefinekeys.pdf | Bin 125348 -> 117570 bytes macros/latex/contrib/oberdiek/kvoptions.dtx | 8 - macros/latex/contrib/oberdiek/kvoptions.pdf | Bin 323706 -> 315291 bytes macros/latex/contrib/oberdiek/kvsetkeys.dtx | 8 - macros/latex/contrib/oberdiek/kvsetkeys.pdf | Bin 227083 -> 219179 bytes macros/latex/contrib/oberdiek/letltxmacro.dtx | 8 - macros/latex/contrib/oberdiek/letltxmacro.pdf | Bin 163367 -> 154365 bytes macros/latex/contrib/oberdiek/listingsutf8.dtx | 8 - macros/latex/contrib/oberdiek/listingsutf8.pdf | Bin 138851 -> 130669 bytes macros/latex/contrib/oberdiek/ltxcmds.dtx | 8 - macros/latex/contrib/oberdiek/ltxcmds.pdf | Bin 296082 -> 295118 bytes macros/latex/contrib/oberdiek/luacolor.dtx | 8 - macros/latex/contrib/oberdiek/luacolor.pdf | Bin 149282 -> 141569 bytes macros/latex/contrib/oberdiek/magicnum.dtx | 8 - macros/latex/contrib/oberdiek/magicnum.pdf | Bin 159190 -> 151546 bytes macros/latex/contrib/oberdiek/mleftright.dtx | 8 - macros/latex/contrib/oberdiek/mleftright.pdf | Bin 137792 -> 129792 bytes macros/latex/contrib/oberdiek/oberdiek.pdf | Bin 418302 -> 398916 bytes macros/latex/contrib/oberdiek/oberdiek.tex | 52 +- macros/latex/contrib/oberdiek/pagegrid.dtx | 8 - macros/latex/contrib/oberdiek/pagegrid.pdf | Bin 151437 -> 143837 bytes macros/latex/contrib/oberdiek/pagesel.dtx | 8 - macros/latex/contrib/oberdiek/pagesel.pdf | Bin 133558 -> 125704 bytes macros/latex/contrib/oberdiek/pdfcol.dtx | 8 - macros/latex/contrib/oberdiek/pdfcol.pdf | Bin 154266 -> 146435 bytes macros/latex/contrib/oberdiek/pdfcolfoot.dtx | 8 - macros/latex/contrib/oberdiek/pdfcolfoot.pdf | Bin 122442 -> 114523 bytes macros/latex/contrib/oberdiek/pdfcolmk.dtx | 1011 ------ macros/latex/contrib/oberdiek/pdfcolmk.pdf | Bin 151509 -> 0 bytes macros/latex/contrib/oberdiek/pdfcolparallel.dtx | 8 - macros/latex/contrib/oberdiek/pdfcolparallel.pdf | Bin 157764 -> 150094 bytes macros/latex/contrib/oberdiek/pdfcolparcolumns.dtx | 8 - macros/latex/contrib/oberdiek/pdfcolparcolumns.pdf | Bin 144691 -> 136921 bytes macros/latex/contrib/oberdiek/pdfcrypt.dtx | 8 - macros/latex/contrib/oberdiek/pdfcrypt.pdf | Bin 156221 -> 147277 bytes macros/latex/contrib/oberdiek/pdfescape.dtx | 8 - macros/latex/contrib/oberdiek/pdfescape.pdf | Bin 246821 -> 239513 bytes macros/latex/contrib/oberdiek/pdflscape.dtx | 8 - macros/latex/contrib/oberdiek/pdflscape.pdf | Bin 142156 -> 134501 bytes macros/latex/contrib/oberdiek/pdfrender.dtx | 8 - macros/latex/contrib/oberdiek/pdfrender.pdf | Bin 209981 -> 202389 bytes macros/latex/contrib/oberdiek/pdftexcmds.dtx | 2689 ---------------- macros/latex/contrib/oberdiek/pdftexcmds.pdf | Bin 240026 -> 0 bytes macros/latex/contrib/oberdiek/picture.dtx | 8 - macros/latex/contrib/oberdiek/picture.pdf | Bin 124352 -> 116677 bytes macros/latex/contrib/oberdiek/pmboxdraw.dtx | 8 - macros/latex/contrib/oberdiek/pmboxdraw.pdf | Bin 503296 -> 495154 bytes macros/latex/contrib/oberdiek/protecteddef.dtx | 8 - macros/latex/contrib/oberdiek/protecteddef.pdf | Bin 146856 -> 138810 bytes macros/latex/contrib/oberdiek/refcount.dtx | 8 - macros/latex/contrib/oberdiek/refcount.pdf | Bin 186104 -> 177858 bytes macros/latex/contrib/oberdiek/rerunfilecheck.dtx | 8 - macros/latex/contrib/oberdiek/rerunfilecheck.pdf | Bin 150017 -> 142409 bytes macros/latex/contrib/oberdiek/resizegather.dtx | 8 - macros/latex/contrib/oberdiek/resizegather.pdf | Bin 143159 -> 135638 bytes macros/latex/contrib/oberdiek/rotchiffre.dtx | 8 - macros/latex/contrib/oberdiek/rotchiffre.pdf | Bin 170058 -> 162136 bytes macros/latex/contrib/oberdiek/scrindex.dtx | 8 - macros/latex/contrib/oberdiek/scrindex.pdf | Bin 120323 -> 112554 bytes macros/latex/contrib/oberdiek/selinput.dtx | 8 - macros/latex/contrib/oberdiek/selinput.pdf | Bin 152421 -> 144530 bytes macros/latex/contrib/oberdiek/setouterhbox.dtx | 8 - macros/latex/contrib/oberdiek/setouterhbox.pdf | Bin 160804 -> 153089 bytes macros/latex/contrib/oberdiek/settobox.dtx | 8 - macros/latex/contrib/oberdiek/settobox.pdf | Bin 129245 -> 121340 bytes macros/latex/contrib/oberdiek/soulutf8.dtx | 8 - macros/latex/contrib/oberdiek/soulutf8.pdf | Bin 236665 -> 228977 bytes macros/latex/contrib/oberdiek/stackrel.dtx | 8 - macros/latex/contrib/oberdiek/stackrel.pdf | Bin 109432 -> 101756 bytes macros/latex/contrib/oberdiek/stampinclude.dtx | 8 - macros/latex/contrib/oberdiek/stampinclude.pdf | Bin 112509 -> 104658 bytes macros/latex/contrib/oberdiek/stringenc.dtx | 8 - macros/latex/contrib/oberdiek/stringenc.pdf | Bin 568512 -> 560339 bytes macros/latex/contrib/oberdiek/tabularht.dtx | 8 - macros/latex/contrib/oberdiek/tabularht.pdf | Bin 156363 -> 148501 bytes macros/latex/contrib/oberdiek/tabularkv.dtx | 8 - macros/latex/contrib/oberdiek/tabularkv.pdf | Bin 98095 -> 90420 bytes macros/latex/contrib/oberdiek/telprint.dtx | 8 - macros/latex/contrib/oberdiek/telprint.pdf | Bin 141274 -> 133279 bytes macros/latex/contrib/oberdiek/thepdfnumber.dtx | 8 - macros/latex/contrib/oberdiek/thepdfnumber.pdf | Bin 177672 -> 169779 bytes macros/latex/contrib/oberdiek/transparent.dtx | 8 - macros/latex/contrib/oberdiek/transparent.pdf | Bin 109328 -> 101561 bytes macros/latex/contrib/oberdiek/twoopt.dtx | 8 - macros/latex/contrib/oberdiek/twoopt.pdf | Bin 108604 -> 100555 bytes macros/latex/contrib/oberdiek/uniquecounter.dtx | 8 - macros/latex/contrib/oberdiek/uniquecounter.pdf | Bin 142362 -> 134249 bytes macros/latex/contrib/oberdiek/zref.dtx | 10 +- macros/latex/contrib/oberdiek/zref.pdf | Bin 521043 -> 513339 bytes macros/latex/contrib/pdfcolmk/README.md | 14 + macros/latex/contrib/pdfcolmk/pdfcolmk.sty | 24 + macros/latex/contrib/pdftexcmds/README.md | 11 + macros/latex/contrib/pdftexcmds/pdftexcmds.dtx | 2662 ++++++++++++++++ macros/latex/contrib/pdftexcmds/pdftexcmds.pdf | Bin 0 -> 411206 bytes 209 files changed, 10330 insertions(+), 12619 deletions(-) create mode 100644 macros/latex/contrib/attachfile2/README.md create mode 100644 macros/latex/contrib/attachfile2/attachfile2.dtx create mode 100644 macros/latex/contrib/attachfile2/attachfile2.pdf delete mode 100644 macros/latex/contrib/caption/newfloat.dtx delete mode 100644 macros/latex/contrib/caption/newfloat.pdf create mode 100644 macros/latex/contrib/epstopdf-pkg/README.md create mode 100644 macros/latex/contrib/epstopdf-pkg/epstopdf.dtx create mode 100644 macros/latex/contrib/epstopdf-pkg/epstopdf.pdf create mode 100644 macros/latex/contrib/newfloat/CHANGELOG create mode 100644 macros/latex/contrib/newfloat/README create mode 100644 macros/latex/contrib/newfloat/SUMMARY create mode 100644 macros/latex/contrib/newfloat/newfloat.dtx create mode 100644 macros/latex/contrib/newfloat/newfloat.ins create mode 100644 macros/latex/contrib/newfloat/newfloat.pdf delete mode 100644 macros/latex/contrib/oberdiek/attachfile2.dtx delete mode 100644 macros/latex/contrib/oberdiek/attachfile2.pdf delete mode 100644 macros/latex/contrib/oberdiek/epstopdf.dtx delete mode 100644 macros/latex/contrib/oberdiek/epstopdf.pdf delete mode 100644 macros/latex/contrib/oberdiek/pdfcolmk.dtx delete mode 100644 macros/latex/contrib/oberdiek/pdfcolmk.pdf delete mode 100644 macros/latex/contrib/oberdiek/pdftexcmds.dtx delete mode 100644 macros/latex/contrib/oberdiek/pdftexcmds.pdf create mode 100644 macros/latex/contrib/pdfcolmk/README.md create mode 100644 macros/latex/contrib/pdfcolmk/pdfcolmk.sty create mode 100644 macros/latex/contrib/pdftexcmds/README.md create mode 100644 macros/latex/contrib/pdftexcmds/pdftexcmds.dtx create mode 100644 macros/latex/contrib/pdftexcmds/pdftexcmds.pdf (limited to 'macros/latex') diff --git a/macros/latex/contrib/attachfile2/README.md b/macros/latex/contrib/attachfile2/README.md new file mode 100644 index 0000000000..d014b5549a --- /dev/null +++ b/macros/latex/contrib/attachfile2/README.md @@ -0,0 +1,11 @@ +# attachfile2 +attach files to PDF documents + + + +See the embedfile package for a newer package supporting this feature. + + +This package comes with a Perl script pdfatfi.pl +that should be installed somewhere in PATH as `pdfatfi', see also +package documentation. diff --git a/macros/latex/contrib/attachfile2/attachfile2.dtx b/macros/latex/contrib/attachfile2/attachfile2.dtx new file mode 100644 index 0000000000..0b5922b976 --- /dev/null +++ b/macros/latex/contrib/attachfile2/attachfile2.dtx @@ -0,0 +1,3296 @@ +% \iffalse meta-comment +% +% File: attachfile2.dtx +% Version: 2019/11/24 v2.10 +% Info: Attach files into PDF +% +% Copyright (C) +% 2005-2010, 2012 Heiko Oberdiek +% 2016-2019 Oberdiek Package Support Group +% https://github.com/ho-tex/attachfile2/issues +% +% This work may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either +% version 1.3c of this license or (at your option) any later +% version. This version of this license is in +% https://www.latex-project.org/lppl/lppl-1-3c.txt +% and the latest version of this license is in +% https://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". +% +% The Current Maintainers of this work are +% Heiko Oberdiek and the Oberdiek Package Support Group +% https://github.com/ho-tex/attachfile2/issues +% +% This work consists of the main source file attachfile2.dtx +% and the derived files +% attachfile2.sty, attachfile2.pdf, attachfile2.ins, attachfile2.drv, +% atfi-dvips.def, atfi-pdftex.def, atfi-dvipdfmx.def, atfi-luatex.def +% pdfatfi.pl. +% +% Distribution: +% CTAN:macros/latex/contrib/attachfile2/attachfile2.dtx +% CTAN:macros/latex/contrib/attachfile2/attachfile2.pdf +% +% Unpacking: +% (a) If attachfile2.ins is present: +% tex attachfile2.ins +% (b) Without attachfile2.ins: +% tex attachfile2.dtx +% (c) If you insist on using LaTeX +% latex \let\install=y\input{attachfile2.dtx} +% (quote the arguments according to the demands of your shell) +% +% Documentation: +% (a) If attachfile2.drv is present: +% latex attachfile2.drv +% (b) Without attachfile2.drv: +% latex attachfile2.dtx; ... +% The class ltxdoc loads the configuration file ltxdoc.cfg +% if available. Here you can specify further options, e.g. +% use A4 as paper format: +% \PassOptionsToClass{a4paper}{article} +% +% Programm calls to get the documentation (example): +% pdflatex attachfile2.dtx +% makeindex -s gind.ist attachfile2.idx +% pdflatex attachfile2.dtx +% makeindex -s gind.ist attachfile2.idx +% pdflatex attachfile2.dtx +% +% Installation: +% TDS:tex/latex/attachfile2/attachfile2.sty +% TDS:tex/latex/attachfile2/atfi-dvips.def +% TDS:tex/latex/attachfile2/atfi-pdftex.def +% TDS:tex/latex/attachfile2/atfi-dvipdfmx.def +% TDS:tex/latex/attachfile2/atfi-luatex.def +% TDS:scripts/attachfile2/pdfatfi.pl (exec flag) +% TDS:doc/latex/attachfile2/attachfile2.pdf +% TDS:source/latex/attachfile2/attachfile2.dtx +% +%<*ignore> +\begingroup + \catcode123=1 % + \catcode125=2 % + \def\x{LaTeX2e}% +\expandafter\endgroup +\ifcase 0\ifx\install y1\fi\expandafter + \ifx\csname processbatchFile\endcsname\relax\else1\fi + \ifx\fmtname\x\else 1\fi\relax +\else\csname fi\endcsname +% +%<*install> +\input docstrip.tex +\Msg{************************************************************************} +\Msg{* Installation} +\Msg{* Package: attachfile2 2019/11/24 v2.10 Attach files into PDF (HO)} +\Msg{************************************************************************} + +\keepsilent +\askforoverwritefalse + +\let\MetaPrefix\relax +\preamble + +This is a generated file. + +Project: attachfile2 +Version: 2019/11/24 v2.10 + +Copyright (C) + 2005-2010, 2012 Heiko Oberdiek + 2016-2019 Oberdiek Package Support Group + +This work may be distributed and/or modified under the +conditions of the LaTeX Project Public License, either +version 1.3c of this license or (at your option) any later +version. This version of this license is in + https://www.latex-project.org/lppl/lppl-1-3c.txt +and the latest version of this license is in + https://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". + +The Current Maintainers of this work are +Heiko Oberdiek and the Oberdiek Package Support Group +https://github.com/ho-tex/attachfile2/issues + + +This work consists of the main source file attachfile2.dtx +and the derived files + attachfile2.sty, attachfile2.pdf, attachfile2.ins, attachfile2.drv, + atfi-dvips.def, atfi-pdftex.def, atfi-dvipdfmx.def, atfi-luatex.def + pdfatfi.pl. + +\endpreamble +\let\MetaPrefix\DoubleperCent + +\generate{% + \file{attachfile2.ins}{\from{attachfile2.dtx}{install}}% + \file{attachfile2.drv}{\from{attachfile2.dtx}{driver}}% + \usedir{tex/latex/attachfile2}% + \file{attachfile2.sty}{\from{attachfile2.dtx}{package}}% + \file{atfi-dvips.def}{\from{attachfile2.dtx}{dvips}}% + \file{atfi-pdftex.def}{\from{attachfile2.dtx}{pdftex}}% + \file{atfi-luatex.def}{\from{attachfile2.dtx}{luatex}}% + \file{atfi-dvipdfmx.def}{\from{attachfile2.dtx}{dvipdfmx}}% + \nopreamble + \nopostamble + \usedir{scripts/attachfile2}% + \csname execfiletrue\endcsname + \file{pdfatfi.pl}{\from{attachfile2.dtx}{pdfatfi}}% +% \usedir{source/latex/attachfile2/catalogue}% +% \file{attachfile2.xml}{\from{attachfile2.dtx}{catalogue}}% +} + +\catcode32=13\relax% active space +\let =\space% +\Msg{************************************************************************} +\Msg{*} +\Msg{* To finish the installation you have to move the following} +\Msg{* files into a directory searched by TeX:} +\Msg{*} +\Msg{* attachfile2.sty, atfi-dvips.def, atfi-pdftex.def,} +\Msg{* atfi-dvipdfmx.def, atfi-luatex.def} +\Msg{*} +\Msg{* And install the following script file:} +\Msg{*} +\Msg{* pdfatfi.pl} +\Msg{*} +\Msg{* To produce the documentation run the file `attachfile2.drv'} +\Msg{* through LaTeX.} +\Msg{*} +\Msg{* Happy TeXing!} +\Msg{*} +\Msg{************************************************************************} + +\endbatchfile +% +%<*ignore> +\fi +% +%<*driver> +\NeedsTeXFormat{LaTeX2e} +\ProvidesFile{attachfile2.drv}% + [2019/11/24 v2.10 Attach files into PDF (HO)]% +\documentclass{ltxdoc} +\usepackage{holtxdoc}[2011/11/22] +\begin{document} + \DocInput{attachfile2.dtx}% +\end{document} +% +% \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{attachfile2.drv} +% +% \title{The \xpackage{attachfile2} package} +% \date{2019/11/24 v2.10} +% \author{Heiko Oberdiek\thanks +% {Please report any issues at \url{https://github.com/ho-tex/attachfile2/issues}}} +% +% \maketitle +% +% \begin{abstract} +% This package can be used to attach files to a PDF document. +% It is a further development of Scott Pakin's package +% \xpackage{attachfile} for \pdfTeX. Apart from bug fixes, +% package \xpackage{attachfile2} adds support for \xoption{dvips}, +% some new options, gets and writes meta information data about +% the attached files. +% \end{abstract} +% +% \tableofcontents +% +% \section{Documentation} +% +% \subsection{Introduction} +% +% The PDF format (\cite{pdfspec}) allows the inclusion of files +% inside the PDF document. The included files can be bound to an +% annotation on a page. Or they can be recorded in a sorted +% list of embedded files. The packages \xpackage{attachfile} +% or \xpackage{attachfile2} follow the first approach, +% package \xpackage{embedfile} uses the latter method. +% +% \subsubsection{Future development} +% +% My dream is a large package that merges the features of +% all these packages meantioned before: +% \begin{itemize} +% \item Files can be attached to a page. +% \item Files can be attached to the document. +% \item An easy user interface for simple, common tasks and +% beginners. +% \item An interface for the advanced users that want to setup +% every detail. +% \item Support of many drivers (pdftex, dvips, dvipdfm, \dots). +% \item \dots +% \end{itemize} +% However, I have not managed to take the time for this project. +% Instead: +% \begin{itemize} +% \item First I experimented with package \xpackage{attachfile}, +% adding driver support, fixing bugs, \dots. The result is +% currently named as \xpackage{attachfile2}. It uses an external +% script to get file properties (size, date, checksum, \dots). +% \item In order to avoid an external program for getting basic +% file properties I provided a patch ``EscapeAndOther'' for +% pdfTeX that was accepted for version 1.30. +% \item Package \xpackage{embedfile} closes a gap left by the +% packages for attaching +% files and allows the embedding of files to the document. +% Also it makes use of the new primitives of \pdfTeX. +% \end{itemize} +% Until this future becomes true, I provide the intermediate +% step \xpackage{attachfile2} at its current state. +% There are many things to do: +% \begin{itemize} +% \item Documentation, documentation, \dots +% \item Improving portability of the Perl script \xfile{pdfatfi.pl} +% (Windows, non-GNU, \dots). +% \item Comfortable program for extracting embeddd files. +% \item Embedding files to the document, see package \xpackage{embedfile}. +% \item Additionally use featurs of \pdfTeX\ 1.30. With a recent +% \pdfTeX\ the Perl script step is then obsolete. +% \item GoToE links. +% \item Layout of PinPush, especially the tip does not scale well. +% \item Driver for \xoption{dvipsone}, similar to \xoption{dvips}, changes: +% \begin{itemize} +% \item coordinate transformation need to be fixed here, +% \xfile{hdvipson.def} contains: +% \begin{quote} +%\begin{verbatim} +%/DvipsToPDF { 65781 div } def +%/PDFToDvips { 65781 mul } def +%\end{verbatim} +% \end{quote} +% \item Syntax for \cs{special}: \xfile{hdvipson.def} contains +% both \verb|\special{! #1}| and +% \verb|\special{headertext= #1}|. Are bothe the same? +% \end{itemize} +% \item File name conversion, see PDF specification: +% \begin{quote} +% \verb|c:\somewhere\foobar.txt| $\rightarrow$ +% \verb|/c/somewhere/foobar.txt| +% \end{quote} +% \item Option \xoption{scale} for icons? +% \item Compatibility for \plainTeX. +% \item ToDos for \xfile{atfidvips.def}. +% \end{itemize} +% +% \subsection{User interface} +% +% Basically this package \xpackage{attachfile2} follows the +% user interface of package \xpackage{attachfile}, +% look into its documentation (\cite{attachfile}). +% +% \subsubsection{New options} +% \begin{itemize} +% \item Driver options \xoption{dvips}, \xoption{pdftex}, +% \xoption{dvipdfmx} and \xoption{xetex} that is an +% alias for \xoption{dvipdfmx}. +% \item Option \xoption{driverfallback} specifies a DVI driver +% if the driver cannot be detected automatically. +% \item New options \xoption{final} and \xoption{draft}. +% \item New option \xoption{scale} for scaling the annotation rectangle. +% \item Options \xoption{file} and \xoption{nofile} for controlling +% the generation of the auxiliary file \xfile{.atfi}. +% \item New option \xoption{ucfilespec} for file names with +% characters outside ASCII (PDF 1.7). +% \end{itemize} +% +% \subsubsection{Option \xoption{color}} +% +% Package \xpackage{attachfile}'s option \xoption{color} only +% understands explicit RGB values as three space separated +% real numbers in the range from 0 to 1. +% +% This package \xpackage{attachfile2} extends the syntax. +% The usual color specifications of packages \xpackage{color} +% or \xpackage{xcolor} may be used. The latter one requires +% that package \xpackage{xcolor} is loaded. +% Without package \xpackage{xcolor} a limited range of +% explicit color specifications are supported, the color models +% \texttt{rgb} and \texttt{gray} (and \texttt{cmyk} if +% package \xpackage{hyperref}'s option \xoption{pdfversion} is set +% to \texttt{1.7} or greater. +% +% Example without package \xpackage{xcolor}: +%\begin{quote} +%\begin{verbatim} +%\documentclass{article} +%\usepackage[color={1 0 .5}]{attachfile2} +% % Spaces in option values in \usepackage or \documentclass +% % must be protected by curly braces. Otherwise LaTeX strips +% % the spaces and the package would see `color=10.5'. +% % This protection is not necessary for \attachfilesetup. +%\attachfilesetup{color=1 0 .5} +%\attachfilesetup{color=[rgb]{1,0,.5}} +%\attachfilesetup{color=[gray]{.5}} +%\end{verbatim} +%\end{quote} +% +% The following example with package \xpackage{xcolor} shows +% additional color specifications: +%\begin{quote} +%\begin{verbatim} +%\documentclass{article} +%\usepackage{xcolor} +%\definecolor{attachfilecolor}{cmyk}{.1,.2,.3,.4} +%\usepackage{color=red}{attachfile2} +%\attachfilesetup{color=red} +%\attachfilesetup{color=attachfilecolor} +%\end{verbatim} +%\end{quote} +% +% \paragraph{For experts.}% +% If the color is used in annotations, the color is converted +% with the help of package \xpackage{xcolor} to RGB. +% PDF versions 1.7 or later also understand color models Gray and +% CMYK. The PDF version is detected if the experimental +% option \xoption{pdfversion} +% of package \xpackage{hyperref} is used, example: +%\begin{quote} +%\begin{verbatim} +%\documentclass{article} +%\usepackage[pdfversion=1.7]{hyperref} +%\usepackage{attachfile2} +%\end{verbatim} +%\end{quote} +% However, currently only driver \xoption{pdftex} also supports +% the actual setting of the PDF version in the output PDF file. +% +% \subsubsection{Perl script \xfile{pdfatfi.pl}} +% +% This package also tries to get and add meta information data, +% such as file size, file date, checksum, \dots. +% As package \xpackage{embedfile} shows the new features +% of \pdfTeX\ 1.30 are very useful for getting this kind of +% data. Since version 2.6 these data are used if available. +% +% For older versions of \pdfTeX\ and \XeTeX\ the Perl script +% \xfile{pdfatfi.pl} is provided to get this data. +% The use of the Perl script is not mandatory. This data can be shown +% by PDF viewers, but they are not a requirement of the PDF specification. +% +% Package \xpackage{attachfile2} and the Perl script communicate +% via an auxiliary file with file extension \xfile{.atfi}. The script +% is used between two \LaTeX\ runs and updates the auxiliary file, +% example for \xoption{dvips}: +% \begin{quote} +%\begin{verbatim} +%latex test +%pdfatfi test +%latex test +%dvips test +%ps2pdf test.ps test.pdf +%\end{verbatim} +% \end{quote} +% +% \subsection{Changes to \xpackage{attachfile}} +% +% Some of the changes I can remember: +% \begin{itemize} +% \item Support for dvips. +% \item Support for dvipdfmx/\XeTeX. +% \item Setting and filling the /Param entry for files +% (file date, file size, \dots). +% \item Perl script \xfile{pdfatfi.pl}. +% \item New options. +% \item Bug fixes. +% \item \dots +% \end{itemize} +% +% \StopEventually{ +% } +% +% \section{Implementation} +% +% \subsection{Package} +% +% \begin{macrocode} +%<*package> +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{attachfile2}% + [2019/11/24 v2.10 Attach files into PDF (HO)]% +% \end{macrocode} +% +% \subsubsection{Loading of packages} +% +% \begin{macrocode} +\RequirePackage{iftex}[2019/11/07] +\RequirePackage{keyval} +\RequirePackage{color} +\RequirePackage{infwarerr}[2010/04/08] +\RequirePackage{ltxcmds}[2010/04/26] +\RequirePackage{kvoptions}[2009/07/21] +\RequirePackage{pdftexcmds}[2010/04/01] +\RequirePackage{pdfescape}[2007/11/11] +% \end{macrocode} +% Package \xpackage{hyperref} is needed because of \cs{pdfstringdef}. +% \begin{macrocode} +\RequirePackage{hyperref} +\RequirePackage{hycolor}[2008/07/29] +% \end{macrocode} +% +% \subsubsection{Value checking} +% +% \begin{macro}{\atfi@Match} +% \begin{macrocode} +\ltx@IfUndefined{pdfmatch}{% + \def\atfi@Match#1#2#3#4#5{}% +}{% + \def\atfi@Match#1#2#3{% + \begingroup + \edef\^{\ltx@backslashchar\string^}% + \edef\.{\ltx@backslashchar.}% + \let\#\ltx@hashchar + \edef\[{\ltx@backslashchar[}% ]] + \edef\${\ltx@backslashchar$}% + \let\%\ltx@percentchar + \edef\&{\string&}% + \edef\({\ltx@backslashchar(}% + \edef\){\ltx@backslashchar)}% + \edef\|{\ltx@backslashchar|}% + \edef\*{\ltx@backslashchar*}% + \edef\+{\ltx@backslashchar+}% + \edef\?{\ltx@backslashchar?}% + \edef\{{\ltx@backslashchar\ltx@leftbracechar}% + \edef\}{\ltx@rightbracechar}% + \edef\\{\ltx@backslashchar\ltx@backslashchar}% + \edef\~{\string~}% + \ifcase\pdfmatch#3{#2}{#1} % + \endgroup + \expandafter\ltx@secondoftwo + \or + \endgroup + \expandafter\ltx@firstoftwo + \else + \atfi@Warning{% + Internal error: Wrong pattern!\MessageBreak + --> #2 <--\MessageBreak + Pattern check ignored% + }% + \endgroup + \expandafter\ltx@firstoftwo + \fi + }% +% \end{macrocode} +% \end{macro} +% \begin{macro}{\atfi@PatToken} +% \begin{macrocode} + \def\atfi@PatToken{% + [% + -% first character + !% + \#$\%\&'% + \*\+\.% + 0-9% + A-Z% + \^_`% + a-z% + \{\}\|\~% + ]+% + }% +% \end{macrocode} +% \end{macro} +% \begin{macro}{\atfi@CR} +% \begin{macrocode} + \begingroup + \lccode64=13 % @ + \lowercase{\endgroup + \def\atfi@CR{@}% + }% +% \end{macrocode} +% \end{macro} +% \begin{macro}{\atfi@PatQuotedString} +% \begin{macrocode} + \def\atfi@PatQuotedString{% + "% + ([^"\\\atfi@CR]|\\.)*% + "% + }% +% \end{macrocode} +% \end{macro} +% \begin{macrocode} + \ltx@ifpackagelater{ltxcmds}{2010/09/11}{}{% +% \end{macrocode} +% \begin{macro}{\atfi@ltx@leftbracechar} +% \begin{macrocode} + \begingroup + \lccode`0=`\{\relax + \lowercase{\endgroup + \def\ltx@leftbracechar{0}% + }% +% \end{macrocode} +% \end{macro} +% \begin{macro}{\ltx@rightbracechar} +% \begin{macrocode} + \begingroup + \lccode`0=`\}\relax + \lowercase{\endgroup + \def\ltx@rightbracechar{0}% + }% +% \end{macrocode} +% \end{macro} +% \begin{macrocode} + }% +} +% \end{macrocode} +% +% \begin{macro}{\atfi@Warning} +% \begin{macrocode} +\def\atfi@Warning{\PackageWarning{attachfile2}} +% \end{macrocode} +% \end{macro} +% +% \subsubsection{Option declarations} +% +% \begin{macrocode} +\SetupKeyvalOptions{% + family=AtFi,% + prefix=atfi@% +} +% \end{macrocode} +% \begin{macro}{\atfi@setup} +% \begin{macrocode} +\def\atfi@setup{\setkeys{AtFi}} +% \end{macrocode} +% \end{macro} +% +% Options \xoption{draft} and \xoption{final}. +% \begin{macrocode} +\DeclareBoolOption{draft} +\DeclareComplementaryOption{final}{draft} +% \end{macrocode} +% +% Option \xoption{mimetype}. +% \begin{macro}{\atfi@mimetype} +% \begin{macrocode} +\def\atfi@mimetype{} +% \end{macrocode} +% \end{macro} +% \begin{macrocode} +\define@key{AtFi}{mimetype}{% + \edef\atfi@mimetype{#1}% + \ifx\atfi@mimetype\ltx@empty + \else + \atfi@Match\atfi@mimetype{% + ^(application|audio|image|model|text|video|x-\atfi@PatToken)% + /% + ([a-z\-\+_\.0-9]+)% + (; ?\atfi@PatToken=(\atfi@PatToken|\atfi@PatQuotedString))*$% + }{icase}{}{% + \atfi@Warning{% + Invalid value `\atfi@mimetype'\MessageBreak + of option `mimetype'.\MessageBreak + Value is discarded% + }% + \let\atfi@mimetype\ltx@empty + }% + \fi + \ifx\atfi@mimetype\ltx@empty + \else + \EdefEscapeName\atfi@mimetype{\atfi@mimetype}% + \edef\atfi@mimetype{/Subtype/\atfi@mimetype}% + \fi +} +% \end{macrocode} +% +% Option \xoption{icon} +% \begin{macrocode} +\define@key{AtFi}{icon}{% + \def\atfi@icon{/Name/#1}% + \def\atfi@icon@icon{#1}% +} +\atfi@setup{icon=PushPin} +% \end{macrocode} +% +% Option \xoption{color} +% \begin{macrocode} +\define@key{AtFi}{color}{% + \HyColor@AttachfileColor{#1}% + \atfi@color@tex\atfi@color@inline\atfi@color@annot + {attachfile2}{color}% +} +\atfi@setup{color=1 0.9255 0.7765} +% \end{macrocode} +% +% time options timezone and date +% \begin{macro}{\atfi@pad@ii} +% \begin{macrocode} +\def\atfi@pad@ii#1{% + \ifnum#1>9 % + \number#1% + \else + 0\number#1% + \fi% +} +% \end{macrocode} +% \end{macro} +% \begin{macro}{atfi@timezone} +% \begin{macrocode} +\let\atfi@timezone\ltx@empty +% \end{macrocode} +% \end{macro} +% \begin{macrocode} +\define@key{AtFi}{timezone}{\def\atfi@timezone{#1}} +% \end{macrocode} +% \begin{macro}{\atfi@time} +% \begin{macrocode} +\edef\atfi@time{\the\time} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\atfi@hours} +% \begin{macrocode} +\def\atfi@hours{% + \numexpr\dimexpr0.01667\dimexpr\atfi@time sp\relax\relax\relax +} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\atfi@minutes} +% \begin{macrocode} +\def\atfi@minutes{% + \numexpr\atfi@time-60*\atfi@hours\relax +} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\atfi@seconds} +% \begin{macrocode} +\def\atfi@seconds{0} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\atfi@date} +% \begin{macrocode} +\def\atfi@date{% + /M(D:\the\year + \atfi@pad@ii\month + \atfi@pad@ii\day + \atfi@pad@ii\atfi@hours + \atfi@pad@ii\atfi@minutes + \atfi@pad@ii\atfi@seconds + \atfi@timezone)% +} +% \end{macrocode} +% \end{macro} +% \begin{macrocode} +\define@key{AtFi}{date}{% + \EdefEscapeString\atfi@date{#1}% + \edef\atfi@date{/M(\atfi@date)}% +} +% \end{macrocode} +% +% Text options author, description, and subject +% \begin{macro}{\atfi@pdfstringdef} +% \begin{macrocode} +\DeclareRobustCommand{\atfi@pdfstringdef}[2]{% + \pdfstringdef\atfi@temp@string{#2}% + \edef#1{\atfi@temp@string}% +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\atfi@NoValue} +% \begin{macrocode} +\def\atfi@NoValue{\NoValue} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\atfi@DefNoValueName} +% \begin{macrocode} +\def\atfi@DefNoValueName#1#2#3{% + \def#1{#3}% + \ifx#1\atfi@NoValue + \let#1\ltx@empty + \else + \atfi@pdfstringdef#1{#1}% + \edef#1{/#2(#1)}% + \fi +} +% \end{macrocode} +% \end{macro} +% +% Name for annotation to be used in GoToE actions +% \begin{macro}{\atfi@annotname} +% \begin{macrocode} +\let\atfi@annotname\ltx@empty +% \end{macrocode} +% \end{macro} +% \begin{macrocode} +\define@key{AtFi}{annotname}[\NoValue]{% + \atfi@DefNoValueName\atfi@annotname{NM}{#1}% +} +% \end{macrocode} +% +% Option \xoption{author}. +% \begin{macro}{\atfi@author} +% \begin{macrocode} +\def\atfi@author{} +% \end{macrocode} +% \end{macro} +% \begin{macrocode} +\define@key{AtFi}{author}[\NoValue]{% + \atfi@DefNoValueName\atfi@author{T}{#1}% +} +% \end{macrocode} +% +% Option \xoption{description}. +% \begin{macro}{\atfi@description} +% \begin{macrocode} +\def\atfi@description{} +% \end{macrocode} +% \end{macro} +% \begin{macrocode} +\define@key{AtFi}{description}[\NoValue]{% + \atfi@DefNoValueName\atfi@description{Contents}{#1}% +} +% \end{macrocode} +% +% Option \xoption{subject}. +% \begin{macro}{\atfi@subject} +% \begin{macrocode} +\def\atfi@subject{} +% \end{macrocode} +% \end{macro} +% \begin{macrocode} +\define@key{AtFi}{subject}[\NoValue]{% + \atfi@DefNoValueName\atfi@subject{Subj}{#1}% +} +% \end{macrocode} +% +% Option \xoption{print}. +% \begin{macrocode} +\DeclareBoolOption[true]{print} +% \end{macrocode} +% +% Option \xoption{zoom}. +% \begin{macrocode} +\DeclareBoolOption[true]{zoom} +% \end{macrocode} +% +% Option \xoption{appearance}. +% \begin{macrocode} +\DeclareBoolOption[true]{appearance} +% \end{macrocode} +% +% Option \xoption{scale}. +% \begin{macrocode} +\DeclareStringOption[1]{scale} +% \end{macrocode} +% +% Option \xoption{ucfilespec}. +% \begin{macro}{\atfi@ucfilespec} +% \begin{macrocode} +\def\atfi@ucfilespec{} +% \end{macrocode} +% \end{macro} +% \begin{macrocode} +\define@key{AtFi}{ucfilespec}[1]{% + \def\atfi@ucfilespec{#1}% + \ifx\atfi@ucfilespec\ltx@empty + \else + \atfi@pdfstringdef\atfi@ucfilespec{#1}% + \fi +} +% \end{macrocode} +% +% Option \xoption{nofiles}. +% \begin{macrocode} +\DeclareBoolOption{nofiles} +% \end{macrocode} +% +% Driver options. +% \begin{macrocode} +\let\atfi@driver\ltx@empty +\def\atfi@driver@pdftex{pdftex} +\def\atfi@driver@luatex{luatex} +\def\atfi@driver@dvips{dvips} +\def\atfi@driver@dvipdfmx{dvipdfmx} +% \end{macrocode} +% \begin{macrocode} +\DeclareVoidOption{pdftex}{% + \ifpdf + \let\atfi@driver\atfi@driver@pdftex + \else + \let\atfi@driver\ltx@empty + \PackageError{attachfile2}{% + Wrong driver option `pdftex',\MessageBreak + because pdfTeX in PDF mode is not detected% + }\@ehc + \fi +} +\DeclareVoidOption{luatex}{% + \let\atfi@driver\atfi@driver@luatex +} +\DeclareVoidOption{dvips}{% + \let\atfi@driver\atfi@driver@dvips +} +\DeclareVoidOption{dvipdfmx}{% + \let\atfi@driver\atfi@driver@dvipdfmx +} +\DeclareVoidOption{xetex}{% + \let\atfi@driver\atfi@driver@dvipdfmx +} +% \end{macrocode} +% \begin{macrocode} +\DeclareStringOption{driverfallback} +% \end{macrocode} +% +% \begin{macro}{\attachfilesetup} +% \begin{macrocode} +\DeclareRobustCommand{\attachfilesetup}[1]{\setkeys{AtFi}{#1}} +% \end{macrocode} +% \end{macro} +% +% \begin{macrocode} +\DeclareLocalOptions{% + annotname,% + appearance,% + author,% + color,% + date,% + description,% + icon,% + mimetype,% + nofiles,% + print,% + scale,% + subject,% + timezone,% + ucfilespec,% + zoom,% +} +% \end{macrocode} +% +% \subsubsection{Option calling} +% +% Timezone setting, \dots +% \begin{macrocode} +\InputIfFileExists{attachfile.cfg}{}{} +% \end{macrocode} +% \begin{macrocode} +\ProcessKeyvalOptions* +% \end{macrocode} +% +% \begin{macro}{\atfi@DisableOption} +% \begin{macrocode} +\def\atfi@DisableOption{% + \DisableKeyvalOption[action=error,package=attachfile2]{AtFi}% +} +% \end{macrocode} +% \end{macro} +% +% \subsubsection{Evaluate driver options} +% +% \begin{macrocode} +\ifpdf + \ifluatex + \let\atfi@driver\atfi@driver@luatex + \else + \let\atfi@driver\atfi@driver@pdftex + \fi +\else + \ifxetex + \let\atfi@driver\atfi@driver@dvipdfmx + \else + \ifx\atfi@driver\ltx@empty + \ifx\atfi@driverfallback\ltx@empty + \else + \expandafter\let\expandafter\atfi@driver + \csname atfi@driver@\atfi@driverfallback\endcsname + \ifx\atfi@driver\atfi@driver@dvips + \else + \ifx\atfi@driver\atfi@driver@dvipdfmx + \else + \let\atfi@driver\ltx@empty + \PackageWarningNoLine{attachfile2}{% + Option `driverfallback' with unsupported\MessageBreak + DVI driver (\atfi@driverfallback)% + }% + \fi + \fi + \fi + \ifx\atfi@driver\ltx@empty + \PackageWarningNoLine{attachfile2}{% + Driver is not specified,\MessageBreak + enforce draft settings% + }% + \atfi@drafttrue + \fi + \fi + \fi +\fi +% \end{macrocode} +% \begin{macrocode} +\atfi@DisableOption{pdftex} +\atfi@DisableOption{dvips} +\atfi@DisableOption{dvipdfmx} +\atfi@DisableOption{xetex} +\atfi@DisableOption{driverfallback} +% \end{macrocode} +% +% \subsubsection{Evaluate options \xoption{draft}/\xoption{final}} +% +% \begin{macro}{\notextattachfile} +% \begin{macrocode} +\DeclareRobustCommand{\notextattachfile}[2][]{% + \begingroup + \atfi@setup{#1}% + \ifatfi@print + \leavevmode + \begingroup + \HyColor@UseColor\atfi@color@tex + #2\strut + \endgroup + \else + \sbox\ltx@zero{#2\strut}% + \makebox[\wd0]{}% + \fi + \endgroup +} +% \end{macrocode} +% \end{macro} +% \begin{macrocode} +\atfi@DisableOption{draft}% +\atfi@DisableOption{final}% +\ifatfi@draft + \def\atfi@dummy@pushpin{% + \raisebox{-1.25bp}{\parbox[b][14bp]{24bp}{}}% + }% + \DeclareRobustCommand{\textattachfile}[3][]{% + \notextattachfile[{#1}]{#3}% + }% + \DeclareRobustCommand{\noattachfile}[1][]{% + \notextattachfile[{#1}]{\atfi@dummy@pushpin}% + }% + \DeclareRobustCommand{\attachfile}[2][]{% + \noattachfile[{#1}]% + }% + \expandafter\endinput +\fi +% \end{macrocode} +% +% \subsubsection{Load driver file} +% +% \begin{macrocode} +\input{atfi-\atfi@driver.def} +% \end{macrocode} +% +% \subsubsection{Graphics} +% +% \begin{macro}{\atfi@acroGraph@data} +% \begin{macrocode} +\def\atfi@acroGraph@data{% + \atfi@GSAVE + 0.5 \atfi@SETGRAYFILL + 1.1133 0 20.7202 18.2754 \atfi@RECTFILL + 0 \atfi@SETFLAT + 0.5 \atfi@SETLINEWIDTH + 4 \atfi@SETMITERLIMIT + \atfi@RECTSTROKEFILL{% + 1 \atfi@SETGRAYFILL + }{% + 0 \atfi@SETGRAYSTROKE + }{% + 0.25 1.6453 20.145 17.7715 % + }% + 0 \atfi@SETGRAYFILL + 2.7319 4.1367 3.9571 13.8867 \atfi@RECTFILL + 8.7031 4.1367 3.9571 9.8867 \atfi@RECTFILL + 14.7471 4.1367 3.9571 11.8867 \atfi@RECTFILL + \atfi@color@inline{FILL}% + 1.689 3.0938 3.9571 13.8867 \atfi@RECTFILL + 7.6602 3.0938 3.9571 9.8867 \atfi@RECTFILL + 13.7041 3.0938 3.9571 11.8867 \atfi@RECTFILL + \atfi@GRESTORE +} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\atfi@acroGraph} +% \begin{macrocode} +\def\atfi@acroGraph{% + \raisebox{-1.5bp}{\parbox[b][20bp]{22bp}{% + \rule{0pt}{0pt}\atfi@literal{\atfi@acroGraph@data}}% + }% +} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\atfi@acroPaperclip@data} +% \begin{macrocode} +\newcommand{\atfi@acroPaperclip@data}{% + \atfi@GSAVE + 0.75 \atfi@SETGRAYSTROKE + 0 \atfi@SETFLAT + 2.5 \atfi@SETLINEWIDTH + 1 \atfi@SETLINECAP + 4 \atfi@SETMITERLIMIT + 1.9619 11.7559 \atfi@MOVETO + 1.9619 3.3037 1.9619 2.5059 \atfi@CURVETOV + 1.9619 1.707 4.0947 1.25 \atfi@CURVETOY + 7.4141 1.25 \atfi@LINETO + 9.4292 1.8223 9.4292 3.3066 \atfi@CURVETOV + 9.4292 4.79 9.4292 16.8945 \atfi@CURVETOY + 9.7852 18.1514 8.481 18.1514 \atfi@CURVETOV + 7.1768 18.1514 5.1616 18.1514 \atfi@CURVETOY + 3.8574 17.9209 3.8574 16.8945 \atfi@CURVETOV + 3.8574 15.8652 3.8574 6.6172 \atfi@CURVETOY + 4.3325 5.418 5.1025 5.418 \atfi@CURVETOV + 5.8726 5.418 6.5845 5.418 \atfi@CURVETOY + 7.6812 5.6455 7.6812 6.4736 \atfi@CURVETOV + 7.6812 7.3027 7.6812 11.5264 \atfi@CURVETOY + \atfi@STROKE + 0 \atfi@SETGRAYSTROKE + 1.2495 12.4404 \atfi@MOVETO + 1.2495 3.9883 1.2495 3.1895 \atfi@CURVETOV + 1.2495 2.3906 3.3833 1.9326 \atfi@CURVETOY + 6.7026 1.9326 \atfi@LINETO + 8.7178 2.5068 8.7178 3.9902 \atfi@CURVETOV + 8.7178 5.4736 8.7178 17.5781 \atfi@CURVETOY + 9.0732 18.834 7.769 18.834 \atfi@CURVETOV + 6.4653 18.834 4.4497 18.834 \atfi@CURVETOY + 3.146 18.6055 3.146 17.5781 \atfi@CURVETOV + 3.146 16.5498 3.146 7.3018 \atfi@CURVETOY + 3.6201 6.1016 4.3911 6.1016 \atfi@CURVETOV + 5.1611 6.1016 5.873 6.1016 \atfi@CURVETOY + 6.9692 6.3301 6.9692 7.1572 \atfi@CURVETOV + 6.9692 7.9863 6.9692 12.21 \atfi@CURVETOY + \atfi@STROKE + \atfi@color@inline{STROKE}% + 1 \atfi@SETLINEWIDTH + 1.2495 12.4404 \atfi@MOVETO + 1.2495 3.9883 1.2495 3.1895 \atfi@CURVETOV + 1.2495 2.3906 3.3833 1.9326 \atfi@CURVETOY + 6.7026 1.9326 \atfi@LINETO + 8.7178 2.5068 8.7178 3.9902 \atfi@CURVETOV + 8.7178 5.4736 8.7178 17.5781 \atfi@CURVETOY + 9.0732 18.834 7.769 18.834 \atfi@CURVETOV + 6.4653 18.834 4.4497 18.834 \atfi@CURVETOY + 3.146 18.6055 3.146 17.5781 \atfi@CURVETOV + 3.146 16.5498 3.146 7.3018 \atfi@CURVETOY + 3.6201 6.1016 4.3911 6.1016 \atfi@CURVETOV + 5.1611 6.1016 5.873 6.1016 \atfi@CURVETOY + 6.9692 6.3301 6.9692 7.1572 \atfi@CURVETOV + 6.9692 7.9863 6.9692 12.21 \atfi@CURVETOY + \atfi@STROKE + \atfi@GRESTORE +} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\atfi@acroPaperclip} +% \begin{macrocode} +\def\atfi@acroPaperclip{% + \raisebox{-1.25bp}{\parbox[b][21bp]{12bp}{% + \rule{0pt}{0pt}\atfi@literal{\atfi@acroPaperclip@data}}% + }% +} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\atfi@acroPushPin@data} +% \begin{macrocode} +\def\atfi@acroPushPin@data{% + \atfi@GSAVE + 1 \atfi@SETLINEWIDTH + 1 6 \atfi@MOVETO + 11 6 \atfi@LINETO + 11 13 \atfi@LINETO + 12 13 \atfi@LINETO + 14 11 \atfi@LINETO + 21 11 \atfi@LINETO + 22 12 \atfi@LINETO + 23 12 \atfi@LINETO + 23 2 \atfi@LINETO + 22 2 \atfi@LINETO + 21 3 \atfi@LINETO + 14 3 \atfi@LINETO + 12 1 \atfi@LINETO + 11 1 \atfi@LINETO + 11 6 \atfi@LINETO + \atfi@FILLSTROKE{% + \atfi@color@inline{FILL}% + }{% + 0 \atfi@SETGRAYSTROKE + }% + 0.5 \atfi@SETGRAYSTROKE + 0 7 \atfi@MOVETO + 10 7 \atfi@LINETO + 10 8 \atfi@LINETO + 1 8 \atfi@LINETO + \atfi@STROKE + 1 \atfi@SETGRAYSTROKE + 12 12 \atfi@MOVETO + 14 10 \atfi@LINETO + 22 10 \atfi@LINETO + 22 11 \atfi@LINETO + \atfi@STROKE + \atfi@GRESTORE +} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\atfi@acroPushPin} +% \begin{macrocode} +\def\atfi@acroPushPin{% + \raisebox{-1.25bp}{\parbox[b][14bp]{24bp}{% + \rule{0pt}{0pt}\atfi@literal{\atfi@acroPushPin@data}}% + }% +} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\atfi@acroTag@data} +% \begin{macrocode} +\def\atfi@acroTag@data{% + \atfi@GSAVE + 0.5 \atfi@SETGRAYFILL + 10.0542 14.9873 \atfi@MOVETO + 24.27 14.9873 \atfi@LINETO + 25.252 14.0059 \atfi@LINETO + 25.252 1.1455 \atfi@LINETO + 24.1064 0 \atfi@LINETO + 9.9609 0 \atfi@LINETO + 6.0327 6.0088 \atfi@LINETO + 6.0327 9.002 \atfi@LINETO + 10.0542 14.9873 \atfi@LINETO + 9.3994 9.376 \atfi@MOVETO + 8.5215 9.376 7.8096 8.5596 7.8096 7.5527 \atfi@CURVETO + 7.8096 6.5449 8.5215 5.7285 9.3994 5.7285 \atfi@CURVETO + 10.2778 5.7285 10.9897 6.5449 10.9897 7.5527 \atfi@CURVETO + 10.9897 8.5596 10.2778 9.376 9.3994 9.376 \atfi@CURVETO + \atfi@CLOSEPATH + \atfi@FILL + 0 \atfi@SETFLAT + 0.5 \atfi@SETLINEWIDTH + 4 \atfi@SETMITERLIMIT + 1 \atfi@SETLINEJOIN + 8.5107 16.5313 \atfi@MOVETO + 22.7266 16.5313 \atfi@LINETO + 23.7085 15.5488 \atfi@LINETO + 23.7085 2.6895 \atfi@LINETO + 22.563 1.543 \atfi@LINETO + 8.4175 1.543 \atfi@LINETO + 4.4893 7.5527 \atfi@LINETO + 4.4893 10.5449 \atfi@LINETO + 8.5107 16.5313 \atfi@LINETO + 7.856 10.9199 \atfi@MOVETO + 6.978 10.9199 6.2661 10.1035 6.2661 9.0957 \atfi@CURVETO + 6.2661 8.0879 6.978 7.2715 7.856 7.2715 \atfi@CURVETO + 8.7344 7.2715 9.4463 8.0879 9.4463 9.0957 \atfi@CURVETO + 9.4463 10.1035 8.7344 10.9199 7.856 10.9199 \atfi@CURVETO + \atfi@CLOSEPATH + \atfi@FILLSTROKE{% + \atfi@color@inline{FILL}% + }{% + 0 \atfi@SETGRAYSTROKE + }% + 1 \atfi@SETLINEWIDTH + 12.3291 12.2656 \atfi@MOVETO + 21.1206 12.2656 \atfi@LINETO + \atfi@STROKE + 12.3291 9.1797 \atfi@MOVETO + 21.1206 9.1797 \atfi@LINETO + \atfi@STROKE + 12.3291 6.1875 \atfi@MOVETO + 21.1206 6.1875 \atfi@LINETO + \atfi@STROKE + % 0 \atfi@SETGRAYSTROKE % redundant? + 0.5 \atfi@SETLINEWIDTH + 0 9.0488 \atfi@MOVETO + 6.2661 9.0957 \atfi@LINETO + \atfi@STROKE + 1.4028 5.2148 \atfi@MOVETO + 1.4028 9.6094 \atfi@LINETO + 1.6831 10.6387 2.4316 10.6387 \atfi@CURVETOV + 3.6475 10.6387 3.5542 9.0488 \atfi@CURVETOY + \atfi@STROKE + \atfi@GRESTORE +} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\atfi@acroTag} +% \begin{macrocode} +\def\atfi@acroTag{% + \raisebox{-1.6bp}{\parbox[b][17bp]{25bp}{% + \rule{0pt}{0pt}\atfi@literal{\atfi@acroTag@data}}% + }% +} +% \end{macrocode} +% \end{macro} +% +% \subsubsection{Reading the \xext{atfi} file} +% +% Commands used in \cs{jobname}\xext{atfi}: +% \begin{itemize} +% \item |attachfile@timezone{}| +% \item +%\begin{verbatim} +%\attachfile@file[ +% Size=, +% CreationDate=, % local time without "D:" and timezone +% ModDateTZ=, +% ModDate=, +% CheckSum= +%]{} +%\end{verbatim} +% \end{itemize} +% +% \begin{macro}{\attachfile@timezone} +% \begin{macrocode} +\def\attachfile@timezone#1{% + \ifx\\#1\\% + % no timezone information given + \else + \def\atfi@timezone{#1}% + \fi +} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\attachfile@file} +% \begin{macrocode} +\newcommand*{\attachfile@file}[2][]{% + \EdefUnescapeHex\atfi@filename{#2}% + \ifx\atfi@filename\ltx@empty + \PackageError{attachfile2}{Empty file name}\@ehc + \else + \@namedef{atfi@file@\atfi@filename}{#1}% + \fi +} +% \end{macrocode} +% \end{macro} +% +% \begin{macrocode} +\InputIfFileExists{\jobname.atfi}{}{}% +% \end{macrocode} +% +% \begin{macrocode} +\newif\ifatfi@checksum +\define@key{AtFi@file}{CheckSum}{% + \atfi@checksumtrue + \edef\atfi@params{\atfi@params/CheckSum<#1>}% +} +% \end{macrocode} +% \begin{macrocode} +\newif\ifatfi@creationdate +\define@key{AtFi@file}{CreationDateTZ}{% + \ifatfi@creationdate + \else + \atfi@creationdatetrue + \edef\atfi@params{% + \atfi@params + /CreationDate(#1)% + }% + \fi +} +% \end{macrocode} +% \begin{macrocode} +\define@key{AtFi@file}{CreationDate}{% + \ifatfi@creationdate + \else + \atfi@creationdatetrue + \edef\atfi@params{% + \atfi@params + /CreationDate(#1\atfi@timezone)% + }% + \fi +} +% \end{macrocode} +% \begin{macrocode} +\newif\ifatfi@moddate +\define@key{AtFi@file}{ModDateTZ}{% + \ifatfi@moddate + \else + \atfi@moddatetrue + \edef\atfi@params{% + \atfi@params + /ModDate(#1)% + }% + \fi +} +% \end{macrocode} +% \begin{macrocode} +\define@key{AtFi@file}{ModDate}{% + \ifatfi@moddate + \else + \atfi@moddatetrue + \edef\atfi@params{% + \atfi@params + /ModDate(D:#1\atfi@timezone)% + }% + \fi +} +% \end{macrocode} +% +% \begin{macro}{\atfi@pdftexdata} +% \begin{macrocode} +\let\atfi@temp\ltx@one +\ltx@IfUndefined{pdf@filesize}{% + \let\atfi@temp\ltx@zero +}{} +\ltx@IfUndefined{pdf@filemoddate}{% + \let\atfi@temp\ltx@zero +}{} +\ltx@IfUndefined{pdf@filemdfivesum}{% + \let\atfi@temp\ltx@zero +}{} +\ifcase\atfi@temp + \let\atfi@pdftexdata\ltx@gobble +\or + \def\atfi@pdftexdata#1{% + \edef\atfi@temp{\pdf@filesize{#1}}% + \ifx\atfi@temp\ltx@empty + \else + \setkeys{AtFi@file}{Size=\atfi@temp}% + \edef\atfi@temp{\pdf@filemoddate{#1}}% + \ifx\atfi@temp\ltx@empty + \else + \setkeys{AtFi@file}{ModDateTZ=\atfi@temp}% + \fi + \edef\atfi@temp{\pdf@filemdfivesum{#1}}% + \ifx\atfi@temp\ltx@empty + \else + \setkeys{AtFi@file}{CheckSum=\atfi@temp}% + \fi + \fi + }% +\fi +% \end{macrocode} +% \end{macro} +% +% \subsubsection{Writing the \xext{atfi} file} +% +% Respect \cs{nofiles} and option \xoption{nofiles}. +% \cs{nofiles} has more weight than option \xoption{nofiles}. +% \begin{macrocode} +\if@filesw +\else + \atfi@nofilestrue +\fi +\ifatfi@nofiles + \PackageInfo{attachfile2}{% + File `\jobname.atfi' will not be written because of\MessageBreak + \string\nofiles\space or option `nofiles'% + }% +% \end{macrocode} +% \begin{macro}{\atfi@writefile} +% \begin{macrocode} + \let\atfi@writefile\ltx@gobble +% \end{macrocode} +% \end{macro} +% \begin{macrocode} +\else +% \end{macrocode} +% \begin{macro}{\atfi@stream} +% \begin{macrocode} + \newwrite\atfi@stream +% \end{macrocode} +% \end{macro} +% \begin{macrocode} + \immediate\openout\atfi@stream=\jobname.atfi\relax + \immediate\write\atfi@stream{% + \string\attachfile@timezone{\atfi@timezone}% + }% +% \end{macrocode} +% \begin{macro}{\atfi@writefile} +% \begin{macrocode} + \def\atfi@writefile#1{% + \begingroup + \EdefEscapeHex\atfi@temp{#1}% + \immediate\write\atfi@stream{% + \string\attachfile@file[% + \ltx@ifundefined{atfi@file@#1}{}{\@nameuse{atfi@file@#1}}% + ]{\atfi@temp}% + }% + \endgroup + }% +% \end{macrocode} +% \end{macro} +% \begin{macrocode} +\fi +\atfi@DisableOption{nofiles} +% \end{macrocode} +% +% \begin{macro}{\atfi@attachfile} +% \begin{macrocode} +\def\atfi@attachfile#1#2{% + \ltx@IfUndefined{atfi@fileobj@#2}{% + \atfi@writefile{#2}% + }{% + % don't need duplicates + }% + \atfi@setup{#1}% + \atfi@embedfile{#2}% + \atfi@set@appearance@icon + \atfi@flags@to@int + \atfi@insert@file@annot{#2}% + \endgroup +} +% \end{macrocode} +% \end{macro} +% +% \subsubsection{Annotation appearance} +% +% \begin{macro}{\atfi@appearancewidth} +% \begin{macrocode} +\newlength{\atfi@appearancewidth} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\atfi@appearanceheight} +% \begin{macrocode} +\newlength{\atfi@appearanceheight} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\atfi@appearancedepth} +% \begin{macrocode} +\newlength{\atfi@appearancedepth} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\atfi@appearancebox} +% \begin{macrocode} +\newsavebox{\atfi@appearancebox} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\atfi@set@appearance@icon} +% \begin{macrocode} +\def\atfi@set@appearance@icon{% + \ltx@IfUndefined{atfi@appobj@\atfi@icon@icon}{% + \savebox{\atfi@appearancebox}{% + \@nameuse{atfi@acro\atfi@icon@icon}% + }% + \expandafter + \xdef\csname atfi@appwidth@\atfi@icon@icon\endcsname{% + \the\wd\atfi@appearancebox + }% + \expandafter + \xdef\csname atfi@appheight@\atfi@icon@icon\endcsname{% + \the\ht\atfi@appearancebox + }% + \expandafter + \xdef\csname atfi@appdepth@\atfi@icon@icon\endcsname{% + \the\dp\atfi@appearancebox + }% + \atfi@xform@icon + \global\expandafter\let + \csname atfi@appobj@\atfi@icon@icon\endcsname + \atfi@appearanceobj + }{% + }% + % optimization: \setlength dropped + \atfi@appearancewidth=% + \@nameuse{atfi@appwidth@\atfi@icon@icon}\relax + \atfi@appearanceheight=% + \@nameuse{atfi@appheight@\atfi@icon@icon}\relax + \atfi@appearancedepth=% + \@nameuse{atfi@appdepth@\atfi@icon@icon}\relax + \expandafter\let\expandafter\atfi@appearanceobj + \csname atfi@appobj@\atfi@icon@icon\endcsname +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\atfi@set@appearance} +% \begin{macrocode} +\def\atfi@set@appearance#1{% + \savebox{\atfi@appearancebox}{#1}% + \atfi@appearancewidth=\wd\atfi@appearancebox + \atfi@appearanceheight=\ht\atfi@appearancebox + \atfi@appearancedepth=\dp\atfi@appearancebox + \atfi@xform +} +% \end{macrocode} +% \end{macro} +% +% \begin{macrocode} +\newcounter{atfi@flags} +% \end{macrocode} +% \begin{macro}{\atfi@flags@to@int} +% \begin{macrocode} +\DeclareRobustCommand{\atfi@flags@to@int}{% + \setcounter{atfi@flags}{0}% + \ifatfi@print + \addtocounter{atfi@flags}{4}% + \fi% + \ifatfi@zoom + \else + \addtocounter{atfi@flags}{8}% + \fi% +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\atfi@textattachfile} +% \begin{macrocode} +\def\atfi@textattachfile#1#2{% + \endgroup + \atfi@textattachfile@i{#1}{#2}% +} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\atfi@textattachfile@i} +% \begin{macrocode} +\def\atfi@textattachfile@i#1#2#3{% + \ltx@IfUndefined{atfi@fileobj@#2}{% + \atfi@writefile{#2}% + }{% + % don't need duplicates + }% + \atfi@setup{#1}% + \atfi@embedfile{#2}% + \atfi@set@appearance{% + \leavevmode + \begingroup + \HyColor@UseColor\atfi@color@tex + #3\strut + \endgroup + }% + \atfi@flags@to@int + \atfi@insert@file@annot{#2}% + \endgroup +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\attachfile} +% \begin{macrocode} +\DeclareRobustCommand{\attachfile}[1][]{% + \begingroup + \let\do\@makeother + \dospecials + \catcode`\{=1\relax + \catcode`\}=2\relax + \atfi@attachfile{#1}% +} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\textattachfile} +% \begin{macrocode} +\DeclareRobustCommand{\textattachfile}[1][]{% + \begingroup + \begingroup + \let\do\@makeother + \dospecials + \catcode`\{=1\relax + \catcode`\}=2\relax + \atfi@textattachfile{#1}% +} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\noattachfile} +% \begin{macrocode} +\DeclareRobustCommand{\noattachfile}[1][]{% + \begingroup + \atfi@setup{#1}% + \atfi@set@appearance@icon + \ifatfi@print + \expandafter + \atfi@refxform\csname atfi@appobj@\atfi@icon@icon\endcsname + \else + \makebox[\atfi@appearancewidth]{}% + \fi + \endgroup +} +% \end{macrocode} +% \end{macro} +% +% \begin{macrocode} +% +% \end{macrocode} +% +% \subsection{Drivers} +% +% \subsubsection{\pdfTeX} +% +% \begin{macrocode} +%<*pdftex> +\NeedsTeXFormat{LaTeX2e} +\ProvidesFile{atfi-pdftex.def}% + [2019/11/24 v2.10 attachfile2 driver for pdfTeX (HO)]% +% \end{macrocode} +% +% \paragraph{Macros for graphics data} +% +% \begin{macro}{\atfi@literal} +% \begin{macrocode} +\let\atfi@literal\pdfliteral +% \end{macrocode} +% \end{macro} +% +% \begin{macrocode} +\def\atfi@GSAVE{q } +\def\atfi@GRESTORE{Q } +\def\atfi@SETLINEWIDTH{w } +\def\atfi@LINETO{l } +\def\atfi@MOVETO{m } +\def\atfi@STROKE{S } +\def\atfi@FILL{f } +% \atfi@FILLSTROKE{}{} +\def\atfi@FILLSTROKE#1#2{#1#2B } +% \end{macrocode} +% color: uppercase are stroke colors, lowercase non-stroke (fill) colors +% PS, however, does not different between stroke and not-stroke colors +% \begin{macrocode} +\def\atfi@SETRGBCOLORSTROKE{RG } +\def\atfi@SETRGBCOLORFILL{rg } +\def\atfi@SETGRAYSTROKE{G } +\def\atfi@SETGRAYFILL{g } +\def\atfi@SETCMYKCOLORSTROKE{K } +\def\atfi@SETCMYKCOLORFILL{k } +\def\atfi@RECTFILL{re f } +\def\atfi@RECTSTROKEFILL#1#2#3{#1#2#3re B } +\def\atfi@SETMITERLIMIT{M } +\def\atfi@SETFLAT{i } +\def\atfi@SETLINECAP{J } +\def\atfi@CURVETO{c } +\def\atfi@CURVETOV{v } +\def\atfi@CURVETOY{y } +\def\atfi@CLOSEPATH{h } +\def\atfi@SETLINEJOIN{j } +% \end{macrocode} +% +% \paragraph{File embedding} +% +% \begin{macrocode} +\define@key{AtFi@file}{Size}{% + \edef\atfi@params{\atfi@params/Size #1}% +} +% \end{macrocode} +% \begin{macro}{\atfi@embedfile} +% \begin{macrocode} +\def\atfi@embedfile#1{% + \ltx@IfUndefined{atfi@fileobj@#1}{% + \begingroup + \let\atfi@params\ltx@empty + \expandafter\let\expandafter\atfi@temp + \csname atfi@file@#1\endcsname + \ifx\atfi@temp\ltx@empty + \let\atfi@temp\relax + \fi + \ifx\atfi@temp\relax + \atfi@pdftexdata{#1}% + \else + \edef\x{% + \noexpand\setkeys{AtFi@file}{\@nameuse{atfi@file@#1}}% + }% + \x + \fi + \ifx\atfi@params\ltx@empty + \else + \edef\atfi@params{/Params<<\atfi@params>>}% + \fi + \immediate\pdfobj stream attr {% + /Type/EmbeddedFile% + \atfi@mimetype + \atfi@params + } file {#1}% + \expandafter + \xdef\csname atfi@fileobj@#1\endcsname{\the\pdflastobj}% + \endgroup + }{% + % file already embedded + }% +} +% \end{macrocode} +% \end{macro} +% +% \paragraph{Annotation appearance} +% +% \begin{macro}{\atfi@xform} +% input: \cs{atfi@appearancebox}, output: \cs{atfi@appearanceobj} +% \begin{macrocode} +\def\atfi@xform{% + \immediate\pdfxform\atfi@appearancebox + \edef\atfi@appearanceobj{\the\pdflastxform}% +} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\atfi@xform@icon} +% \begin{macrocode} +\let\atfi@xform@icon\atfi@xform +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\atfi@refxform} +% \begin{macrocode} +\def\atfi@refxform#1{% + \pdfrefxform#1\relax +} +% \end{macrocode} +% \end{macro} +% +% \paragraph{File attachment annotation} +% +% \begin{macro}{\atfi@insert@file@annot} +% \begin{macrocode} +\def\atfi@insert@file@annot#1{% + \rule{0pt}{0pt}% + \ifatfi@appearance + \def\atfi@appearance@dict{% + /AP<<% + /N \atfi@appearanceobj\space 0 R% + /R \atfi@appearanceobj\space 0 R% + /D \atfi@appearanceobj\space 0 R% + >>% + }% + \else + \let\atfi@appearance@dict\ltx@empty + \fi + \ltx@IfUndefined{atfi@fsobj@#1}{% + \begingroup + \hypersetup{unicode=false}% + \atfi@pdfstringdef\atfi@file{#1}% + \immediate\pdfobj{% + <<% + /Type/Filespec% + /F(\atfi@file)% + \ifx\atfi@ucfilespec\ltx@empty + \else + /UF(\atfi@ucfilespec)% + \fi + /EF<<% + /F \@nameuse{atfi@fileobj@#1} 0 R% + >>% + >>% + }% + \expandafter\xdef\csname atfi@fsobj@#1\endcsname{% + \the\pdflastobj + }% + \endgroup + }{% + }% + \pdfannot width \atfi@scale\atfi@appearancewidth + height \atfi@scale\atfi@appearanceheight + depth \atfi@scale\atfi@appearancedepth {% + /Subtype/FileAttachment% + \atfi@icon + \atfi@color@annot + \atfi@author + \atfi@date + \atfi@annotname + \atfi@description + \atfi@subject + \atfi@appearance@dict + /F \theatfi@flags + /FS \@nameuse{atfi@fsobj@#1} 0 R% + }% + \rule{0pt}{\atfi@appearanceheight}% + \rule[-\atfi@appearancedepth]{0pt}{\atfi@appearancedepth}% + \rule{\atfi@appearancewidth}{0pt}% +} +% \end{macrocode} +% \end{macro} +% +% \begin{macrocode} +% +% \end{macrocode} +% +% \subsection{luatex} +% \begin{macrocode} +%<*luatex> +\NeedsTeXFormat{LaTeX2e} +\ProvidesFile{atfi-luatex.def}% + [2019/11/24 v2.10 attachfile2 driver for luaTeX (HO)]% +\protected\def\atfi@literal {\pdfextension literal} +\def\atfi@GSAVE{q } +\def\atfi@GRESTORE{Q } +\def\atfi@SETLINEWIDTH{w } +\def\atfi@LINETO{l } +\def\atfi@MOVETO{m } +\def\atfi@STROKE{S } +\def\atfi@FILL{f } +\def\atfi@FILLSTROKE#1#2{#1#2B } +\def\atfi@SETRGBCOLORSTROKE{RG } +\def\atfi@SETRGBCOLORFILL{rg } +\def\atfi@SETGRAYSTROKE{G } +\def\atfi@SETGRAYFILL{g } +\def\atfi@SETCMYKCOLORSTROKE{K } +\def\atfi@SETCMYKCOLORFILL{k } +\def\atfi@RECTFILL{re f } +\def\atfi@RECTSTROKEFILL#1#2#3{#1#2#3re B } +\def\atfi@SETMITERLIMIT{M } +\def\atfi@SETFLAT{i } +\def\atfi@SETLINECAP{J } +\def\atfi@CURVETO{c } +\def\atfi@CURVETOV{v } +\def\atfi@CURVETOY{y } +\def\atfi@CLOSEPATH{h } +\def\atfi@SETLINEJOIN{j } +\define@key{AtFi@file}{Size}{% + \edef\atfi@params{\atfi@params/Size #1}% +} +\def\atfi@embedfile#1{% + \ltx@IfUndefined{atfi@fileobj@#1}{% + \begingroup + \let\atfi@params\ltx@empty + \expandafter\let\expandafter\atfi@temp + \csname atfi@file@#1\endcsname + \ifx\atfi@temp\ltx@empty + \let\atfi@temp\relax + \fi + \ifx\atfi@temp\relax + \atfi@pdftexdata{#1}% + \else + \edef\x{% + \noexpand\setkeys{AtFi@file}{\@nameuse{atfi@file@#1}}% + }% + \x + \fi + \ifx\atfi@params\ltx@empty + \else + \edef\atfi@params{/Params<<\atfi@params>>}% + \fi + \immediate\pdfextension obj stream attr {% + /Type/EmbeddedFile% + \atfi@mimetype + \atfi@params + } file {#1}% + \expandafter + \xdef\csname atfi@fileobj@#1\endcsname{\the\numexpr\pdffeedback lastobj\relax}% + \endgroup + }{% + % file already embedded + }% +} +\def\atfi@xform{% + \immediate\saveboxresource\atfi@appearancebox + \edef\atfi@appearanceobj{\the\lastsavedboxresourceindex}% +} +\let\atfi@xform@icon\atfi@xform +\def\atfi@refxform#1{% + \useboxresource#1\relax +} +\def\atfi@insert@file@annot#1{% + \rule{0pt}{0pt}% + \ifatfi@appearance + \def\atfi@appearance@dict{% + /AP<<% + /N \atfi@appearanceobj\space 0 R% + /R \atfi@appearanceobj\space 0 R% + /D \atfi@appearanceobj\space 0 R% + >>% + }% + \else + \let\atfi@appearance@dict\ltx@empty + \fi + \ltx@IfUndefined{atfi@fsobj@#1}{% + \begingroup + \hypersetup{unicode=false}% + \atfi@pdfstringdef\atfi@file{#1}% + \immediate\pdfextension obj{% + <<% + /Type/Filespec% + /F(\atfi@file)% + \ifx\atfi@ucfilespec\ltx@empty + \else + /UF(\atfi@ucfilespec)% + \fi + /EF<<% + /F \@nameuse{atfi@fileobj@#1} 0 R% + >>% + >>% + }% + \expandafter\xdef\csname atfi@fsobj@#1\endcsname{% + \the\numexpr\pdffeedback lastobj\relax + }% + \endgroup + }{% + }% + \pdfextension annot width \atfi@scale\atfi@appearancewidth + height \atfi@scale\atfi@appearanceheight + depth \atfi@scale\atfi@appearancedepth {% + /Subtype/FileAttachment% + \atfi@icon + \atfi@color@annot + \atfi@author + \atfi@date + \atfi@annotname + \atfi@description + \atfi@subject + \atfi@appearance@dict + /F \theatfi@flags + /FS \@nameuse{atfi@fsobj@#1} 0 R% + }% + \rule{0pt}{\atfi@appearanceheight}% + \rule[-\atfi@appearancedepth]{0pt}{\atfi@appearancedepth}% + \rule{\atfi@appearancewidth}{0pt}% +} +% +% \end{macrocode} +% +% \subsubsection{dvips} +% +% \begin{macrocode} +%<*dvips> +\NeedsTeXFormat{LaTeX2e} +\ProvidesFile{atfi-dvips.def}% + [2019/11/24 v2.10 attachfile2 driver for dvips (HO)]% +% \end{macrocode} +% +% \paragraph{Macros for graphics data} +% +% \begin{macro}{\atfi@literal} +% \begin{macrocode} +\def\atfi@literal#1{% + \special{ps:atfi_dict begin{#1}atfi_?pdfmark end}% +} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\atfi@header} +% \begin{macrocode} +\def\atfi@header#1{% + \special{! #1}% +} +% \end{macrocode} +% \end{macro} +% +% \begin{macrocode} +\atfi@header{% + userdict begin 20 dict dup /atfi_dict exch def end begin% + /atfi_?pdfmark systemdict % + dup/pdfmark known% + {% + /exec get def% + }{% + /pop get def% + } ifelse% + {% + % + % x y width height atfi_re -> + languagelevel 2 ge {% + /atfi_rectfill { rectfill } bind def% + /atfi_rectstroke { rectstroke } bind def% + }{% + /atfi_rect {% + /atfi_height exch def% + /atfi_width exch def% + /atfi_x exch def% + /atfi_y exch def % + newpath % + atfi_x atfi_y moveto % + atfi_x atfi_width add atfi_y lineto % + atfi_x atfi_width add atfi_y atfi_height add lineto % + atfi_x atfi_y atfi_height add lineto % + closepath% + } bind def% + /atfi_rectfill {% + atfi_rect fill% + } bind def% + /atfi_rectstroke {% + atfi_rect stroke% + } bind def% + } ifelse% + /atfi_curveto_v {% + currentpoint 6 2 roll curveto% + } bind def% + /atfi_curveto_y {% + 2 copy curveto% + } bind def% + % + % help macro for atfi_convert_date + /atfi_two {% + dup 10 lt% + {% + 1 string cvs % + exch 1 add exch% + }{% + 2 string cvs% + } ifelse % + putinterval% + } bind def% + % + % atfi_convert_date -> (D:...Z) + /atfi_convert_date {% + dup% + /atfi_days exch 3600 idiv 24 idiv def% + % calc date part + /atfi_year 1970 def% + {% + atfi_year 400 mod 0 eq % + atfi_year 100 mod 0 ne % + atfi_year 4 mod 0 eq % + and or% + {366} {365} ifelse % + dup atfi_days lt% + {% + atfi_days exch sub /atfi_days exch def% + /atfi_year atfi_year 1 add def% + }{% + exit% + } ifelse% + } loop% + /atfi_month 1 def% + /atfi_days atfi_days 1 add def % + 31 atfi_days lt% + {% + atfi_days 31 sub /atfi_days exch def% + /atfi_month atfi_month 1 add def % + 366 eq {29} {28} ifelse dup atfi_days lt% + {% + atfi_days exch sub /atfi_days exch def% + /atfi_month atfi_month 1 add def % + 31 atfi_days lt% + {% + atfi_days 31 sub /atfi_days exch def% + /atfi_month atfi_month 1 add def % + 30 atfi_days lt% + {% + atfi_days 30 sub /atfi_days exch def% + /atfi_month atfi_month 1 add def % + 31 atfi_days lt% + {% + atfi_days 31 sub /atfi_days exch def% + /atfi_month atfi_month 1 add def % + 30 atfi_days lt% + {% + atfi_days 30 sub /atfi_days exch def% + /atfi_month atfi_month 1 add def % + 31 atfi_days lt% + {% + atfi_days 31 sub /atfi_days exch def% + /atfi_month atfi_month 1 add def % + 31 atfi_days lt% + {% + atfi_days 31 sub /atfi_days exch def% + /atfi_month atfi_month 1 add def % + 30 atfi_days lt% + {% + atfi_days 30 sub /atfi_days exch def% + /atfi_month atfi_month 1 add def % + 31 atfi_days lt% + {% + atfi_days 31 sub /atfi_days exch def% + /atfi_month atfi_month 1 add def % + 30 atfi_days lt% + {% + atfi_days 30 sub /atfi_days exch def% + /atfi_month atfi_month 1 add def % + 31 atfi_days lt% + {% + atfi_days 31 sub /atfi_days exch def% + /atfi_month atfi_month 1 add def% + } if% + } if% + } if% + } if% + } if% + } if% + } if% + } if% + } if% + } if% + } { pop } ifelse% + }{ pop } ifelse % + % calc time part + 3600 24 mul mod % + dup 3600 idiv dup /atfi_hour exch def % + 3600 mul sub % + dup 60 idiv dup /atfi_min exch def % + 60 mul sub % + /atfi_sec exch def% + (D:19700101000000Z)% + dup 2 atfi_year 4 string cvs putinterval % + dup 6 atfi_month atfi_two % + dup 8 atfi_days atfi_two % + dup 10 atfi_hour atfi_two % + dup 12 atfi_min atfi_two % + dup 14 atfi_sec atfi_two% + } bind def % + % + % atfi_calc_checksum -> /CheckSum + % or returns nothing, if MD5Encode is not given + false % + languagelevel 2 ge {% + (MD5Encode)% + { pop true or }% + (MD5Encode) length string% + /Filter % + resourceforall% + } if% + {% + /atfi_calc_checksum {% + /atfi_checksum 16 string def% + /atfi_file exch (r) file def% + /atfi_md5sum atfi_checksum /MD5Encode filter def % + % not too efficient to read and write byte by byte, + % using a buffer is probably faster + atfi_size {% + atfi_file read% + {% + atfi_md5sum exch write% + } if% + } repeat % + atfi_md5sum closefile % + atfi_file closefile% + /CheckSum atfi_checksum% + } bind def% + }{% + /atfi_calc_checksum { pop } bind def% + } ifelse% + % + /atfi_pttobp { 72.27 div 72 mul } bind def% + /atfi_pdftodvipsx { 72.27 div Resolution mul } bind def% + /atfi_pdftodvipsy { 72.27 div VResolution mul } bind def% + % + } atfi_?pdfmark % + end% +} +% \end{macrocode} +% \begin{macrocode} +\def\atfi@GSAVE{gsave } +\def\atfi@GRESTORE{grestore } +\def\atfi@SETLINEWIDTH{setlinewidth } +\def\atfi@LINETO{lineto } +\def\atfi@MOVETO{moveto } +\def\atfi@STROKE{stroke } +\def\atfi@FILL{fill } +\def\atfi@FILLSTROKE#1#2{gsave #1 fill grestore #2 stroke } +\def\atfi@SETRGBCOLORSTROKE{setrgbcolor } +\def\atfi@SETRGBCOLORFILL{setrgbcolor } +\def\atfi@SETGRAYSTROKE{setgray } +\def\atfi@SETGRAYFILL{setgray } +\def\atfi@SETCMYKCOLORSTROKE{setcmykcolor } +\def\atfi@SETCMYKCOLORFILL{setcmykcolor } +\def\atfi@RECTFILL{atfi_rectfill } +\def\atfi@RECTSTROKEFILL#1#2#3{% + #3% + #1% + gsave atfi_rectfill grestore % + #2% + #3% + atfi_rectstroke % + #1% +} +\def\atfi@SETMITERLIMIT{setmiterlimit } +\def\atfi@SETFLAT{setflat } +\def\atfi@SETLINECAP{setlinecap } +\def\atfi@CURVETO{curveto } +\def\atfi@CURVETOV{atfi_curveto_v } +\def\atfi@CURVETOY{atfi_curveto_y } +\def\atfi@CLOSEPATH{closepath } +\def\atfi@SETLINEJOIN{setlinejoin } +% \end{macrocode} +% +% \begin{macrocode} +\newcounter{atfi@obj} +\renewcommand*{\theatfi@obj}{% + {atfi_obj_\number\c@atfi@obj}% +} +% \end{macrocode} +% +% \paragraph{File embedding} +% +% Most values for Params dictionary found in the \xext{atfi} file +% have priority: +% \begin{itemize} +% \item Recalculation (md5sum, \dots) is avoided. +% \item An external script has more possibilities than programming +% at PostScript level (operating system, getting the date and +% time values of the file with correct interpretation. +% \item Exception: status is called to test file existence, thus +% we get the value of size for free. +% \end{itemize} +% \begin{macrocode} +\define@key{AtFi@file}{Size}{} +% \end{macrocode} +% \begin{macro}{\atfi@embedfile} +% \begin{macrocode} +\def\atfi@embedfile#1{% + \ltx@IfUndefined{atfi@fileobj@#1}{% + \atfi@pdfstringdef\atfi@psfilename{#1}% + \stepcounter{atfi@obj}% + \expandafter\xdef\csname atfi@fileobj@#1\endcsname{\theatfi@obj}% + \begingroup + \let\atfi@params\ltx@empty + \expandafter\let\expandafter\atfi@temp + \csname atfi@file@#1\endcsname + \ifx\atfi@temp\ltx@empty + \let\atfi@temp\relax + \fi + \ifx\atfi@temp\relax + \atfi@pdftexdata{#1}% + \else + \edef\x{% + \noexpand\setkeys{AtFi@file}{\@nameuse{atfi@file@#1}}% + }% + \x + \fi + \atfi@literal{% + /atfi_filename(\atfi@psfilename)def % + atfi_filename status% + {% +% \end{macrocode} +% ok: file found\\ +% save parameters of status command +% \begin{macrocode} + /atfi_created exch def% + /atfi_referenced exch def% + /atfi_size exch def % + pop % +% \end{macrocode} +%\begin{verbatim} +%drop parameter "pages" (storage space), never needed +%ghostscript: +% created: stat.st_ctime +% referenced: stat.st_mtime +% stat.st_ctime: interpretion depends on operating system: +% * unix: inode change time (not interesting) +% * win32: probably creation time +% --> /CreationDate +% stat.st_mtime: modification time --> /ModDate +% time values are seconds since 1970-01-01, GMT +%TODO: ghostscript offers "getenv" for getting the value +% of an environment variable. That could be used to +% to detect windows and settingthe /CreationDate entry. +%TODO: how are these values interpreted by other distiller +% programs? +%\end{verbatim} +% \begin{macrocode} + [% + /_objdef \theatfi@obj + /type/stream% + /OBJ pdfmark% + [% + \theatfi@obj + <<% + /Type/EmbeddedFile% + \atfi@mimetype + /Params% + <<% + \atfi@params + % + /Size atfi_size% + % + /product where% + {% + pop % +% \end{macrocode} +% check for ghostscript +% \begin{macrocode} + product (Ghostscript) search% + {% + pop pop pop % +% \end{macrocode} +% ghostscript is running +% \begin{macrocode} + \ifatfi@creationdate + \else + false % TODO: test for windows + {% + /CreationDate atfi_created atfi_convert_date% + } if% + \fi + \ifatfi@moddate + \else + /ModDate atfi_referenced atfi_convert_date% + \fi + } if% +% \end{macrocode} +% look for MD5Encode filter and calculate CheckSum +% \begin{macrocode} + } if % + \ifatfi@checksum + \else + atfi_filename atfi_calc_checksum% + \fi + >>% + >>% + /PUT pdfmark% + [% + \theatfi@obj + atfi_filename (r) file% + /PUT pdfmark% + [% + \theatfi@obj + /CLOSE pdfmark% + }{% +% \end{macrocode} +% error: file not found\\ +% currently nothing is done +% \begin{macrocode} + } ifelse% + }% + \endgroup + }{% +% \end{macrocode} +% file already embedded +% \begin{macrocode} + }% +} +% \end{macrocode} +% \end{macro} +% +% +% \paragraph{Annotation appearance} +% +% output: \cs{atfi@appearanceobj}\\ +% input: \cs{atfi@appearancebox}, \cs{atfi@icon@icon} +% \begin{macro}{atfi@xfrom@icon} +% \begin{macrocode} +\def\atfi@xform@icon{% + \stepcounter{atfi@obj}% + \edef\atfi@appearanceobj{\theatfi@obj}% + \atfi@literal{% + [% + /_objdef \atfi@appearanceobj + /BBox[% + 0 % + 0 % + \strip@pt\wd\atfi@appearancebox\space atfi_pttobp % + \strip@pt\dimexpr\dp\atfi@appearancebox + +\ht\atfi@appearancebox\relax\space atfi_pttobp% + ]% + /BP pdfmark % + \csname atfi@acro\atfi@icon@icon @data\endcsname + [% + /EP pdfmark% + }% +} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\atfi@xform} +% output: \cs{atfi@appearanceobj}, +% input: \cs{atfi@appearancebox} +% \begin{macrocode} +\def\atfi@xform{% + \stepcounter{atfi@obj}% + \edef\atfi@appearanceobj{\theatfi@obj}% + \begingroup + \setbox\ltx@zero=\hbox{% + \atfi@literal{% + [% + /_objdef \atfi@appearanceobj + /BBox[% + currentpoint % + \strip@pt\dp\atfi@appearancebox\space sub % + currentpoint % + exch \strip@pt\wd\atfi@appearancebox\space add % + exch \strip@pt\ht\atfi@appearancebox\space add% + ]% + /BP pdfmark % + gsave % + currentpoint % + 2 copy translate % + 72.27 Resolution div 72.27 VResolution div neg scale % + exch neg exch neg translate% + }% + \usebox{\atfi@appearancebox}% + \atfi@literal{% + grestore% + [% + /EP pdfmark% + }% + }% + % do not allocate any space for xobject definition + \dp\ltx@zero=\z@ + \ht\ltx@zero=\z@ + \wd\ltx@zero=\z@ + \mbox{\usebox\ltx@zero}% + \endgroup +} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\atfi@refxform} +% \begin{macrocode} +\def\atfi@refxform#1{% + \raisebox{-\atfi@appearancedepth}{% + \atfi@literal{% + gsave % + currentpoint translate % + Resolution 72 div VResolution neg 72 div scale% + [#1 /SP pdfmark % hash-ok + grestore% + }% + \makebox[\atfi@appearancewidth]{}% + }% + \rule{0pt}{\atfi@appearanceheight}% +} +% \end{macrocode} +% \end{macro} +% +% \paragraph{File attachment annotation} +% +% \begin{macro}{\atfi@insert@file@annot} +% \begin{macrocode} +\def\atfi@insert@file@annot#1{% + \rule{0pt}{0pt}% + \ifatfi@appearance + \def\atfi@appearance@dict{% + /AP<<% + /N \atfi@appearanceobj + /R \atfi@appearanceobj + /D \atfi@appearanceobj + >>% + }% + \else + \let\atfi@appearance@dict\ltx@empty + \fi + \ltx@IfUndefined{atfi@fsobj@#1}{% + \stepcounter{atfi@obj}% + \expandafter + \xdef\csname atfi@fsobj@#1\endcsname{\theatfi@obj}% + \begingroup + \hypersetup{unicode=false}% + \atfi@pdfstringdef\atfi@file{#1}% + \atfi@literal{% + [% + /_objdef \theatfi@obj + /type/dict% + /OBJ pdfmark% + [% + \theatfi@obj + <<% + /Type/Filespec% + /F(\atfi@file)% + \ifx\atfi@ucfilespec\ltx@empty + \else + /UF(\atfi@ucfilespec)% + \fi + /EF<<% + /F \csname atfi@fileobj@#1\endcsname + >>% + >>% + /PUT pdfmark% + }% + \endgroup + }{% + }% + \atfi@literal{% + [% + /Subtype/FileAttachment% + \atfi@icon + \atfi@color@annot + \atfi@author + \atfi@date + \atfi@annotname + \atfi@description + \atfi@subject + \atfi@appearance@dict + /F \theatfi@flags + /FS \csname atfi@fsobj@#1\endcsname + /Rect[% + currentpoint % + \strip@pt\dimexpr\atfi@scale\atfi@appearancedepth\relax + \space atfi_pdftodvipsy add % + currentpoint % + exch % + \strip@pt\dimexpr\atfi@scale\atfi@appearancewidth\relax + \space atfi_pdftodvipsx add % + exch % + \strip@pt\dimexpr\atfi@scale\atfi@appearanceheight\relax + \space atfi_pdftodvipsy sub % + ]% + /ANN pdfmark% + }% + \rule{0pt}{\atfi@appearanceheight}% + \rule[-\atfi@appearancedepth]{0pt}{\atfi@appearancedepth}% + \rule{\atfi@appearancewidth}{0pt}% +} +% \end{macrocode} +% \end{macro} +% +% \begin{macrocode} +% +% \end{macrocode} +% +% \subsubsection{dvipdfmx} +% +% \begin{macrocode} +%<*dvipdfmx> +\NeedsTeXFormat{LaTeX2e} +\ProvidesFile{atfi-dvipdfmx.def}% + [2019/11/24 v2.10 attachfile2 driver for dvipdfmx/XeTeX (HO)]% +% \end{macrocode} +% +% \paragraph{Macros for graphics data} +% +% \begin{macro}{\atfi@special} +% \begin{macrocode} +\def\atfi@special#1{% + \special{pdf:#1}% +} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\atfi@literal} +% \begin{macrocode} +\def\atfi@literal#1{% + \atfi@special{content #1}% +} +% \end{macrocode} +% \end{macro} +% +% \begin{macrocode} +\def\atfi@GSAVE{q } +\def\atfi@GRESTORE{Q } +\def\atfi@SETLINEWIDTH{w } +\def\atfi@LINETO{l } +\def\atfi@MOVETO{m } +\def\atfi@STROKE{S } +\def\atfi@FILL{f } +\def\atfi@FILLSTROKE#1#2{#1#2B } +\def\atfi@SETRGBCOLORSTROKE{RG } +\def\atfi@SETRGBCOLORFILL{rg } +\def\atfi@SETGRAYSTROKE{G } +\def\atfi@SETGRAYFILL{g } +\def\atfi@SETCMYKCOLORSTROKE{K } +\def\atfi@SETCMYKCOLORFILL{k } +\def\atfi@RECTFILL{re f } +\def\atfi@RECTSTROKEFILL#1#2#3{#1#2#3re B } +\def\atfi@SETMITERLIMIT{M } +\def\atfi@SETFLAT{i } +\def\atfi@SETLINECAP{J } +\def\atfi@CURVETO{c } +\def\atfi@CURVETOV{v } +\def\atfi@CURVETOY{y } +\def\atfi@CLOSEPATH{h } +\def\atfi@SETLINEJOIN{j } +% \end{macrocode} +% +% \begin{macrocode} +\newcounter{atfi@obj} +\renewcommand*{\theatfi@obj}{% + @atfi_obj_\number\c@atfi@obj +} +% \end{macrocode} +% +% \paragraph{File embedding} +% +% \begin{macrocode} +\define@key{AtFi@file}{Size}{% + \edef\atfi@params{\atfi@params/Size #1}% +} +% \end{macrocode} +% \begin{macro}{\atfi@embedfile} +% \begin{macrocode} +\def\atfi@embedfile#1{% + \ltx@IfUndefined{atfi@fileobj@#1}{% + \stepcounter{atfi@obj}% + \begingroup + \let\atfi@params\ltx@empty + \expandafter\let\expandafter\atfi@temp + \csname atfi@file@#1\endcsname + \ifx\atfi@temp\ltx@empty + \let\atfi@temp\relax + \fi + \ifx\atfi@temp\relax + \atfi@pdftexdata{#1}% + \else + \edef\x{% + \noexpand\setkeys{AtFi@file}{\@nameuse{atfi@file@#1}}% + }% + \x + \fi + \ifx\atfi@params\ltx@empty + \else + \edef\atfi@params{/Params<<\atfi@params>>}% + \fi + \edef\atfi@FILE{#1}% + \filename@parse\atfi@FILE + \ifx\filename@area\ltx@empty + \edef\atfi@FILE{./\atfi@FILE}% + \fi + \EdefEscapeString\atfi@FILE{\atfi@FILE}% + \atfi@special{fstream % + \theatfi@obj + (\atfi@FILE)% + <<% + /Type/EmbeddedFile% + \atfi@mimetype + \atfi@params + >>% + }% + \atfi@special{close \theatfi@obj}% + \expandafter + \xdef\csname atfi@fileobj@#1\endcsname{\theatfi@obj}% + \endgroup + }{% + % file already embedded + }% +} +% \end{macrocode} +% \end{macro} +% +% \paragraph{Annotation appearance} +% +% \begin{macro}{\atfi@xform} +% input: \cs{atfi@appearancebox}, output: \cs{atfi@appearanceobj} +% \begin{macrocode} +\def\atfi@xform{% + \stepcounter{atfi@obj}% + \smash{% + \rlap{% + \atfi@special{bxobj \theatfi@obj\space + width \the\wd\atfi@appearancebox\space + height \the\ht\atfi@appearancebox\space + depth \the\dp\atfi@appearancebox + }% + \usebox\atfi@appearancebox + \atfi@special{exobj}% + }% + }% + \edef\atfi@appearanceobj{\theatfi@obj}% +} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\atfi@xform@icon} +% \begin{macrocode} +\let\atfi@xform@icon\atfi@xform +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\atfi@refxform} +% \begin{macrocode} +\def\atfi@refxform#1{% + \leavevmode + \atfi@special{uxobj #1}% +} +% \end{macrocode} +% \end{macro} +% +% \paragraph{File attachment annotation} +% +% \begin{macro}{\atfi@insert@file@annot} +% \begin{macrocode} +\def\atfi@insert@file@annot#1{% + \rule{0pt}{0pt}% + \ifatfi@appearance + \def\atfi@appearance@dict{% + /AP<<% + /N \atfi@appearanceobj + /R \atfi@appearanceobj + /D \atfi@appearanceobj + >>% + }% + \else + \let\atfi@appearance@dict\ltx@empty + \fi + \ltx@IfUndefined{atfi@fsobj@#1}{% + \begingroup + \ifxetex + \let\atfi@temp\Hy@Warning + \let\Hy@Warning\ltx@gobble + \fi + \hypersetup{unicode=false}% + \ifxetex + \let\Hy@Warning\atfi@temp + \fi + \atfi@pdfstringdef\atfi@file{#1}% + \stepcounter{atfi@obj}% + \atfi@special{obj \theatfi@obj <<% + /Type/Filespec% + /F(\atfi@file)% + \ifx\atfi@ucfilespec\ltx@empty + \else + /UF(\atfi@ucfilespec)% + \fi + /EF<<% + /F \@nameuse{atfi@fileobj@#1}% + >>% + >>% + }% + \expandafter\xdef\csname atfi@fsobj@#1\endcsname{% + \theatfi@obj + }% + \endgroup + }{% + }% + \begingroup + \dimen@=\atfi@scale\atfi@appearancewidth + \edef\atfi@rule{width \the\dimen@}% + \dimen@=\atfi@scale\atfi@appearanceheight + \edef\atfi@rule{\atfi@rule\space height \the\dimen@}% + \dimen@=\atfi@scale\atfi@appearancedepth + \edef\atfi@rule{\atfi@rule\space depth \the\dimen@}% + \atfi@special{ann \atfi@rule + <<% + /Subtype/FileAttachment% + \atfi@icon + \atfi@color@annot + \atfi@author + \atfi@date + \atfi@annotname + \atfi@description + \atfi@subject + \atfi@appearance@dict + /F \theatfi@flags + /FS \@nameuse{atfi@fsobj@#1}% + >>% + }% + \endgroup + \rule{0pt}{\atfi@appearanceheight}% + \rule[-\atfi@appearancedepth]{0pt}{\atfi@appearancedepth}% + \rule{\atfi@appearancewidth}{0pt}% +} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macrocode} +% +% \end{macrocode} +% +% \subsection{Perl script \xfile{pdfatfi.pl}} +% +% \begin{macrocode} +%<*pdfatfi> +% \end{macrocode} +% \begingroup\small +% \SpecialEscapechar\| +% \begin{macrocode} +#!/usr/bin/env perl +use strict; +$^W=1; # turn warning on +# +# pdfatfi.pl +# +# Copyright (C) 2005-2010, 2012 Heiko Oberdiek. +# +# This work may be distributed and/or modified under the +# conditions of the LaTeX Project Public License, either +# version 1.3c of this license or (at your option) any later +# version. This version of this license is in +# https://www.latex-project.org/lppl/lppl-1-3c.txt +# and the latest version of this license is in +# https://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". +# +# The Current Maintainers of this work are +# Heiko Oberdiek and the Oberdiek Package Support Group +# https://github.com/ho-tex/attachfile2/issues +# +# See file "attachfile2.pdf" for a list of files that belong to +# this project. +# +# This file "pdfatfi.pl" may be renamed to "pdfatfi" +# for installation purposes. +# +my $prj = 'pdfatfi'; +my $file = "$prj.pl"; +my $program = uc($&) if $file =~ /^\w+/; +my $version = "2.9"; +my $date = "2019/11/24"; +my $author = "Heiko Oberdiek"; +my $copyright = "Copyright (c) 2005-2010, 2012 by $author."; +# +# History: +# 2005/05/21 v1.0: First release. +# 2006/08/16 v2.2: Included in DTX file of attachfile2.dtx. +# 2010/09/27 v2.6: Keys ModDateTZ and CreationDateTZ added. +# 2016/05/16 v2.8: Option --version added. +# 2019/11/24 v2.10: adapted version to attachfile2 version. +# + +use POSIX qw(strftime); # %z is used (GNU) +use Digest::MD5; + +### program identification +my $title = "$program $version, $date - $copyright\n"; + +### error strings +my $Error = "!!! Error:"; # error prefix + +### variables +my $atfifile; + +### option variables +my @bool = ("false", "true"); +$::opt_help = 0; +$::opt_quiet = 0; +$::opt_debug = 0; +$::opt_verbose = 0; +$::opt_version = 0; + +my $usage = <<"END_OF_USAGE"; +${title}Syntax: \L$program\E [options] +Function: Help program for LaTeX package "attachfile2". +Options: (defaults:) + --help print usage + --version print version number + --(no)quiet suppress messages ($bool[$::opt_quiet]) + --(no)verbose verbose printing ($bool[$::opt_verbose]) + --(no)debug debug informations ($bool[$::opt_debug]) +END_OF_USAGE + +### process options +my @OrgArgv = @ARGV; +use Getopt::Long; +GetOptions( + "help!", + "version!", + "quiet!", + "debug!", + "verbose!", +) or die $usage; +!$::opt_help or die $usage; +if ($::opt_version) { + print "$prj $date v$version\n"; + exit(0); +} +@ARGV == 1 or die "$usage$Error Missing jobname!\n"; + +$::opt_quiet = 0 if $::opt_verbose; + +print $title unless $::opt_quiet; + +### get jobname +$atfifile = $ARGV[0]; +if (!-f $atfifile && -f "$atfifile.atfi") { + $atfifile .= ".atfi"; +} +-f $atfifile or die "$Error File `$atfifile' not found!\n"; + +print "* job file = $atfifile\n" if $::opt_verbose; + +if ($::opt_debug) { + print <<"END_DEB"; +* OSNAME: $^O +* PERL_VERSION: $] +* ARGV: @OrgArgv +END_DEB +} + +my $tmpfile = $atfifile . ".tmp"; + +my $timezone = strftime "%z", localtime; + +sub gettz ($) { + my $time = shift; + my $tz = strftime "%z", localtime($time); + return '' unless $tz; + return 'Z' if $tz eq '+0000'; + $tz =~ s/^([+\-]\d\d)(\d\d)$/$1'$2'/; + return $tz; +} + +open(IN, $atfifile) or die "$Error Cannot open `$atfifile'!\n"; +open(OUT, ">$tmpfile") or die "$Error Cannot write `$tmpfile'!\n"; + +while() { + # timezone + if (s/^(\\attachfile\@timezone\{).*(\})$/$1$timezone$2/) { + print "* timezone = $timezone\n" if $::opt_verbose; + } + + # file entry + if (/^\\attachfile\@file\[[^\]]*\]\{(.*)\}$/) { + my $hexfile = $1; + my $file = pack('H*', $hexfile); + my @s = stat($file); + if (@s == 0) { + print "!!! Warning: File `$file' not found!\n"; + } + else { + my $size = $s[7]; + my $mtime = $s[9]; + my $ctime = $s[10]; # inode change time + + my ($sec, $min, $hour, $mday, $mon, $year) = + localtime($mtime); + my $moddate = sprintf("%04d%02d%02d%02d%02d%02d", + $year + 1900, $mon + 1, $mday, + $hour, $min, $sec); + my $moddatetz = 'D:' . $moddate . gettz($mtime); + + # Manual page "perlport" says that "ctime" is creation + # time instead of inode change time for "Win32" and + # "Mac OS", but it is unsupported for "Mac OS X". + my $creationdate = ""; + my $creationdatetz = ""; + if ($^O eq 'MSWin32') { # cygwin? + ($sec, $min, $hour, $mday, $mon, $year) = + localtime($ctime); + $creationdate = sprintf("%04d%02d%02d%02d%02d%02d", + $year + 1900, $mon + 1, $mday, + $hour, $min, $sec); + $creationdatetz = + 'D:' . $creationdate . gettz($ctime); + } + + # md5 checksum + my $checksum = ""; + my $ctx = Digest::MD5->new; + if (open(FILE, $file)) { + $ctx->addfile(*FILE); + $checksum = $ctx->hexdigest; + close(FILE); + } + else { + print "!!! Warning: File `$file' cannot be read," + . " dropping checksum!\n"; + } + + $_ = "\\attachfile\@file[" + . "ModDateTZ=$moddatetz" + . ",Size=$size" + . ($checksum ? ",CheckSum=$checksum" : "") + . ($creationdatetz ? + ",CreationDateTZ=$creationdatetz" : + ($creationdate ? + ",CreationDate=$creationdate" : "")) + . "]{$hexfile}\n"; + if ($::opt_verbose) { + print "* file entry = $file\n"; + print " size = $size\n"; + print " moddate = $moddate\n"; + print " creationdate = $creationdate\n" + if $creationdate; + print " checksum = $checksum\n" if $checksum; + } + } + } + + print OUT $_; +} + +close(IN); +close(OUT); + +unlink($atfifile) or die "$Error Cannot delete old `$atfifile'!\n"; +rename $tmpfile, $atfifile + or die "$Error Cannot move `$tmpfile' to `$atfifile'!\n"; + +print "*** ready. ***\n" unless $::opt_quiet; + +__END__ +% \end{macrocode} +% \endgroup +% \begin{macrocode} +% +% \end{macrocode} +% +% +% \section{Installation} +% +% \subsection{Download} +% +% \paragraph{Package.} This package is available on +% CTAN\footnote{\CTANpkg{attachfile2}}: +% \begin{description} +% \item[\CTAN{macros/latex/contrib/attachfile2/attachfile2.dtx}] The source file. +% \item[\CTAN{macros/latex/contrib/attachfile2/attachfile2.pdf}] Documentation. +% \end{description} +% +% +% \paragraph{Bundle.} All the packages of the bundle `attachfile2' +% are also available in a TDS compliant ZIP archive. There +% the packages are already unpacked and the documentation files +% are generated. The files and directories obey the TDS standard. +% \begin{description} +% \item[\CTANinstall{install/macros/latex/contrib/attachfile2.tds.zip}] +% \end{description} +% \emph{TDS} refers to the standard ``A Directory Structure +% for \TeX\ Files'' (\CTAN{tds/tds.pdf}). Directories +% with \xfile{texmf} in their name are usually organized this way. +% +% \subsection{Bundle installation} +% +% \paragraph{Unpacking.} Unpack the \xfile{attachfile2.tds.zip} in the +% TDS tree (also known as \xfile{texmf} tree) of your choice. +% Example (linux): +% \begin{quote} +% |unzip attachfile2.tds.zip -d ~/texmf| +% \end{quote} +% +% \paragraph{Script installation.} +% Check the directory \xfile{TDS:scripts/attachfile2/} for +% scripts that need further installation steps. +% Package \xpackage{attachfile2} comes with the Perl script +% \xfile{pdfatfi.pl} that should be installed in such a way +% that it can be called as \texttt{pdfatfi}. +% Example (linux): +% \begin{quote} +% |chmod +x scripts/attachfile2/pdfatfi.pl|\\ +% |cp scripts/attachfile2/pdfatfi.pl /usr/local/bin/| +% \end{quote} +% +% \subsection{Package installation} +% +% \paragraph{Unpacking.} The \xfile{.dtx} file is a self-extracting +% \docstrip\ archive. The files are extracted by running the +% \xfile{.dtx} through \plainTeX: +% \begin{quote} +% \verb|tex attachfile2.dtx| +% \end{quote} +% +% \paragraph{TDS.} Now the different files must be moved into +% the different directories in your installation TDS tree +% (also known as \xfile{texmf} tree): +% \begin{quote} +% \def\t{^^A +% \begin{tabular}{@{}>{\ttfamily}l@{ $\rightarrow$ }>{\ttfamily}l@{}} +% attachfile2.sty & tex/latex/attachfile2/attachfile2.sty\\ +% atfi-dvips.def & tex/latex/attachfile2/atfi-dvips.def\\ +% atfi-pdftex.def & tex/latex/attachfile2/atfi-pdftex.def\\ +% atfi-dvipdfmx.def & tex/latex/attachfile2/atfi-dvipdfmx.def\\ +% pdfatfi.pl & scripts/attachfile2/pdfatfi.pl\\ +% attachfile2.pdf & doc/latex/attachfile2/attachfile2.pdf\\ +% attachfile2.dtx & source/latex/attachfile2/attachfile2.dtx\\ +% \end{tabular}^^A +% }^^A +% \sbox0{\t}^^A +% \ifdim\wd0>\linewidth +% \begingroup +% \advance\linewidth by\leftmargin +% \advance\linewidth by\rightmargin +% \edef\x{\endgroup +% \def\noexpand\lw{\the\linewidth}^^A +% }\x +% \def\lwbox{^^A +% \leavevmode +% \hbox to \linewidth{^^A +% \kern-\leftmargin\relax +% \hss +% \usebox0 +% \hss +% \kern-\rightmargin\relax +% }^^A +% }^^A +% \ifdim\wd0>\lw +% \sbox0{\small\t}^^A +% \ifdim\wd0>\linewidth +% \ifdim\wd0>\lw +% \sbox0{\footnotesize\t}^^A +% \ifdim\wd0>\linewidth +% \ifdim\wd0>\lw +% \sbox0{\scriptsize\t}^^A +% \ifdim\wd0>\linewidth +% \ifdim\wd0>\lw +% \sbox0{\tiny\t}^^A +% \ifdim\wd0>\linewidth +% \lwbox +% \else +% \usebox0 +% \fi +% \else +% \lwbox +% \fi +% \else +% \usebox0 +% \fi +% \else +% \lwbox +% \fi +% \else +% \usebox0 +% \fi +% \else +% \lwbox +% \fi +% \else +% \usebox0 +% \fi +% \else +% \lwbox +% \fi +% \else +% \usebox0 +% \fi +% \end{quote} +% If you have a \xfile{docstrip.cfg} that configures and enables \docstrip's +% TDS installing feature, then some files can already be in the right +% place, see the documentation of \docstrip. +% +% \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 +% \verb|mktexlsr|. +% +% \subsection{Script installation} +% This package comes with a Perl script \xfile{pdfatfi.pl}. +% Install it somewhere so that it is executed, when it is called +% as \verb|pdfatfi| on the command line. Example for +% installing it under Linux: +% \begin{quote} +%\begin{verbatim} +%cp pdfatfi.pl /usr/local/bin/pdfatfi +%chmod +x /usr/local/bin/pdfatfi +%\end{verbatim} +% \end{quote} +% +% +% \subsection{Some details for the interested} +% +% \paragraph{Unpacking with \LaTeX.} +% The \xfile{.dtx} chooses its action depending on the format: +% \begin{description} +% \item[\plainTeX:] Run \docstrip\ and extract the files. +% \item[\LaTeX:] Generate the documentation. +% \end{description} +% If you insist on using \LaTeX\ for \docstrip\ (really, +% \docstrip\ does not need \LaTeX), then inform the autodetect routine +% about your intention: +% \begin{quote} +% \verb|latex \let\install=y\input{attachfile2.dtx}| +% \end{quote} +% Do not forget to quote the argument according to the demands +% of your shell. +% +% \paragraph{Generating the documentation.} +% You can use both the \xfile{.dtx} or the \xfile{.drv} to generate +% the documentation. The process can be configured by the +% configuration file \xfile{ltxdoc.cfg}. For instance, put this +% line into this file, if you want to have A4 as paper format: +% \begin{quote} +% \verb|\PassOptionsToClass{a4paper}{article}| +% \end{quote} +% An example follows how to generate the +% documentation with pdf\LaTeX: +% \begin{quote} +%\begin{verbatim} +%pdflatex attachfile2.dtx +%makeindex -s gind.ist attachfile2.idx +%pdflatex attachfile2.dtx +%makeindex -s gind.ist attachfile2.idx +%pdflatex attachfile2.dtx +%\end{verbatim} +% \end{quote} +% +% \begin{thebibliography}{9} +% \bibitem{attachfile} +% Scott Pakin: \textit{The \xpackage{attachfile} package}; +% 2005/02/20 v1.2; +% \CTANpkg{attachfile}. +% +% \bibitem{embedfile} +% Heiko Oberdiek: \textit{The \xpackage{embedfile} package}; +% 2006/08/16 v1.0; +% \CTAN{macros/latex/contrib/oberdiek/embedfile.pdf}. +% +% \bibitem{pdfspec} +% Adobe Systems Incorporated: +% \href{https://www.adobe.com/devnet/pdf/pdf_reference.html}% +% {\textit{PDF Reference, Version 1.7}},% +% +% \bibitem{mime} +% Network Working Group: RFC 2046, \textit{Multipurpose Internet Mail Extensions (MIME) Part Two: +% Media Types}, November 1996; \url{http://www.rfc-editor.org/}. +% +% \bibitem{types} +% IANA (Internet Assigned Numbers Authority): +% \textit{MIME Media Types}, May 2006; +% \url{http://www.iana.org/assignments/media-types/}. +% +% \end{thebibliography} +% +% \begin{History} +% \begin{Version}{2005/02/23 v2.0} +% \item +% New options: \xoption{draft}/\xoption{final}. +% \item +% New option scale for scaling the annotation rectangle. +% \item +% Supported driver options: \xoption{pdftex}, \xoption{dvips}. +% \item +% Configuration file `attachfile.cfg' supported. +% \item +% Dependency of package calc dropped. +% \item +% \eTeX\ (\cs{numexpr}, \cs{dimexpr}) used. +% \item +% New auxiliary file \cs{jobname.atfi} to get data unavailable +% by (pdf)\TeX, controlled by \cs{nofiles} and option nofiles. +% \item +% Use of package \xpackage{prokvopt} (never released). +% \end{Version} +% \begin{Version}{2005/10/07 v2.1} +% \item +% Option \xoption{annotname} for naming annotations +% (this name can be used for embedded go-to actions). +% \end{Version} +% \begin{Version}{2006/08/17 v2.2} +% \item +% Use of package \xpackage{kvoptions} instead of \xpackage{prokvopt}. +% \item +% DTX framework. +% \item +% A little documentation. +% \end{Version} +% \begin{Version}{2007/04/11 v2.3} +% \item +% Line ends sanitized. +% \end{Version} +% \begin{Version}{2008/07/29 v2.4} +% \item +% Improved color support. Option \xoption{color} now understands +% the usual color specifications if package \xpackage{xcolor} is +% loaded. +% \end{Version} +% \begin{Version}{2009/09/25 v2.5} +% \item +% New option \xoption{ucfilespec} (since PDF 1.7). +% \item +% Fix: \xpackage{hyperref}'s option \xoption{unicode} is disabled +% for file names except for \xoption{ucfilespec}. +% \end{Version} +% \begin{Version}{2010/09/27 v2.6} +% \item +% Support for dvipdfmx added, new option \xoption{dvipdfmx} +% and alias option \xoption{xetex}. +% (Thanks Will Robertson for pointing to |\special{pdf:fstream ...}|). +% \item +% New option \xoption{driverfallback}. +% \item +% All options except driver options are local options, +% that means they are ignored as global options. +% \item +% Some options are disabled after they are used +% (driver options, \xoption{draft}, \xoption{final}, \xoption{nofiles}). +% \item +% Driver files renamed from \texttt{atfi.def} to +% \texttt{atfi-.def}. +% \item +% Bug fix: \cs{textattachfile} now adds an entry into +% the \xext{atfi} file. +% \item +% Program \xfile{pdfatfi.pl} sets modification and creation time with +% time zone, because the time zone offset might differ with +% the file date. +% \end{Version} +% \begin{Version}{2012/04/18 v2.7} +% \item +% Program \xfile{pdfatfi.pl}: Option \xoption{version} added. +% \end{Version} +% \begin{Version}{2016/05/16 v2.8} +% \item +% Documentation updates. +% \end{Version} +% \begin{Version}{2019/07/24 v2.9} +% \item +% Added luatex driver (UF, issue 69) +% \end{Version} +% \begin{Version}{2019/11/24 v2.10} +% \item +% Fix perl header comment +% \item +% Address perl warning \verb|Scalar value @s[7] better written as $s[7] at pdfatfi.pl line 147| +% \item +% use \CTANpkg{iftex} not \CTANpkg{ifpdf}, \CTANpkg{ifxetex}, \CTANpkg{ifluatex}. +% \end{Version} +% \end{History} +% +% \PrintIndex +% +% \Finale +\endinput diff --git a/macros/latex/contrib/attachfile2/attachfile2.pdf b/macros/latex/contrib/attachfile2/attachfile2.pdf new file mode 100644 index 0000000000..193c7e6793 Binary files /dev/null and b/macros/latex/contrib/attachfile2/attachfile2.pdf differ diff --git a/macros/latex/contrib/caption/CHANGELOG b/macros/latex/contrib/caption/CHANGELOG index 68fb6c4a8c..1eab8c90a4 100644 --- a/macros/latex/contrib/caption/CHANGELOG +++ b/macros/latex/contrib/caption/CHANGELOG @@ -112,6 +112,12 @@ v3.3 (2013/01/06) - Corrects incorrect load order hyperref-float now (needs hyperref v6.82q or newer) - New switch \ifsinglelinecaption for usage inside own commands added +v3.4 (2019/09/11) +- Label format `autodot' added (for usage within documents using KOMA-Script document class) +- Label format `unnumbered' added +- \ContinuedFloat renamed to \continuedfloat (since this is not a preamble command) +- \caption will always be re-defined now, unless `compatibility' is set to `v1' (or an incompatible package is loaded) + bicaption package ----------------- @@ -162,22 +168,12 @@ v1.1 (2011/08/17) - New command \phantomsubcaption v1.2 (2018/05/13) -- Optional argument values `B' and `T' added to the environments `subfigure' and `subtable' +- Values `B' and `T' for the optional argument added to the environments `subfigure' and `subtable' v1.3 (2019/08/31) - New command \subfloat for easy transition from the `subfig' package -newfloat package ----------------- - -v1.0 (2011/10/30) -- 1st published version - -v1.1 (2013/04/27) -- New command \PrepareListOf - - totalcount package ------------------ diff --git a/macros/latex/contrib/caption/README b/macros/latex/contrib/caption/README index baf9a932e9..74919d6378 100644 --- a/macros/latex/contrib/caption/README +++ b/macros/latex/contrib/caption/README @@ -1,7 +1,7 @@ ========================================================================== The `caption' package bundle -Release 2019-09-01 +Release 2019-11-24 Copyright (C) 1994-2019 Axel Sommerfeldt (axel.sommerfeldt@f-m.fm) License: LPPL = LaTeX Project Public Licence @@ -29,7 +29,7 @@ or send an e-mail to -------------------------------------------------------------------------- -The `caption' package v3.3 offers customization of captions of floating +The `caption' package v3.4 offers customization of captions of floating environments such `figure' and `table' and cooperates with the packages float, floatflt, fltpage, hyperref, hypcap, listings, longtable, @@ -73,11 +73,8 @@ User Manual: subcaption.pdf (English) -------------------------------------------------------------------------- -The `newfloat' package v1.1 offers the command \DeclareFloatingEnvironment -for defining new floating environments which behave like the existing -floating environments "figure" and "table". - -User Manual: newfloat.pdf (English) +Note: The `newfloat' package was removed from this package bundle and was +uploaded to CTAN as stand-alone package. ========================================================================== (The pictures cat.eps & elephant.eps were taken with permission from the diff --git a/macros/latex/contrib/caption/caption.dtx b/macros/latex/contrib/caption/caption.dtx index 89abe25309..3b0a396831 100644 --- a/macros/latex/contrib/caption/caption.dtx +++ b/macros/latex/contrib/caption/caption.dtx @@ -25,12 +25,12 @@ % and the user manuals caption-deu.tex, caption-eng.tex, and caption-rus.tex. % % \fi -% \CheckSum{3694} +% \CheckSum{2974} % % \iffalse %<*driver> \NeedsTeXFormat{LaTeX2e}[1994/12/01] -\ProvidesFile{caption.drv}[2011/08/06 v3.3 Implementation of the caption package] +\ProvidesFile{caption.drv}[2015/09/16 v3.4 Implementation of the caption package] \hbadness=9999 \newcount\hbadness \hfuzz=100pt % Make TeX shut up. %\errorcontextlines=3 % @@ -89,8 +89,6 @@ % % \newcommand*\issue[1]{GitLab~\##1} % -% \GetFileInfo{caption.drv} -% \let\docdate\filedate % \GetFileInfo{caption.sty} % % \title{The Implementation of @@ -99,7 +97,7 @@ % {the caption package}} % \author{Axel Sommerfeldt\\ % \url{https://gitlab.com/axelsommerfeldt/caption}} -% \date{\docdate} +% \date{\filedate} % \maketitle % % \begin{abstract} @@ -120,10 +118,10 @@ % \package{caption3} kernel. % \end{abstract} % -% \section*{User manuals} +% \section*{User manual} % -% This document is describing the code implementation only. The user -% documentation can be found in +% This document is describing the code implementation only. +% The user documentation can be found in % \nopagebreak\begin{quote} % \begin{tabular}{ll} % \href{http://mirror.ctan.org/macros/latex/contrib/caption/caption-eng.pdf}% @@ -201,46 +199,41 @@ % \changes{v1.4}{1995/01/30}{New option \texttt{nooneline}} % \changes{v1.4b}{1995/04/05}{Bugfix release} % \changes{v3.0}{2003/12/20}{Rewritten; many new commands and features} -% \changes{v3.0d}{2004/11/28}{Split into two packages: -% \package{caption} \& \package{caption3}} +% \changes{v3.0d}{2004/11/28}{Split into two packages: \package{caption} \& \package{caption3}} % % \iffalse % --------------------------------------------------------------------------- % % \fi % % \clearpage -% \let\subsubsection\subsection -% \let\subsection\section % % \iffalse %<*package> % \fi % -% \subsection{Identification} +% \section{Identification} % % \begin{macrocode} \NeedsTeXFormat{LaTeX2e}[1994/12/01] -\ProvidesPackage{caption}[2019/09/01 v3.3d Customizing captions (AR)] +\ProvidesPackage{caption}[2019/10/18 v3.4a Customizing captions (AR)] % \end{macrocode} % -% \subsection{Loading the kernel} +% \section{Loading the kernel} % % \begin{macrocode} -\RequirePackage{caption3}[2019/09/01] % needs v1.8d or newer +\RequirePackage{caption3}[2019/09/09] % needs v1.8e or newer % \end{macrocode} % -% \subsection{Check against incompatible document classes} +% \section{Check against unknown document classes} % % \begin{macrocode} \caption@ifbool{documentclass}{}{% \caption@WarningNoLine{% - Unsupported document class (or package) detected,\MessageBreak - usage of the caption package is not recommended}% - \caption@InfoNoLine{\string\@makecaption\space=\space\meaning\@makecaption}% -} + Unknown document class (or package),\MessageBreak + standard defaults will be used}} % \end{macrocode} % -% \subsection{Check against incompatible packages} +% \section{Check against incompatible packages} % % \changes{v3.0p}{2007/04/06}{Check against obsolete \package{caption2} package added} % \begin{macrocode} @@ -265,7 +258,7 @@ % \changes{v3.1g}{2008/03/20}{\texttt{position=b} added} % \changes{v3.1h}{2008/03/29}{% % Name changed from \cs{caption@IncompatiblePackage} to \cs{caption@DisablePositionOption}; -% moved from package to kernel; disables the `position' option now instead of issuing a warning} +% disables the `position' option now instead of issuing a warning} % |\caption@DisablePositionOption|\marg{package}\par % disables the `position' option. % \begin{macrocode} @@ -284,9 +277,9 @@ % \end{macrocode} % \end{macro} % -% \subsection{Declaration of options} +% \section{Declaration of options} % -% \subsubsection{Options for figure and table} +% \subsection{Options for figure and table} % % \changes{v3.0a}{2004/01/09}{Options \opt{figureposition} and \opt{tableposition} added} % \begin{macrocode} @@ -401,7 +394,7 @@ % \end{macrocode} % \end{macro} % -% \subsubsection{Miscellaneous options} +% \subsection{Miscellaneous options} % % \begin{macrocode} \DeclareCaptionOption*{config}[caption]{% @@ -471,15 +464,57 @@ \captionsetup{@minipage=default} % \end{macrocode} % -% \subsubsection{caption v1.x compatibility options} +% \subsection{caption v1.x compatibility options} % \changes{v3.1}{2007/07/21}{Option `compatibility' added} % \changes{v3.1}{2007/09/01}{caption v1.x compatibility options revised} % \changes{v3.1d}{2007/10/24}{Bugfix 07-10-24 in caption v1.x$ compatibility options} % +% Currently we support |v1| and |v3| as values for the |compatibility=| option. +% But since this used to be a boolean option is the past we still support any boolean value +% for compatibility reasons. +% % \begin{macrocode} -\DeclareCaptionOption{compatibility}[1]{\caption@setbool{compatibility}{#1}} +\DeclareCaptionOption{compatibility}[v1]{% + \caption@ifinlist{#1}{v1,1,true,yes,on}{% + \let\caption@ifcompatibility\@firstoftwo + }{\caption@ifinlist{#1}{v3,3,0,false,no,off}{% + \let\caption@ifcompatibility\@secondoftwo + }{% + \caption@Error{Undefined compatibility value `#1'}% + }}} \@onlypreamble@key{caption}{compatibility} % \end{macrocode} +% \begin{macrocode} +\caption@setbool{compatibility}{0} % default: Try not to be compatible to v1.x +% \end{macrocode} +% +% \begin{macro}{\caption@setincompatible} +% \changes{v3.4}{2019/09/09}{This macro added} +% |\caption@setincompatible|\marg{condition}\marg{message text} +% \begin{macrocode} +\newcommand*\caption@setincompatible[2]{% + #1{% + \caption@WarningNoLine{% + #2;\MessageBreak + Setting compatibility to v1}% + \caption@setbool{compatibility}{1}% + }{}} +% \end{macrocode} +% \end{macro} +% +% Check against incompatible packages which used to work fine with v1 of the `caption' package. +% \begin{macrocode} +\caption@AtBeginDocument{\caption@ifcompatibility{}{% +% \end{macrocode} +% The usage of the (now obsolete) \package{captcont} package, +% which brings its own definition of |\caption*|, was quite common in the old days. +% \begin{macrocode} + \caption@setincompatible{\@ifpackageloaded{captcont}}{captcont package is loaded}% +% \end{macrocode} +% To be continued\ldots +% \begin{macrocode} +}} +% \end{macrocode} % % \begin{macrocode} \DeclareCaptionOptionNoValue*{normal}{% @@ -529,7 +564,7 @@ \DeclareCaptionOptionNoValue*{ruled}{\caption@setbool{ruled}{1}} % \end{macrocode} % -% \subsubsection{caption2 v2.x compatibility options} +% \subsection{caption2 v2.x compatibility options} % \changes{v3.0h}{2005/07/08}{caption2 \version{2.x} compatibility options added} % \changes{v3.1}{2007/09/01}{caption2 v2.x compatibility options revised} % \changes{v3.1d}{2007/10/24}{Bugfix 07-10-24 in caption v2.x$ compatibility options} @@ -550,7 +585,7 @@ \caption@WarningNoLine{Obsolete option `ignoreLTcapwidth' ignored}} % \end{macrocode} % -% \subsubsection{Obsolete caption v3.0 options} +% \subsection{Obsolete caption v3.0 options} % \changes{v3.1}{2007/05/07}{Package option \opt{caption} marked as obsolete, % gives error now} % @@ -564,7 +599,7 @@ and do *not* load the caption package anymore}}} % \end{macrocode} % -% \subsubsection{fltpage package support options} +% \subsection{fltpage package support options} % % \changes{v3.1}{2007/09/01}{Options `FPlist' \& `FPref' added} % With these options is controlled where the list-of entry and |\ref| resp. @@ -587,7 +622,7 @@ \captionsetup{FPlist=caption,FPref=figure} % \end{macrocode} % -% \subsubsection{hyperref package support options} +% \subsection{hyperref package support options} % % \changes{v3.1}{2007/06/21}{Options `hypcap' \& `hypcapspace' added} % With |hypcap=off| one can turn the \package{hypcap} support off @@ -600,21 +635,21 @@ \captionsetup{hypcap=1,hypcapspace=.5\baselineskip} % \end{macrocode} % -% \subsection{\AmS{} \& \SmF{} document classes support} +% \section{\AmS{} \& \SmF{} document classes support} % \changes{v3.1}{2007/07/29}{\AmS\ \& \SmF\ document classes support added} % % \begin{macrocode} -\caption@ifamsclass{% +\caption@ifclassloaded{ams}{% \caption@InfoNoLine{AMS or SMF document class}% % \end{macrocode} % \begin{macrocode} \setlength\belowcaptionskip{0pt}% set to 12pt by AMS class % \end{macrocode} % \begin{macrocode} -} +}{} % \end{macrocode} % -% \subsection{\KOMAScript{} document classes support} +% \section{\KOMAScript{} document classes support} % \changes{v3.0a}{2004/01/18}{Minimum adaptation to \KOMAScript\ added} % \changes{v3.0h}{2005/08/22}{\KOMAScript\ compatibility options added} % \changes{v3.0i}{2005/11/17}{\KOMAScript\ compatibility commands added} @@ -623,7 +658,7 @@ % \changes{v3.1}{2007/04/05}{\KOMAScript\ compatibility revised \& enhanced} % % \begin{macrocode} -\caption@ifkomaclass{% +\caption@ifclassloaded{koma}{% \caption@InfoNoLine{KOMA-Script document class}% % \end{macrocode} % @@ -651,7 +686,7 @@ % \begin{macro}{\@figurecaptionabovefalse} % \changes{v3.3}{2013/02/15}{Support of \cs{@figurecaptionabovetrue} added} % \begin{macrocode} - \caption@ifundefined\@figurecaptionabovetrue{}{% + \caption@ifdefined\@figurecaptionabovetrue{% % \end{macrocode} % \begin{macrocode} \g@addto@macro\@figurecaptionabovetrue{\captionsetup*[figure]{position=t}} @@ -665,7 +700,7 @@ \fi % \end{macrocode} % \begin{macrocode} - }% + }{}% % \end{macrocode} % \end{macro} % \end{macro} @@ -696,6 +731,7 @@ % instead of \cs{captionabove/below}} % \changes{v3.1g}{2008/03/01}{\cs{def} changed to \cs{g@addto@macro}} % \changes{v3.1k}{2009/10/09}{\opt{figureposition} and \opt{tableposition} will issue a warning now} +% \changes{v3.4}{2019/09/11}{\opt{figureposition} and \opt{tableposition} will now set the position anyway since it could be used by other packages} % Please note that these are stronger than the \opt{position} setting, therefore we % override the options \opt{figureposition} and \opt{tableposition} to typeout a warning. % \begin{macrocode} @@ -705,10 +741,12 @@ % \begin{macrocode} \DeclareCaptionOption{figureposition}{% \caption@WarningNoLine{Option `figureposition=#1' has no effect\MessageBreak - when used with a KOMA script document class}} + when used with a KOMA script document class}% + \captionsetup*[figure]{position=#1}} \DeclareCaptionOption{tableposition}{% \caption@WarningNoLine{Option `tableposition=#1' has no effect\MessageBreak - when used with a KOMA script document class}} + when used with a KOMA script document class}% + \captionsetup*[table]{position=#1}} % \end{macrocode} % \end{macro} % \end{macro} @@ -731,7 +769,7 @@ % \end{macro} % % \begin{macrocode} - \caption@ifundefined\cap@indent{}{\caption@setcapindent} + \caption@ifdefined\cap@indent{\caption@setcapindent}{} % \end{macrocode} % % \begin{macro}{\setcapwidth} @@ -749,11 +787,11 @@ % \begin{macrocode} \newcommand*\caption@setcapwidth[1]{% \ifx\\#1\\\else - \caption@ifundefined\cap@margin{}{% + \caption@ifdefined\cap@margin{% \def\@tempa{captionbeside}% \ifx\@tempa\@currenvir\else\caption@Warning{% Ignoring optional argument [#1] of \string\setcapwidth\MessageBreak}% - \fi}% + \fi}{}% \fi \captionsetup{width=\cap@width}} % \end{macrocode} @@ -805,10 +843,10 @@ % \end{macrocode} % % \begin{macrocode} -} +}{} % \end{macrocode} % -% \subsection{Processing of options} +% \section{Processing of options} % % \changes{v3.0m}{2007/03/04}{Verbose option added} % \changes{v3.1}{2007/07/02}{Verbose option removed from package} @@ -819,7 +857,7 @@ \caption@ProcessOptions*{caption} % \end{macrocode} % -% \subsection{\cs{caption}, \cs{@caption}, and \cs{@makecaption}} +% \section{\cs{caption}, \cs{@caption}, and \cs{@makecaption}} % % \begin{macro}{\caption@ifflag} % \changes{v3.3}{2011/12/28}{This switch added} @@ -834,7 +872,7 @@ % |\caption@if|\-|flag{4}| is set if there is already content which have % incremented the counter (so the counter doesn't need to be incremented % for the main caption, further sub-figures, and other stuff), and -% |\caption@if|\-|flag{1}| is set if |\Continued|\-|Float| was given. +% |\caption@if|\-|flag{1}| is set if |\continued|\-|float| was given. % % In the past three boolean switches were used to store the flags, but since some % packages (like the \package{floatrow} and \package{tabu} package) try hard to keep @@ -1031,512 +1069,31 @@ % % \begin{macro}{\caption@redefine} % \changes{v3.1k}{2009/03/30}{This macro added, it contains the patching code now} -% We only redefine |\caption| and |\@caption| if the current definitions -% are well known, so documents written in the old (\package{caption} -% package \version{1.x}) days (where |\caption| \& |\@caption| were not -% redefined by us) will still compile fine. -% For example the usage of the (now obsolete) \package{captcont} package, -% which brings its own definition of |\caption*|, was quite common these days. +% Prior to \version{3.4} we only redefined |\caption| and |\@caption| if the current definitions +% were well known, so documents written in the old (\package{caption} package \version{1.x}) days +% (where |\caption| \& |\@caption| were not redefined by us) still compiled fine. +% This used to make sense when introducing \version{3.0} in the year 2003 +% but is simply overcautious and especially unwanted by the user nowadays. +% So starting with \version{3.4} we only do not redefine |\caption| and |\@caption| if the +% `compatibility' option is set to `v1'. % \begin{macrocode} \newcommand*\caption@redefine{} \g@addto@macro\caption@redefine{% % \end{macrocode} -% -% \begin{macrocode} - \caption@setbool{incompatible}{0}% -% \end{macrocode} -% -% \begin{macrocode} - \caption@CheckCommand\caption{% - % ltfloat.dtx [2002/10/01 v1.1v LaTeX Kernel (Floats)] - \def\caption{% - \ifx\@captype\@undefined - \@latex@error{\noexpand\caption outside float}\@ehd - \expandafter\@gobble - \else - \refstepcounter\@captype - \expandafter\@firstofone - \fi - {\@dblarg{\@caption\@captype}}% - }}% -% \end{macrocode} -% -% \begin{macrocode} - \caption@CheckCommand\caption{% - % beamerbaselocalstructure.sty,v 1.53 2007/01/28 20:48:21 tantau - \def\caption{ - \ifx\@captype\@undefined - \@latex@error{\noexpand\caption outside figure or table}\@ehd - \expandafter\@gobble - \else - \refstepcounter\@captype - \expandafter\@firstofone - \fi - {\@dblarg{\@caption\@captype}}% - }}% -% \end{macrocode} -% -% \begin{macrocode} - \caption@CheckCommand\caption{% - % beamerbaselocalstructure.sty, Joseph Wright committed 4ac715c 2013-09-04 - \def\caption{% - \ifx\@captype\@undefined - \@latex@error{\noexpand\caption outside figure or table}\@ehd - \expandafter\@gobble - \else - \refstepcounter\@captype - \expandafter\@firstofone - \fi - {\@dblarg{\@caption\@captype}}% - }}% -% \end{macrocode} -% -% \begin{macrocode} - \caption@CheckCommand\caption{% - % float.sty [2001/11/08 v1.3d Float enhancements (AL)] - \long\def\caption{% - \ifx\@captype\@undefined - \@latex@error{\noexpand\caption outside float}\@ehd - \expandafter\@gobble - \else - \refstepcounter\@captype - \let\@tempf\@caption - \expandafter\ifx\csname @float@c@\@captype\endcsname\relax\else - \expandafter\expandafter\let - \expandafter\@tempf\csname @float@c@\@captype\endcsname - \fi - \fi - \@dblarg{\@tempf\@captype}}}% -% \end{macrocode} -% -% \begin{macrocode} - \caption@CheckCommand\caption{% - % hyperref.sty [2007/02/27 v6.75t Hypertext links for LaTeX] - % hyperref.sty [2007/04/09 v6.76a Hypertext links for LaTeX] - % hyperref.sty [2007/06/12 v6.76h Hypertext links for LaTeX] - \def\caption{% - \ifx\@captype\@undefined - \@latex@error{\noexpand\caption outside float}\@ehd - \expandafter\@gobble - \else - \H@refstepcounter\@captype - \@ifundefined{fst@\@captype}{% - \let\Hy@tempa\@caption - }{% - \let\Hy@tempa\Hy@float@caption - }% - \expandafter\@firstofone - \fi - {\@dblarg{\Hy@tempa\@captype}}% - }}% -% \end{macrocode} -% \begin{macrocode} - \caption@CheckCommand\caption{% - % hyperref.sty [2007/08/05 v6.76j Hypertext links for LaTeX] - \def\caption{% - \ifx\@captype\@undefined - \@latex@error{\noexpand\caption outside float}\@ehd - \expandafter\@gobble - \else - \H@refstepcounter\@captype - \let\Hy@tempa\@caption - \@ifundefined{float@caption}{% - }{% - \expandafter\ifx\csname @float@c@\@captype\endcsname\float@caption - \let\Hy@tempa\Hy@float@caption - \fi - }% - \expandafter\@firstofone - \fi - {\@dblarg{\Hy@tempa\@captype}}% - }}% -% \end{macrocode} -% \begin{macrocode} - \caption@CheckCommand\caption{% - % memhfixc.sty [2010/08/17 v1.15 nameref/hyperref package fixes for memoir class] - % \let\m@moldhypcaption\caption - \long\def\caption{\donemaincaptiontrue\m@moldhypcaption}}% -% \end{macrocode} -% \begin{macrocode} - \caption@IfCheckCommand{}{% - \caption@InfoNoLine{% - Incompatible package detected (regarding \string\caption).\MessageBreak - \string\caption\space=\space\meaning\caption}% - \caption@setbool{incompatible}{1}}% -% \end{macrocode} -% -% \begin{macrocode} - \caption@CheckCommand\@caption{% - % ltfloat.dtx [2002/10/01 v1.1v LaTeX Kernel (Floats)] - \long\def\@caption#1[#2]#3{% - \par - \addcontentsline{\csname ext@#1\endcsname}{#1}% - {\protect\numberline{\csname the#1\endcsname}{\ignorespaces #2}}% - \begingroup - \@parboxrestore - \if@minipage - \@setminipage - \fi - \normalsize - \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}\par - \endgroup}}% -% \end{macrocode} -% -% \begin{macrocode} - \caption@CheckCommand\@caption{% - % beamerbaselocalstructure.sty,v 1.53 2007/01/28 20:48:21 tantau - \long\def\@caption#1[#2]#3{% second argument ignored - \par\nobreak - \begingroup - \@parboxrestore - \if@minipage - \@setminipage - \fi - \beamer@makecaption{#1}{\ignorespaces #3}\par\nobreak - \endgroup}}% -% \end{macrocode} -% -% \begin{macrocode} - \caption@CheckCommand\@caption{% - % memhfixc.sty [2010/08/17 v1.15 nameref/hyperref package fixes for memoir class] - \long\def\@caption#1[#2]#3{% - \MNR@old@caption{#1}[{#2}]{#3}% - \def\@currentlabelname{#2}% - \M@gettitle{#2}% - }}% -% \end{macrocode} -% -% \begin{macrocode} - \caption@CheckCommand\@caption{% - % arabicore.sty [2006/01/01 v1.0 Arabi Core switching commands (may still change)] - \long\def\@caption#1[#2]#3{% - \par - \addtocontents{\csname ext@#1\endcsname}{\xstring\select@language{\main@Arabi@language}}% - \addcontentsline{\csname ext@#1\endcsname}{#1}% - {\protect\numberline{\csname the#1\endcsname}{\ignorespaces \if@rl{\textRL{#2}}\else\textLR{#2}\fi}}% - \begingroup - \@parboxrestore - \if@minipage - \@setminipage - \fi - \normalsize - \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces \if@rl{\textRL{#3}}\else\textLR{#3}\fi}\par - \endgroup}}% -% \end{macrocode} -% -% \begin{macrocode} - \caption@CheckCommand\@caption{% - % rlbabel.def [2005/03/30 v2.3h Right-to-Left support from the babel system Hebrew language support from the babel system] - \long\def\@caption#1[#2]#3{% - \par - \addcontentsline{\csname ext@#1\endcsname}{#1}% - {\protect\numberline{\csname the#1\endcsname}% - {\ignorespaces #2}}% - \def\@fignm{figure} - \ifx#1\@fignm\addcontentsline{fol}{#1}% - {\protect\numberline{\csname the#1\endcsname}% - {\ignorespaces #2}}\fi% - \def\@tblnm{table} - \ifx#1\@tblnm\addcontentsline{tol}{#1}% - {\protect\numberline{\csname the#1\endcsname}% - {\ignorespaces #2}}\fi% - \begingroup - \@parboxrestore - \if@minipage - \@setminipage - \fi - \normalsize - \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}\par - \endgroup}}% -% \end{macrocode} -% -% \begin{macrocode} - \caption@CheckCommand\@caption{% - % magyar.ldf [2005/03/30 v1.4j Magyar support from the babel system] - \long\def\@caption#1[#2]#3{% - \csname par\endcsname - \addcontentsline{\csname ext@#1\endcsname}{#1}% - {\protect\numberline{\csname the#1\endcsname.}{\ignorespaces #2}}% - \begingroup - \@parboxrestore - \if@minipage - \@setminipage - \fi - \normalsize - \@makecaption{\csname fnum@#1\endcsname}% - {\ignorespaces #3}\csname par\endcsname - \endgroup}}% -% \end{macrocode} -% -% \begin{macrocode} -% \caption@CheckCommand\float@caption{% -% % float.sty [2001/11/08 v1.3d Float enhancements (AL)] -% \long\def\float@caption#1[#2]#3{% -% \addcontentsline{\@nameuse{ext@#1}}{#1}% -% {\protect\numberline{\@nameuse{the#1}}{\ignorespaces #2}} -% \global\setbox\@floatcapt\vbox\bgroup\@parboxrestore -% \normalsize\@fs@capt{\@nameuse{fnum@#1}}{\ignorespaces #3}% -% \@ifnextchar[{\float@ccon}{\egroup}}% -% \long\def\float@ccon[#1]{#1\par\egroup}}% -% \end{macrocode} -% -% \begin{macrocode} - \caption@CheckCommand\@caption{% - % hyperref.sty [2007/02/27 v6.75t Hypertext links for LaTeX] - \long\def\@caption#1[#2]#3{% - \hyper@makecurrent{\@captype}% - \def\@currentlabelname{#2}% - \par\addcontentsline{\csname ext@#1\endcsname}{#1}{% - \protect\numberline{\csname the#1\endcsname}{\ignorespaces #2}% - }% - \begingroup - \@parboxrestore - \if@minipage - \@setminipage - \fi - \normalsize - \@makecaption{\csname fnum@#1\endcsname}{% - \ignorespaces - \ifHy@nesting - \hyper@@anchor{\@currentHref}{#3}% - \else - \Hy@raisedlink{\hyper@@anchor{\@currentHref}{\relax}}#3% - \fi - }% - \par - \endgroup - }}% -% \end{macrocode} -% \begin{macrocode} - \caption@CheckCommand\@caption{% - % hyperref.sty [2007/04/09 v6.76a Hypertext links for LaTeX] - % hyperref.sty [2007/06/12 v6.76h Hypertext links for LaTeX] - % hyperref.sty [2007/08/05 v6.76j Hypertext links for LaTeX] - \long\def\@caption#1[#2]#3{% - \expandafter\ifx\csname if@capstart\expandafter\endcsname - \csname iftrue\endcsname - \global\let\@currentHref\hc@currentHref - \else - \hyper@makecurrent{\@captype}% - \fi - \def\@currentlabelname{#2}% - \par\addcontentsline{\csname ext@#1\endcsname}{#1}{% - \protect\numberline{\csname the#1\endcsname}{\ignorespaces #2}% - }% - \begingroup - \@parboxrestore - \if@minipage - \@setminipage - \fi - \normalsize - \expandafter\ifx\csname if@capstart\expandafter\endcsname - \csname iftrue\endcsname - \global\@capstartfalse - \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces#3}% - \else - \@makecaption{\csname fnum@#1\endcsname}{% - \ignorespaces - \ifHy@nesting - \hyper@@anchor{\@currentHref}{#3}% - \else - \Hy@raisedlink{\hyper@@anchor{\@currentHref}{\relax}}#3% - \fi - }% - \fi - \par - \endgroup - }}% -% \end{macrocode} -% \begin{macrocode} - \caption@CheckCommand\@caption{% - % hyperref.sty [2009/11/27 v6.79k Hypertext links for LaTeX] - \long\def\@caption#1[#2]#3{% - \expandafter\ifx\csname if@capstart\expandafter\endcsname - \csname iftrue\endcsname - \global\let\@currentHref\hc@currentHref - \else - \hyper@makecurrent{\@captype}% - \fi - \def\@currentlabelname{#2}% - \par\addcontentsline{\csname ext@#1\endcsname}{#1}{% - \protect\numberline{\csname the#1\endcsname}{\ignorespaces #2}% - }% - \begingroup - \@parboxrestore - \if@minipage - \@setminipage - \fi - \normalsize - \expandafter\ifx\csname if@capstart\expandafter\endcsname - \csname iftrue\endcsname - \global\@capstartfalse - \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces#3}% - \else - \@makecaption{\csname fnum@#1\endcsname}{% - \ignorespaces - \ifHy@nesting - \expandafter\hyper@@anchor\expandafter{\@currentHref}{#3}% - \else - \Hy@raisedlink{% - \expandafter\hyper@@anchor\expandafter{\@currentHref}{\relax}% - }% - #3% - \fi - }% - \fi - \par - \endgroup - }}% -% \end{macrocode} -% \begin{macrocode} - \caption@CheckCommand\@caption{% - % hyperref.sty [2009/12/09 v6.79m Hypertext links for LaTeX] - % hyperref.sty [2009/12/28 v6.79z Hypertext links for LaTeX] - \long\def\@caption#1[#2]#3{% - \expandafter\ifx\csname if@capstart\expandafter\endcsname - \csname iftrue\endcsname - \global\let\@currentHref\hc@currentHref - \else - \hyper@makecurrent{\@captype}% - \fi - \@ifundefined{NR@gettitle}{% - \def\@currentlabelname{#2}% - }{% - \NR@gettitle{#2}% - }% - \par\addcontentsline{\csname ext@#1\endcsname}{#1}{% - \protect\numberline{\csname the#1\endcsname}{\ignorespaces #2}% - }% - \begingroup - \@parboxrestore - \if@minipage - \@setminipage - \fi - \normalsize - \expandafter\ifx\csname if@capstart\expandafter\endcsname - \csname iftrue\endcsname - \global\@capstartfalse - \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces#3}% - \else - \@makecaption{\csname fnum@#1\endcsname}{% - \ignorespaces - \ifHy@nesting - \expandafter\hyper@@anchor\expandafter{\@currentHref}{#3}% - \else - \Hy@raisedlink{% - \expandafter\hyper@@anchor\expandafter{% - \@currentHref - }{\relax}% - }% - #3% - \fi - }% - \fi - \par - \endgroup - }}% -% \end{macrocode} -% -% \begin{macrocode} - \caption@CheckCommand\@caption{% - % nameref.sty [2006/12/27 v2.28 Cross-referencing by name of section] - \long\def\@caption#1[#2]{% - \def\@currentlabelname{#2}% - \NR@@caption{#1}[{#2}]% - }}% -% \end{macrocode} -% \begin{macrocode} - \caption@CheckCommand\@caption{% - % nameref.sty [2009/11/27 v2.32 Cross-referencing by name of section] - \long\def\@caption#1[#2]{% - \NR@gettitle{#2}% - \NR@@caption{#1}[{#2}]% - }}% -% \end{macrocode} -% -% \begin{macrocode} - \caption@CheckCommand\@caption{% - % subfigure.sty [2002/07/30 v2.1.4 subfigure package] - \long\def\@caption#1[#2]#3{% - \@ifundefined{if#1topcap}% - {\subfig@oldcaption{#1}[{#2}]{#3}}% - {\@nameuse{if#1topcap}% - \@listsubcaptions{#1}% - \subfig@oldcaption{#1}[{#2}]{#3}% - \else - \subfig@oldcaption{#1}[{#2}]{#3}% - \@listsubcaptions{#1}% - \fi}}}% -% \end{macrocode} -% -% \begin{macrocode} - \caption@CheckCommand\@caption{% - % subfig.sty [2005/06/28 ver: 1.3 subfig package] - \def\@caption{\caption@}% -% \long\def\caption@#1[#2]#3{% -% \@ifundefined{caption@setfloattype}% -% \caption@settype -% \caption@setfloattype -% \@captype -% \sf@ifpositiontop{% -% \@listsubcaptions{#1}% -% \sf@old@caption{#1}[{#2}]{#3}% -% }{% -% \sf@old@caption{#1}[{#2}]{#3}% -% \@listsubcaptions{#1}% -% }}% - }% -% \end{macrocode} -% -% \begin{macrocode} - \caption@CheckCommand\@caption{% - % chkfloat.sty [2012/08/19 v0.1 chkfloat: check for moved floats] - \def\@caption#1[#2]#3{\chkfloat@caption{#1}[#2]{#3}% - \addtocontents{fof}{\protect\chkfloat@{\thepage}{\chkfloat@page}{\csname fnum@#1\endcsname: #2}}% - }}% -% \end{macrocode} -% \begin{macrocode} - \caption@CheckCommand\@caption{% - % chkfloat.sty [20??/??/?? v0.? chkfloat: check for moved floats] - \def\@caption#1[#2]#3{\chkfloat@caption{#1}[{#2}]{#3}% - \chkfloat@addcontentsline{#1}{#2}% - }}% -% \end{macrocode} -% -% \begin{macrocode} - \caption@IfCheckCommand{}{% - \caption@InfoNoLine{% - Incompatible package detected (regarding \string\@caption).\MessageBreak - \string\@caption\space=\space\meaning\@caption}% - \caption@setbool{incompatible}{1}}% -% \end{macrocode} -% -% The option |compatibility=| will override the compatibility mode. -% \begin{macrocode} - \caption@ifundefined\caption@ifcompatibility - {\let\caption@ifcompatibility\caption@ifincompatible - \let\caption@tempa\caption@WarningNoLine}% - {\let\caption@tempa\@gobble}% suppress warning -% \end{macrocode} -% % \begin{macrocode} \caption@ifcompatibility{% % \end{macrocode} -% % \begin{macrocode} - \caption@tempa{% - \noexpand\caption will not be redefined since it's already\MessageBreak - redefined by a document class or package which is\MessageBreak - unknown to the caption package}% + \caption@InfoNoLine{ + \noexpand\caption will not be redefined since `compatibility' is set to v1}% % \end{macrocode} -% % \begin{macrocode} \renewcommand*\caption@redefine{}% % \end{macrocode} % -% |\ContinuedFloat| is not supported in compatibility mode. +% |\continuedfloat| is not supported in compatibility mode. % \begin{macrocode} - \renewcommand*\caption@ContinuedFloatX[1]{% + \renewcommand*\caption@continuedfloat[1]{% \caption@Error{Not available in compatibility mode}}% % \end{macrocode} % @@ -1544,10 +1101,10 @@ % \begin{macrocode} \caption@AtBeginDocument*{% \let\caption@start\relax - \caption@ifundefined\caption@ORI@capstart{}{% + \caption@ifdefined\caption@ORI@capstart{% \caption@Debug{% Restore hypcap definition of \string\capstart\@gobble}% - \let\capstart\caption@ORI@capstart}% + \let\capstart\caption@ORI@capstart}{}% }% % \end{macrocode} % @@ -1562,22 +1119,12 @@ }{% % \end{macrocode} % -% \begin{macrocode} - \caption@ifincompatible{% - \caption@WarningNoLine{% - Forced redefinition of \noexpand\caption since the\MessageBreak - unsupported(!) package option `compatibility=false'\MessageBreak - was given}% - }{}% -% \end{macrocode} -% % \begin{macro}{\caption} % \begin{macro}{\@caption} % \begin{macrocode} \renewcommand*\caption@redefine{% \let\caption\caption@caption \let\@caption\caption@@caption}% - \caption@redefine % \end{macrocode} % \end{macro} % \end{macro} @@ -1586,6 +1133,7 @@ }% % \end{macrocode} % \begin{macrocode} + \caption@redefine \caption@AtBeginDocument*{% \let\caption@ORI@capstart\@undefined}% % \end{macrocode} @@ -1635,7 +1183,7 @@ % \end{macrocode} % \end{macro} % -% \subsection{\cs{captionof}} +% \section{\cs{captionof}} % % \changes{v3.0d}{2004/08/03}{Option \opt{type=} added} % \changes{v3.1}{2007/06/25}{Option \opt{type*=} added} @@ -1777,8 +1325,7 @@ % Since we often need to check if |\@captype| is defined (means: we % are inside a floating environment) this helper macro was introduced. % \begin{macrocode} -\newcommand*\caption@iftype{% - \caption@ifundefined\@captype\@secondoftwo\@firstoftwo} +\newcommand*\caption@iftype{\caption@ifdefined\@captype} % \end{macrocode} % \end{macro} % @@ -1879,7 +1426,7 @@ % \end{macrocode} % \end{macro} % -% \subsection{\cs{captionlistentry}} +% \section{\cs{captionlistentry}} % % \begin{macro}{\captionlistentry} % \changes{v3.1}{2007/07/28}{This macro added} @@ -1907,7 +1454,7 @@ % \end{macrocode} % \end{macro} % -% \subsection{\cs{captionbox}} +% \section{\cs{captionbox}} % % \begin{macro}{\captionbox} % \changes{v3.2}{2010/12/17}{This macro added} @@ -1975,9 +1522,9 @@ % \end{macrocode} % \end{macro} % -% \subsection{\cs{ContinuedFloat}} +% \section{\cs{continuedfloat}} % -% \begin{macro}{\ContinuedFloat} +% \begin{macro}{\continuedfloat} % \changes{v3.0i}{2005/11/12}{Optional argument added} % \changes{v3.0g}{2005/06/28}{Bugfix: \cs{newcounter} replaced by \cs{newcount}} % \changes{v3.1}{2007/07/02}{Format of \package{hyperref} extension changed} @@ -1987,14 +1534,15 @@ % \changes{v3.3}{2011/12/28}{Uses \cs{ifcaption@ContinuedFloat} now} % \changes{v3.3}{2013/05/01}{Usage of \cs{caption@restorecounters} added} % \changes{v3.3}{2013/12/16}{Bugfix: Does not use \cs{caption@ContinuedFloat} anymore since this breaks \cs{ContinuedFloat} offered by the \package{subfig} package} -% |\ContinuedFloat|\\ -% |\ContinuedFloat*|\par +% \changes{v3.4}{2015/09/16}{Renamed from \cs{ContinuedFloat} to \cs{continuedfloat}} +% |\continuedfloat|\\ +% |\continuedfloat*|\par % This mainly sets the appropriate flag, increments the % continuation counter, and executes the given options. -% Furthermore we set |\caption@reset|\-|Continued|\-|Float| to |\@gobble| so the +% Furthermore we set |\caption@reset|\-|continued|\-|float| to |\@gobble| so the % continuation counter will not be reset to zero inside |\caption@ref|\-|step|\-|counter|.\par % When the \package{hyperref} package is used we have the problem -% that the usage of |\Continued|\-|Float| will create duplicate +% that the usage of |\continued|\-|float| will create duplicate % hyper links -- |\@current|\-|Href| will be the same for the main float and % the continued ones. So we have to make sure unique labels and references % will be created each time. We do this by extending |\the|\-|H|\-|figure| and @@ -2006,57 +1554,80 @@ % \Note{This does not help if the \package{hyperref} package option % \texttt{naturalnames=true} is set.} % \begin{macrocode} -\def\ContinuedFloat{% +\def\continuedfloat{% \caption@iftype - {\caption@ContinuedFloatX\@captype}% - {\caption@Error{\noexpand\ContinuedFloat outside float}}} + {\caption@continuedfloat\@captype}% + {\caption@Error{\noexpand\continuedfloat outside float}}} % \end{macrocode} % \begin{macrocode} -\newcommand*\caption@ContinuedFloatX[1]{% +\newcommand*\caption@continuedfloat[1]{% \@ifstar {\caption@@refstepcounter\@captype - \caption@@ContinuedFloat{#1}}% - {\caption@Continued@Float{#1}}} + \caption@@continuedfloat{#1}}% + {\caption@continued@float{#1}}} % \end{macrocode} % \begin{macrocode} -\newcommand*\caption@Continued@Float[1]{% +\newcommand*\caption@continued@float[1]{% \edef\caption@tempa{#1}% \ifx\caption@tempa\caption@CFtype \caption@restorecounters - \caption@@ContinuedFloat{#1}% + \caption@@continuedfloat{#1}% \else \caption@Error{Continued `#1' after `\caption@CFtype'}% \fi} % \end{macrocode} % \begin{macrocode} -\newcommand*\caption@@ContinuedFloat{% - \caption@setflag1% ContinuedFloat - \caption@@@ContinuedFloat} -\newcommand*\caption@@@ContinuedFloat{% - \stepcounter{ContinuedFloat}% - \caption@@@@ContinuedFloat} +\newcommand*\caption@@continuedfloat{% + \caption@setflag1% continued float + \caption@@@continuedfloat} +\newcommand*\caption@@@continuedfloat{% + \stepcounter{continuedfloat}% + \caption@@@@continuedfloat} % \end{macrocode} % \begin{macrocode} -\newcommand*\caption@@@@ContinuedFloat[1]{% - \caption@setoptions{ContinuedFloat}% +\newcommand*\caption@@@@continuedfloat[1]{% + \caption@setoptions{ContinuedFloat}% for compatibility reasons + \caption@setoptions{continuedfloat}% \caption@setoptions{continued#1}% - \expandafter\l@addto@macro\csname the#1\endcsname\theContinuedFloat + \expandafter\l@addto@macro\csname the#1\endcsname\thecontinuedfloat \@ifundefined{theH#1}{}{% \expandafter\l@addto@macro\csname theH#1\endcsname{% - \@alph\c@ContinuedFloat}}% - \let\caption@@@@ContinuedFloat\@gobble} + \@alph\c@continuedfloat}}% + \let\caption@@@@continuedfloat\@gobble} % \end{macrocode} % \begin{macrocode} \newcommand*\caption@CFtype{??} % \end{macrocode} % \end{macro} % -% \begin{macro}{\theContinuedFloat} +% \begin{macro}{\thecontinuedfloat} +% \changes{v3.4}{2015/09/16}{Renamed from \cs{theContinuedFloat} to \cs{thecontinuedfloat}} % This one is preset to \cs{@empty}, so usually the continuation counter is not % included in the caption label or references. % \begin{macrocode} -\newcounter{ContinuedFloat} -\let\theContinuedFloat\@empty +\newcounter{continuedfloat} +\let\c@ContinuedFloat\c@continuedfloat % defined for compatibility reasons +\def\thecontinuedfloat{\theContinuedFloat} +\let\theContinuedFloat\@empty % defined for compatibility reasons +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\caption@reset@continuedfloat} +% \changes{v3.2f}{2011/12/17}{Redefinition of \cs{continuedfloat} added} +% |\caption@reset@continuedfloat|\marg{type}\par +% If a continuation counter is defined, we reset it. +% (This one will be called inside |\@caption|.) +% \begin{macrocode} +\newcommand*\caption@reset@continuedfloat[1]{% + \xdef\caption@CFtype{#1}% + \@stpelt{continuedfloat}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\ContinuedFloat} +% For compatibility reasons we still support |\Continued|\-|Float|. +% \begin{macrocode} +\def\ContinuedFloat{\continuedfloat} % defined for compatibility reasons % \end{macrocode} % \end{macro} % @@ -2067,20 +1638,8 @@ % This one is used by \cs{ContinuedFloat} offered by the \package{subfig} package. % \begin{macrocode} \def\caption@ContinuedFloat{% - \let\caption@resetContinuedFloat\@gobble - \caption@@@ContinuedFloat} -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\caption@resetContinuedFloat} -% \changes{v3.2f}{2011/12/17}{Redefinition of \cs{ContinuedFloat} added} -% |\caption@resetContinuedFloat|\marg{type}\par -% If a continuation counter is defined, we reset it. -% (This one will be called inside |\@caption|.) -% \begin{macrocode} -\newcommand*\caption@resetContinuedFloat[1]{% - \xdef\caption@CFtype{#1}% - \@stpelt{ContinuedFloat}} + \let\caption@reset@continuedfloat\@gobble + \caption@@@continuedfloat} % \end{macrocode} % \end{macro} % @@ -2089,14 +1648,14 @@ % counter at |\@float|, right after |\done|\-|main|\-|caption|\-|false|, % we save all sub-caption counters at |\done|\-|main|\-|caption|\-|false| % so we can restore them using |\caption@restore|\-|counters| -% inside |\Continued|\-|Float|. +% inside |\continued|\-|float|. % \begin{macrocode} -\caption@ifundefined\donemaincaptionfalse{}{% - \g@addto@macro\donemaincaptionfalse\caption@savesubcounters} +\caption@ifdefined\donemaincaptionfalse{% + \g@addto@macro\donemaincaptionfalse\caption@savesubcounters}{} % \end{macrocode} % \end{macro} % -% \subsection{Internal helpers} +% \section{Internal helpers} % % \begin{macro}{\caption@refstepcounter} % \changes{v3.1}{2007/07/28}{This macro added} @@ -2129,9 +1688,9 @@ % \end{macrocode} % \begin{macrocode} \newcommand*\caption@ref@stepcounter{% - \caption@ifflag1{% ContinuedFloat + \caption@ifflag1{% continued float \let\caption@tempa\caption@@refcounter - \caption@clrflag1% ContinuedFloat + \caption@clrflag1% continued float }{% \let\caption@tempa\caption@@refstepcounter \caption@ifflag2{}{% caption @@ -2168,7 +1727,7 @@ % \begin{macrocode} \newcommand*\caption@prepare@stepcounter[2]{% \caption@addsubcontentslines{#2stepcounter}% - \caption@resetContinuedFloat{#1}} + \caption@reset@continuedfloat{#1}} % \end{macrocode} % \begin{macrocode} \newcommand*\caption@@@refstepcounter{\refstepcounter} @@ -2207,8 +1766,7 @@ % \changes{v3.0a}{2004/01/23}{\cs{caption@settype} changed to \cs{caption@setfloattype}} % \changes{v3.0e}{2005/04/12}{Check for default label format added} % \changes{v3.0f}{2005/06/11}{Usage of \cs{caption@resetContinuedFloat} added} -% \changes{v3.1}{2007/05/09}{Usage of \cs{caption@setfloattype} \& -% \cs{caption@resetContinuedFloat} removed} +% \changes{v3.1}{2007/05/09}{Usage of \cs{caption@setfloattype} \& \cs{caption@resetContinuedFloat} removed} % \changes{v3.3}{2011/12/29}{Usage of \cs{caption@fixedposition} removed} % Our handling of |\caption| will always be surrounded by % |\caption@begin| (or |\caption@beginex|) and |\caption@end|.\par @@ -2389,13 +1947,13 @@ % This one is needed for support of the \package{nameref} package. % \begin{macrocode} \newcommand\caption@gettitle[1]{% - \caption@ifundefined\NR@gettitle - {\def\@currentlabelname{#1}}% - {\NR@gettitle{#1}}} + \caption@ifdefined\NR@gettitle + {\NR@gettitle{#1}}% + {\def\@currentlabelname{#1}}} % \end{macrocode} % \end{macro} % -% \subsection{Support for sub-captions} +% \section{Support for sub-captions} % \changes{v3.1f}{2007/11/16}{Support for sub-captions added} % % \begin{macro}{\caption@DeclareSubType} @@ -2417,9 +1975,9 @@ % Initialize the sub-captions defined with \cs{newsubfloat}\cite{subfig}\ldots % \begin{macrocode} \caption@AtBeginDocument*{% - \caption@ifundefined\sf@counterlist{}{% + \caption@ifdefined\sf@counterlist{% \@for\sf@temp:=\sf@counterlist\do{% - \expandafter\caption@DeclareSubType\sf@temp\@nil}}} + \expandafter\caption@DeclareSubType\sf@temp\@nil}}{}} % \end{macrocode} % % \begin{macro}{\caption@subtypehook} @@ -2449,7 +2007,7 @@ \let\caption@addsubcontentslines\@gobble \caption@ifflag4{}{% subcaption % no \subcaption in this part of the (floating) environment yet - \caption@ifflag1{% ContinuedFloat + \caption@ifflag1{% continued float \caption@clrflag1% }{% \caption@@stepcounter\@captype @@ -2459,7 +2017,7 @@ }% % \end{macrocode} % \begin{macrocode} - \c@ContinuedFloat=0\relax + \c@continuedfloat=0\relax \let\caption@setfloatcapt\@firstofone \let\caption@chkfloat\@gobbletwo % \end{macrocode} @@ -2474,7 +2032,7 @@ % redefine \setcaptiontype \def\caption@settype{\caption@withoptargs\caption@sub@settype}% \def\caption@sub@settype##1##2{% - \def\caption@tempa{##2}% + \edef\caption@tempa{##2}% \ifx\caption@tempa\@captype %%% \caption@setsubtype##1\relax \else @@ -2608,36 +2166,41 @@ % We do this |\At|\-|Begin|\-|Document| so packages like \package{newfloat} % will not complain about an unknown document class. % \begin{macrocode} -\AtBeginDocument{\caption@ifundefined\chapter{}{% - \let\caption@chapter@ORI\chapter - \def\chapter{% - \caption@addsubcontentslines{chapter}\caption@chapter@ORI}}} +\AtBeginDocument{% +% \end{macrocode} +% \begin{macrocode} + \caption@ifdefined\chapter{% + \let\caption@chapter@ORI\chapter + \def\chapter{% + \caption@addsubcontentslines{chapter}\caption@chapter@ORI}}{}% % \end{macrocode} % Same for \cs{appendix}. % \begin{macrocode} -\AtBeginDocument{\caption@ifundefined\appendix{}{% - \let\caption@appendix@ORI\appendix - \def\appendix{% - \caption@addsubcontentslines{appendix}\caption@appendix@ORI}}} + \caption@ifdefined\appendix{% + \let\caption@appendix@ORI\appendix + \def\appendix{% + \caption@addsubcontentslines{appendix}\caption@appendix@ORI}}{}% % \end{macrocode} % Flush the list of pending sub-caption list entries at the end of the document. % \begin{macrocode} -\AtEndDocument{% - \caption@addsubcontentslines{AtEndDocument}} + \caption@addsubcontentslines{AtEndDocument}% +% \end{macrocode} +% \begin{macrocode} +} % \end{macrocode} % \end{macro} % % -% \subsection{Document class \& Babel package support} +% \section{Document class \& Babel package support} % -% \subsubsection{The \AmS{} \& \SmF{} classes} +% \subsection{The \AmS{} \& \SmF{} classes} % \changes{v3.1}{2007/07/29}{\AmS\ \& \SmF\ classes support added} % % \begin{macrocode} -\caption@ifundefined\smf@makecaption{}{\let\smf@makecaption\@makecaption} +\caption@ifdefined\smf@makecaption{\let\smf@makecaption\@makecaption}{} % \end{macrocode} % -% \subsubsection{The beamer class} +% \subsection{The beamer class} % \changes{v3.1}{2007/03/10}{beamer class support added} % % \begin{macrocode} @@ -2658,9 +2221,10 @@ % \begin{macro}{\table} % \changes{v3.1f}{2007/12/17}{This re-definition for \class{beamer} document class added} % \changes{v3.3d}{2019/09/01}{This re-definition for \class{beamer} document class revised} +% \changes{v3.4a}{2019/10/18}{Bug fixed which was introduced in previous revision} % We redefine |table| so our type-specific options will be used etc. % \begin{macrocode} - \let\caption@ORI@table\figure + \let\caption@ORI@table\table \def\table{\caption@settype{table}\caption@ORI@table} % \end{macrocode} % \end{macro} @@ -2669,18 +2233,18 @@ }{} % \end{macrocode} % -% \subsubsection{The \KOMAScript{} classes} +% \subsection{The \KOMAScript{} classes} % % \KOMAScript\ contains the code % |\AtBeginDocument{\let\scr@caption\caption}| % so we need to update |\scr@caption| here, too. % % \begin{macrocode} -\caption@ifundefined\scr@caption{}{% - \caption@AtBeginDocument{\let\scr@caption\caption}} +\caption@ifdefined\scr@caption{% + \caption@AtBeginDocument{\let\scr@caption\caption}}{} % \end{macrocode} % -% \subsubsection{The frenchb Babel option} +% \subsection{The frenchb Babel option} % \changes{v3.1}{2006/05/14}{Adaptation to \package{frenchb} added} % % Suppress @@ -2691,11 +2255,11 @@ \@nameuse{caption@frenchb}\@nameundef{caption@frenchb} % \end{macrocode} % -% \subsubsection{The frenchle/pro package} +% \subsection{The frenchle/pro package} % \changes{v3.0h}{2005/10/03}{Adaptation to \package{frenchle/pro} added} % % \begin{macrocode} -\caption@AtBeginDocument{\caption@ifundefined\frenchTeXmods{}{% +\caption@AtBeginDocument{\caption@ifdefined\frenchTeXmods{% \caption@InfoNoLine{frenchle/pro package is loaded}% % \end{macrocode} % @@ -2709,9 +2273,9 @@ % captions have already been done, so we can do our patches immediately. % Otherwise we must add our stuff to |\GOfrench|. % \begin{macrocode} - \caption@ifundefined\GOfrench - {\let\caption@tempa\@firstofone}% + \caption@ifdefined\GOfrench {\def\caption@tempa{\g@addto@macro\GOfrench}}% + {\let\caption@tempa\@firstofone}% \caption@tempa{% % \end{macrocode} % @@ -2768,10 +2332,10 @@ % % \begin{macrocode} }% -}} +}{}} % \end{macrocode} % -% \subsubsection{The hungarian and magyar Babel option} +% \subsection{The hungarian and magyar Babel option} % \changes{v3.2}{2009/03/29}{\package{magyar} package support added} % \changes{v3.3}{2018/08/26}{\package{magyar} package support revised} % @@ -2792,7 +2356,7 @@ \caption@tempa{magyar}% % \end{macrocode} % -% \subsection{Package support} +% \section{Package support} % \changes{v3.1}{2007/04/11}{Package options `float', `longtable' etc. % are not supported anymore, removed} % @@ -2881,10 +2445,10 @@ % Used by the \package{bicaption} package. % \begin{macrocode} \newcommand*\caption@freeze{% - \let\caption@frozen@ContinuedFloat\ContinuedFloat - \def\ContinuedFloat{% - \caption@@freeze{\caption@@@@ContinuedFloat\@captype}% - \caption@frozen@ContinuedFloat}% + \let\caption@frozen@continuedfloat\continuedfloat + \def\continuedfloat{% + \caption@@freeze{\caption@@@@continuedfloat\@captype}% + \caption@frozen@continuedfloat}% % \end{macrocode} % \begin{macrocode} \let\caption@frozen@setup\caption@setup @@ -2930,7 +2494,7 @@ % \end{macrocode} % \begin{macrocode} \def\caption@warmup{% - \let\ContinuedFloat\caption@frozen@ContinuedFloat + \let\continuedfloat\caption@frozen@continuedfloat \let\caption@setup\caption@frozen@setup \let\caption\caption@frozen@caption \let\label\caption@frozen@label}}% @@ -2976,7 +2540,7 @@ % \end{macrocode} % \end{macro} % -% \subsubsection{The chkfloat package} +% \subsection{The chkfloat package} % \changes{v3.3}{2018/09/06}{Support of the \package{chkfloat} package added} % % \begin{macrocode} @@ -2986,12 +2550,13 @@ % \begin{macro}{\caption@chkfloat} % \changes{v3.3}{2018/09/06}{This macro added} % \begin{macrocode} - \caption@ifundefined\chkfloat@addcontentsline{% - \renewcommand\caption@chkfloat[2]{% - \caption@ifundefined\chkfloat@page{}{% - \addtocontents{fof}{\protect\chkfloat@{\thepage}{\chkfloat@page}{\csname fnum@#1\endcsname: #2}}}}% - }{% + \caption@ifdefined\chkfloat@addcontentsline{% \renewcommand\caption@chkfloat{\chkfloat@addcontentsline}% + }{% + \renewcommand\caption@chkfloat[2]{% + \caption@ifdefined\chkfloat@page{% + \addtocontents{fof}{\protect\chkfloat@{\thepage}{\chkfloat@page}{\csname fnum@#1\endcsname: #2}}% + }{}}% }% % \end{macrocode} % \end{macro} @@ -3000,7 +2565,7 @@ }{}% % \end{macrocode} % -% \subsubsection{The float package} +% \subsection{The float package} % \changes{v3.0f}{2005/05/31}{\package{float} package support rewritten and improved} % \iffalse % (This is a more straight-ahead implementation, but it only works with v1.3 @@ -3098,9 +2663,9 @@ % If it was redefined by the \package{hyperref} package, % we need to build on the original definition (and not on the redefined one). % \begin{macrocode} - \caption@ifundefined\HyOrg@float@makebox - {\let\caption@ORI@float@makebox\float@makebox}% + \caption@ifdefined\HyOrg@float@makebox {\let\caption@ORI@float@makebox\HyOrg@float@makebox}% + {\let\caption@ORI@float@makebox\float@makebox}% \renewcommand\float@makebox[1]{% \caption@ORI@float@makebox{#1\relax \caption@defrostHref}}% % \end{macrocode} @@ -3230,7 +2795,7 @@ \caption@undefbool{ruled} % \end{macrocode} % -% \subsubsection{The floatflt package} +% \subsection{The floatflt package} % \changes{v3.1}{2007/06/10}{Support of the \package{floatflt} package added} % % \begin{macrocode} @@ -3282,7 +2847,7 @@ }{} % \end{macrocode} % -% \subsubsection{The fltpage package} +% \subsection{The fltpage package} % \changes{v3.1}{2007/07/22}{Support of the \package{fltpage} package added} % % \begin{macrocode} @@ -3432,7 +2997,7 @@ } % \end{macrocode} % -% \subsubsection{The hyperref package} +% \subsection{The hyperref package} % \changes{v3.0f}{2005/06/11}{Support of the \package{hyperref} package added} % \changes{v3.1}{2007/03/09}{Usage of \cs{hyper@makecurrent} instead of % \cs{theHfigure} as indicator for \package{hyperref} package} @@ -3559,7 +3124,7 @@ % instead of \texttt{xxx} now} % |\caption@makestart|\marg{type} % defines a \package{hyperref} anchor inside |\caption@start|.\par -% Since we offer |\ContinuedFloat| the float counter can change between +% Since we offer |\continuedfloat| the float counter can change between % `now' and |\caption|, i.e., we simply don't know the figure or table counter % yet and therefore we are not able to generate the `right' \package{hyperref} % label. @@ -3706,7 +3271,7 @@ }}{} % \end{macrocode} % -% \subsubsection{The hypcap package} +% \subsection{The hypcap package} % \changes{v3.0f}{2005/06/22}{Support of the \package{hypcap} package added} % \changes{v3.0l}{2007/02/20}{Adapted to \package{hypcap} \version{1.6}} % \changes{v3.1e}{2007/11/04}{\package{hypcap} support adapted to \package{hyperref} \version{6.77}} @@ -3750,7 +3315,7 @@ \fi}{} % \end{macrocode} % -% \subsubsection{The listings package} +% \subsection{The listings package} % \changes{v3.0b}{2004/05/16}{Support of the \package{listings} package added} % % \begin{macrocode} @@ -3844,7 +3409,7 @@ }{} % \end{macrocode} % -% \subsubsection{The longtable package} +% \subsection{The longtable package} % % \begin{macro}{\LTcaptype} % \changes{v3.1}{2007/07/06}{This macro and its support added} @@ -3903,7 +3468,7 @@ \@ifstar{\egroup\LT@listentry\LTcaptype}% gobble * {\egroup\LT@listentry\LTcaptype}}% % \end{macrocode} -% |\ContinuedFloat| for longtable:\\ +% |\continuedfloat| for longtable:\\ % {\small(Commented out, since it's not deeply tested and quite useless anyway)} % \Note{\package{hyperref} versions $<$ v6.76j uses $2\times$ \cs{hyper@makecurrent}} % \begin{macrocode} @@ -3917,24 +3482,24 @@ % \def\hyper@makecurrent####1{% %% \let\@currentHlabel\Hy@LT@currentHlabel % \let\@currentHref\Hy@LT@currentHref}}% -% \let\caption@ORI@ContinuedFloat\ContinuedFloat -% \def\ContinuedFloat{\noalign{% +% \let\caption@ORI@continuedfloat\continuedfloat +% \def\continuedfloat{\noalign{% % \gdef\caption@setContinuedFloat{% -% \let\caption@resetContinuedFloat\@gobble}% +% \let\caption@reset@continuedfloat\@gobble}% % \def\caption@setoptions####1{% % \g@addto@macro\caption@setContinuedFloat{% % \caption@setoptions{####1}}}% % \let\@captype\LTcaptype % \caption@ORI@ContinuedFloat}}% % }{% -% \def\ContinuedFloat{\noalign{% +% \def\continuedfloat{\noalign{% % \caption@Error{% -% \noexpand\ContinuedFloat inside longtables\MessageBreak +% \noexpand\continuedfloat inside longtables\MessageBreak % is only available with `hypcap=true'}}}% % }% % \global\let\caption@setContinuedFloat\@empty - \def\ContinuedFloat{\noalign{% - \caption@Error{\noexpand\ContinuedFloat outside float}}}% + \def\continuedfloat{\noalign{% + \caption@Error{\noexpand\continuedfloat outside float}}}% % \end{macrocode} % |\bicaption| for longtable: % \begin{macrocode} @@ -4049,8 +3614,8 @@ % so we supress this skip if the \package{floatrow} package is loaded. % (This fixes \issue{50}) % \begin{macrocode} - \caption@ifundefined\FBifcaptop{}{% - \let\caption@belowskip\@empty}% + \caption@ifdefined\FBifcaptop{% + \let\caption@belowskip\@empty}{}% % \end{macrocode} % % The following code should look familiar. We do our skips and use @@ -4113,7 +3678,7 @@ % \end{macrocode} % \end{macro} % -% \subsubsection{The picinpar package} +% \subsection{The picinpar package} % \changes{v3.1}{2007/06/13}{Support of the \package{picinpar} package added} % % \begin{macrocode} @@ -4197,7 +3762,7 @@ }{} % \end{macrocode} % -% \subsubsection{The picins package} +% \subsection{The picins package} % \changes{v3.0j}{2006/01/26}{Support of the \package{picins} package added} % % \begin{macro}{\piccaptiontype} @@ -4334,7 +3899,7 @@ } % \end{macrocode} % -% \subsubsection{The rotating package} +% \subsection{The rotating package} % % \begin{macrocode} \caption@IfPackageLoaded{rotating}[1995/08/22 v2.10]{% @@ -4398,7 +3963,7 @@ }{} % \end{macrocode} % -% \subsubsection{The sidecap package} +% \subsection{The sidecap package} % % \begin{macrocode} \caption@IfPackageLoaded{sidecap}[2003/06/06 v1.6f]{% @@ -4497,7 +4062,7 @@ }{} % \end{macrocode} % -% \subsubsection{The subfigure package} +% \subsection{The subfigure package} % \changes{v3.1}{2007/04/06}{subfigure package support added} % % \begin{macrocode} @@ -4535,7 +4100,7 @@ }{} % \end{macrocode} % -% \subsubsection{The supertabular and xtab packages} +% \subsection{The supertabular and xtab packages} % % \begin{macrocode} \caption@IfPackageLoaded{supertabular}[2002/07/19 v4.1e]{% @@ -4678,7 +4243,7 @@ }{} % \end{macrocode} % -% \subsubsection{The threeparttable package} +% \subsection{The threeparttable package} % \changes{v3.1}{2007/05/08}{Support of the \package{threeparttable} package added} % % \begin{macrocode} @@ -4748,7 +4313,7 @@ }{} % \end{macrocode} % -% \subsubsection{The wrapfig package} +% \subsection{The wrapfig package} % \changes{v3.1}{2007/05/05}{Support of the \package{wrapfig} package added} % \changes{v3.2d}{2011/11/02}{Support of the \package{wrapfig} package rewritten} % diff --git a/macros/latex/contrib/caption/caption.ins b/macros/latex/contrib/caption/caption.ins index 21368b1850..45381b8402 100644 --- a/macros/latex/contrib/caption/caption.ins +++ b/macros/latex/contrib/caption/caption.ins @@ -25,16 +25,13 @@ This work has the LPPL maintenance status "maintained". This Current Maintainer of this work is Axel Sommerfeldt. This work consists of the files - CHANGELOG, README, SUMMARY, caption.ins, - caption.dtx, caption2.dtx, caption3.dtx, - bicaption.dtx, ltcaption.dtx, subcaption.dtx, - newfloat.dtx, and totalcount.dtx + caption.ins, caption.dtx, caption2.dtx, caption3.dtx, + bicaption.dtx, ltcaption.dtx, subcaption.dtx, totalcount.dtx, the derived files caption.sty, caption2.sty, caption3.sty, - bicaption.sty, ltcaption.sty, subcaption.sty, - newfloat.sty, and totalcount.sty + bicaption.sty, ltcaption.sty, subcaption.sty, totalcount.sty, and the user manuals - caption-deu.tex, caption-eng.tex, and caption-rus.tex. + caption-deu.tex, caption-eng.tex, caption-rus.tex. \endpreamble @@ -44,7 +41,6 @@ and the user manuals \generate{\file{bicaption.sty}{\from{bicaption.dtx}{package}}} \generate{\file{ltcaption.sty}{\from{ltcaption.dtx}{package}}} \generate{\file{subcaption.sty}{\from{subcaption.dtx}{package}}} -\generate{\file{newfloat.sty}{\from{newfloat.dtx}{package}}} \generate{\file{totalcount.sty}{\from{totalcount.dtx}{package}}} \Msg{***********************************************************} @@ -52,8 +48,7 @@ and the user manuals \Msg{* To finish the installation you have to move the files} \Msg{* `caption.sty', `caption2.sty', 'caption3.sty',} \Msg{* `bicaption.sty', `ltcaption.sty', `subcaption.sty',} -\Msg{* `newfloat.sty', and `totalcount.sty'} -\Msg{* into a directory searched by TeX.} +\Msg{* and `totalcount.sty' into a directory searched by TeX.} \Msg{*} \Msg{* To produce the documentation run the file} \Msg{* `caption-eng.tex' (English version) or `caption-rus.tex'} diff --git a/macros/latex/contrib/caption/caption3.dtx b/macros/latex/contrib/caption/caption3.dtx index bdffdcc66a..59e24f0fc1 100644 --- a/macros/latex/contrib/caption/caption3.dtx +++ b/macros/latex/contrib/caption/caption3.dtx @@ -25,7 +25,7 @@ % and the user manuals caption-deu.tex, caption-eng.tex, and caption-rus.tex. % % \fi -% \CheckSum{3961} +% \CheckSum{3418} % % \iffalse %<*driver> @@ -38,9 +38,6 @@ \setlength\parindent{0pt} \setlength\parskip{\smallskipamount} % -%\let\ORIsubsection\subsection -%\def\subsection{\clearpage\ORIsubsection} -% \makeatletter % make room for subsections like 2.16.14 in the TOC %\newcommand*\l@subsection{\@dottedtocline{2}{1.5em}{2.3em}} \renewcommand*\l@subsection{\@dottedtocline{2}{1.5em}{2.7em}} @@ -57,11 +54,8 @@ \ifpdf\usepackage{hypdestopt}\fi \hypersetup{pdfkeywords={LaTeX, package, caption},pdfstartpage={},pdfstartview={}} % -\usepackage[debug]{caption3}[2018/05/01] +\usepackage{caption3}[2019/09/09] % -\DeclareRobustCommand*\eTeX{\texorpdfstring - {\leavevmode\hbox{$\varepsilon$}-\TeX}% - {e-TeX}} \DeclareRobustCommand*\AmS{\texorpdfstring {{\protect\usefont{OMS}{cmsy}{m}{n}A\kern-.1667em\lower.5ex\hbox{M}\kern-.125emS}}% {AMS}} @@ -90,8 +84,6 @@ % \newcommand*\csoarg[1]{\texttt{\char`\[#1\char`\]}} % \newcommand*\version[2][]{\textit{v#2}} % -% \GetFileInfo{caption3.drv} -% \let\docdate\filedate % \GetFileInfo{caption3.sty} % % \title{The Implementation of @@ -100,7 +92,7 @@ % {the caption kernel}} % \author{Axel Sommerfeldt\\ % \url{https://gitlab.com/axelsommerfeldt/caption}} -% \date{\docdate} +% \date{\filedate} % \maketitle % % \begin{abstract} @@ -187,25 +179,23 @@ % \fi % % \clearpage -% \let\subsubsection\subsection -% \let\subsection\section % % \iffalse %<*package> % \fi % -% \subsection{Identification} +% \section{Identification} % % \begin{macrocode} \NeedsTeXFormat{LaTeX2e}[1994/12/01] -\ProvidesPackage{caption3}[2019/09/01 v1.8d caption3 kernel (AR)] +\ProvidesPackage{caption3}[2019/09/09 v1.8e caption3 kernel (AR)] % \end{macrocode} % -% \subsection{Workaround for bug in package \package{arabtex}} +% \section{Workaround for bug in package \package{arabtex}} % \package{arabtex} re-defines \cs{@gobble} as not-long so the packages of the % \package{caption} package bundle are doomed to fail. % Since this fatal bug won't be fixed in \package{arabtex} but we are dependent on a -% proper definition of \cs{@gobble}, \cs{@firstofone}, \cs{@firstoftwo}, \cs{@secondoftwo} +% proper definition of \cs{@gobble}, \cs{@firstofone}, \cs{@firstoftwo}, \cs{@secondoftwo}, % and so on we fix this here. (Sigh!) % \begin{macrocode} \providecommand\caption@FixArabTeX{% @@ -223,7 +213,7 @@ \let\caption@FixArabTeX\@undefined} % \end{macrocode} % -% \subsection{Generic helpers} +% \section{Generic helpers} % % \begin{macro}{\@nameundef} % This is the opposite to |\@namedef| which is offered by the \LaTeX\ kernel. @@ -286,8 +276,8 @@ % \begin{macro}{\caption@ifundefined} % \changes{v1.3a}{2011/08/12}{This macro added} % \changes{v1.3b}{2011/08/18}{Made expandable} -% Similar to \cs{@ifundefined} offered by the \LaTeX kernel, but does -% not define the undefined macro as \cs{relax}. +% Similar to \cs{@ifundefined} offered by the \LaTeX kernel, +% but takes a macro as argument instead of a macro name. % \begin{macrocode} \newcommand*\caption@ifundefined[1]{% \ifx#1\@undefined @@ -300,6 +290,22 @@ % \end{macrocode} % \end{macro} % +% \begin{macro}{\caption@ifdefined} +% \changes{v1.8e}{2018/05/11}{This macro added} +% Similar to \cs{@ifundefined} offered by the \LaTeX kernel, +% but takes a macro as argument instead of a macro name. +% \begin{macrocode} +\newcommand*\caption@ifdefined[1]{% + \ifx#1\@undefined + \expandafter\@secondoftwo + \else\ifx#1\relax + \expandafter\expandafter\expandafter\@secondoftwo + \else + \expandafter\expandafter\expandafter\@firstoftwo + \fi\fi} +% \end{macrocode} +% \end{macro} +% % \begin{macro}{\caption@ifinlist} % \changes{v1.1}{2007/07/29}{Rewritten} % This helper macro checks if the first argument is in the comma separated @@ -505,53 +511,6 @@ % \end{macrocode} % \end{macro} % -% \begin{macro}{\caption@CheckCommand} -% \changes{v1.1}{2007/04/10}{This macro added} -% \begin{macro}{\caption@IfCheckCommand} -% \changes{v1.1}{2007/04/10}{This macro added} -% \changes{v1.2b}{2008/08/02}{Revised so \cs{next} is no longer used} -% \changes{v1.5}{2012/08/25}{Bugfix: Uses \cs{caption@tempa} instead of \cs{@tempa}} -% |\caption@CheckCommand|\marg{macro}\marg{definition of macro}\par -% checks if a command already exists, with the same definition. -% It can be used more-than-once to check if one of multiple definitions will -% finally match. -% (It redefines itself later on to |\@gobbletwo| if the two commands match -% fine, making further checks harmless.)\par -% |\caption@IfCheckCommand|\marg{true}\marg{false}\par -% will execute the \meta{true} code if one match was finally given, -% the \meta{false} code otherwise. -% (It simply checks if |\caption@CheckCommand| is |\@gobbletwo| and -% restores the starting definition of |\caption@CheckCommand|.) -% \begin{macrocode} -\newcommand\caption@DoCheckCommand[2]{% - \begingroup - \let\caption@tempa#1% - #2% - \ifx\caption@tempa#1% - \endgroup - \let\caption@CheckCommand\@gobbletwo - \else - \endgroup - \fi} -\@onlypreamble\caption@DoCheckCommand -% \end{macrocode} -% \begin{macrocode} -\let\caption@CheckCommand\caption@DoCheckCommand -\@onlypreamble\caption@CheckCommand -% \end{macrocode} -% \begin{macrocode} -\newcommand*\caption@IfCheckCommand{% - \ifx\caption@CheckCommand\@gobbletwo - \let\caption@CheckCommand\caption@DoCheckCommand - \expandafter\@firstoftwo - \else - \expandafter\@secondoftwo - \fi} -\@onlypreamble\caption@IfCheckCommand -% \end{macrocode} -% \end{macro} -% \end{macro} -% % \begin{macro}{\caption@AtBeginDocument} % \changes{v1.1}{2007/04/13}{This macro and its usage added} % \changes{v1.2e}{2010/01/09}{Adapted to the combine document class} @@ -591,7 +550,7 @@ % \end{macrocode} % \end{macro} % -% \subsection{Information, Warnings, and Errors} +% \section{Information, Warnings, and Errors} % % \begin{macro}{\caption@Info} % \changes{v1.3}{2010/10/25}{Moved from package to kernel} @@ -658,7 +617,7 @@ % \end{macrocode} % \end{macro} % -% \subsection{Using the keyval package} +% \section{Using the keyval package} % % We need the \package{keyval} package for option handling, so we load it here. % \begin{macrocode} @@ -1127,7 +1086,7 @@ % \end{macrocode} % \end{macro} % -% \subsection{Margin resp. width} +% \section{Margin resp. width} % \changes{v1.0n}{2007/04/01}{\cs{captionmarginx} renamed to \cs{captionmargin@}} % \changes{v1.0n}{2007/04/03}{Option `twoside' added} % \changes{v1.1}{2007/08/11}{Options `margin*', `minmargin', and `maxmargin' added} @@ -1369,7 +1328,7 @@ % \end{macrocode} % \end{macro} % -% \subsection{Indentions} +% \section{Indentions} % % \begin{macro}{\caption@indent} % \changes{v1.1}{2007/07/29}{Renamed from \cs{captionindent} to \cs{caption@indent}} @@ -1404,59 +1363,7 @@ \l@addto@macro\caption@@par{\setlength\parskip{#1}}} % \end{macrocode} % -% \changes{v1.0f}{2005/08/22}{Increased compatibility to KOMA-Script: -% A special version of options `parindent' and `parskip' added} -% \changes{v1.0g}{2006/01/03}{Bugfix 06-01-03: KOMA-Script variants of -% `parskip' and `parindent' options revised and moved into caption kernel} -% \changes{v1.0h}{2006/02/23}{KOMA-Script variants of `parskip' and -% `parindent' are obsolete now, removed} -% \changes{v1.0m}{2007/03/30}{KOMA-Script variants of `parskip' and -% `parindent' re-added, since they still collide with the current -% version of the subfig package (Sigh!)} -% -% There is an option clash between the \KOMAScript\ document classes -% and the \package{caption} kernel, both define the options |parindent| and -% |parskip| but with different meaning. -% Furthermore the ones defined by the \package{caption} kernel take a -% value as parameter but the \KOMAScript\ ones do not. -% So we need special versions of the options |parindent| and |parskip| here -% which determine if a value is given (and therefore should be treated as -% our option) or not (and therefore should be ignored by us).\footnote{%^^A -% This problem was completely solved due a change of \cs{caption@ProcessOptions} -% in \thispackage\ \version{1.0h}, but we still need this workaround since -% these options would otherwise still collide with the current version $1.3$ -% of the \package{subfig} package (Sigh!)} -% \begin{macrocode} -\providecommand*\caption@ifkomaclass{% - \caption@ifundefined\scr@caption\@gobble\@firstofone} -\@onlypreamble\caption@ifkomaclass -% \end{macrocode} -% \begin{macrocode} -\caption@ifkomaclass{% -% \end{macrocode} -% \begin{macrocode} - \let\caption@KV@parindent\KV@caption@parindent - \DeclareCaptionOption{parindent}[]{% - \ifx,#1,% - \caption@Debug{Option `parindent' ignored}% - \else - \caption@KV@parindent{#1}% - \fi}% -% \end{macrocode} -% \begin{macrocode} - \let\caption@KV@parskip\KV@caption@parskip - \DeclareCaptionOption{parskip}[]{% - \ifx,#1,% - \caption@Debug{Option `parskip' ignored}% - \else - \caption@KV@parskip{#1}% - \fi}% -% \end{macrocode} -% \begin{macrocode} -} -% \end{macrocode} -% -% \subsection{Styles} +% \section{Styles} % % \begin{macro}{\DeclareCaptionStyle} % \changes{v1.0a}{2004/01/17}{Pass through argument \#3 so extra spaces @@ -1564,7 +1471,7 @@ \DeclareCaptionOption{slc}[1]{\KV@caption@singlelinecheck{#1}} % \end{macrocode} % -% \subsection{Boxes} +% \section{Boxes} % % \begin{macro}{\DeclareCaptionBox} % \changes{v1.5}{2012/03/15}{This macro added} @@ -1627,7 +1534,7 @@ \def\caption@box@default{\caption@box@none} % \end{macrocode} % -% \subsection{Formats} +% \section{Formats} % % \begin{macro}{\DeclareCaptionFormat} % \changes{v1.0a}{2004/01/17}{Pass through argument \#3 so extra spaces @@ -1720,7 +1627,7 @@ \DeclareCaptionDefaultFormat{plain} % \end{macrocode} % -% \subsection{Label formats} +% \section{Label formats} % % \begin{macro}{\DeclareCaptionLabelFormat} % \changes{v1.0a}{2004/01/17}{% @@ -1768,7 +1675,7 @@ \def\caption@lfmt@default{\caption@lfmt@simple} % \end{macrocode} % -% \subsection{Label separators} +% \section{Label separators} % % \begin{macro}{\DeclareCaptionLabelSeparator} % \changes{v1.0a}{2004/01/17}{Pass through argument \#2 so extra spaces @@ -1856,7 +1763,7 @@ \caption@set@default@labelsep{colon} % \end{macrocode} % -% \subsection{Text formats} +% \section{Text formats} % % \begin{macro}{\DeclareCaptionTextFormat} % \changes{v1.0j}{2007/02/18}{This macro added} @@ -1953,7 +1860,7 @@ % \end{macrocode} % \end{macro} % -% \subsection{Fonts} +% \section{Fonts} % % \begin{macro}{\DeclareCaptionFont} % \changes{v1.0a}{2004/01/22}{% @@ -2151,8 +2058,8 @@ % \changes{v1.2d}{2009/10/09}{Bugfix 09-05-18: \package{setspace} package support revised} % \begin{macrocode} \DeclareCaptionFont{singlespacing}{% - \caption@ifundefined\setspace@singlespace{}{% - \setstretch\setspace@singlespace}}% normally 1 + \caption@ifdefined\setspace@singlespace{% + \setstretch\setspace@singlespace}{}}% normally 1 \DeclareCaptionFont{onehalfspacing}{\onehalfspacing} \DeclareCaptionFont{doublespacing}{\doublespacing} \DeclareCaptionFont{stretch}{\setstretch{#1}} @@ -2178,7 +2085,7 @@ \DeclareCaptionDefaultFont{size}{} % \end{macrocode} % -% \subsection{Justifications} +% \section{Justifications} % % \begin{macro}{\DeclareCaptionJustification} % \changes{v1.0a}{2004/01/17}{Pass through argument \#2 so extra spaces @@ -2261,7 +2168,7 @@ % \end{macrocode} % \end{macro} % -% \subsubsection{The ragged2e package} +% \subsection{The ragged2e package} % \changes{v1.0b}{2004/05/16}{Improved \package{ragged2e} package support} % % We also support the upper-case commands offered by the \package{ragged2e} @@ -2353,7 +2260,7 @@ % \end{macrocode} % \end{macro} % -% \subsection{Vertical spaces before and after captions} +% \section{Vertical spaces before and after captions} % % \begin{macro}{\abovecaptionskip} % \begin{macro}{\belowcaptionskip} @@ -2392,7 +2299,7 @@ \DeclareCaptionOption{rule}[1]{\caption@set@bool\caption@ifrule{#1}} % \end{macrocode} % -% \subsection{Positioning} +% \section{Positioning} % % These macros handle the right position of the caption. % Note that the position is actually \emph{not} controlled by the @@ -2517,7 +2424,7 @@ % \end{macrocode} % \end{macro} % -% \subsection{Hooks} +% \section{Hooks} % % \begin{macro}{\AtBeginCaption} % \begin{macro}{\AtEndCaption} @@ -2533,7 +2440,7 @@ % \end{macro} % \end{macro} % -% \subsection{Lists} +% \section{Lists} % % \changes{v1.0b}{2004/05/16}{Option \opt{listof=} added} % \changes{v1.2}{2007/11/17}{Option \opt{list=} added} @@ -2642,7 +2549,7 @@ \caption@set@default@listformat{subsimple} % \end{macrocode} % -% \subsection{Debug option} +% \section{Debug option} % \changes{v1.0k}{2007/03/04}{Debug option added} % % \begin{macrocode} @@ -2659,44 +2566,73 @@ \setkeys{caption}{debug=0} % \end{macrocode} % -% \subsection{Document classes \& Babel support} -% -% \subsubsection{The standard \texorpdfstring{\LaTeX{}}{LaTeX} classes} +% \section{Document classes \& Babel support} % +% \begin{macro}{\caption@ifdocumentclass} +% Boolean switch which is set if the document class could be detected successfully, +% i.e. |\caption@document|\-|class| is set to a proper value. +% (If |\caption@document|\-|class| is already set, this flag will also be set.) % \begin{macrocode} -\caption@CheckCommand\@makecaption{% - % article|report|book [2005/09/16 v1.4f Standard LaTeX document class] - \long\def\@makecaption#1#2{% - \vskip\abovecaptionskip - \sbox\@tempboxa{#1: #2}% - \ifdim \wd\@tempboxa >\hsize - #1: #2\par - \else - \global \@minipagefalse - \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}% - \fi - \vskip\belowcaptionskip}} +\caption@setbool{documentclass}{1} % \end{macrocode} +% \end{macro} % -% \subsubsection{The elsarticle classes} -% \changes{v1.5}{2013/01/06}{elsarticle class support added} -% -% \begin{macro}{\caption@ifelsarticleclass} +% \begin{macro}{\caption@documentclass} +% \changes{v1.8e}{2018/05/11}{This macro added} +% Determine document class used. +% Set |\caption@document|\-|class| by good-guessing, if not already set. % \begin{macrocode} -\providecommand*\caption@ifelsarticleclass{% - \@ifclassloaded{elsarticle}\@firstofone\@gobble} -\@onlypreamble\caption@ifelsarticleclass +\caption@ifundefined\caption@documentclass{% +% \end{macrocode} +% \begin{macrocode} + \@ifclassloaded{beamer}{% + \caption@InfoNoLine{beamer document class detected}% + \def\caption@documentclass{beamer}% % \end{macrocode} -% \end{macro} -% % \begin{macrocode} -\caption@ifelsarticleclass{% + }{\@ifclassloaded{elsarticle}{% + \caption@InfoNoLine{elsarticle document class detected}% + \def\caption@documentclass{elsarticle}% % \end{macrocode} % \begin{macrocode} - \caption@CheckCommand\@makecaption{% - % elsarticle.cls,v 1.20 2008-10-13 04:24:12 cvr Exp - \long\def\@makecaption#1#2{% - \vskip\abovecaptionskip\footnotesize + }{\@ifclassloaded{memoir}{% + \caption@InfoNoLine{memoir document class detected}% + \def\caption@documentclass{memoir}% +% \end{macrocode} +% \begin{macrocode} + }{\caption@ifdefined\scr@caption{% + \caption@InfoNoLine{KOMA-Script document class detected}% + \def\caption@documentclass{koma}% +% \end{macrocode} +% If |\@captionheadfont| is defined, we assume it's a AMS or SMF document class. +% \begin{macrocode} + }{\caption@ifdefined\@captionheadfont{% + \caption@InfoNoLine{AMS or SMF document class detected}% + \def\caption@documentclass{ams}% +% \end{macrocode} +% If |\@CaptionFonts| is defined, we assume it's a NTG Dutch document class. +% \begin{macrocode} + }{\caption@ifdefined\CaptionFonts{% + \caption@InfoNoLine{NTG document class detected}% + \def\caption@documentclass{ntg}% +% \end{macrocode} +% If |\cph@font| and |\cpb@font| are defined, we assume it's a NTG Dutch document class. +% \begin{macrocode} + }{\caption@ifdefined\cph@font{% + \caption@ifdefined\cpb@font\@firstoftwo\@secondoftwo + }{% + \@secondoftwo + }{% + \caption@InfoNoLine{thesis document class detected}% + \def\caption@documentclass{thesis}% + }{% +% \end{macrocode} +% If the definition of |\@makecaption| matches the one from the standard \LaTeX\ document classes +% |article|, |report|, or |book|, we assume it's either one of them or is compatible to them. +% \begin{macrocode} + % article|report|book [2005/09/16 v1.4f Standard LaTeX document class] + \long\def\caption@tempa#1#2{% + \vskip\abovecaptionskip \sbox\@tempboxa{#1: #2}% \ifdim \wd\@tempboxa >\hsize #1: #2\par @@ -2705,98 +2641,68 @@ \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}% \fi \vskip\belowcaptionskip}} + \ifx\caption@tempa\@makecaption + \caption@InfoNoLine{Standard document class detected}% + \else % \end{macrocode} +% Otherwise we are clueless and use standard default settings for the captions anyway. +% (And we unset the |document|\-|class| flag to indicate that the content of |\caption@document|\-|class| is not correct.) % \begin{macrocode} - \DeclareCaptionDefaultFont{font}{\footnotesize} + \caption@InfoNoLine{% + Unknown document class (or package),\MessageBreak + standard defaults will be used}% + \caption@InfoNoLine{\string\@makecaption\space=\space\meaning\@makecaption\@gobble}% + \caption@setbool{documentclass}{0}% + \fi + \def\caption@documentclass{base}% + }}}}}}% +}{} % \end{macrocode} +% \end{macro} +% +% \begin{macro}{\caption@ifclassloaded} +% \changes{v1.8e}{2019/09/09}{This macro added} +% |\caption@ifclassloaded|\marg{name}\marg{yes-code}\marg{no-code} % \begin{macrocode} -} +\newcommand*\caption@ifclassloaded[1]{% + \edef\caption@tempa{#1}% + \ifx\caption@tempa\caption@documentclass + \expandafter\@firstoftwo + \else + \expandafter\@secondoftwo + \fi} % \end{macrocode} +% \end{macro} % -% \subsubsection{The \AmS{} \& \SmF{} classes} -% \changes{v1.1}{2007/07/29}{\AmS\ \& \SmF\ classes support added} +% \subsection{The standard \texorpdfstring{\LaTeX{}}{LaTeX} classes} +% +% Since this is the default, there is no extra work to be done here. +% +% \subsection{The elsarticle classes} +% \changes{v1.5}{2013/01/06}{elsarticle class support added} % -% \begin{macro}{\caption@ifamsclass} % \begin{macrocode} -\providecommand*\caption@ifamsclass{% - \caption@ifundefined\@captionheadfont\@gobble\@firstofone} -\@onlypreamble\caption@ifamsclass +\caption@ifclassloaded{elsarticle}{% % \end{macrocode} -% \end{macro} -% % \begin{macrocode} -\caption@ifamsclass{% + \DeclareCaptionDefaultFont{font}{\footnotesize} % \end{macrocode} % \begin{macrocode} - \caption@CheckCommand\@makecaption{% - % amsart|amsproc|amsbook [2004/08/06 v2.20] - \long\def\@makecaption#1#2{% - \setbox\@tempboxa\vbox{\color@setgroup - \advance\hsize-2\captionindent\noindent - \@captionfont\@captionheadfont#1\@xp\@ifnotempty\@xp - {\@cdr#2\@nil}{.\@captionfont\upshape\enspace#2}% - \unskip\kern-2\captionindent\par - \global\setbox\@ne\lastbox\color@endgroup}% - \ifhbox\@ne % the normal case - \setbox\@ne\hbox{\unhbox\@ne\unskip\unskip\unpenalty\unkern}% - \fi - \ifdim\wd\@tempboxa=\z@ % this means caption will fit on one line - \setbox\@ne\hbox to\columnwidth{\hss\kern-2\captionindent\box\@ne\hss}% - \else % tempboxa contained more than one line - \setbox\@ne\vbox{\unvbox\@tempboxa\parskip\z@skip - \noindent\unhbox\@ne\advance\hsize-2\captionindent\par}% - \fi - \ifnum\@tempcnta<64 % if the float IS a figure... - \addvspace\abovecaptionskip - \hbox to\hsize{\kern\captionindent\box\@ne\hss}% - \else % if the float IS NOT a figure... - \hbox to\hsize{\kern\captionindent\box\@ne\hss}% - \nobreak - \vskip\belowcaptionskip - \fi - \relax - }} +}{} % \end{macrocode} +% +% \subsection{The \AmS{} \& \SmF{} classes} +% \changes{v1.1}{2007/07/29}{\AmS\ \& \SmF\ classes support added} +% % \begin{macrocode} - \caption@CheckCommand\@makecaption{% - % smfart|smfbook [1999/11/15 v1.2f Classe LaTeX pour les articles publies par la SMF] - \long\def\@makecaption#1#2{% - \ifdim\captionindent>.1\hsize \captionindent.1\hsize \fi - \setbox\@tempboxa\vbox{\color@setgroup - \advance\hsize-2\captionindent\noindent - \@captionfont\@captionheadfont#1\@xp\@ifnotempty\@xp - {\@cdr#2\@nil}{\@addpunct{.}\@captionfont\upshape\enspace#2}% - \unskip\kern-2\captionindent\par - \global\setbox\@ne\lastbox\color@endgroup}% - \ifhbox\@ne % the normal case - \setbox\@ne\hbox{\unhbox\@ne\unskip\unskip\unpenalty\unkern}% - \fi - \ifdim\wd\@tempboxa=\z@ % this means caption will fit on one line - \setbox\@ne\hbox to\columnwidth{\hss\kern-2\captionindent\box\@ne\hss}% - \@tempdima\wd\@ne\advance\@tempdima-\captionindent - \wd\@ne\@tempdima - \else % tempboxa contained more than one line - \setbox\@ne\vbox{\rightskip=0pt plus\captionindent\relax - \unvbox\@tempboxa\parskip\z@skip - \noindent\unhbox\@ne\advance\hsize-2\captionindent\par}% - \fi - \ifnum\@tempcnta<64 % if the float IS a figure... - \addvspace\abovecaptionskip - \noindent\kern\captionindent\box\@ne - \else % if the float IS NOT a figure... - \noindent\kern\captionindent\box\@ne - \nobreak - \vskip\belowcaptionskip - \fi - \relax - }} +\caption@ifclassloaded{ams}{% % \end{macrocode} % \begin{macrocode} \let\captionmargin\captionindent % set to 3pc by AMS class \begingroup\edef\@tempa{\endgroup \noexpand\caption@g@addto@list\noexpand\caption@sty@default {margin=\the\captionmargin - \caption@ifundefined\smf@makecaption{}{,maxmargin=.1\linewidth}}} + \caption@ifdefined\smf@makecaption{,maxmargin=.1\linewidth}{}}} \@tempa \caption@g@addto@list\caption@sls@default{margin*=.5\captionmargin} \DeclareCaptionLabelSeparator{default}{.\enspace} @@ -2807,10 +2713,10 @@ \captionsetup[table]{position=t} % \end{macrocode} % \begin{macrocode} -} +}{} % \end{macrocode} % -% \subsubsection{The beamer class (Part one)} +% \subsection{The beamer class (Part one)} % \changes{v1.1}{2007/03/10}{\package{beamer} class support added} % \changes{v1.3}{2011/08/06}{\package{beamer} class support revised} % \changes{v1.5}{2013/04/27}{The \package{beamer} template \texttt{caption label separator} will be used now} @@ -2818,33 +2724,8 @@ % \changes{v1.7}{2018/04/15}{Re-definition of label format \texttt{simpleMagyar} revised} % \changes{v1.7}{2018/05/01}{Definition of \package{beamer} default label font revised} % -% \begin{macro}{\caption@ifbeamerclass} -% \begin{macrocode} -\providecommand*\caption@ifbeamerclass{% - \@ifclassloaded{beamer}\@firstofone\@gobble} -\@onlypreamble\caption@ifbeamerclass -% \end{macrocode} -% \end{macro} -% % \begin{macrocode} -\caption@ifbeamerclass{% -% \end{macrocode} -% \begin{macrocode} - \caption@CheckCommand\beamer@makecaption{% - % beamerbaselocalstructure.sty,v 1.53 2007/01/28 20:48:21 tantau - \long\def\beamer@makecaption#1#2{% - \def\insertcaptionname{\csname#1name\endcsname}% - \def\insertcaptionnumber{\csname the#1\endcsname}% - \def\insertcaption{#2}% - \nobreak\vskip\abovecaptionskip\nobreak - \sbox\@tempboxa{\usebeamertemplate**{caption}}% - \ifdim \wd\@tempboxa >\hsize - \usebeamertemplate**{caption}\par - \else - \global \@minipagefalse - \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}% - \fi - \nobreak\vskip\belowcaptionskip\nobreak}} +\caption@ifclassloaded{beamer}{% % \end{macrocode} % % \begin{macro}{\caption@ifbeamertemplate} @@ -2926,38 +2807,14 @@ % \begin{macrocode} % % \begin{macrocode] -} +}{} % \end{macrocode} % -% \subsubsection{The KOMA-Script classes} +% \subsection{The KOMA-Script classes} % \changes{v1.1}{2007/03/31}{\KOMAScript\ classes support added} % -% \begin{macro}{\caption@ifkomaclass} % \begin{macrocode} -\providecommand*\caption@ifkomaclass{% - \caption@ifundefined\scr@caption\@gobble\@firstofone} -\@onlypreamble\caption@ifkomaclass -% \end{macrocode} -% \end{macro} -% -% \begin{macrocode} -\caption@ifkomaclass{% -% \end{macrocode} -% \begin{macrocode} - \caption@CheckCommand\@makecaption{% - % scrartcl|scrreprt|scrbook [2007/03/07 v2.97a KOMA-Script document class] - \long\def\@makecaption#1#2{% - \if@captionabove - \vskip\belowcaptionskip - \else - \vskip\abovecaptionskip - \fi - \@@makecaption\@firstofone{#1}{#2}% - \if@captionabove - \vskip\abovecaptionskip - \else - \vskip\belowcaptionskip - \fi}} +\caption@ifclassloaded{koma}{% % \end{macrocode} % \begin{macrocode} \DeclareCaptionFormat{default}[#1#2#3\par]{% @@ -2981,74 +2838,71 @@ \DeclareCaptionDefaultFont{font}{\scr@fnt@caption} \DeclareCaptionDefaultFont{labelfont}{\scr@fnt@captionlabel} % \end{macrocode} -% \begin{macrocode} -} -% \end{macrocode} % -% \subsubsection{The \NTG{} Dutch classes} -% \changes{v1.1}{2007/04/06}{NTG classes support added} +% \changes{v1.0f}{2005/08/22}{Increased compatibility to KOMA-Script: +% A special version of options `parindent' and `parskip' added} +% \changes{v1.0g}{2006/01/03}{Bugfix 06-01-03: KOMA-Script variants of +% `parskip' and `parindent' options revised and moved into caption kernel} +% \changes{v1.0h}{2006/02/23}{KOMA-Script variants of `parskip' and +% `parindent' are obsolete now, removed} +% \changes{v1.0m}{2007/03/30}{KOMA-Script variants of `parskip' and +% `parindent' re-added, since they still collide with the current +% version of the subfig package (Sigh!)} % -% \begin{macro}{\caption@ifntgclass} +% There is an option clash between the \KOMAScript\ document classes +% and the \package{caption} kernel, both define the options |parindent| and +% |parskip| but with different meaning. +% Furthermore the ones defined by the \package{caption} kernel take a +% value as parameter but the \KOMAScript\ ones do not. +% So we need special versions of the options |parindent| and |parskip| here +% which determine if a value is given (and therefore should be treated as +% our option) or not (and therefore should be ignored by us).\footnote{%^^A +% This problem was completely solved due a change of \cs{caption@ProcessOptions} +% in \thispackage\ \version{1.0h}, but we still need this workaround since +% these options would otherwise still collide with the current version $1.3$ +% of the \package{subfig} package (Sigh!)} % \begin{macrocode} -\providecommand*\caption@ifntgclass{% - \caption@ifundefined\CaptionFonts\@gobble\@firstofone} -\@onlypreamble\caption@ifntgclass + \let\caption@KV@parindent\KV@caption@parindent + \DeclareCaptionOption{parindent}[]{% + \ifx,#1,% + \caption@Debug{Option `parindent' ignored}% + \else + \caption@KV@parindent{#1}% + \fi}% % \end{macrocode} -% \end{macro} -% % \begin{macrocode} -\caption@ifntgclass{% + \let\caption@KV@parskip\KV@caption@parskip + \DeclareCaptionOption{parskip}[]{% + \ifx,#1,% + \caption@Debug{Option `parskip' ignored}% + \else + \caption@KV@parskip{#1}% + \fi}% % \end{macrocode} % \begin{macrocode} - \caption@CheckCommand\@makecaption{% - % artikel|rapport|boek [2004/06/07 v2.1a NTG LaTeX document class] - \long\def\@makecaption#1#2{% - \vskip\abovecaptionskip - \sbox\@tempboxa{{\CaptionLabelFont#1:} \CaptionTextFont#2}% - \ifdim \wd\@tempboxa >\hsize - {\CaptionLabelFont#1:} \CaptionTextFont#2\par - \else - \global \@minipagefalse - \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}% - \fi - \vskip\belowcaptionskip}} +}{} +% \end{macrocode} +% +% \subsection{The \NTG{} Dutch classes} +% \changes{v1.1}{2007/04/06}{NTG classes support added} +% +% \begin{macrocode} +\caption@ifclassloaded{ntg}{% % \end{macrocode} % \begin{macrocode} \DeclareCaptionDefaultFont{labelfont}{\CaptionLabelFont} \DeclareCaptionDefaultFont{textfont}{\CaptionTextFont} % \end{macrocode} % \begin{macrocode} -} +}{} % \end{macrocode} % -% \subsubsection{The thesis class} +% \subsection{The thesis class} % \changes{v1.2a}{2008/01/31}{thesis class support added} % \changes{v1.2e}{2009/11/15}{Bugfix 09-11-14: thesis class support revised} % -% \begin{macro}{\caption@ifthesisclass} % \begin{macrocode} -\providecommand*\caption@ifthesisclass{% - \caption@ifundefined\cph@font - {\@gobble}% - {\caption@ifundefined\cpb@font\@gobble\@firstofone}} -% \end{macrocode} -% \end{macro} -% -% \begin{macrocode} -\caption@ifthesisclass{% -% \end{macrocode} -% \begin{macrocode} - \caption@CheckCommand\@makecaption{% - % thesis.cls 1996/25/01 1.0g LaTeX document class (wm). - \long\def\@makecaption#1#2{% - \vskip\abovecaptionskip - \setbox\@tempboxa\hbox{{\cph@font #1:} {\cpb@font #2}}% - \ifdim \wd\@tempboxa >\hsize - \@hangfrom{\cph@font #1: }{\cpb@font #2\par}% - \else - \hbox to\hsize{\hfil\box\@tempboxa\hfil}% - \fi - \vskip\belowcaptionskip}} +\caption@ifclassloaded{thesis}{% % \end{macrocode} % \begin{macrocode} \DeclareCaptionDefaultFormat{hang} @@ -3056,23 +2910,23 @@ \DeclareCaptionDefaultFont{textfont}{\cpb@font} % \end{macrocode} % \begin{macrocode} -} +}{} % \end{macrocode} % -% \subsubsection{The arabic Babel option} +% \subsection{The arabic Babel option} % \changes{v1.8}{2018/05/20}{\package{arabic} babel package support added} % % \begin{macrocode} -\caption@ifundefined\ArabiCoreLoaded{% +\caption@ifdefined\ArabiCoreLoaded{% % \end{macrocode} +% % \begin{macro}{\caption@rl} % \changes{v1.8}{2018/05/20}{This macro added} % \begin{macrocode} - \let\caption@rl\@firstofone -}{% \newcommand\caption@rl[1]{\if@rl\textRL{#1}\else\textLR{#1}\fi} % \end{macrocode} % \end{macro} +% % \begin{macrocode} \def\fnum@figure{\figurename\nobreakspace\thefigure}% \def\fnum@table{\tablename\nobreakspace\thetable}% @@ -3083,51 +2937,16 @@ \if@rl\caption@lsep@arabi\else\caption@lsep@colon\fi} % \end{macrocode} % \begin{macrocode} - \caption@CheckCommand\@makecaption{% - % arabicore.sty [2006/01/01 v1.0 Arabi Core switching commands (may still change)] - \long\def\@makecaption#1#2{% - \vskip\abovecaptionskip - \sbox\@tempboxa{#1: #2}% - \sbox\@Arabitempboxa{\textRL{#2} : #1}% - \if@rl{ - \ifdim \wd\@Arabitempboxa >\hsize - \textRL{#2} : #1\par - \else - \global \@minipagefalse - \hb@xt@\hsize{\hfil\box\@Arabitempboxa\hfil}% - \fi}\else{ - \ifdim \wd\@tempboxa >\hsize - #1: #2\par - \else - \global \@minipagefalse - \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}% - \fi}\fi - \vskip\belowcaptionskip}} -% \end{macrocode} -% \begin{macrocode} +}{% + \let\caption@rl\@firstofone } % \end{macrocode} % -% \subsubsection{The frenchb Babel option} +% \subsection{The frenchb Babel option} % \changes{v1.1}{2006/05/14}{\package{frenchb} babel package support added} % % \begin{macrocode} -\caption@ifundefined\FB@makecaption{}{% -% \end{macrocode} -% \begin{macrocode} - \caption@CheckCommand\@makecaption{% - % frenchb.ldf [2005/02/06 v1.6g French support from the babel system] - % frenchb.ldf [2007/10/05 v2.0e French support from the babel system] - \long\def\@makecaption#1#2{% - \vskip\abovecaptionskip - \sbox\@tempboxa{#1\CaptionSeparator #2}% - \ifdim \wd\@tempboxa >\hsize - #1\CaptionSeparator #2\par - \else - \global \@minipagefalse - \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}% - \fi - \vskip\belowcaptionskip}} +\caption@ifdefined\FB@makecaption{% % \end{macrocode} % \begin{macrocode} \ifx\@makecaption\STD@makecaption @@ -3145,69 +2964,24 @@ \fi % \end{macrocode} % \begin{macrocode} -} +}{} % \end{macrocode} % -% \subsubsection{The frenchle/pro package} +% \subsection{The frenchle/pro package} % \changes{v1.1}{2006/05/14}{\package{frenchle/pro} package support added} % % \begin{macrocode} -\caption@ifundefined\frenchTeXmods{}{% -% \end{macrocode} -% \begin{macrocode} - \caption@CheckCommand\@makecaption{% - % french(le).sty [2006/10/03 The french(le) package /V5,9991/] - % french(le).sty [2007/06/28 The french(le) package /V5,9994/] - \def\@makecaption#1#2{% - \ifFTY% - \def\@secondofmany##1##2\void{##2}% - \def\@tempa{\@secondofmany#2\void}% - \ifx\@tempa\empty% - \let\captionseparator\empty% - \fi% - \@mcORI{#1}{\relax\captionfont{#2}}% - \else - \@mcORI{#1}{#2}% - \fi}}% -% \end{macrocode} -% \begin{macrocode} - \caption@CheckCommand\@makecaption{% - % french(le).sty [2007/02/11 The french(le) package /V5,9993/] - \def\@makecaption#1#2{% - \ifFTY% - \def\@secondofmany##1##2\void{##2}% - \protected@edef\@tempa{\@secondofmany#2\void}% - \ifx\@tempa\empty% - \let\captionseparator\empty% - \fi% - \@mcORI{#1}{\relax\captionfont{#2}}% - \else - \@mcORI{#1}{#2}% - \fi}}% +\caption@ifdefined\frenchTeXmods{% % \end{macrocode} % \begin{macrocode} \DeclareCaptionDefaultFont{textfont}{\itshape}% \DeclareCaptionLabelSeparator{default}{\captionseparator\space}% % \end{macrocode} % \begin{macrocode} -} -% \end{macrocode} -% -% \subsubsection{The hebrew Babel option} -% \changes{v1.8}{2018/08/26}{\package{hebrew} package support added} -% -% \begin{macrocode} - \caption@CheckCommand\@makecaption{% - % rlbabel.def [2005/03/30 v2.3h Right-to-Left support from the babel system Hebrew language support from the babel system] - \long\def\@makecaption#1#2{% - \vskip\abovecaptionskip% - \begin{center}% - #1: #2% - \end{center} \par% - \vskip\belowcaptionskip}}% +}{} % \end{macrocode} % -% \subsubsection{The hungarian and magyar Babel option} +% \subsection{The hungarian and magyar Babel option} % \changes{v1.3}{2009/03/29}{\package{magyar} package support added} % \changes{v1.3a}{2011/08/12}{\package{magyar} package support revised} % \changes{v1.8b}{2018/08/26}{\package{magyar} package support revised} @@ -3217,22 +2991,6 @@ % \end{macrocode} % % \begin{macrocode} -\caption@ifundefined\hunnewlabel{}{% - \caption@CheckCommand\@makecaption{% - % magyar.ldf [2005/03/30 v1.4j Magyar support from the babel system] - \def\@makecaption#1#2{% - \vskip\abovecaptionskip - \sbox\@tempboxa{#1. #2}% - \ifdim \wd\@tempboxa >\hsize - {#1. #2\csname par\endcsname} - \else - \global \@minipagefalse - \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}% - \fi - \vskip\belowcaptionskip}}} -% \end{macrocode} -% -% \begin{macrocode} \def\caption@tempa#1{% \@ifpackagewith{babel}{#1}{% \caption@InfoNoLine{#1 babel option is loaded}% @@ -3253,22 +3011,7 @@ % % TODO: babel-latvian/latvian.ldf % -% \subsubsection{Unknown document class (or package)} -% \changes{v1.1}{2007/04/10}{Check of document class added} -% -% \begin{macrocode} -\caption@IfCheckCommand{% - \caption@setbool{documentclass}{1}% -}{% - \caption@setbool{documentclass}{0}% - \caption@InfoNoLine{% - Unknown document class (or package),\MessageBreak - standard defaults will be used}% - \caption@Debug{\string\@makecaption\space=\space\meaning\@makecaption\@gobble}% -} -% \end{macrocode} -% -% \subsection{Execution of options} +% \section{Execution of options} % % \begin{macrocode} \captionsetup{style=default,position=default,% @@ -3278,7 +3021,7 @@ \ProcessOptions* % \end{macrocode} % -% \subsection{Making an `List of' entry} +% \section{Making an `List of' entry} % % \begin{macro}{\caption@addcontentsline} % \changes{v1.1}{2007/07/01}{This macro added} @@ -3299,13 +3042,13 @@ \caption@ifcontentsline{#2}{% \begingroup \let\@tempa\@gobble - \caption@ifundefined\caption@listtype - {\edef\caption@listtype{#1}}% + \caption@ifdefined\caption@listtype {\let\@tempa\@firstofone}% - \caption@ifundefined\caption@listtype@ext - {}% + {\edef\caption@listtype{#1}}% + \caption@ifdefined\caption@listtype@ext {\edef\caption@listtype{\caption@listtype\caption@listtype@ext}% \let\@tempa\@firstofone}% + {}% \@tempa {\caption@Debug{addcontentsline: #1 => \caption@listtype}% % \caption@setoptions\caption@listtype @@ -3333,8 +3076,8 @@ % \end{macrocode} % \begin{macrocode} \newcommand*\caption@@@addcontentsline[4]{% -% \caption@ifundefined\main@Arabi@language{}% -% {\addtocontents{#1}{\xstring\select@language{\main@Arabi@language}}}% +% \caption@ifdefined\main@Arabi@language +% {\addtocontents{#1}{\xstring\select@language{\main@Arabi@language}}}{}% \addcontentsline{#1}{#2}{\protect\numberline{#3}{#4}}} % \end{macrocode} % \begin{macrocode} @@ -3356,7 +3099,7 @@ % \end{macrocode} % \end{macro} % -% \subsection{Typesetting the caption} +% \section{Typesetting the caption} % % \begin{macro}{\ifcaption@star} % If the starred form of |\caption| is used, this will be set to |true|. @@ -3833,7 +3576,7 @@ % \end{macrocode} % \end{macro} % -% \subsection{Types \& sub-types} +% \section{Types \& sub-types} % % \begin{macro}{\DeclareCaptionType} % \changes{v1.1}{2007/08/12}{This macro added} @@ -3860,13 +3603,13 @@ % will execute the given code for all (known) floating environments. % \begin{macrocode} \newcommand\caption@ForEachType[1]{% - \caption@ifundefined\ForEachFloatingEnvironment + \caption@ifdefined\ForEachFloatingEnvironment + {\ForEachFloatingEnvironment{#1}}% {\def\@elt##1{#1}% - \caption@ifundefined\c@figure\@gobble\@elt{figure}% - \caption@ifundefined\c@table\@gobble\@elt{table}% + \caption@ifdefined\c@figure\@elt\@gobble{figure}% + \caption@ifdefined\c@table\@elt\@gobble{table}% \let\@elt\relax - \newfloat@addtohook{#1}}% - {\ForEachFloatingEnvironment{#1}}} + \newfloat@addtohook{#1}}} % \end{macrocode} % \begin{macrocode} \providecommand\newfloat@addtohook[1]{% @@ -3920,8 +3663,8 @@ % \end{macrocode} % Support of \package{titletoc} package % \begin{macrocode} - \caption@ifundefined\contentsuse{}{% - \contentsuse{sub#3}{\csname ext@sub#3\endcsname}}% + \caption@ifdefined\contentsuse{% + \contentsuse{sub#3}{\csname ext@sub#3\endcsname}}{}% % \end{macrocode} % \begin{macrocode} \@namedef{sub#3name}{}% @@ -3939,9 +3682,9 @@ % \end{macrocode} % \begin{macrocode} \newcommand*\caption@declaresublistentry{% - \caption@ifundefined\l@chapter - {\caption@@declaresublistentry\l@subsubsection}% - {\caption@@declaresublistentry\l@subsection}} + \caption@ifdefined\l@chapter + {\caption@@declaresublistentry\l@subsection}% + {\caption@@declaresublistentry\l@subsubsection}} \@onlypreamble\caption@declaresublistentry % \end{macrocode} % \begin{macrocode} @@ -4062,7 +3805,7 @@ % \end{macrocode} % \end{macro} % -% \subsection{subfig package adaptions} +% \section{subfig package adaptions} % \changes{v1.1}{2007/07/07}{Several adaptions to the \package{subfig} package added} % \changes{v1.4a}{2011/11/01}{Bugfix 11-11-01: Test for the \package{subfig} package revised} % diff --git a/macros/latex/contrib/caption/newfloat.dtx b/macros/latex/contrib/caption/newfloat.dtx deleted file mode 100644 index 71484e60bc..0000000000 --- a/macros/latex/contrib/caption/newfloat.dtx +++ /dev/null @@ -1,2074 +0,0 @@ -% \iffalse meta-comment -% -% This is file `newfloat.dtx'. -% -% Copyright (C) 2011-2019 Axel Sommerfeldt (axel.sommerfeldt@f-m.fm) -% -% -------------------------------------------------------------------------- -% -% 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 2003/12/01 or later. -% -% This work has the LPPL maintenance status "maintained". -% -% This Current Maintainer of this work is Axel Sommerfeldt. -% -% This work consists of the files caption.ins, caption.dtx, caption2.dtx, -% caption3.dtx, bicaption.dtx, ltcaption.dtx, subcaption.dtx, and newfloat.dtx, -% the derived files caption.sty, caption2.sty, caption3.sty, -% bicaption.sty, ltcaption.sty, subcaption.sty, and newfloat.sty, -% and the user manuals caption-deu.tex, caption-eng.tex, and caption-rus.tex. -% -% \fi -% \CheckSum{1605} -% -% \iffalse -%<*driver> -\NeedsTeXFormat{LaTeX2e}[1994/12/01] -\ProvidesFile{newfloat.drv}% - [2013/04/27 v1.1 This package offers a command for defining new floating environments] -\hbadness=9999 \newcount\hbadness \hfuzz=48pt % Make TeX shut up. -% -\documentclass{ltxdoc} -\setlength\parindent{0pt} -\setlength\parskip{\smallskipamount} -% -\usepackage{ifpdf} -\ifpdf - \usepackage{mathptmx,courier} - \usepackage[scaled=0.90]{helvet} -% \addtolength\marginparwidth{15pt} -\fi -% -\usepackage[bottom]{footmisc} -% -\usepackage{hypdoc} -\ifpdf\usepackage{hypdestopt}\fi -\hypersetup{pdfkeywords={LaTeX, package, newfloat},pdfstartpage={},pdfstartview={}} -% -\usepackage{newfloat} -% -\DeclareRobustCommand*\eTeX{\texorpdfstring - {\leavevmode\hbox{$\varepsilon$}-\TeX}% - {e-TeX}} -\DeclareRobustCommand*\AmS{\texorpdfstring - {{\protect\usefont{OMS}{cmsy}{m}{n}A\kern-.1667em\lower.5ex\hbox{M}\kern-.125emS}}% - {AMS}} -\DeclareRobustCommand*\KOMAScript{\texorpdfstring - {\textsf{K\kern.05em O\kern.05em M\kern.05em A\kern.1em-\kern.1em Script}}% - {KOMA-Script}} -\DeclareRobustCommand*\NTG{NTG} -\DeclareRobustCommand*\SmF{SMF} -% -\begin{document} - \DocInput{newfloat.dtx} -\end{document} -% -% \fi -% -% \newcommand*\purerm[1]{{\upshape\mdseries\rmfamily #1}} -% \newcommand*\puresf[1]{{\upshape\mdseries\sffamily #1}} -% \newcommand*\purett[1]{{\upshape\mdseries\ttfamily #1}} -% \let\class\puresf \let\package\puresf -% \let\env\purett \let\opt\purett -% -% \def\thispackage{the \package{newfloat} package} -% \def\Thispackage{The \package{newfloat} package} -% -% \newcommand*\csmarg[1]{\texttt{\char`\{#1\char`\}}} -% \newcommand*\csoarg[1]{\texttt{\char`\[#1\char`\]}} -% \newcommand*\version[2][]{\textit{v#2}} -% -% \setlength\leftmargini{1.5em} -% -% \GetFileInfo{newfloat.drv} -% \let\docdate\filedate -% \let\docversion\fileversion -% \GetFileInfo{newfloat.sty} -% -% \title{\texorpdfstring{\Thispackage\thanks{%^^A -% This package has version number \docversion.}}%^^A -% {The newfloat package}} -% \author{Axel Sommerfeldt\\ -% \url{https://gitlab.com/axelsommerfeldt/caption}} -% \date{\docdate} -% \maketitle -% -% \begin{abstract} -% \centering -% This package offers the command -% |\Declare|\-|Floating|\-|Environment| for defining new floating environments -% which behave like |figure| and |table|. -% \end{abstract} -% -% \tableofcontents -% -% \clearpage -% \section{Loading the package} -% -% First of all you need to include this package into your document with -% \begin{quote} -% |\usepackage|\oarg{options}|{newfloat}| -% \end{quote} -% where \meta{options} are one or more of -% \begin{quote}\begin{tabular}{r@{\,}l} -% |within=| & \meta{``within'' counter} \emph{or} \texttt{none}\quad\\ -% |chapterlistsgap=| & \meta{value}~\footnotemark[1] -% \end{tabular}\end{quote} -% -% The ``within'' counter specifies the counter which will be used to reset -% the counter of the floating environments |figure| and |table| . -% (Furthermore this setting will be used as default setting for -% |\Declare|\-|Floating|\-|Environment|.) -% -% So for example |within=chapter| will give you a numbering scheme -% \meta{chapter}.\meta{x} for floating environments, -% while |within=section| will give you a numbering scheme -% \meta{chapter}.\meta{section}.\meta{x}, or \meta{section}.\meta{x} -% if the document class does not offer |\chapter|. -% |within=none| will result in a continuous numbering throughout the document, -% i.e.~the numbering scheme will be simply \meta{x}. -% -% The option |chapterlistsgap=|\meta{value} sets the amount of the -% vertical gap inserted into the ``List of Figure'', ``List of Tables'', -% and all lists created with |\Declare|\-|Floating|\-|Environment| -% when a new chapter will be started. -% The default value is |10pt|. -% (This option will only be available if the document class used offer -% the usage of chapters, e.g.~the |book| or |report| document class.) -% -% \pagebreak[3] -% Both options can be changed later on, too, by using the command -% \begin{quote} -% |\newfloatsetup|\meta{options}\quad, -% \end{quote} -% -% \pagebreak[3] -% \section{\cs{DeclareFloatingEnvironment}} -% -% After loading \thispackage\ you can define your own floating environments with -% \begin{quote} -% \iffalse -% \setlength{\leftmargin}{6cm} -% \fi -% |\DeclareFloatingEnvironment|\oarg{options}\marg{type}% -% \iffalse -% \oarg{name}\oarg{list name} -% \fi -% \end{quote} -% where \meta{options} are one or more of -% \begin{quote}\begin{tabular}{r@{\,}l} -% |fileext=| & \meta{file extension}\\ -% |listname=| & \meta{list name}\\ -% |name=| & \meta{prosa name}\\ -% |placement=| & \meta{combination of \,\purett{htbp}}\\ -% |within=| & \meta{``within'' counter} \emph{or} \texttt{none}\\ -% |chapterlistsgaps=| & \texttt{on} \emph{or} \texttt{off}~\footnotemark[1] -% \end{tabular}\end{quote} -% \footnotetext[1]{Please note that although \thispackage\ tries hard to offer this -% option it may not be available or is working incorrectly in cooperation with -% your document class since there is no standard interface which we could use -% for that purpose. Therefore we have to try to patch the \cs{chapter} command, -% and if this fails, we try to patch \cs{addtocontents} (in an unusual way) instead.} -% -% If no \meta{options} are given, -% ``lo\meta{type}'' will be used as \meta{file extension} for the list, -% ``List of \meta{name}s'' as \meta{list name}. -% ``\meta{name}'' as \meta{name} (but with the first letter capitalized), -% ``|tbp|'' as \meta{placement} specifier, -% and ``|chapter|'' resp. ``|none|'' as \meta{``within'' counter}, -% i.e., the counter which resets the numbering. -% -% The default value of the |chapterlistsgaps=| option depends on the -% ``within'' setting, it is set to |on| if |chapter| or |section| is selected, -% otherwise it is set to |off|. -% (This option will only be available if the document class used offer -% the usage of chapters, e.g.~the |book| or |report| document class.) -% -% The list will be typeset using the command |\list|\-|of|\meta{type}|s| -% resp.~|\list|\-|of|\meta{type}|es|, -% analogous to |\list|\-|of|\-|figures| and |\list|\-|of|\-|tables|. -% -% If the \package{fltpage} package is loaded, an environment called -% |FP|\meta{type} will be defined additionally, same for |sideways|\meta{type} -% (\package{rotating} package), |SC|\meta{type} (\package{sidecap} package), -% and |wrap|\meta{type} (\package{wrapfig} package). -% -% \bigskip -% -% \pagebreak[3] -% So for example -% \begin{quote} -% |\DeclareFloatingEnvironment{diagram}| -% \end{quote} -% will define a new floating environment called |diagram|, -% the list will be stored in a file with the extension |lodiagram|, the name -% (used for the caption) will be ``Diagram'' and the list name -% ``List of Diagrams''. -% The list could be typeset with |\list|\-|of|\-|diagrams|. -% Dependent on which packages are loaded, the environments |FP|\-|diagram|, -% |sideways|\-|diagram|, |SC|\-|diagram|, and |wrap|\-|diagram| will be defined additionally. -% -% \pagebreak[3] -% Another example: -% \begin{quote} -% |\DeclareFloatingEnvironment[|\\ -% | fileext=lox,|\\ -% | listname={List of Matrixes},|\\ -% | name=Matrix,|\\ -% | placement=p,|\\ -% | within=section,|\\ -% | chapterlistsgaps=off,|\\ -% | ]{matrix}| -% \end{quote} -% will define a new floating environment called |matrix| with the given settings. -% Please note that names which contain spaces needs to be enclosed in curly braces. -% -% \pagebreak[3] -% \section{\cs{SetupFloatingEnvironment}} -% -% While |\DeclareFloatingEnvironment| will create new floating environments, -% \begin{quote} -% |\SetupFloatingEnvironment|\marg{floating environment}\marg{options} -% \end{quote} -% will change the settings of existing ones, i.e. either |figure| or |table|, -% or a one created with |\Declare|\-|Floating|\-|Environment|, -% or a one created with |\new|\-|float| offered by the \package{float} package, -% or a one created with |\new|\-|float| offered by the \package{memoir} document class, -% or a one created with |\Declare|\-|New|\-|Float|\-|Type| offered by the \package{floatrow} package, -% or \ldots -% -% The \meta{options} are the same as the options for -% |\Declare|\-|Floating|\-|Environment|, -% but one should avoid changing the file extension -% of existing floating environments, -% i.e.~using the |fileext=| option within |\Setup|\-|Floating|\-|Environment| -% is usually a very bad idea. -% -% \bigskip -% -% \pagebreak[3] -% An example: -% \begin{quote} -% |\SetupFloatingEnvironment{lstlisting}{chapterlistsgaps=off}| -% \end{quote} -% will switch off the chapter lists gaps for |lstlisting| environments -% offered by the \package{listings} package. -% -% \pagebreak[3] -% \section{\cs{ForEachFloatingEnvironment}} -% -% \begin{quote} -% |\ForEachFloatingEnvironment|\marg{code with \#1} -% \end{quote} -% will execute the given \meta{code} for all known floating environments, -% and for ones defined with |\Declare|\-|Floating|\-|Environment| later on. -% -% \pagebreak[3] -% So for example the \package{subcaption} packages uses -% \begin{quote} -% |\ForEachFloatingEnvironment{\DeclareCaptionSubType{#1}}| -% \end{quote} -% for initializing itself for all floating environments which are -% known to \thispackage. -% -% \medskip -% -% There is also a starred variant |\For|\-|Each|\-|Floating|\-|Environment*| -% which will execute the given code for already existing floating environments -% only, i.e.~no hook will be placed inside |\Declare|\-|Floating|\-|Environment|. -% -% \pagebreak[3] -% An example: -% \begin{quote} -% |\ForEachFloatingEnvironment*{\typeout{#1}}| -% \end{quote} -% will typeout the names of all already known floating environments to the terminal -% and log file. -% -% \pagebreak[3] -% \section{\cs{PrepareListOf}} -% -% Unfortunately there is no standardized way of typesetting and customizing -% lists of floating environments, i.e.~every document class offers it's own stuff here, -% and there are plenty of \LaTeXe\ packages for this purpose. -% -% \pagebreak[3] -% For that reason the \thispackage\ simply typesets the lists of newly -% defined floating environments as ``List of Figure'' internally (using |\list|\-|of|\-|figure|) -% but using a different list (the right one, of course) and using a different list name, -% the one you have specified with either |\Declare|\-|Floating|\-|Environment| or -% |\Setup|\-|Floating|\-|Environment|.\footnote{Please note that this is not the -% fact when using a \KOMAScript\ document class, not \cs{listoffigure} but \cs{listoftoc} -% will be used here, and therefore no problems should occur.} -% -% \pagebreak[3] -% While this usually results in the same layout as the ``List of Figure'' and -% is sufficient for most cases, there are some cases where this might -% lead to an unwanted side effect. -% -% \pagebreak[3] -% Therefore the \thispackage\ offers -% \begin{quote} -% |\PrepareListOf|\marg{floating environment}\marg{code} -% \end{quote} -% which will execute the given \meta{code} right before actually typesetting the list -% with |\list|\-|of|\-|figures| internally. -% -% \pagebreak[3] -% One example: -% \begin{quote} -% |\PrepareListOf{diagram}{%|\\ -% | \renewcommand{\cftfigpresnum}{Diagram~}}| -% \end{quote} -% will change the part typeset in front of the diagram number within the -% ``List of Diagrams'' when using the \package{tocloft} package~\cite{tocloft}. -% Without the code above you will get the part defined for figures instead. -% -% \pagebreak[3] -% However, when dealing with the \package{tocloft} package it's a better -% idea not to use |\Prepare|\-|List|\-|Of| but the customization facilities of that package -% instead, e.g.: -% \begin{quote} -% |\documentclass{book}|\\ -% \ldots\\ -% |\usepackage{newfloat,tocloft}|\\ -% |\newlistof{diagram}{lod}{List of Diagrams}|\\ -% |\DeclareFloatingEnvironment[name=Diagram,fileext=lod]{diagram}|\\ -% | % Note: Due of a bug in tocloft the file extension|\\ -% | % must be repeated at \DeclareFloatingEnvironment,|\\ -% | % otherwise you will get an empty list.|\\ -% ||\\ -% |% Customize `List of Figures'|\\ -% |\renewcommand{\cftfigpresnum}{Figure~}|\\ -% |\setlength{\cftfignumwidth}{2cm}|\\ -% ||\\ -% |% Customize `List of Diagrams'|\\ -% |\renewcommand{\cftdiagrampresnum}{Diagram~}|\\ -% |\setlength{\cftdiagramnumwidth}{2cm}|\\ -% ||\\ -% \ldots\\ -% ||\\ -% |\begin{document}|\\ -% \ldots\\ -% |\listoffigures|\\ -% |\listofdiagrams|\\ -% \ldots\\ -% |\end{document}| -% \end{quote} -% -% \iffalse -% \pagebreak[3] -% \section{For \LaTeX{} package authors} -% -% |\For|\-|Each|\-|Floating|\-|Environment| without \package{newfloat} package: -% \begin{quote} -% |\newcommand\mypackage@foreachfloat[1]{%|\\ -% | \@ifundefined{ForEachFloatingEnvironment}%|\\ -% | {\def\@elt##1{#1}%|\\ -% | \@ifundefined{c@figure}\@gobble\@elt{figure}%|\\ -% | \@ifundefined{c@table}\@gobble\@elt{table}%|\\ -% | \let\@elt\relax|\\ -% | \newfloat@addtohook{#1}}%|\\ -% | {\ForEachFloatingEnvironment{#1}}}|\\ -% |\providecommand\newfloat@addtohook[1]{%|\\ -% | \toks@=\expandafter{\newfloat@hook{##1}#1}%|\\ -% | \edef\@tempa{\def\noexpand\newfloat@hook####1{\the\toks@}}%|\\ -% | \@tempa}|\\ -% |\providecommand*\newfloat@hook[1]{}| -% \end{quote} -% -% \pagebreak[3] -% Adding environment to list of floating environments: -% \begin{quote} -% |\SetupFloatingEnvironment|\marg{environment}|{}| -% \end{quote} -% or (without \package{newfloat} package loaded): -% \begin{quote} -% |\providecommand\newfloat@list{}|\\ -% |\@cons\newfloat@list{|\marg{environment}|}| -% \end{quote} -% (Please note the doubled curly braces around the environment name.) -% \fi -% -% \iffalse -% --------------------------------------------------------------------------- % -% \fi -% -% \StopEventually{%^^A -% \pagebreak[4] -% \begin{thebibliography}{9} -% -% \bibitem{memoir} -% Peter Wilson:\\ -% \href{http://www.ctan.org/pkg/memoir}% -% {\emph{The Memoir Class for Configurable Typesetting}},\\ -% 2011/03/06 -% -% \bibitem{NTGclasses} -% Victor Eijkhout:\\ -% \href{http://www.ctan.org/pkg/ntgclass}% -% {\emph{An introduction to the Dutch \LaTeX\ document classes}},\\ -% \mbox{3~September~1989} -% -% \bibitem{KOMAScript} -% Markus Kohm \& Jens-Uwe-Morawski:\\ -% \href{http://www.ctan.org/pkg/koma-script}% -% {\emph{KOMA-Script -- a versatile \LaTeXe\ bundle}},\\ -% 2012-07-22 -% -% \bibitem{float} -% Anselm Lingnau:\\ -% \href{http://www.ctan.org/pkg/float}% -% {\emph{An Improved Environment for Floats}},\\ -% 2001/11/08 -% -% \bibitem{fltpage} -% Sebastian Gross:\\ -% \href{http://www.ctan.org/pkg/fltpage}% -% {\emph{Welcome to the beta test of fltpage package!}},\\ -% 1998/11/13 -% -% \bibitem{rotating} -% Sebastian Rahtz and Leonor Barroca:\\ -% \href{http://www.ctan.org/pkg/rotating}% -% {\emph{A style option for rotated objects in \LaTeX}},\\ -% 1997/09/26 -% -% \bibitem{sidecap} -% Rolf Niepraschk \& Hubert G\"a\ss lein:\\ -% \href{http://www.ctan.org/pkg/sidecap}% -% {\emph{The sidecap package}},\\ -% 2003/06/06 -% -% \bibitem{tocloft} -% Peter Wilson, Herries Press, Will Robertson:\\ -% \href{http://www.ctan.org/pkg/tocloft}% -% {\emph{The tocloft package}},\\ -% 2010/10/13 -% -% \bibitem{wrapfig} -% Donald Arseneau:\\ -% \href{http://www.ctan.org/pkg/wrapfig}% -% {\emph{WRAPFIG.STY ver 3.6}},\\ -% 2003/01/31 -% -% \end{thebibliography} -% } -% -% \iffalse -% --------------------------------------------------------------------------- % -% \fi -% -% \DoNotIndex{\\,\_,\ ,\@@par} -% \DoNotIndex{\@bsphack} -% \DoNotIndex{\@car,\@cdr,\@classoptionslist,\@cons,\@currext,\@currname} -% \DoNotIndex{\@ehc,\@ehd,\@empty,\@esphack,\@expandtwoargs} -% \DoNotIndex{\@for,\@firstofone,\@firstoftwo} -% \DoNotIndex{\@gobble,\@gobbletwo,\@gobblethree,\@gobblefour,\@hangfrom} -% \DoNotIndex{\@ifnextchar,\@ifpackagelater,\@ifpackageloaded} -% \DoNotIndex{\@ifstar,\@ifundefined,\@latex@error,\@namedef,\@nameuse} -% \DoNotIndex{\@onlypreamble,\@parboxrestore,\@plus,\@ptionlist} -% \DoNotIndex{\@removeelement,\@restorepar,\@secondoftwo,\@setpar} -% \DoNotIndex{\@tempa,\@tempboxa,\@tempdima,\@tempdimb,\@tempdimc,\@tempb,\@tempc} -% \DoNotIndex{\@testopt} -% \DoNotIndex{\@undefined,\@unprocessedoptions,\@unusedoptionlist} -% \DoNotIndex{\p@,\z@} -% \DoNotIndex{\active,\addtocounter,\addtolength,\advance,\aftergroup} -% \DoNotIndex{\baselineskip,\begin,\begingroup,\bfseries,\box} -% \DoNotIndex{\catcode,\centering,\changes,\csname,\def,\divide,\do,\downarrow} -% \DoNotIndex{\edef,\else,\empty,\end,\endcsname,\endgraf,\endgroup,\expandafter} -% \DoNotIndex{\fi,\footnotesize,\global} -% \DoNotIndex{\hangindent,\hbox,\hfil,\hsize,\hskip,\hspace,\hss} -% \DoNotIndex{\ifcase,\ifdim,\ifnum,\ifodd,\ifvoid,\ifvmode} -% \DoNotIndex{\ifx,\ignorespaces,\itshape} -% \DoNotIndex{\Large,\large,\leavevmode,\leftmargini,\leftskip,\let,\linewidth} -% \DoNotIndex{\llap,\long,\m@ne,\margin,\mdseries,\message} -% \DoNotIndex{\newcommand,\newdimen,\newlength,\newline,\newif,\newsavebox} -% \DoNotIndex{\next,\nobreak,\nobreakspace,\noexpand,\noindent,\numberline} -% \DoNotIndex{\normalcolor,\normalfont,\normalsize,\or,\par,\parbox,\parfillskip} -% \DoNotIndex{\parindent,\parskip,\prevdepth,\protect,\protected@edef,\protected@write} -% \DoNotIndex{\providecommand,\quad} -% \DoNotIndex{\raggedleft,\raggedright,\relax,\renewcommand,\RequirePackage} -% \DoNotIndex{\rightskip,\rmfamily} -% \DoNotIndex{\sbox,\scriptsize,\scshape,\setbox,\setlength,\sffamily,\slshape} -% \DoNotIndex{\small,\string,\space,\strut} -% \DoNotIndex{\textheight,\the,\toks@,\typeout,\ttfamily} -% \DoNotIndex{\unvbox,\uparrow,\upshape,\usebox,\usepackage} -% \DoNotIndex{\value,\vbox,\vsize,\vskip,\wd,\width,\z@skip} -% \DoNotIndex{\AtBeginDocument,\AtEndOfPackage,\CurrentOption,\DeclareOption} -% \DoNotIndex{\ExecuteOptions,\GenericWarning,\IfFileExists,\InputIfFileExists} -% \DoNotIndex{\NeedsTeXFormat,\MessageBreak} -% \DoNotIndex{\PackageError,\PackageInfo,\PackageWarning,\PackageWarningNoLine} -% \DoNotIndex{\PassOptionsToPackage,\ProcessOptions,\ProvidesPackage} -% -% \iffalse -% --------------------------------------------------------------------------- % -% \fi -% -% \setlength{\parskip}{0pt plus 1pt} -% \changes{v1.0}{2011/10/30}{First release as \package{newfloat} package, -% outsourced from the \package{caption3} package and revised} -% \changes{v1.1}{2013/04/27}{Adapted to the \package{tocloft} package} -% \changes{v1.1}{2013/04/27}{New command \cs{PrepareListOf} added} -% \changes{v1.1d}{2019/03/16}{Adapted to the \package{dgruyter} package} -% -% \iffalse -% --------------------------------------------------------------------------- % -% \fi -% -% \clearpage -% \section{The Implementation} -% \iffalse -%<*package> -% \fi -% -% \pagebreak[3] -% \subsection{Identification} -% -% \begin{macrocode} -\NeedsTeXFormat{LaTeX2e}[1994/12/01] -\ProvidesPackage{newfloat}[2019/09/01 v1.1k Defining new floating environments (AR)] -% \end{macrocode} -% -% \begin{macro}{\newfloat@Info} -% \begin{macro}{\newfloat@InfoNoLine} -% |\newfloat@Info|\marg{message} -% \begin{macrocode} -\newcommand*\newfloat@Info[1]{% - \PackageInfo{newfloat}{#1}} -\newcommand*\newfloat@InfoNoLine[1]{% - \newfloat@Info{#1\@gobble}} -% \end{macrocode} -% \end{macro} -% \end{macro} -% -% \begin{macro}{\newfloat@Warning} -% \begin{macro}{\newfloat@WarningNoLine} -% |\newfloat@Warning|\marg{message} -% \begin{macrocode} -\newcommand*\newfloat@Warning[1]{% - \PackageWarning{newfloat}{#1}} -\newcommand*\newfloat@WarningNoLine[1]{% - \newfloat@Warning{#1\@gobble}} -% \end{macrocode} -% \end{macro} -% \end{macro} -% -% \begin{macro}{\newfloat@Error} -% |\newfloat@Error|\marg{message} -% \begin{macrocode} -\newcommand*\newfloat@Error[1]{% - \PackageError{newfloat}{#1}\newfloat@eh} -% \end{macrocode} -% \begin{macrocode} -\newcommand*\newfloat@eh{% - If you do not understand this error, please take a closer look\MessageBreak - at the documentation of the `newfloat' package.\MessageBreak\@ehc} -% \end{macrocode} -% \end{macro} -% -% \pagebreak[3] -% \subsection{Using the keyval package} -% -% We need the \package{keyval} package for option handling, so we load it here. -% \begin{macrocode} -\RequirePackage{keyval}[1997/11/10] -% \end{macrocode} -% -% \pagebreak[3] -% \subsection{Helper macros} -% -% \begin{macro}{\newfloat@def} -% \changes{v1.1}{2013/04/27}{This macro added} -% |\newfloat@def|\marg{macro name}\marg{definition} -% \begin{macrocode} -\newcommand*\newfloat@def[2]{% - \newfloat@ifundefined{#1}{% - \@namedef{#1}{#2}}} -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\newfloat@let} -% \changes{v1.1}{2013/04/27}{This macro added} -% |\newfloat@let|\marg{macro name}\marg{macro} -% \begin{macrocode} -\newcommand*\newfloat@let[2]{% - \newfloat@ifundefined{#1}{% - \expandafter\let\csname #1\endcsname#2}} -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\newfloat@ifundefined} -% \changes{v1.1}{2013/04/27}{This macro added} -% |\newfloat@ifundefined|\marg{macro name}\marg{code} -% \begin{macrocode} -\newcommand*\newfloat@ifundefined[2]{% - \@ifundefined{#1}{#2}{% - \newfloat@Info{% - \expandafter\string\csname#1\endcsname\space is already defined}}} -% \end{macrocode} -% \end{macro} -% -% \pagebreak[3] -% \subsection{\cs{DeclareFloatingEnvironment}} -% -% \begin{macro}{\DeclareFloatingEnvironment} -% \changes{v1.0a}{2011/11/16}{Bugfix: Undefines \cs{fst@}\meta{environment} now} -% \changes{v1.1}{2013/04/27}{Revised, only defines stuff yet undefined now} -% \changes{v1.1}{2013/11/03}{Uses \cs{newfloat@capitalize} now} -% \changes{v1.1}{2015/09/16}{Support of \cs{autodot} (offered by the \KOMAScript\ classes) added} -% \changes{v1.1}{2018/03/04}{Usage of \cs{ifdefined} replaced by \cs{@ifundefined} to improve compatibility with the \package{listings} package} -% \changes{v1.1b}{2018/12/26}{Bugfix: Missing curly braces added} -% \changes{v1.1c}{2019/01/10}{Bugfix: Support of \cs{autodot} fixed} -% \changes{v1.1k}{2019/09/01}{Adapted to the \class{beamer} document class} -% |\DeclareFloatingEnvironment|\oarg{options}\marg{environment}\oarg{name}\oarg{list name} -% \begin{macrocode} -\newcommand*\DeclareFloatingEnvironment{% - \@testopt\@DeclareFloatingEnvironment{}} -\@onlypreamble\DeclareFloatingEnvironment -% \end{macrocode} -% \begin{macrocode} -\def\@DeclareFloatingEnvironment[#1]#2{% - \newfloat@Info{New float `#2' with options `#1'}% -% \end{macrocode} -% Define a counter with the same name as the floating environment -% \begin{macrocode} - \newfloat@ifundefined{c@#2}{\newcounter{#2}}% -% \end{macrocode} -% Set |\ftype@|\meta{type} which contains the type number for floats of type \meta{type}\par -% (See also \url{http://tex.stackexchange.com/q/32359/2574}) -% \begin{macrocode} - \@ifundefined{c@float@type}% from float package - {\@ifundefined{c@newflo@tctr}% from memoir document class - {\ifdefined\newfloat@ftype \else - \newcount\newfloat@ftype - \newfloat@ftype=8\relax - \fi - \expandafter\xdef\csname ftype@#2\endcsname{\the\newfloat@ftype}% - \advance\newfloat@ftype\newfloat@ftype}% - {\expandafter\edef\csname ftype@#2\endcsname{\the\c@newflo@tctr}% - \advance\c@newflo@tctr \c@newflo@tctr}}% - {\expandafter\edef\csname ftype@#2\endcsname{\the\value{float@type}}% - \addtocounter{float@type}{\value{float@type}}}% -% \end{macrocode} -% \begin{macrocode} - \newfloat@Info{float type `#2'=\@nameuse{ftype@#2}}% -% \end{macrocode} -% Define |\fnum@|\meta{type}, a macro to generate the figure number for a caption -% \begin{macrocode} - \newfloat@def{fnum@#2}% - {\@nameuse{#2name}\nobreakspace\@nameuse{the#2}% - \ifdefined\autodot\expandafter\autodot\fi}% -% \end{macrocode} -% Define |\|\meta{type}|name| used by |\fnum@|\meta{type} as \meta{type}, -% but with first letter capitalized -% \begin{macrocode} - \newfloat@capitalize\newfloat@Type{#2}% - \newfloat@let{#2name}{\newfloat@Type}% - \newfloat@def{fleg#2}{\@nameuse{#2name}}% legend naming (memoir) -% \end{macrocode} -% Legend name in ToC (memoir document class) -% \begin{macrocode} - \newfloat@ifundefined{flegtoc#2}{\@namedef{flegtoc#2}##1{}}% -% \end{macrocode} -% Define the floating environment\par -% If the \class{tufte} document class is loaded, -% |\@tufte@float| and |\end@tufte@float| will be used instead of -% |\@float|, |\end@float|, |\@dblfloat|, and |\end@dblfloat|.\par -% If the \class{beamer} document class is loaded, -% |\beamer@float| and |\end@beamer@float| will be used. -% \begin{macrocode} - \ifcsname @tufte@float\endcsname - \newenvironment{#2}[1][htbp]% - {\begin{@tufte@float}[{##1}]{#2}{}}% - {\end{@tufte@float}}% - \newenvironment{#2*}[1][htbp]% - {\begin{@tufte@float}[{##1}]{#2}{star}}% - {\end{@tufte@float}}% - \else - \@ifclassloaded{beamer}{% - \newenvironment{#2}[1][]{\beamer@float{#2}}{\end@beamer@float}% - }{% - \newenvironment{#2}{\@float{#2}}{\end@float}% - \newenvironment{#2*}{\@dblfloat{#2}}{\end@dblfloat}% - }% - \fi -% \end{macrocode} -% Define the listing command |\listof|\meta{type}(|e|)|s| -% \changes{v1.1}{2013/04/27}{Definition of list hook added} -% \begin{macrocode} - \newfloat@def{listof#2}{\newfloat@listof{#2}}% - \newfloat@def{listof#2s}{\@nameuse{listof#2}}% - \newfloat@def{listof#2es}{\@nameuse{listof#2s}}% - \newfloat@def{newfloat@listof#2@hook}{}% - \ifdefined\l@figure - \newfloat@let{l@#2}{\l@figure}% - \else - \newfloat@def{l@#2}{\@dottedtocline{1}{1.5em}{2.3em}}% - \fi - \edef\newfloat@tempa{List of \newfloat@Type s}% - \newfloat@let{list#2name}{\newfloat@tempa}% -% \end{macrocode} -% We undefine |\fst@|\meta{environment} so the new environment -% will not be recognized as defined by the \package{float} package. -% (|\fst@|\meta{type} use to hold the float style, see \package{float} package -% implementation for details.) -% \begin{macrocode} - \expandafter\let\csname fst@#2\endcsname\@undefined -% \end{macrocode} -% Set default parameters -% \begin{macrocode} - \newfloat@ifundefined{fps@#2}{\newfloat@setplacement{#2}{tbp}}% - \newfloat@ifundefined{ext@#2}{\newfloat@setfileext{#2}{lo#2}}% -% \end{macrocode} -% Apply given options -% \begin{macrocode} - \newfloat@setoptions*{#2}{#1}% -% \end{macrocode} -% Announce the new floating environment to other packages -% \begin{macrocode} - \@expandtwoargs\newfloat@announce{#2}{\@nameuse{ext@#2}}% -% \end{macrocode} -% Apply the last two optional arguments for setting names -% \begin{macrocode} - \@ifnextchar[\newfloat@DFE@setname\relax} -\@onlypreamble\@DeclareFloatingEnvironment -% \end{macrocode} -% \begin{macrocode} -\def\newfloat@DFE@setname[#1]{% - \KV@@newfloat@name{#1}% - \@ifnextchar[\newfloat@DFE@setlistname\relax} -\@onlypreamble\newfloat@DFE@setname -% \end{macrocode} -% \begin{macrocode} -\def\newfloat@DFE@setlistname[#1]{% - \KV@@newfloat@listname{#1}} -\@onlypreamble\newfloat@DFE@setlistname -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\newfloat@capitalize} -% \changes{v1.1}{2013/11/03}{Code extracted from \cs{DeclareFloatingEnvironment}} -% \changes{v1.1}{2013/11/03}{Uses \cs{newfloat@tempa} instead of \cs{@tempa} now} -% |\newfloat@capitalize|\marg{command}\marg{name}\\ -% Defines \meta{command} to \meta{name}, but with first letter capitalized. -% \begin{macrocode} -\newcommand*\newfloat@capitalize[2]{% - \edef\newfloat@tempa{\gdef\noexpand#1{\@car#2\@nil}}% - \uppercase\expandafter{\newfloat@tempa}% - \edef\newfloat@tempa{% - \noexpand\g@addto@macro\noexpand#1{\@cdr#2\@nil}}% - \newfloat@tempa} -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\newfloat@listof} -% \changes{v1.1}{2013/04/27}{Revised} -% \changes{v1.1g}{2019/08/28}{Starred variant added} -% |\newfloat@listof|\marg{float type}\\ -% typesets the list, using |\listoffigure| with patched list name and file extension. -% \begin{macrocode} -\newcommand*\newfloat@listof[1]{% - \@ifstar - {\newfloat@list@of{#1}*}% - {\newfloat@list@of{#1}\relax}} -% \end{macrocode} -% \begin{macrocode} -\newcommand*\newfloat@list@of[1]{% - \@expandtwoargs\newfloat@list@of@{#1}{\@nameuse{ext@#1}}} -% \end{macrocode} -% \begin{macrocode} -\newcommand*\newfloat@list@of@[3]{% - \begingroup - \expandafter\let\expandafter\listfigurename\csname list#1name\endcsname - \def\ext@figure{#2}% - \let\newfloat@starttoc\@starttoc - \def\@starttoc##1{\newfloat@starttoc{#2}}% - \let\newfloat@listoftoc\listoftoc - \def\listoftoc##1{\newfloat@listoftoc{#2}}% - \@nameuse{newfloat@listof#1@hook}% - \listoffigures#3% - \endgroup} -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\newfloat@setoptions} -% |\newfloat@setoptions*|\marg{environment}\marg{options} -% \begin{macrocode} -\newcommand*\newfloat@setoptions{% - \@ifstar - {\newfloat@@setoptions\@firstofone}% - {\newfloat@@setoptions\@gobble}} -% \end{macrocode} -% \begin{macrocode} -\newcommand*\newfloat@@setoptions[3]{% - \let\newfloat@within@value\@undefined - \let\newfloat@chapterlistsgaps@value\@undefined - #1{\KV@@newfloat@within\newfloat@within@default}% set default value for new floats - \def\newfloat@type{#2}% - \setkeys{@newfloat}{#3}% - \ifx\newfloat@within@value\@undefined \else - \newfloat@setoption{within}\newfloat@within@value - \fi - \ifx\newfloat@chapterlistsgaps@value\@undefined \else - \newfloat@setoption{chapterlistsgaps}\newfloat@chapterlistsgaps@value - \fi} -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\newfloat@within@default} -% The default `within' value. -% This one will be used if no option |within=|\meta{counter} is given. -% \begin{macrocode} -\newcommand*\newfloat@within@default{% - \ifcsname c@chapter\endcsname chapter\else none\fi} -\@onlypreamble\newfloat@within@default -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\newfloat@setoption} -% \changes{v1.1}{2015/09/15}{Bugfix: \cs{@expandtwoargs} replaced by own expansion so the option value do not get expanded anymore} -% |\newfloat@setoption|\marg{option name}{options} -% \begin{macrocode} -\newcommand*\newfloat@setoption[1]{% - \edef\caption@tempa{\noexpand\@nameuse{newfloat@set#1}{\newfloat@type}}% - \caption@tempa} -% \end{macrocode} -% \end{macro} -% -% The available \meta{options} are: -% |fileext=|\meta{file extension}, -% |listname=|\meta{list name}, -% |name=|\meta{prosa name}, -% |placement=|\meta{htbp}, -% |within=|\meta{none,chapter,section}, and -% |without|. -% -% \begin{macro}{\newfloat@setfileext} -% |\newfloat@setfileext|\marg{environment}\marg{file extension} -% \begin{macrocode} -\newcommand*\newfloat@setfileext[2]{% - \@namedef{ext@#1}{#2}} -% \end{macrocode} -% \begin{macrocode} -\define@key{@newfloat}{fileext}{% - \newfloat@setoption{fileext}{#1}} -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\newfloat@setlistname} -% |\newfloat@setlistname|\marg{environment}\marg{list name} -% \begin{macrocode} -\newcommand*\newfloat@setlistname[2]{% - \@namedef{list#1name}{#2}} -% \end{macrocode} -% \begin{macrocode} -\define@key{@newfloat}{listname}{% - \newfloat@setoption{listname}{#1}} -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\newfloat@setname} -% |\newfloat@setname|\marg{environment}\marg{name} -% \begin{macrocode} -\newcommand*\newfloat@setname[2]{% - \newfloat@@setname{#1}{#2}% - \begingroup - \ifcsname languagename\endcsname - \ifcsname captions\languagename\endcsname - \expandafter\g@addto@macro\csname captions\languagename\endcsname - {\newfloat@@setname{#1}{#2}}% - \fi - \fi - \endgroup} -%%\AtBeginDocument{\let\newfloat@setname\newfloat@@setname} -% \end{macrocode} -% \begin{macrocode} -\newcommand*\newfloat@@setname[2]{% - \@namedef{#1name}{#2}} -% \end{macrocode} -% \begin{macrocode} -\define@key{@newfloat}{name}{% - \newfloat@setoption{name}{#1}} -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\newfloat@setplacement} -% |\newfloat@setplacement|\marg{environment}\marg{float placement} -% \begin{macrocode} -\newcommand*\newfloat@setplacement[2]{% - \@namedef{fps@#1}{#2}} -% \end{macrocode} -% \begin{macrocode} -\define@key{@newfloat}{placement}{% - \newfloat@setoption{placement}{#1}} -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\newfloat@setwithin} -% |\newfloat@setwithin|\marg{environment}\marg{counter}\par -% setup the counter for working ``within'' a given counter. -% Furthermore the chapters lists gap will be switched on -% (if counter $=$ |chapter|) or off (otherwise). -% \begin{macrocode} -\newcommand*\newfloat@setwithin[2]{% - \ifcsname c@chapter\endcsname - \@removefromreset{#1}{chapter}% - \fi - \@removefromreset{#1}{section}% -% \end{macrocode} -% \begin{macrocode} - \edef\@tempa{#2}% - \ifx\@tempa\@empty - \def\@tempa{none}% - \fi - \def\@tempb{none}% - \ifx\@tempa\@tempb - \ifcsname c@chapter\endcsname - \@chapterlistsgap@off{#1}% - \fi - \newfloat@@setwithin{#1}{}{}% - \else - \def\@tempb{chapter}% - \ifx\@tempa\@tempb - \@addtoreset{#1}{chapter}% - \@chapterlistsgap@on{#1}% - \newfloat@@setwithin{#1}{\ifnum\c@chapter>\z@ \thechapter.\fi}{\theHchapter.}% - \else - \def\@tempb{section}% - \ifx\@tempa\@tempb - \@addtoreset{#1}{section}% - \ifcsname c@chapter\endcsname - \@addtoreset{#1}{chapter}% - \@chapterlistsgap@on{#1}% - \newfloat@@setwithin{#1}{\thesection.}{\theHsection.}% - \else - \newfloat@@setwithin{#1}{\ifnum\c@section>\z@ \thesection.\fi}{\theHsection.}% - \fi - \else - \newfloat@Error{Invalid value `#2' for option `within'}% - \fi - \fi - \fi} -% \end{macrocode} -% Note: Since the \package{hyperref} package with version $<$ 6.82k defines -% |\the|\-|H|\-|figure| and |\the|\-|H|\-|table| with |\new|\-|command|, -% |\newfloat@@setwithin| will yield to an error message when using with an -% old version of \package{hyperref}, -% e.g. ``\texttt{LaTeX Error: Command \cs{theHfigure} already defined}''. -% \begin{macrocode} -\newcommand*\newfloat@@setwithin[3]{% - \global\@namedef{the#1}{#2\arabic{#1}}% - \global\@namedef{theH#1}{#3\arabic{#1}}} -% \end{macrocode} -% \begin{macrocode} -\define@key{@newfloat}{within}{% - \def\newfloat@within@value{#1}} -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\newfloat@setwithout} -% |\newfloat@setwithout|\marg{environment} -% \begin{macrocode} -\newcommand*\newfloat@setwithout[1]{% - \newfloat@setwithin{#1}{none}} -% \end{macrocode} -% \begin{macrocode} -\define@key{@newfloat}{without}[]{% - \def\newfloat@within@value{none}} -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\newfloat@setchapterlistsgaps} -% |\newfloat@setchapterlistsgaps|\marg{environment}\marg{on/off} -% \begin{macrocode} -\newcommand*\newfloat@setchapterlistsgaps[2]{% - \edef\@tempa{#2}% - \def\@tempb{off}% - \ifx\@tempa\@tempb - \@chapterlistsgap@off{#1}% - \else - \def\@tempb{on}% - \ifx\@tempa\@tempb - \@chapterlistsgap@on{#1}% - \else - \newfloat@Error{Invalid value `#2' for option `chapterlistsgaps'}% - \fi - \fi} -% \end{macrocode} -% \begin{macrocode} -\define@key{@newfloat}{chapterlistsgaps}{% - \def\newfloat@chapterlistsgaps@value{#1}} -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\@removefromreset} -% This code was taken from the \package{remreset} package -% which is part of the `carlisle' package bundle. -% (Copyright 1997 David Carlisle) -% \begin{macrocode} -\providecommand*\@removefromreset[2]{{% - \expandafter\let\csname c@#1\endcsname\@removefromreset - \def\@elt##1{% - \expandafter\ifx\csname c@##1\endcsname\@removefromreset - \else - \noexpand\@elt{##1}% - \fi}% - \expandafter\xdef\csname cl@#2\endcsname{% - \csname cl@#2\endcsname}}} -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\newfloat@announce} -% |\newfloat@announce|\marg{environment name}\marg{list file extension} -% \begin{macrocode} -\newcommand*\newfloat@announce[2]{% -% \end{macrocode} -% \begin{macrocode} - \@cons\newfloat@list{{#1}}% - \@cons\newfloat@@list{{#1}}% -% \end{macrocode} -% \begin{macrocode} - \newfloat@ifundefined{newfloat@ext@#2}{% - \@namedef{newfloat@ext@#2}{#1}% -% \end{macrocode} -% Support of \package{memoir} document class -% \begin{macrocode} - \ifcsname c@lofdepth\endcsname - \newfloat@ifundefined{c@#2depth}{% - \newcounter{#2depth}% - \setcounter{#2depth}{1}}% - \fi -% \end{macrocode} -% Support of \package{tocbasic} package -% \begin{macrocode} - \ifcsname addtotoclist\endcsname - \addtotoclist[float]{#2}% - \newfloat@def{listof#2name}{\@nameuse{list#1name}}% - \fi -% \end{macrocode} -% \begin{macrocode} - }% -% \end{macrocode} -% Support of \package{titletoc} package -% \begin{macrocode} - \ifcsname contentsuse\endcsname - \contentsuse{#1}{#2}% - \fi -% \end{macrocode} -% \begin{macrocode} - \newfloat@hook{#1}} -\@onlypreamble\newfloat@announce -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\newfloat@@list} -% |\newfloat@@list| is an \cs{@elt}-list containing the floating environments defined -% with |\Declare|\-|Floating|\-|Environment| only. -% \begin{macrocode} -\newcommand*\newfloat@@list{} -% \end{macrocode} -% \end{macro} -% -% \pagebreak[3] -% \subsection{\cs{SetupFloatingEnvironment}} -% -% \begin{macro}{\SetupFloatingEnvironment} -% |\SetupFloatingEnvironment|\marg{environment}\marg{options} -% \begin{macrocode} -\newcommand*\SetupFloatingEnvironment[1]{% - \newfloat@addtolist{#1}% - \newfloat@setoptions{#1}} -% \end{macrocode} -% \end{macro} -% -% \pagebreak[3] -% \subsection{\cs{ForEachFloatingEnvironment}} -% -% \begin{macro}{\ForEachFloatingEnvironment} -% |\ForEachFloatingEnvironment|\marg{code} -% will execute the given code for each floating environment. -% The starred variant will only work for already existing environments, -% i.e.~no hook will be placed inside |\Declare|\-|Floating|\-|Environment|. -% \begin{macrocode} -\newcommand\ForEachFloatingEnvironment{% - \@ifstar - {\@ForEachFloatingEnvironment\@gobble}% - {\@ForEachFloatingEnvironment\@iden}} -% \end{macrocode} -% \begin{macrocode} -\newcommand\@ForEachFloatingEnvironment[2]{% - \def\@elt##1{#2}% - \newfloat@list - \let\@elt\relax - #1{\newfloat@addtohook{#2}}} -% \end{macrocode} -% \begin{macrocode} -\providecommand\newfloat@addtohook[1]{% - \toks@=\expandafter{\newfloat@hook{##1}#1}% - \edef\@tempa{\def\noexpand\newfloat@hook####1{\the\toks@}}% - \@tempa} -% \end{macrocode} -% \begin{macrocode} -\providecommand*\newfloat@hook[1]{} -% \end{macrocode} -% \end{macro} -% -% \pagebreak[3] -% \subsection{\cs{PrepareListOf}} -% -% \begin{macro}{\PrepareListOf} -% \changes{v1.1}{2013/04/27}{This macro added} -% |\PrepareListOf|\marg{float type}\marg{code}\\ -% adds \meta{code} to the one which prepares typesetting the list, -% just before |\listoffigures|. -% \begin{macrocode} -\newcommand\PrepareListOf[1]{% - \expandafter\g@addto@macro\csname newfloat@listof#1@hook\endcsname} -\@onlypreamble\PrepareListOf -% \end{macrocode} -% \end{macro} -% -% \pagebreak[3] -% \subsection{The list of floating environments} -% -% \begin{macro}{\newfloat@list} -% |\newfloat@list| is an \cs{@elt}-list containing the already existising floating -% environments as well the ones defined with |\Declare|\-|Floating|\-|Environment|. -% \begin{macrocode} -\newcommand*\newfloat@list{} -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\newfloat@addtolist} -% \changes{v1.0b}{2012/05/18}{Bugfix: Definition of \cs{@ifchapterlistsgap@}\meta{environment} added} -% |\newfloat@addtolist|\marg{environment} -% adds an environment to the list of floating environments. -% \begin{macrocode} -\newcommand*\newfloat@addtolist[1]{% - \newfloat@ifinlist{#1}{}{% - \ifcsname ext@#1\endcsname - \@cons\newfloat@list{{#1}}% - \@namedef{newfloat@ext@\@nameuse{ext@#1}}{#1}% - \newfloat@let{@ifchapterlistsgap@#1}{\@iden}% - \else - \newfloat@Error{`#1' does not seem to be a floating environment}% - \fi}} -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\newfloat@ifinlist} -% |\newfloat@ifinlist|\marg{environment}\marg{yes code}\marg{no code} -% tests if an environment is an element of the list of floating environments. -% \begin{macrocode} -\newcommand*\newfloat@ifinlist[1]{% - \let\next\@secondoftwo - \begingroup - \expandafter\let\csname c@#1\endcsname\newfloat@ifinlist - \def\@elt##1{% - \expandafter\ifx\csname c@##1\endcsname\newfloat@ifinlist - \global\let\next\@firstoftwo - \fi}% - \newfloat@list - \endgroup - \next} -% \end{macrocode} -% \end{macro} -% -% Add |figure| and |table| to the list of floating environments. -% \begin{macrocode} -\ifcsname ext@figure\endcsname - \newfloat@addtolist{figure} -\fi -\ifcsname ext@table\endcsname - \newfloat@addtolist{table} -\fi -% \end{macrocode} -% -% \pagebreak[3] -% \subsection{Chapter lists gaps} -% -% \begin{macrocode} -\ifcsname @chapter\endcsname -% \end{macrocode} -% -% \begin{macro}{\@chapterlistsgap} -% The amount of the chapter lists gap, the default one is |10pt|. -% (This command is already defined in \KOMAScript.) -% \begin{macrocode} - \providecommand*\@chapterlistsgap{10\p@}% -% \end{macrocode} -% If the \package{dgruyter} package is loaded, the default gap is |13pt|. -% \begin{macrocode} - \@ifpackageloaded{dgruyter}{\renewcommand*\@chapterlistsgap{13\p@}}{}% -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\@addchapterlistsgap} -% |\@addchapterlistsgap|\marg{float type}\marg{file extension}\par -% will add the chapter lists gap for the given float type. -% \begin{macrocode} - \providecommand*\@addchapterlistsgap[2]{% - \@nameuse{@ifchapterlistsgap@#1}{% if switched on - \@@addchapterlistsgap{#1}{#2}}} -% \end{macrocode} -% \begin{macrocode} - \providecommand*\@@addchapterlistsgap[2]{% - \@ifundefined{@addchapterlistsgap@#2}{% only once per extension - \@namedef{@addchapterlistsgap@#2}{#1}% - \@@@addchapterlistsgap{#2}}{}} -% \end{macrocode} -% \begin{macrocode} - \providecommand*\@@@addchapterlistsgap[1]{% - \ifdim \@chapterlistsgap>\z@ - \addtocontents{#1}{\protect\addvspace{\@chapterlistsgap}}% - \fi} -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\@addchapterlistsgaps} -% \changes{v1.0b}{2012/05/18}{Bugfix: Group added to make \cs{@addchapterlistsgap} work correctly} -% |\@addchapterlistsgaps|\par -% will add the chapter lists gaps for all floating environments in |\newfloat@list|. -% \begin{macrocode} - \providecommand*\@addchapterlistsgaps{% - \begingroup - \def\@elt##1{% - \@expandtwoargs\@addchapterlistsgap{##1}{\@nameuse{ext@##1}}}% - \newfloat@list - \endgroup} -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\@chapterlistsgap@off} -% |\@chapterlistsgap@off|\marg{float type}\par -% switches the chapter lists gap off for the given float type. -% Since \KOMAScript{} (still) supports |\float@exts| we need to handle -% this locally, too, even if |\unsettoc| is offered by the \package{tocbasic} package. -% (Otherwise our handling could be moved into the |\else| branch.) -% \begin{macrocode} - \providecommand*\@chapterlistsgap@off[1]{% - \expandafter\let\csname @ifchapterlistsgap@#1\endcsname\@gobble - \ifcsname unsettoc\endcsname - \@expandtwoargs\unsettoc{\@nameuse{ext@#1}}{chapteratlist}% - \fi} -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\@chapterlistsgap@on} -% |\@chapterlistsgap@off|\marg{float type}\par -% switches the chapter lists gap on for the given float type. -% \begin{macrocode} - \providecommand*\@chapterlistsgap@on[1]{% - \expandafter\let\csname @ifchapterlistsgap@#1\endcsname\@iden - \ifcsname setuptoc\endcsname - \@expandtwoargs\setuptoc{\@nameuse{ext@#1}}{chapteratlist}% - \fi} -% \end{macrocode} -% \end{macro} -% -% \begin{macrocode} -\fi -% \end{macrocode} -% -% \pagebreak[3] -% \subsection{Global options} -% -% \begin{macro}{chapterlistsgap=} -% The |chapterlistsgap=| option sets the vertical skip added to each list when -% starting a new chapter. -% \begin{macrocode} -\define@key{newfloat}{chapterlistsgap}{% - \renewcommand*\@chapterlistsgap{#1}} -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{within=} -% The |within=| option redefines the default value and modifies all -% existing floating environments. -% \begin{macrocode} -\define@key{newfloat}{within}{% - \def\newfloat@within@default{#1}% set new default value - \def\@elt##1{\newfloat@setwithin{##1}{#1}}% - \newfloat@list - \let\@elt\relax} -% \end{macrocode} -% \begin{macrocode} -\define@key{newfloat}{without}[]{% - \KV@newfloat@within{none}} -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{figurename=} -% \begin{macro}{listfigurename=} -% \begin{macro}{figurewithin=} -% We define these options not only for |figure| but for all existing floating environments. -% \begin{macrocode} -\def\@elt#1{% - \define@key{newfloat}{#1name}{% - \newfloat@setname{#1}{##1}}% - \define@key{newfloat}{list#1name}{% - \newfloat@setname{list#1}{##1}}% - \define@key{newfloat}{#1within}{% - \newfloat@setwithin{#1}{##1}}% - \define@key{newfloat}{#1without}[]{% - \newfloat@setwithout{#1}}% -}% -\newfloat@list -\let\@elt\relax -% \end{macrocode} -% \end{macro} -% \end{macro} -% \end{macro} -% -% \begin{macro}{planb=} -% \changes{v1.0b}{2012/05/18}{This option added} -% This option switches the `Plan B' on or off. (default$=$true) -% \begin{macrocode} -\define@key{newfloat}{planb}[true]{% - \def\@tempa{#1}% - \def\@tempb{false}% - \ifx\@tempa\@tempb - \let\newfloat@ifplanb\@gobble - \else - \def\@tempb{true}% - \ifx\@tempa\@tempb - \let\newfloat@ifplanb\@iden - \else - \newfloat@Error{Invalid value `#1' for option `planb'}% - \fi - \fi} -% \end{macrocode} -% \end{macro} -% \begin{macro}{planb-filext=} -% \changes{v1.0b}{2012/05/19}{This option added} -% This option sets the file extension used for `Plan B'. -% (default$=$use the 1st one which seem to fit) -% \begin{macrocode} -\define@key{newfloat}{planb-fileext}{% - \newfloat@Info{Setting Plan B file extension to `#1'} - \xdef\newfloat@addtocontents@ext{#1}} -% \end{macrocode} -% \end{macro} -% -% Process the package options: -% We use |\setkeys| here instead of |\ProcessOptions|. -% \begin{macrocode} -\let\@tempc\relax -\@expandtwoargs\setkeys{newfloat}{planb,\@ptionlist{\@currname.\@currext}}% -\AtEndOfPackage{\let\@unprocessedoptions\relax} -% \end{macrocode} -% -% \begin{macro}{\newfloatsetup} -% |\newfloatsetup|\marg{options} -% sets global options after loading the package. -% \begin{macrocode} -\newcommand*\newfloatsetup{\setkeys{newfloat}} -% \end{macrocode} -% \end{macro} -% -% \pagebreak[3] -% \subsection{Patching \cs{chapter}} -% -% \begin{macro}{\newfloat@replace@chapter} -% \changes{v1.1f}{2019/08/25}{Parameter \meta{class name} added to macro} -% \changes{v1.1i}{2019/08/31}{Local definition of \cs{if@chapnum} added} -% |\newfloat@replace@chapter|\marg{class name}\marg{original code}\marg{replacement code}\par -% tries to patch |\@chapter| so |\@add|\-|chapter|\-|lists|\-|gaps| will be supported. -% It checks for |\Hy@org@chapter|, too, since the original code will be stored here -% if the \package{hyperref} package was loaded. -% \begin{macrocode} -\newcommand\newfloat@replace@chapter[3]{% - \begingroup - \let\if@twocolumn\iffalse - \let\if@mainmatter\iffalse - \let\if@thema\iffalse - \let\if@chapnum\iffalse - \def\@tempa[##1]##2{#2}% - \ifx\@tempa\@chapter - \newfloat@InfoNoLine{Document class `#1' detected}% - \gdef\@chapter[##1]##2{#3}% - \global\let\newfloat@replace@chapter\newfloat@dont@replace@chapter - \else\ifx\@tempa\Hy@org@chapter - \newfloat@InfoNoLine{Document class `#1' detected (Hy)}% - \gdef\Hy@org@chapter[##1]##2{#3}% - \global\let\newfloat@replace@chapter\newfloat@dont@replace@chapter - \fi\fi - \endgroup} -% \end{macrocode} -% \begin{macrocode} -\newcommand\newfloat@dont@replace@chapter[3]{} -% \end{macrocode} -% \begin{macrocode} -\ifcsname @chapter\endcsname \else - \let\newfloat@replace@chapter\newfloat@dont@replace@chapter -\fi -% \end{macrocode} -% \end{macro} -% -% \pagebreak[3] -% \subsubsection{Standard \LaTeX{} document classes} -% -% \begin{macrocode} -% report.cls [2005/09/16 v1.4f Standard LaTeX document class] -\newfloat@replace@chapter{report}{% - \ifnum \c@secnumdepth >\m@ne - \refstepcounter{chapter}% - \typeout{\@chapapp\space\thechapter.}% - \addcontentsline{toc}{chapter}% - {\protect\numberline{\thechapter}#1}% - \else - \addcontentsline{toc}{chapter}{#1}% - \fi - \chaptermark{#1}% - \addtocontents{lof}{\protect\addvspace{10\p@}}% - \addtocontents{lot}{\protect\addvspace{10\p@}}% - \if@twocolumn - \@topnewpage[\@makechapterhead{#2}]% - \else - \@makechapterhead{#2}% - \@afterheading - \fi -}{% - \ifnum \c@secnumdepth >\m@ne - \refstepcounter{chapter}% - \typeout{\@chapapp\space\thechapter.}% - \addcontentsline{toc}{chapter}% - {\protect\numberline{\thechapter}#1}% - \else - \addcontentsline{toc}{chapter}{#1}% - \fi - \chaptermark{#1}% - \@addchapterlistsgaps - \if@twocolumn - \@topnewpage[\@makechapterhead{#2}]% - \else - \@makechapterhead{#2}% - \@afterheading - \fi} -% \end{macrocode} -% -% \begin{macrocode} -% book.cls [2005/09/16 v1.4f Standard LaTeX document class] -\newfloat@replace@chapter{book}{% - \ifnum \c@secnumdepth >\m@ne - \if@mainmatter - \refstepcounter{chapter}% - \typeout{\@chapapp\space\thechapter.}% - \addcontentsline{toc}{chapter}% - {\protect\numberline{\thechapter}#1}% - \else - \addcontentsline{toc}{chapter}{#1}% - \fi - \else - \addcontentsline{toc}{chapter}{#1}% - \fi - \chaptermark{#1}% - \addtocontents{lof}{\protect\addvspace{10\p@}}% - \addtocontents{lot}{\protect\addvspace{10\p@}}% - \if@twocolumn - \@topnewpage[\@makechapterhead{#2}]% - \else - \@makechapterhead{#2}% - \@afterheading - \fi -}{% - \ifnum \c@secnumdepth >\m@ne - \if@mainmatter - \refstepcounter{chapter}% - \typeout{\@chapapp\space\thechapter.}% - \addcontentsline{toc}{chapter}% - {\protect\numberline{\thechapter}#1}% - \else - \addcontentsline{toc}{chapter}{#1}% - \fi - \else - \addcontentsline{toc}{chapter}{#1}% - \fi - \chaptermark{#1}% - \@addchapterlistsgaps - \if@twocolumn - \@topnewpage[\@makechapterhead{#2}]% - \else - \@makechapterhead{#2}% - \@afterheading - \fi} -% \end{macrocode} -% -% \pagebreak[3] -% \subsubsection{\AmS{} \& \SmF{} document classes} -% -% \begin{macrocode} -% amsbook.cls [2004/08/06 v2.20] -% smfbook.cls [1999/11/15 v1.2f Classe LaTeX pour les monographies editees par la SMF] -\newfloat@replace@chapter{amsbook}{% - \refstepcounter{chapter}% - \ifnum\c@secnumdepth<\z@ \let\@secnumber\@empty - \else \let\@secnumber\thechapter \fi - \typeout{\chaptername\space\@secnumber}% - \def\@toclevel{0}% - \ifx\chaptername\appendixname \@tocwriteb\tocappendix{chapter}{#2}% - \else \@tocwriteb\tocchapter{chapter}{#2}\fi - \chaptermark{#1}% - \addtocontents{lof}{\protect\addvspace{10\p@}}% - \addtocontents{lot}{\protect\addvspace{10\p@}}% - \@makechapterhead{#2}\@afterheading -}{% - \refstepcounter{chapter}% - \ifnum\c@secnumdepth<\z@ \let\@secnumber\@empty - \else \let\@secnumber\thechapter \fi - \typeout{\chaptername\space\@secnumber}% - \def\@toclevel{0}% - \ifx\chaptername\appendixname \@tocwriteb\tocappendix{chapter}{#2}% - \else \@tocwriteb\tocchapter{chapter}{#2}\fi - \chaptermark{#1}% - \@addchapterlistsgaps - \@makechapterhead{#2}\@afterheading} -% \end{macrocode} -% -% \pagebreak[3] -% \subsubsection{\KOMAScript{} document classes} -% -% If a \KOMAScript{} document class or the \package{tocbasic} package is used -% we don't need to patch anything. -% Instead we use |\setup|\-|toc| and |\un|\-|set|\-|toc| to setup the -% chapters gap in |\@chapter|\-|lists|\-|gap@on| and |\@chapter|\-|lists|\-|gap@off|. -% \begin{macrocode} -\@ifpackageloaded{tocbasic}{% - \let\newfloat@replace@chapter\newfloat@dont@replace@chapter}{} -% \end{macrocode} -% -% \pagebreak[3] -% \subsubsection{memoir document classes} -% -% If the \package{memoir} document class is used, -% replacing |\insert|\-|chapter|\-|space| by |\@add|\-|chapter|\-|lists|\-|gaps| is sufficient. -% \begin{macrocode} -\ifcsname insertchapterspace\endcsname - \renewcommand*\insertchapterspace{\@addchapterlistsgaps} - \let\newfloat@replace@chapter\newfloat@dont@replace@chapter -\fi -% \end{macrocode} -% -% \pagebreak[3] -% \subsubsection{NTG document classes} -% -% \begin{macrocode} -% rapport1/3.cls [2004/06/07 v2.1a NTG LaTeX document class] -\newfloat@replace@chapter{rapport}{% - \ifnum \c@secnumdepth >\m@ne - \refstepcounter{chapter}% - \typeout{\@chapapp\space\thechapter.}% - \addcontentsline{toc}{chapter}% - {\protect\numberline{\thechapter}\toc@font0 #1}% - \else - \addcontentsline{toc}{chapter}{\toc@font0 #1}% - \fi - \chaptermark{#1}% - \addtocontents{lof}{\protect\addvspace{10\p@}}% - \addtocontents{lot}{\protect\addvspace{10\p@}}% - \if@twocolumn - \@topnewpage[\@makechapterhead{#2}]% - \else - \@makechapterhead{#2}% - \@afterheading - \fi -}{% - \ifnum \c@secnumdepth >\m@ne - \refstepcounter{chapter}% - \typeout{\@chapapp\space\thechapter.}% - \addcontentsline{toc}{chapter}% - {\protect\numberline{\thechapter}\toc@font0 #1}% - \else - \addcontentsline{toc}{chapter}{\toc@font0 #1}% - \fi - \chaptermark{#1}% - \@addchapterlistsgaps - \if@twocolumn - \@topnewpage[\@makechapterhead{#2}]% - \else - \@makechapterhead{#2}% - \@afterheading - \fi} -% \end{macrocode} -% \begin{macrocode} -% boek(3).cls [2004/06/07 v2.1a NTG LaTeX document class] -\newfloat@replace@chapter{boek}{% - \ifnum \c@secnumdepth >\m@ne - \if@mainmatter - \refstepcounter{chapter}% - \typeout{\@chapapp\space\thechapter.}% - \addcontentsline{toc}{chapter}% - {\protect\numberline{\thechapter}\toc@font0 #1}% - \else - \addcontentsline{toc}{chapter}{\toc@font0 #1}% - \fi - \else - \addcontentsline{toc}{chapter}{\toc@font0 #1}% - \fi - \chaptermark{#1}% - \addtocontents{lof}{\protect\addvspace{10\p@}}% - \addtocontents{lot}{\protect\addvspace{10\p@}}% - \if@twocolumn - \@topnewpage[\@makechapterhead{#2}]% - \else - \@makechapterhead{#2}% - \@afterheading - \fi -}{% - \ifnum \c@secnumdepth >\m@ne - \if@mainmatter - \refstepcounter{chapter}% - \typeout{\@chapapp\space\thechapter.}% - \addcontentsline{toc}{chapter}% - {\protect\numberline{\thechapter}\toc@font0 #1}% - \else - \addcontentsline{toc}{chapter}{\toc@font0 #1}% - \fi - \else - \addcontentsline{toc}{chapter}{\toc@font0 #1}% - \fi - \chaptermark{#1}% - \@addchapterlistsgaps - \if@twocolumn - \@topnewpage[\@makechapterhead{#2}]% - \else - \@makechapterhead{#2}% - \@afterheading - \fi} -% \end{macrocode} -% -% \pagebreak[3] -% \subsubsection{The thesis document class} -% -% \begin{macrocode} -% thesis.cls [1996/25/01 1.0g LaTeX document class (wm).] -\newfloat@replace@chapter{thesis}{% - \ifnum \c@secnumdepth >\m@ne - \if@mainmatter - \refstepcounter{chapter}% - \typeout{\chaptername\space\thechapter.} - \if@thema - \ifx\@shortauthor\@empty - \addcontentsline{toc}{chapter}{% - \protect\numberline{\thechapter.}#1}% - \else - \addcontentsline{toc}{chapter}{% - \protect\numberline{\thechapter.}% - \@shortauthor\hfill\mbox{}\vskip\normallineskip #1}% - \fi - \else - \addcontentsline{toc}{chapter}{% - \protect\numberline{\thechapter.}#1}% - \fi - \else - \addcontentsline{toc}{chapter}{#1} - \fi - \else - \addcontentsline{toc}{chapter}{#1} - \fi - \chaptermark{#1} - \addtocontents{lof}{\protect\addvspace{10pt}} - \addtocontents{lot}{\protect\addvspace{10pt}} - \if@twocolumn - \@topnewpage[\@makechapterhead{#2}] - \else - \@makechapterhead{#2} - \@afterheading - \fi -}{% - \ifnum \c@secnumdepth >\m@ne - \if@mainmatter - \refstepcounter{chapter}% - \typeout{\chaptername\space\thechapter.}% - \if@thema - \ifx\@shortauthor\@empty - \addcontentsline{toc}{chapter}{% - \protect\numberline{\thechapter.}#1}% - \else - \addcontentsline{toc}{chapter}{% - \protect\numberline{\thechapter.}% - \@shortauthor\hfill\mbox{}\vskip\normallineskip #1}% - \fi - \else - \addcontentsline{toc}{chapter}{% - \protect\numberline{\thechapter.}#1}% - \fi - \else - \addcontentsline{toc}{chapter}{#1}% - \fi - \else - \addcontentsline{toc}{chapter}{#1}% - \fi - \chaptermark{#1}% - \@addchapterlistsgaps - \if@twocolumn - \@topnewpage[\@makechapterhead{#2}]% - \else - \@makechapterhead{#2}% - \@afterheading - \fi} -% \end{macrocode} -% -% \pagebreak[3] -% \subsubsection{The Springer Verlag document classes} -% \changes{v1.1f}{2019/08/25}{Support of \package{svmono} and \package{svmult} document classes added} -% -% \begin{macrocode} -% svmono.cls [2018/06/25 v5.6 Springer Verlag global LaTeX document class for monographs] -% svmult.cls [2018/01/11 v5.5 Springer Verlag global LaTeX document class for multi authored books] -\newfloat@replace@chapter{svmono}{% - \if@chapnum % war mal \ifnum \c@secnumdepth >\m@ne - \refstepcounter{chapter}% - \if@mainmatter - \typeout{\@chapapp\space\thechapter.}% - \addcontentsline{toc}{chapter}{\protect - \numberline{\thechapter\thechapterend}#1}% - \else - \addcontentsline{toc}{chapter}{#1}% - \fi - \else - \addcontentsline{toc}{chapter}{#1}% - \fi - \chaptermark{#1}% - \addtocontents{lof}{\protect\addvspace{10\p@}}% - \addtocontents{lot}{\protect\addvspace{10\p@}}% - \if@twocolumn - \@topnewpage[\@makechapterhead{#2}]% - \else - \@makechapterhead{#2}% - \@afterheading - \fi -}{% - \if@chapnum % war mal \ifnum \c@secnumdepth >\m@ne - \refstepcounter{chapter}% - \if@mainmatter - \typeout{\@chapapp\space\thechapter.}% - \addcontentsline{toc}{chapter}{\protect - \numberline{\thechapter\thechapterend}#1}% - \else - \addcontentsline{toc}{chapter}{#1}% - \fi - \else - \addcontentsline{toc}{chapter}{#1}% - \fi - \chaptermark{#1}% - \@addchapterlistsgaps - \if@twocolumn - \@topnewpage[\@makechapterhead{#2}]% - \else - \@makechapterhead{#2}% - \@afterheading - \fi} -% \end{macrocode} -% -% \pagebreak[3] -% \subsubsection{The dgruyter package} -% \changes{v1.1j}{2019/08/31}{Extended support of \package{dgruyter} package added} -% -% \begin{macrocode} -% dgruyter.sty [2017/09/19 v2.00 De Gruyter layout] -\newfloat@replace@chapter{dgruyter}{% - \let\thesection\theinchapsection - \let\theequation\theinchapequation - \let\thefigure\theinchapfigure - \let\thetable\theinchaptable - \ifx\bookDOI\@undefined - \else - \@tempcnta\numexpr\componentd@i+\@ne\relax - \xdef\componentd@i{\the\@tempcnta}% - \xdef\@DOI{% - https://doi.org/\bookDOI - -\ifx\thepage\thefrontmatterpage2\else\ifnum\@tempcnta<100 0\fi\fi - \ifnum\@tempcnta<10 0\fi\componentd@i}% - \fi - \ifnum \c@secnumdepth >\m@ne - \if@mainmatter - \refstepcounter{chapter}% - \typeout{\@chapapp\space\thechapter.}% - \addcontentsline{toc}{chapter}{\protect\numberline{\thechapter}#1}% - \else - \addcontentsline{toc}{schapter}{#1}% - \fi - \else - \addcontentsline{toc}{schapter}{#1}% - \fi - \chaptermark{#1}% - \addtocontents{lof}{\protect\addvspace{13\p@}}% - \addtocontents{lot}{\protect\addvspace{13\p@}}% - \if@twocolumn - \@topnewpage[\@makechapterhead{#2}]% - \else - \@makechapterhead{#2}% - \@afterheading - \fi -}{% - \let\thesection\theinchapsection - \let\theequation\theinchapequation - \let\thefigure\theinchapfigure - \let\thetable\theinchaptable - \ifx\bookDOI\@undefined - \else - \@tempcnta\numexpr\componentd@i+\@ne\relax - \xdef\componentd@i{\the\@tempcnta}% - \xdef\@DOI{% - https://doi.org/\bookDOI - -\ifx\thepage\thefrontmatterpage2\else\ifnum\@tempcnta<100 0\fi\fi - \ifnum\@tempcnta<10 0\fi\componentd@i}% - \fi - \ifnum \c@secnumdepth >\m@ne - \if@mainmatter - \refstepcounter{chapter}% - \typeout{\@chapapp\space\thechapter.}% - \addcontentsline{toc}{chapter}{\protect\numberline{\thechapter}#1}% - \else - \addcontentsline{toc}{schapter}{#1}% - \fi - \else - \addcontentsline{toc}{schapter}{#1}% - \fi - \chaptermark{#1}% - \@addchapterlistsgaps - \if@twocolumn - \@topnewpage[\@makechapterhead{#2}]% - \else - \@makechapterhead{#2}% - \@afterheading - \fi} -% \end{macrocode} -% -% \pagebreak[3] -% \subsubsection{Compatibility warning} -% -% \begin{macrocode} -\ifx\newfloat@replace@chapter\newfloat@dont@replace@chapter \else -% \end{macrocode} -% If we were not able to patch |\@chapter| an info message is issued -% since we may not be able to support chapter lists gaps then. -% \begin{macrocode} - \newfloat@InfoNoLine{% - Unsupported document class, or \noexpand\@chapter\MessageBreak - was already redefined by another package} - \newfloat@InfoNoLine{\string\@chapter\space=\space\meaning\@chapter} - \newfloat@InfoNoLine{\string\Hy@org@chapter\space=\space\meaning\Hy@org@chapter} -% \end{macrocode} -% Plan B: We patch |\add|\-|to|\-|contents| instead, and keep our fingers crossed -% in the hope that this redefinition actually will fit. -% (Note: Since \package{biblatex} patches |\add|\-|to|\-|contents| as well we do -% this using |\At||Begin||Document|.) -% \changes{v1.1f}{2019/08/25}{Plan B will now be done using \cs{AtBeginDocument}} -% \begin{macrocode} - \newfloat@ifplanb{\AtBeginDocument{% - \newfloat@InfoNoLine{Trying Plan B..}% - \let\newfloat@addtocontents@ORI\addtocontents - \long\def\addtocontents#1#2{% - \newfloat@addtocontents{#1}{#2}#2\addvspace\newfloat@nil}% - \long\def\newfloat@addtocontents#1#2#3\addvspace#4\newfloat@nil{% - \def\newfloat@tempa{#4}% - \ifx\newfloat@tempa\@empty - \newfloat@addtocontents@ORI{#1}{#2}% - \else - \ifx\newfloat@addtocontents@ext\@undefined - \newfloat@Info{Setting Plan B file extension to `#1'...}% - \xdef\newfloat@addtocontents@ext{#1}% - \fi - \edef\newfloat@tempa{#1}% - \ifx\newfloat@tempa\newfloat@addtocontents@ext - \begingroup - \let\addtocontents\newfloat@addtocontents@ORI - \@addchapterlistsgaps - \endgroup - \fi - \fi}}} -% \end{macrocode} -% \begin{macrocode} -\fi -% \end{macrocode} -% -% \pagebreak[3] -% \subsection{Support of document classes} -% -% \subsubsection{The beamer document class} -% -% \begin{macro}{\beamer@float} -% \changes{v1.1k}{2019/09/01}{This macro added} -% Unfortunately the \class{beamer} document class does not offer -% |\beamer@float| and |\end@beamer@float| (yet), so we have to define them -% for ourself. -% (This code was taken from beamerbaselocalstructure.sty [2019/07/23 v3.56] and adapted.) -% \begin{macrocode} -\ifcsname beamer@float\endcsname \else -% \end{macrocode} -% \begin{macrocode} - \def\beamer@float#1{% - \ifcsname caption@settype\endcsname - \caption@settype{#1}% - \else - \def\@captype{#1}% - \fi - \par\nobreak\begin{center}\nobreak} -% \end{macrocode} -% \begin{macrocode} - \def\end@beamer@float{% - \par\nobreak\end{center}} -% \end{macrocode} -% \begin{macrocode} -\fi -% \end{macrocode} -% \end{macro} -% -% \pagebreak[3] -% \subsection{Support of other packages} -% -% \begin{macro}{\newfloat@IfPackageLoaded} -% \changes{v1.1e}{2019/03/17}{This macro revised} -% \changes{v1.1h}{2019/08/31}{This macro revised again and renamed from \cs{newfloat@ForEachNew} to \cs{newfloat@IfPackageLoaded}} -% |\newfloat@IfPackageLoaded|\marg{package name}\marg{command}\marg{code} -% will execute the given code for every floating environment defined with -% |\Declare|\-|Floating|\-|Environment| if \meta{command} is not defined yet. -% (If \meta{command} is already defined a warning will be issued.) -% This will be tried |\At|\-|Begin|\-|Document| additionally so the affected package could -% be loaded after \thispackage. -% \begin{macrocode} -\newcommand\newfloat@IfPackageLoaded[3]{% - \@ifpackageloaded{#1}{% - \newfloat@@IfPackageLoaded{#1}{#2}{#3}% - }{% - \AtBeginDocument{% - \@ifpackageloaded{#1}{% - \newfloat@@IfPackageLoaded{#1}{#2}{#3}% - }{}}% - }} -\@onlypreamble\newfloat@IfPackageLoaded -% \end{macrocode} -% \begin{macrocode} -\newcommand\newfloat@@IfPackageLoaded[3]{% - \newfloat@InfoNoLine{`#1' package detected}% - % Execute code for every previous \DeclareFloatingEnvironment - \def\@elt##1{\newfloat@@@IfPackageLoaded{#1}{#2}{#3}}% - \newfloat@@list - \let\@elt\relax - % Execute code for every future \DeclareFloatingEnvironment - \newfloat@addtohook{\newfloat@@@IfPackageLoaded{#1}{#2}{#3}}} -\@onlypreamble\newfloat@@IfPackageLoaded -% \end{macrocode} -% \begin{macrocode} -\newcommand\newfloat@@@IfPackageLoaded[3]{% - \ifcsname#2\endcsname - \newfloat@WarningNoLine{% - Command \@backslashchar#2 already defined.\MessageBreak - (`#1' package support)}% - \else - #3% - \fi} -\@onlypreamble\newfloat@@@IfPackageLoaded -% \end{macrocode} -% \end{macro} -% -% \pagebreak[3] -% \subsubsection{\package{dgruyter}} -% -% The De Gruyter layout package (for preparing books for Walter de Gruyter GmbH) -% is defining |\plist@figure| and |\plist@table|, and expects this to be -% defined for other floating environments as well. -% (This will be used as prefix for the ``List of''.) -% \begin{macrocode} -\newfloat@IfPackageLoaded{dgruyter}{plist@#1}{% - \expandafter\newcommand\csname plist@#1\endcsname{% - \@nameuse{#1name}\space}} -% \end{macrocode} -% -% \pagebreak[3] -% \subsubsection{\package{float}} -% -% If the \package{float} package is used we fill up |\float@exts| with our file -% extensions, too. Since this list will be used for inserting chapters gaps -% we only add the ones which are configured for chapters gaps on. -% \begin{macrocode} -\newfloat@IfPackageLoaded{float}{newfloat@undefined}{% - \@nameuse{@ifchapterlistsgap@#1}{% if switched on - \let\float@do=\relax - \edef\@tempa{% - \noexpand\float@exts{\the\float@exts\float@do{\@nameuse{ext@#1}}}}% - \@tempa}} -% \end{macrocode} -% -% \pagebreak[3] -% \subsubsection{\package{fltpage}} -% -% We define a FP-variant of new floating environments here. -% \begin{macrocode} -\newfloat@IfPackageLoaded{fltpage}{FP#1}{% - \newcounter{FP@#1C}% - \newenvironment{FP#1}{\FP@floatBegin{#1}}{\FP@floatEnd}} -% \end{macrocode} -% -% \pagebreak[3] -% \subsubsection{\package{listings}} -% -% \begin{macro}{\ext@lstlisting} -% Since the \package{listings} package do not define |\ext@lst|\-|listing| -% but we needed it when |Setup|\-|Floating|\-|Environment{lst|\-|listing}{|\ldots|}| -% will be done by the end user, we define it here. -% \begin{macrocode} -\providecommand*\ext@lstlisting{lol}% -% \end{macrocode} -% \end{macro} -% -% \pagebreak[3] -% \subsubsection{\package{rotating}} -% -% We define a sideways-variant of new floating environments here. -% \begin{macrocode} -\newfloat@IfPackageLoaded{rotating}{sideways#1}{% - \newenvironment{sideways#1}{\@rotfloat{#1}}{\end@rotfloat}% - \newenvironment{sideways#1*}{\@rotdblfloat{#1}}{\end@rotdblfloat}} -% \end{macrocode} -% -% \pagebreak[3] -% \subsubsection{\package{sidecap}} -% -% We define a SC-variant of new floating environments here. -% \begin{macro}{\SC@float} -% \changes{v1.1b}{2018/12/26}{Bugfix: Missing curly braces added} -% \begin{macrocode} -\newcommand*\newfloat@For@SC[2]{% - \def#1{b}% = \sidecaptionvpos{#2}{b} (v1.6) - \newenvironment{SC#2}% - {\SC@float[{#1}]{#2}}{\endSC@float}% - \newenvironment{SC#2*}% - {\SC@dblfloat[{#1}]{#2}}{\endSC@dblfloat}} -\@onlypreamble\newfloat@For@SC -% \end{macrocode} -% \begin{macrocode} -\newfloat@IfPackageLoaded{sidecap}{SC#1}{% - \expandafter\newfloat@For@SC\csname SC@#1@vpos\endcsname{#1}} -% \end{macrocode} -% \end{macro} -% -% \pagebreak[3] -% \subsubsection{\package{wrapfig}} -% -% We define a wrap-variant of new floating environments here. -% \begin{macrocode} -\newfloat@IfPackageLoaded{wrapfig}{wrap#1}{% - \newenvironment{wrap#1}{\wrapfloat{#1}}{\endwrapfloat}} -% \end{macrocode} -% -% \iffalse -% -% \fi -% -% \iffalse -% --------------------------------------------------------------------------- % -% \fi -% -% \Finale -% -\endinput diff --git a/macros/latex/contrib/caption/newfloat.pdf b/macros/latex/contrib/caption/newfloat.pdf deleted file mode 100644 index 597f044f51..0000000000 Binary files a/macros/latex/contrib/caption/newfloat.pdf and /dev/null differ diff --git a/macros/latex/contrib/caption/subcaption.dtx b/macros/latex/contrib/caption/subcaption.dtx index 0eb2a144fc..70b669ee20 100644 --- a/macros/latex/contrib/caption/subcaption.dtx +++ b/macros/latex/contrib/caption/subcaption.dtx @@ -30,7 +30,7 @@ % \iffalse %<*driver> \NeedsTeXFormat{LaTeX2e}[1994/12/01] -\ProvidesFile{subcaption.drv}[2019/08/31 v1.3 Adds a sub-caption feature to the caption package] +\ProvidesFile{subcaption.drv}[2019/09/10 v1.3 Adds a sub-caption feature to the caption package] \hbadness=9999 \newcount\hbadness \hfuzz=74pt % Make TeX shut up. %\errorcontextlines=3 % @@ -402,7 +402,7 @@ % \end{itemize} % % \NEWfeature{v1.2} -% Beside the \meta{inner-pos} values of `c', `t', and `b', \thispackage\ also offers the +% Beside the \meta{outer-pos} values of `c', `t', and `b', \thispackage\ also offers the % values `T' and `B' additionally which align the |sub|\-|figure| at the % very top resp.~bottom. (In contrast `t' and `b' align the |sub|\-|figure| at the % top resp.~bottom \textit{baseline}.) @@ -410,7 +410,7 @@ % \bigskip % % \begin{background} -% The |subfigure| \& |subtable| environments are just simple minipage +% The |subfigure| \& |subtable| environments are just simple |minipage| % environments with |\set|\-|caption|\-|sub|\-|type| as first contents line. % These environments are defined with the help of % |\caption@For{subtypelist}|, which executes code for every sub-type diff --git a/macros/latex/contrib/caption/subcaption.pdf b/macros/latex/contrib/caption/subcaption.pdf index 70b4cde42d..8a4257ed5e 100644 Binary files a/macros/latex/contrib/caption/subcaption.pdf and b/macros/latex/contrib/caption/subcaption.pdf differ diff --git a/macros/latex/contrib/epstopdf-pkg/README.md b/macros/latex/contrib/epstopdf-pkg/README.md new file mode 100644 index 0000000000..20129fd094 --- /dev/null +++ b/macros/latex/contrib/epstopdf-pkg/README.md @@ -0,0 +1,20 @@ +# epstopdf +epstopdf (and epstopdf-base) package for including EPS in pdftex and luatex + + +## Note + +`epstopdf-base.sty` is included by the pdftex and luatex options for +the core graphics package + +Separating epspdf to a separate repository is a first step in removing +the dependency of the core package on the entire oberdiek bundle. + +Currently the dependency is still present due to + + + \RequirePackage{infwarerr}[2007/09/09] + \RequirePackage{grfext}\relax + \RequirePackage{kvoptions}[2007/10/02] + \RequirePackage{pdftexcmds}[2007/11/11] + diff --git a/macros/latex/contrib/epstopdf-pkg/epstopdf.dtx b/macros/latex/contrib/epstopdf-pkg/epstopdf.dtx new file mode 100644 index 0000000000..497fc5c4e7 --- /dev/null +++ b/macros/latex/contrib/epstopdf-pkg/epstopdf.dtx @@ -0,0 +1,1595 @@ +% \iffalse meta-comment +% +% File: epstopdf.dtx +% Version: 2019/11/24 v2.7 +% Info: Conversion with epstopdf on the fly +% +% Copyright (C) +% 2001, 2006-2010 Heiko Oberdiek +% 2016-2019 Oberdiek Package Support Group +% +% This work may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either +% version 1.3c of this license or (at your option) any later +% version. This version of this license is in +% https://www.latex-project.org/lppl/lppl-1-3c.txt +% and the latest version of this license is in +% https://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". +% +% The Current Maintainers of this work are +% Heiko Oberdiek and the Oberdiek Package Support Group +% https://github.com/ho-tex/epstopdf/issues +% +% This work consists of the main source file epstopdf.dtx +% and the derived files +% epstopdf.sty, epstopdf.pdf, epstopdf.ins, epstopdf.drv, +% epstopdf-base.sty, epstopdf-test1.tex. +% +% Distribution: +% CTAN:macros/latex/contrib/epstopdf/epstopdf.dtx +% CTAN:macros/latex/contrib/epstopdf/epstopdf.pdf +% +% Unpacking: +% (a) If epstopdf.ins is present: +% tex epstopdf.ins +% (b) Without epstopdf.ins: +% tex epstopdf.dtx +% (c) If you insist on using LaTeX +% latex \let\install=y\input{epstopdf.dtx} +% (quote the arguments according to the demands of your shell) +% +% Documentation: +% (a) If epstopdf.drv is present: +% latex epstopdf.drv +% (b) Without epstopdf.drv: +% latex epstopdf.dtx; ... +% The class ltxdoc loads the configuration file ltxdoc.cfg +% if available. Here you can specify further options, e.g. +% use A4 as paper format: +% \PassOptionsToClass{a4paper}{article} +% +% Programm calls to get the documentation (example): +% pdflatex epstopdf.dtx +% makeindex -s gind.ist epstopdf.idx +% pdflatex epstopdf.dtx +% makeindex -s gind.ist epstopdf.idx +% pdflatex epstopdf.dtx +% +% Installation: +% TDS:tex/latex/epstopdf/epstopdf.sty +% TDS:tex/latex/epstopdf/epstopdf-base.sty +% TDS:doc/latex/epstopdf/epstopdf.pdf +% TDS:source/latex/epstopdf/epstopdf.dtx +% +%<*ignore> +\begingroup + \catcode123=1 % + \catcode125=2 % + \def\x{LaTeX2e}% +\expandafter\endgroup +\ifcase 0\ifx\install y1\fi\expandafter + \ifx\csname processbatchFile\endcsname\relax\else1\fi + \ifx\fmtname\x\else 1\fi\relax +\else\csname fi\endcsname +% +%<*install> +\input docstrip.tex +\Msg{************************************************************************} +\Msg{* Installation} +\Msg{* Package: epstopdf 2019/11/24 v2.7 Conversion with epstopdf on the fly (HO)} +\Msg{************************************************************************} + +\keepsilent +\askforoverwritefalse + +\let\MetaPrefix\relax +\preamble + +This is a generated file. + +Project: epstopdf +Version: 2019/11/24 v2.7 + +Copyright (C) + 2001, 2006-2010 Heiko Oberdiek + 2016-2019 Oberdiek Package Support Group + +This work may be distributed and/or modified under the +conditions of the LaTeX Project Public License, either +version 1.3c of this license or (at your option) any later +version. This version of this license is in + https://www.latex-project.org/lppl/lppl-1-3c.txt +and the latest version of this license is in + https://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". + +The Current Maintainers of this work are +Heiko Oberdiek and the Oberdiek Package Support Group +https://github.com/ho-tex/oberdiek/issues + + +This work consists of the main source file epstopdf.dtx +and the derived files + epstopdf.sty, epstopdf.pdf, epstopdf.ins, epstopdf.drv, + epstopdf-base.sty, epstopdf-test1.tex. + +\endpreamble +\let\MetaPrefix\DoubleperCent + +\generate{% + \file{epstopdf.ins}{\from{epstopdf.dtx}{install}}% + \file{epstopdf.drv}{\from{epstopdf.dtx}{driver}}% + \usedir{tex/latex/epstopdf}% + \file{epstopdf.sty}{\from{epstopdf.dtx}{package}}% + \file{epstopdf-base.sty}{\from{epstopdf.dtx}{base}}% +% \usedir{doc/latex/epstopdf/test}% +% \file{epstopdf-test1.tex}{\from{epstopdf.dtx}{test1}}% + \nopreamble + \nopostamble +% \usedir{source/latex/epstopdf/catalogue}% +% \file{epstopdf-pkg.xml}{\from{epstopdf.dtx}{catalogue}}% +} + +\catcode32=13\relax% active space +\let =\space% +\Msg{************************************************************************} +\Msg{*} +\Msg{* To finish the installation you have to move the following} +\Msg{* files into a directory searched by TeX:} +\Msg{*} +\Msg{* epstopdf.sty, epstopdf-base.sty} +\Msg{*} +\Msg{* To produce the documentation run the file `epstopdf.drv'} +\Msg{* through LaTeX.} +\Msg{*} +\Msg{* Happy TeXing!} +\Msg{*} +\Msg{************************************************************************} + +\endbatchfile +% +%<*ignore> +\fi +% +%<*driver> +\NeedsTeXFormat{LaTeX2e} +\ProvidesFile{epstopdf.drv}% + [2019/11/24 v2.7 Conversion with epstopdf on the fly (HO)]% +\documentclass{ltxdoc} +\usepackage{holtxdoc}[2011/11/22] +\begin{document} + \DocInput{epstopdf.dtx}% +\end{document} +% +% \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{epstopdf.drv} +% +% \title{The \xpackage{epstopdf} package} +% \date{2019/11/24 v2.7} +% \author{Heiko Oberdiek\thanks +% {Please report any issues at \url{https://github.com/ho-tex/epstopdf/issues}}} +% +% \maketitle +% +% \begin{abstract} +% This packages adds support of handling eps images +% to package \xpackage{graphics} or \xpackage{graphicx} +% with option \xoption{pdftex}. If an eps image is detected, +% epstopdf is automatically called to convert it to pdf format. +% \end{abstract} +% +% \tableofcontents +% +% \providecommand*{\xprogram}[1]{\textsf{#1}} +% +% \section{Documentation} +% +% \subsection{Introduction} +% +% \LaTeX\ provides its graphics bundle to include graphics files. +% Both packages \xpackage{graphics} or \xpackage{graphicx} may +% be used. the latter one loads the first and adds options +% in key value style for \cs{includegraphics}. +% +% Usually the drivers do not support all kind of graphics files. +% Other image types must be converted, before they become +% usuable. In case of driver \xprogram{dvips}, the graphics +% rule may contain a conversion rule. Then all that package +% \xpackage{graphics} must know is the bounding box, the command +% is passed to \xprogram{dvips} that calls it and embeds the +% converted image. +% +% However, \pdfTeX\ has its driver for PDF output already +% build in. It's graphics inclusion commands (\cs{pdfximage}) +% does not allow the execution of external commands. +% Therefore commands in the last argument of +% \cs{DeclareGraphicsRule} were of no use. +% But external programs can be called within \pdfTeX. +% This feature is called ``shell escape'' or ``write 18'' +% and must usually enabled explicitely because of security reasons. +% Now, this package \xpackage{epstopdf} hooks +% into package \xpackage{graphics}' code to catch +% that argument with the external command and executes it +% to convert the graphics file to a supported format and +% passes the control of graphics inclusion back to package +% \xpackage{graphics}. +% +% \subsection{Requirements} +% +% \begin{itemize} +% \item +% The feature \cs{write18} must be enabled. This allows the +% running of external programs during \TeX's compile run. +% Keep in mind that this is a security risk. The feature is an +% addition to \cs{TeX}. Mik\TeX, te\TeX, \TeX\ Live support it. +% In Web2C based \TeX\ distributions (te\TeX, \TeX\ Live) it can be +% enabled in the configuration file \xfile{texmf.cnf}: +% \begin{quote} +% |shell_escape = 1| +% \end{quote} +% Because of the security risk, it is better to do it on the +% command line only: +% \begin{quote} +% \texttt{--shell-escape} (te\TeX, \TeX\ Live)\\ +% \texttt{--enable-write18} (MiK\TeX) +% \end{quote} +% Example: +% \begin{quote} +% |pdflatex -shell-escape test.tex| +% \end{quote} +% \item +% The program \xprogram{epstopdf} for the conversion from EPS +% to PDF. However, other programs can +% be used and configured by \cs{DeclareGraphicsRule}. +% Example: +% \begin{quote} +% |\epstopdfDeclareGraphicsRule{.eps}{pdf}{.pdf}{%|\\ +% | ps2pdf -dEPSCrop #1 \OutputFile|\\ +% |}| +% \end{quote} +% \end{itemize} +% +% \subsection{Usage} +% +% The package is loaded after graphic\{s,x\}, e.g.: +% \begin{quote} +% |\usepackage[pdftex]{graphicx}|\\ +% |\usepackage{epstopdf}| +% \end{quote} +% Now images with file name extension \xfile{.eps} are detected +% and supported using \cs{includegraphics}. +% +% If the graphics file name is explicitly specified with extension +% \xfile{.eps} the new rule for EPS files is called and +% the conversion performed. If option \xoption{update} is in force +% then the conversion step is dropped if the target file already +% exists and is not older then the EPS file. +% +% The situation is more complicate if the graphics file is +% given without file name extension. Then the \xpackage{graphics} +% package must search for a supported image file. +% The possible extensions are stored in the graphics extension +% list, that can be set by \cs{DeclareGraphicsExtensions}. +% The algorithm: +% \begin{quote} +% \def\>{\mbox{}\quad} +% function search( \meta{filebase} )\\ +% \>foreach \meta{ext} in \meta{graphics extensions}\\ +% \>\>foreach \meta{dir} in \meta{current directory}, \meta{\cs{graphicspath}}\\ +% \>\>\>\meta{file} := \meta{dir} + \meta{filebase} + \meta{ext}\\ +% \>\>\>if exist \meta{file}\\ +% \>\>\>\>return found\\ +% \>return not found +% \end{quote} +% Package \xpackage{epstopdf} puts \xfile{.eps} at the end of the +% graphics extension search list. This is the behaviour of option +% \xoption{append} that is enabled by default. +% That means, the conversion is called last +% unless a supported file type cannot be found earlier. This avoids +% unnecessary conversion steps that slow down the \LaTeX\ run. +% If you want to use option \xoption{update} and your \pdfTeX\ supports +% it, then an outdated PDF file also would be found earlier unless +% \xoption{suffix} is used that is the default since version 2.0. +% +% With an empty option \xoption{suffix} and option +% \xoption{prepend} there is a risk that an original PDF file is overwritten: +% +% If the original image file is the PDF file and there is also a generated +% EPS file, then the original PDF file can be regenerated (depending +% on the option settings) and the original PDF file gets lost. +% Therefore option \xoption{suffix} is introduced in version 1.9 +% to create a separate name space for generated output files. +% +% \textbf{Note:} Usually the conversion program needs the exact location +% of the image file. Usually the current directory works. +% Also if the image file is found using \cs{graphicspath}, the +% location is known. However, if the image is somewhere +% in a directory of environment variable |TEXINPUTS|, then +% the package does not know the exact location and the +% conversion program will not find the image file unless it +% implements a search using |TEXINPUTS| (program \xprogram{kpsewhich} +% may be of help in this task). +% +% \subsection{Options} +% +% Options can be given as package options or later using: +% \begin{declcs}{epstopdfsetup} \M{key value list} +% \end{declcs} +% \LaTeX\ expands the option list before passing the option list +% to the package's option handling code. This can fail +% for option \xoption{suffix} if it contains some of the macros +% described below. Use \cs{epstopdfsetup} after the package is loaded. +% Or load package \xpackage{kvoptions-patch} before. This package +% is also loaded by option \xoption{patch} of package \xpackage{kvoptions}. +% \LaTeX's option code is redefined to respect key value options and +% let the values untouched. +% +% \begin{description} +% \def\It#1{\item[\xoption{#1}:]}^^A +% \It{update} +% The conversion program is only called, if the target file +% does not exist or is older than the source image file. +% \It{append} +% Puts the extension \xfile{.eps} at the end of the graphics extension list +% (default). +% \It{prepend} +% Puts the extension \xfile{.eps} at the begin of the graphics extension list. +% \It{outdir} +% The converted file may put in an other output directory. +% The value of \xoption{outdir} must include the directory separator. +% Example for the current directory: +% \begin{quote} +% |\epstopdfsetup{outdir=./}| +% \end{quote} +% For other directories ensure, that they can be found. +% See \cs{graphicspath} or |TEXINPUTS|. +% \It{suffix} +% This option takes a string that is put between the file name base +% and the extension of the output file. Rationale: It can happen, +% that a PDF file is the original file and the EPS file the +% generated file. If now the package thinks, that the PDF file +% is the generated file, it will `regnerate' it. But in reality +% the original file is lost. Therefore I recommend to use this +% option always to generate a separate name space for generated +% files. Proposed value is \texttt{-generated} or \texttt{.generated}. +% The suffix \texttt{.generated} will also work here without the need for +% package \xpackage{grffile}). +% +% Example: +% \begin{quote} +% |\epstopdfsetup{suffix=-generated}|\\ +% Then \xfile{foo.eps} is converted to \xfile{foo-generated.pdf}. +% \end{quote} +% \cs{SourceExt} can be used inside the suffix string. +% It's will be replaced by the extension of the image source +% file without the leading dot, for instance: +% \begin{quote} +% |\epstopdfsetup{suffix=-\SourceExt-converted-to}|\\ +% \xfile{foo.eps} $\Rightarrow$ \xfile{foo-eps-converted-to.pdf} +% \end{quote} +% See also the next option \xoption{prefersuffix} that +% modifies the behaviour of option \xoption{suffix} in some +% cases. +% +% Default for \xoption{suffix} is `|-\SourceExt-converted-to|'. +% +% \It{prefersuffix} +% If a suffix is set by option \xoption{suffix}, then there can be +% two image file names that could be taken into account for inclusion: +% A image file name with the suffix string inside +% its name and a image file name without; e.g. for \xfile{foo.eps} +% the names could be: +% \begin{quote} +% \xfile{foo-suffix.pdf}, \xfile{foo.pdf} +% \end{quote} +% If option \xoption{perfersuffix} is turned on, the +% file \xfile{foo-suffix.pdf} and its generation is preferred +% over using \xfile{foo.pdf}. Otherwise \xfile{foo.pdf} is included +% without generating \xfile{foo-suffix.pdf}. +% The default of option \xoption{prefersuffix} is \texttt{true}. +% \It{program@epstopdf} +% The name for the conversion program from EPS to PDF, +% default is `|epstopdf|'. +% \It{verbose} +% It prints some information about the image in the \xfile{.log} file +% (default). +% \end{description} +% +% \subsection{Configuration} +% +% \subsubsection{System configuration file \xfile{epstopdf-sys.cfg}} +% +% If \xfile{epstopdf-sys} exists it is loaded at the end of the +% package \xpackage{epstopdf-base} and before the user configuration +% file. It's intended for TeX distributors. Thus they could add +% additional conversion rules (e.g., .gif -> .png) or set options. +% +% \subsubsection{User configuration file \xfile{epstopdf.cfg}} +% +% A configuration file \xfile{epstopdf.cfg} is loaded at the end +% of the package if it exists. It can be used for changing +% the default option setting. Example: +% \begin{quote} +% |\epstopdfsetup{verbose=false}| +% \end{quote} +% +% \subsubsection{Conversion program} +% +% You can use \cs{DeclareGraphicsRule} in a similar way as the +% route via \xprogram{dvips} to specify the conversion +% command line. +% The conversion argument starts with a back tick, followed +% by the conversion command including parameters. +% +% The whole conversion argument should also be wrapped inside +% \cs{epstopdfcall}. This reduces the problem with packages +% (e.g. \xpackage{pst-pdf}) that use the conversion argument +% and expands it. Macros \cs{SourceFile}, \cs{OutputFile}, and +% \cs{SourceExt} are not defined outside \xpackage{epstopdf-base}'s +% \cs{Gin@setfile} and error messages because of undefined +% command names are the result. If \cs{epstopdfcall} detects that +% it is called outside \xpackage{epstopdf-base}'s \cs{Gin@setfile} +% then it replaces the conversion argument by +% package \xpackage{graphics}'s +% default, usually the image file. +% +% The following macros are available inside: +% \begin{description} +% \def\It#1{\item[\cs{#1}:]} +% \It{OutputFile}: output file name (with known path and extension) +% \It{SourceFile}: source file name (with known path and extension), +% usually the same as |#1|, +% \It{SourceExt}: source extension without leading dot. +% \end{description} +% +% \paragraph{Conversion from EPS to PDF.} +% Other programs than \xprogram{epstopdf} can be used to convert from +% EPS to PDF. Example that uses \xprogram{Ghostscript}: +% \begin{quote} +% |\DeclareGraphicsRule{.eps}{pdf}{.pdf}{%|\\ +% | \epstopdfcall{`ps2pdf -dEPSCrop #1 \noexpand\OutputFile}%|\\ +% |}| +% \end{quote} +% \cs{DeclareGraphicsRule} expands the argument, therefore \cs{noexpand} +% is necessary. As convenience package \xpackage{epstopdf-base} defines +% \cs{epstopdfDeclareGraphicsRule}. Then the conversion argument +% is not expanded, \cs{epstopdfcall} and the back tick are added: +% \begin{quote} +% |\epstopdfDeclareGraphicsRule{.eps}{pdf}{.pdf}{%|\\ +% | ps2pdf -dEPSCrop #1 \OutputFile|\\ +% |}| +% \end{quote} +% +% Also \cs{OutputFile} respects the setting of option \xoption{outdir}. +% +% \subsection{Other image formats} +% +% The support that package \xpackage{epstopdf} implements is not +% limited to EPS files. Other image conversions can be declared. +% The following example shows it for GIF images under Unix with +% ImageMagick's \xprogram{convert}: +%\begin{quote} +%\begin{verbatim} +%\epstopdfDeclareGraphicsRule{.gif}{png}{.png}{% +% convert #1 \OutputFile +%} +%\end{verbatim} +%\end{quote} +% The file extension \xfile{.gif} can be added to the extension list that +% package \xpackage{graphics} searches if the file extension +% is not given in \cs{includegraphics}. +% The list can be set by \cs{GraphicsExtensions}. +% \begin{quote} +% |\AppendGraphicsExtensions{.gif}|\\ +% or\\ +% |\PrependGraphicsExtensions{.gif}| +% \end{quote} +% +% \StopEventually{ +% } +% +% \section{Implementation} +% +% \begin{macrocode} +%<*package> +% \end{macrocode} +% +% \subsection{Wrapper package} +% +% Reload check, especially if the package is not used with \LaTeX. +% \begin{macrocode} +\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@epstopdf.sty\endcsname + \ifx\x\relax % plain-TeX, first loading + \else + \def\empty{}% + \ifx\x\empty % LaTeX, first loading, + % variable is initialized, but \ProvidesPackage not yet seen + \else + \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{epstopdf}{The package is already loaded}% + \aftergroup\endinput + \fi + \fi +\endgroup% +% \end{macrocode} +% Package identification: +% \begin{macrocode} +\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}% + \xdef#1{#4}% + }% + \else + \def\x#1#2[#3]{\endgroup + #2[{#3}]% + \ifx#1\@undefined + \xdef#1{#3}% + \fi + \ifx#1\relax + \xdef#1{#3}% + \fi + }% + \fi +\expandafter\x\csname ver@epstopdf.sty\endcsname +\ProvidesPackage{epstopdf}% + [2019/11/24 v2.7 Conversion with epstopdf on the fly (HO)]% +% \end{macrocode} +% Larger catcode set because of configuration files needed. +% \begin{macrocode} +\begingroup\catcode61\catcode48\catcode32=10\relax% + \catcode13=5 % ^^M + \endlinechar=13 % + \catcode123=1 % { + \catcode125=2 % } + \catcode64=11 % @ + \def\x{\endgroup + \expandafter\edef\csname ETE@AtEnd\endcsname{% + \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\catcode61\catcode48\catcode32=10\relax% +\catcode13=5 % ^^M +\endlinechar=13 % +\catcode35=6 % # +\catcode64=11 % @ +\catcode123=1 % { +\catcode125=2 % } +\def\TMP@EnsureCode#1#2{% + \edef\ETE@AtEnd{% + \ETE@AtEnd + \catcode#1=\the\catcode#1\relax + }% + \catcode#1=#2\relax +} +\TMP@EnsureCode{39}{12}% ' +\TMP@EnsureCode{40}{12}% ( +\TMP@EnsureCode{41}{12}% ) +\TMP@EnsureCode{42}{12}% * +\TMP@EnsureCode{45}{12}% - +\TMP@EnsureCode{47}{12}% / +\TMP@EnsureCode{91}{12}% [ +\TMP@EnsureCode{93}{12}% ] +\edef\ETE@AtEnd{\ETE@AtEnd\noexpand\endinput} +% \end{macrocode} +% +% \begin{macrocode} +\let\ETE@SavedAtEnd\ETE@AtEnd +\RequirePackage{epstopdf-base}[2019/11/24] +\let\ETE@AtEnd\ETE@SavedAtEnd +% \end{macrocode} +% +% \subsubsection{Option handling} +% +% \begin{macrocode} +\DeclareOption*{% + \expandafter\epstopdfsetup\expandafter{\CurrentOption}% +} +\ProcessOptions*\relax +% \end{macrocode} +% +% \begin{macrocode} +\ETE@AtEnd% +% +% \end{macrocode} +% +% \subsection{Base package} +% +% \begin{macrocode} +%<*base> +% \end{macrocode} +% +% \subsection{Preparations} +% +% \subsubsection{Relead check and identification} +% +% Reload check, especially if the package is not used with \LaTeX. +% \begin{macrocode} +\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@epstopdf-base.sty\endcsname + \ifx\x\relax % plain-TeX, first loading + \else + \def\empty{}% + \ifx\x\empty % LaTeX, first loading, + % variable is initialized, but \ProvidesPackage not yet seen + \else + \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{epstopdf-base}{The package is already loaded}% + \aftergroup\endinput + \fi + \fi +\endgroup% +% \end{macrocode} +% Package identification: +% \begin{macrocode} +\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}% + \xdef#1{#4}% + }% + \else + \def\x#1#2[#3]{\endgroup + #2[{#3}]% + \ifx#1\@undefined + \xdef#1{#3}% + \fi + \ifx#1\relax + \xdef#1{#3}% + \fi + }% + \fi +\expandafter\x\csname ver@epstopdf-base.sty\endcsname +\ProvidesPackage{epstopdf-base}% + [2019/11/24 v2.7 Base part for package epstopdf]% +% \end{macrocode} +% +% \subsubsection{Catcodes} +% +% \begin{macrocode} +\begingroup\catcode61\catcode48\catcode32=10\relax% + \catcode13=5 % ^^M + \endlinechar=13 % + \catcode123=1 % { + \catcode125=2 % } + \catcode64=11 % @ + \def\x{\endgroup + \expandafter\edef\csname ETE@AtEnd\endcsname{% + \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\catcode61\catcode48\catcode32=10\relax% +\catcode13=5 % ^^M +\endlinechar=13 % +\catcode35=6 % # +\catcode64=11 % @ +\catcode123=1 % { +\catcode125=2 % } +\def\TMP@EnsureCode#1#2{% + \edef\ETE@AtEnd{% + \ETE@AtEnd + \catcode#1=\the\catcode#1\relax + }% + \catcode#1=#2\relax +} +\TMP@EnsureCode{33}{12}% ! +\TMP@EnsureCode{39}{12}% ' +\TMP@EnsureCode{42}{12}% * +\TMP@EnsureCode{44}{12}% , +\TMP@EnsureCode{45}{12}% - +\TMP@EnsureCode{46}{12}% . +\TMP@EnsureCode{47}{12}% / +\TMP@EnsureCode{58}{12}% : +\TMP@EnsureCode{60}{12}% < +\TMP@EnsureCode{62}{12}% > +\TMP@EnsureCode{96}{12}% ` +\edef\ETE@AtEnd{\ETE@AtEnd\noexpand\endinput} +% \end{macrocode} +% +% \subsubsection{Load packages} +% +% \begin{macrocode} +\RequirePackage{infwarerr}[2007/09/09] +\RequirePackage{grfext}\relax +\RequirePackage{kvoptions}[2007/10/02] +\RequirePackage{pdftexcmds}[2007/11/11] +% \end{macrocode} +% +% \subsection{Checks} +% +% Check, whether package graphics is loaded +% (also graphicx loads graphics). +% Because miniltx.tex does not know \cs{@ifpackageloaded} +% we test for \cs{Gin@setfile} instead. +% \begin{macrocode} +\begingroup\expandafter\expandafter\expandafter\endgroup +\expandafter\ifx\csname Gin@setfile\endcsname\relax + \@PackageWarningNoLine{epstopdf}{% + No graphics package \string`graphic{s,x}\string' loaded% + }% + \newcommand*{\epstopdfsetup}[1]{}% + \expandafter\ETE@AtEnd +\fi% +% \end{macrocode} +% +% Check, whether pdftex.def is loaded. \cs{ver@pdftex.def} is not +% available with miniltx.tex, thus we test for \cs{Gin@driver}. +% \begin{macrocode} +\begingroup + \def\x{luatex.def}% + \ifx\Gin@driver\x + \else + \def\x{pdftex.def}% + \ifx\Gin@driver\x + \else + \@PackageWarningNoLine{epstopdf}{% + Drivers other than `pdftex' and `luatex' are not supported% + }% + \endgroup + \newcommand*{\epstopdfsetup}[1]{}% + \expandafter\ETE@AtEnd + \fi% + \fi% +\endgroup +% \end{macrocode} +% +% Check, whether the shell escape feature is enabled. +% +% \begin{macrocode} +\begingroup + \expandafter\ifx\csname pdf@shellescape\endcsname\relax + \else + \ifnum\pdf@shellescape>0 % + \else + \@PackageWarningNoLine{epstopdf}{% + Shell escape feature is not enabled% + }% + \fi + \fi +\endgroup +% \end{macrocode} +% +% \subsection{Package loading} +% +% \begin{macrocode} +% \end{macrocode} +% +% \subsection{Options} +% +% \begin{macrocode} +\SetupKeyvalOptions{family=ETE,prefix=ETE@} +\DeclareBoolOption{update} +\DeclareBoolOption{verbose} +\newif\ifETE@prepend +\DeclareVoidOption{prepend}{\ETE@prependtrue} +\DeclareVoidOption{append}{\ETE@prependfalse} +\DeclareStringOption{outdir} +\DeclareStringOption{suffix} +\DeclareBoolOption{prefersuffix} +\DeclareStringOption{program@epstopdf} +% \end{macrocode} +% Options \xoption{disable} and \xoption{enable} are for testing +% only. Therefore they are not documented on purpose. +% \begin{macrocode} +\DeclareBoolOption{disable} +\DeclareComplementaryOption{enable}{disable} +% \end{macrocode} +% \begin{macrocode} +\newcommand*{\epstopdfsetup}{\setkeys{ETE}} +% \end{macrocode} +% +% \subsubsection{Default setting} +% +% \begin{macrocode} +\epstopdfsetup{% + verbose,% + enable,% + append,% + update,% + prefersuffix,% + suffix=-\SourceExt-converted-to,% + program@epstopdf=epstopdf% +} +% \end{macrocode} +% +% \subsection{Make and verbose} +% +% \begin{macrocode} +\begingroup\expandafter\expandafter\expandafter\endgroup +\expandafter\ifx\csname pdf@filemoddate\endcsname\relax + \def\ETE@Make#1#2{% + \ifETE@update + \ETE@WarnModDate + \fi + \@firstofone + }% + \def\ETE@WarnModDate{% + \@PackageWarningNoLine{epstopdf}{% + \string\pdffilemoddate\space is not available,\MessageBreak + option `update' will be ignored% + }% + \global\let\ETE@WarnModDate\relax + }% + \def\ETE@FileInfo#1#2{#1 file: <#2>}% +\else + \def\ETE@Make#1#2{% + \ifETE@update + \ifnum\pdf@strcmp{\pdf@filemoddate{#1}}{\pdf@filemoddate{#2}}>0 % + \expandafter\expandafter\expandafter\@firstofone + \else + \@PackageInfoNoLine{epstopdf}{% + Output file is already uptodate% + }% + \expandafter\expandafter\expandafter\@gobble + \fi + \else + \expandafter\@firstofone + \fi + }% + \def\ETE@FileInfo#1#2{% + #1 file: <#2>% + \expandafter\expandafter\expandafter + \ETE@Date\pdf@filemoddate{#2}\@nil + \expandafter\expandafter\expandafter + \ETE@Size\pdf@filesize{#2}\@nil + }% + \def\ETE@Date#1\@nil{% + \ifx\\#1\\% + \else + \ETE@@Date#1\@nil + \fi + }% + \def\ETE@@Date#1:#2#3#4#5#6#7#8#9{% + \MessageBreak + \@spaces\space\space\space date: #2#3#4#5-#6#7-#8#9 % + \ETE@@Time + }% + \def\ETE@@Time#1#2#3#4#5#6#7\@nil{% + #1#2:#3#4:#5#6% + }% + \def\ETE@Size#1\@nil{% + \ifx\\#1\\% + \else + \MessageBreak + \@spaces\space\space\space size: #1 bytes% + \fi + }% +\fi +% \end{macrocode} +% +% \subsection{Adding conversion support} +% +% Patch \cs{Gin@setfile} to execute |#3|, if it contains +% a command. +% \begin{macrocode} +\expandafter\ifx\csname ETE@OrgGin@setfile\endcsname\relax + \let\ETE@OrgGin@setfile\Gin@setfile +\else + \@PackageError{epstopdf}{% + Command \string\ETE@OrgGin@setfile\space + already defined.\MessageBreak + }{% + Probably some package has included the code of this package% + \MessageBreak + instead of using \string\RequirePackage{epstopdf}.% + \MessageBreak + \@ehc + }% +\fi +\def\ETE@IfFileExists{% + \begingroup\expandafter\expandafter\expandafter\endgroup + \expandafter\ifx\csname grffile@IfFileExists\endcsname\relax + \expandafter\IfFileExists + \else + \global\let\ETE@IfFileExists\grffile@IfFileExists + \expandafter\grffile@IfFileExists + \fi +} +\def\ETE@Skip#1#2\x\fi\fi{% + \fi + \fi + \endgroup + \fi + \fi + #1% +} +\newif\ifETE@InsideSetfile +\newcommand*{\epstopdfcall}[1]{% + \ifETE@InsideSetfile + \expandafter\@firstoftwo + \else + \expandafter\@secondoftwo + \fi + {`#1}% + {\Gin@base\Gin@ext}% +} +\def\ETE@DefCommandLine#1{% + \edef\CommandLine{\expandafter\fi\if`#1}% +} +\def\ETE@DefX#1{% + \expandafter\expandafter\expandafter\def + \expandafter\expandafter\expandafter\x + \expandafter\expandafter\expandafter{% + \expandafter\fi\if`#1\relax\else + }% +} +\def\ETE@Gin@setfile#1#2#3{% + \ifETE@disable + \ETE@OrgGin@setfile{#1}{#2}{#3}% + \else + \begingroup + \ETE@InsideSetfiletrue + \ETE@DefX{#3}% + \expandafter\endgroup + \ifx\x\@empty + \ETE@OrgGin@setfile{#1}{#2}{#3}% + \else + \begingroup + \ETE@InsideSetfiletrue + \def\GraphicsType{#1}% + \def\GraphicsRead{#2}% + \ifETE@prefersuffix + \else + \ifx\ETE@suffix\@empty + \else + \ETE@IfFileExists{\Gin@base\GraphicsRead}{% + \ETE@Skip{% + \ETE@OrgGin@setfile{#1}{#2}{\Gin@base#2}% + }% + }{% + \let\next\relax + }% + \next + \fi + \fi + \ifx\Gin@ext\relax + \let\SourceExt\Gin@eext + \def\SourceFile{\Gin@base\Gin@eext}% + \else + \let\SourceExt\Gin@ext + \def\SourceFile{\Gin@base\Gin@ext}% + \fi + \edef\SourceExt{% remove dot + \expandafter\@cdr\SourceExt\@empty\@nil + }% + \let\OutputDirectory\ETE@outdir + \ifx\OutputDirectory\@empty + \edef\OutputFile{\ETE@GenerateName{\Gin@base}{#2}}% + \else + \begingroup + \filename@parse{\Gin@base#2}% + \edef\x{\endgroup + \def\noexpand\OutputFile{% + \ETE@GenerateName{% + \OutputDirectory\filename@base + }{#2}% + }% + }% + \x + \fi + \ETE@DefCommandLine{#3}% + \ifETE@verbose + \@PackageInfo{epstopdf}{% + \ETE@FileInfo{Source}\SourceFile\MessageBreak + \ETE@FileInfo{Output}\OutputFile\MessageBreak + Command: <\CommandLine>\MessageBreak + \string\includegraphics + }% + \fi + \ETE@Make\SourceFile\OutputFile{% + \pdf@system{\CommandLine}% + \ifETE@verbose + \@PackageInfoNoLine{epstopdf}{% + \ETE@FileInfo{Result}\OutputFile + }% + \fi + }% + \edef\x{\endgroup + \ifx\OutputDirectory\@empty + \else + \def\noexpand\Gin@base{% + \OutputDirectory\noexpand\filename@base + }% + \fi + \ifx\ETE@suffix\@empty + \else + \edef\noexpand\Gin@base{% + \noexpand\Gin@base\ETE@suffix + }% + \fi + \noexpand\ETE@OrgGin@setfile{% + \GraphicsType + }{% + \GraphicsRead + }{% + \OutputFile + }% + }% + \x + \fi + \fi +} +\let\Gin@setfile\ETE@Gin@setfile +\def\ETE@GenerateName#1#2{% + #1\ETE@suffix#2% +} +% \end{macrocode} +% +% \subsection{Declare graphics rule} +% +% \begin{macrocode} +\newcommand*{\epstopdfDeclareGraphicsRule}[4]{% + \ifx\\#4\\% + \@PackageError{epstopdf-base}{% + Conversion command is missing% + }\@ehc + \else + \begingroup + \@ifundefined{Gin@rule@#1}{% + }{% + \@PackageInfo{epstopdf-base}{% + Redefining graphics rule for `#1'% + }% + }% + \endgroup + \@namedef{Gin@rule@#1}##1{{#2}{#3}{\epstopdfcall{#4}}}% + \fi +} +% \end{macrocode} +% +% \cs{DeclareGraphicsRule} for .eps +% \begin{macrocode} +\epstopdfDeclareGraphicsRule{.eps}{pdf}{.pdf}{% + \ETE@epstopdf{#1}% +} +\def\ETE@epstopdf#1{% + \ETE@program@epstopdf\space + \ifcase\ifx\OutputDirectory\@empty + \ifx\ETE@suffix\@empty + 1% + \fi + \fi + 0 % + --outfile=\OutputFile\space + \fi + #1% +} +% \end{macrocode} +% +% \begin{macrocode} +\ifETE@prepend + \expandafter\PrependGraphicsExtensions +\else + \expandafter\AppendGraphicsExtensions +\fi +{.eps} +\let\ETE@prepend\@undefined +\DeclareVoidOption{prepend}{% + \PrependGraphicsExtensions{.eps}% +} +\let\ETE@append\@undefined +\DeclareVoidOption{append}{% + \AppendGraphicsExtensions{.eps}% +} +% \end{macrocode} +% +% \begin{macrocode} +\InputIfFileExists{epstopdf-sys.cfg}{}{} +\InputIfFileExists{epstopdf.cfg}{}{} +% \end{macrocode} +% +% \begin{macrocode} +\ETE@AtEnd% +% +% \end{macrocode} +% +% \section{Test} +% +% \subsection{Preface for standard catcode check} +% +% \begin{macrocode} +%<*test1> +\input miniltx.tex\relax +\def\Gin@driver{pdftex.def} +\input graphicx.sty\relax +\resetatcatcode +% +% \end{macrocode} +% +% \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 epstopdf.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} +% +% \end{macrocode} +% +% \section{Installation} +% +% \subsection{Download} +% +% \paragraph{Package.} This package is available on +% CTAN\footnote{\CTANpkg{epstopdf-pkg}}: +% \begin{description} +% \item[\CTAN{macros/latex/contrib/epstopdf/epstopdf.dtx}] The source file. +% \item[\CTAN{macros/latex/contrib/epstopdf/epstopdf.pdf}] Documentation. +% \end{description} +% +% +% \paragraph{Bundle.} All the packages of the bundle `epstopdf' +% are also available in a TDS compliant ZIP archive. There +% the packages are already unpacked and the documentation files +% are generated. The files and directories obey the TDS standard. +% \begin{description} +% \item[\CTANinstall{install/macros/latex/contrib/epstopdf.tds.zip}] +% \end{description} +% \emph{TDS} refers to the standard ``A Directory Structure +% for \TeX\ Files'' (\CTAN{tds/tds.pdf}). Directories +% with \xfile{texmf} in their name are usually organized this way. +% +% \subsection{Bundle installation} +% +% \paragraph{Unpacking.} Unpack the \xfile{epstopdf.tds.zip} in the +% TDS tree (also known as \xfile{texmf} tree) of your choice. +% Example (linux): +% \begin{quote} +% |unzip epstopdf.tds.zip -d ~/texmf| +% \end{quote} +% +% \subsection{Package installation} +% +% \paragraph{Unpacking.} The \xfile{.dtx} file is a self-extracting +% \docstrip\ archive. The files are extracted by running the +% \xfile{.dtx} through \plainTeX: +% \begin{quote} +% \verb|tex epstopdf.dtx| +% \end{quote} +% +% \paragraph{TDS.} Now the different files must be moved into +% the different directories in your installation TDS tree +% (also known as \xfile{texmf} tree): +% \begin{quote} +% \def\t{^^A +% \begin{tabular}{@{}>{\ttfamily}l@{ $\rightarrow$ }>{\ttfamily}l@{}} +% epstopdf.sty & tex/latex/epstopdf/epstopdf.sty\\ +% epstopdf-base.sty & tex/latex/epstopdf/epstopdf-base.sty\\ +% epstopdf.pdf & doc/latex/epstopdf/epstopdf.pdf\\ +% test/epstopdf-test1.tex & doc/latex/epstopdf/test/epstopdf-test1.tex\\ +% epstopdf.dtx & source/latex/epstopdf/epstopdf.dtx\\ +% \end{tabular}^^A +% }^^A +% \sbox0{\t}^^A +% \ifdim\wd0>\linewidth +% \begingroup +% \advance\linewidth by\leftmargin +% \advance\linewidth by\rightmargin +% \edef\x{\endgroup +% \def\noexpand\lw{\the\linewidth}^^A +% }\x +% \def\lwbox{^^A +% \leavevmode +% \hbox to \linewidth{^^A +% \kern-\leftmargin\relax +% \hss +% \usebox0 +% \hss +% \kern-\rightmargin\relax +% }^^A +% }^^A +% \ifdim\wd0>\lw +% \sbox0{\small\t}^^A +% \ifdim\wd0>\linewidth +% \ifdim\wd0>\lw +% \sbox0{\footnotesize\t}^^A +% \ifdim\wd0>\linewidth +% \ifdim\wd0>\lw +% \sbox0{\scriptsize\t}^^A +% \ifdim\wd0>\linewidth +% \ifdim\wd0>\lw +% \sbox0{\tiny\t}^^A +% \ifdim\wd0>\linewidth +% \lwbox +% \else +% \usebox0 +% \fi +% \else +% \lwbox +% \fi +% \else +% \usebox0 +% \fi +% \else +% \lwbox +% \fi +% \else +% \usebox0 +% \fi +% \else +% \lwbox +% \fi +% \else +% \usebox0 +% \fi +% \else +% \lwbox +% \fi +% \else +% \usebox0 +% \fi +% \end{quote} +% If you have a \xfile{docstrip.cfg} that configures and enables \docstrip's +% TDS installing feature, then some files can already be in the right +% place, see the documentation of \docstrip. +% +% \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 +% \verb|mktexlsr|. +% +% \subsection{Some details for the interested} +% +% \paragraph{Unpacking with \LaTeX.} +% The \xfile{.dtx} chooses its action depending on the format: +% \begin{description} +% \item[\plainTeX:] Run \docstrip\ and extract the files. +% \item[\LaTeX:] Generate the documentation. +% \end{description} +% If you insist on using \LaTeX\ for \docstrip\ (really, +% \docstrip\ does not need \LaTeX), then inform the autodetect routine +% about your intention: +% \begin{quote} +% \verb|latex \let\install=y\input{epstopdf.dtx}| +% \end{quote} +% Do not forget to quote the argument according to the demands +% of your shell. +% +% \paragraph{Generating the documentation.} +% You can use both the \xfile{.dtx} or the \xfile{.drv} to generate +% the documentation. The process can be configured by the +% configuration file \xfile{ltxdoc.cfg}. For instance, put this +% line into this file, if you want to have A4 as paper format: +% \begin{quote} +% \verb|\PassOptionsToClass{a4paper}{article}| +% \end{quote} +% An example follows how to generate the +% documentation with pdf\LaTeX: +% \begin{quote} +%\begin{verbatim} +%pdflatex epstopdf.dtx +%makeindex -s gind.ist epstopdf.idx +%pdflatex epstopdf.dtx +%makeindex -s gind.ist epstopdf.idx +%pdflatex epstopdf.dtx +%\end{verbatim} +% \end{quote} +% +% \begin{History} +% \begin{Version}{2001/01/06 v1.0} +% \item +% First public version, +% published in the \pdfTeX\ mailing list. +% \end{Version} +% \begin{Version}{2001/02/04 v1.1} +% \item +% Minor documentation update. +% \item +% CTAN. +% \end{Version} +% \begin{Version}{2006/02/20 v1.2} +% \item +% DTX framework. +% \item +% Compatibility for \xfile{miniltx.tex}. +% \end{Version} +% \begin{Version}{2006/08/26 v1.3} +% \item +% Check for \cs{write18} if available and print a warning +% if the feature is not enabled. +% \end{Version} +% \begin{Version}{2007/04/26 v1.4} +% \item +% Documentation rewritten and extended. +% \end{Version} +% \begin{Version}{2007/10/02 v1.5} +% \item +% New option \xoption{update}: If the converted file exists, it will be only +% converted if it is out of date. +% \item +% Updating the extension list is delegated to package \xpackage{grfext}. +% Fine tuning is done by the new options \xoption{append}, \xoption{prepend}. +% \item +% New option \xoption{outdir} for changing the output directory. +% \item +% New option \xoption{verbose}. +% \item +% \cs{SourceFile} and \cs{OutputFile} introduced. +% \item +% Configuration file support added. +% \end{Version} +% \begin{Version}{2007/11/11 v1.6} +% \item +% Use of package \xpackage{pdftexcmds} for \LuaTeX\ support. +% \end{Version} +% \begin{Version}{2008/05/06 v1.7} +% \item +% Warning messages uses ``loaded'' instead of ``found''. +% \end{Version} +% \begin{Version}{2009/03/01 v1.8} +% \item +% Warning message for missing \xfile{pdftex.def} changed. +% \end{Version} +% \begin{Version}{2009/07/06 v1.9} +% \item +% Option \xoption{suffix} added. +% \end{Version} +% \begin{Version}{2009/07/07 v1.10} +% \item +% \cs{SourceExt} added. +% \item +% If option \xoption{suffix} is set, the inclusion of +% an image without the suffix namespace is preferred over generating the +% the image within the suffix namespace. +% \end{Version} +% \begin{Version}{2009/07/12 v2.0} +% \item +% New default settings. +% \item +% Package is split into \xpackage{epstopdf} that only takes package +% options and loads \xpackage{epstopdf-base} that does the work. +% \item +% \cs{epstopdfDeclareGraphicsRule} and \cs{epstopdfcall} added. +% \item +% \xfile{epstopdf-sys.cfg} is loaded before \xfile{epstopdf.cfg} +% if \xfile{epstopdf-sys.cfg} exists. +% \end{Version} +% \begin{Version}{2009/07/15 v2.1} +% \item +% Default setting: \xoption{verbose} is now turned on as the +% documentation for v2.0 said. +% \item +% Documentation fixes. +% \end{Version} +% \begin{Version}{2009/07/16 v2.2} +% \item +% Fixed redefined \cs{Gin@setfile}. +% \item +% Documentation extended for package options. +% \end{Version} +% \begin{Version}{2009/09/24 v2.3} +% \item +% Bug fix for the case that both option \xoption{suffix} and +% \xoption{outdir} are used. +% \end{Version} +% \begin{Version}{2009/10/17 v2.4} +% \item +% The name of the program `epstopdf' can be configured via +% the new option \xoption{program@epstopdf}. +% \end{Version} +% \begin{Version}{2016/05/15 v2.5} +% \item +% Wording of warning message fixed (Karl Berry). +% \item +% \cs{ETE@Gin@setfile} added (Karl Berry). +% \end{Version} +% \begin{Version}{2016/05/15 v2.6} +% \item +% luaTeX compatibility +% \end{Version} +% \begin{Version}{2019/11/24 v2.7} +% \item +% New epstopdf repository. +% \end{Version} +% \end{History} +% +% \PrintIndex +% +% \Finale +\endinput diff --git a/macros/latex/contrib/epstopdf-pkg/epstopdf.pdf b/macros/latex/contrib/epstopdf-pkg/epstopdf.pdf new file mode 100644 index 0000000000..0602221929 Binary files /dev/null and b/macros/latex/contrib/epstopdf-pkg/epstopdf.pdf differ diff --git a/macros/latex/contrib/footnoterange/README b/macros/latex/contrib/footnoterange/README index 30812580a5..fb785c9428 100644 --- a/macros/latex/contrib/footnoterange/README +++ b/macros/latex/contrib/footnoterange/README @@ -1,4 +1,4 @@ -README for footnoterange package, 2018/10/15, v1.0b +README for footnoterange package, 2019/11/24, v1.0c TABLE OF CONTENTS diff --git a/macros/latex/contrib/footnoterange/footnoterange-example.pdf b/macros/latex/contrib/footnoterange/footnoterange-example.pdf index 75cd9a4f49..693449febb 100644 Binary files a/macros/latex/contrib/footnoterange/footnoterange-example.pdf and b/macros/latex/contrib/footnoterange/footnoterange-example.pdf differ diff --git a/macros/latex/contrib/footnoterange/footnoterange.dtx b/macros/latex/contrib/footnoterange/footnoterange.dtx index 50432562ea..307cb9862e 100644 --- a/macros/latex/contrib/footnoterange/footnoterange.dtx +++ b/macros/latex/contrib/footnoterange/footnoterange.dtx @@ -1,9 +1,9 @@ % \iffalse meta-comment % % File: footnoterange.dtx -% Version: 2018/10/15 v1.0b +% Version: 2019/11/24 v1.0c % -% Copyright (C) 2012 - 2018 by +% Copyright (C) 2012 - 2019 by % H.-Martin M"unch % Portions of code copyrighted by other people as marked; % lines marked "FMi": code by Frank Mittelbach, thanks! @@ -85,7 +85,7 @@ \input docstrip.tex \Msg{*********************************************************************************} \Msg{* Installation} -\Msg{* Package: footnoterange 2018/10/15 v1.0b References to ranges of footnotes (HMM)} +\Msg{* Package: footnoterange 2019/11/24 v1.0c References to ranges of footnotes (HMM)} \Msg{*********************************************************************************} \keepsilent @@ -97,9 +97,9 @@ This is a generated file. Project: footnoterange -Version: 2018/10/15 v1.0b +Version: 2019/11/24 v1.0c -Copyright (C) 2012 - 2018 by +Copyright (C) 2012 - 2019 by H.-Martin M"unch Portions of code copyrighted by other people as marked; lines marked "FMi": code by Frank Mittelbach, thanks! @@ -188,7 +188,7 @@ In memoriam % \begin{macrocode} %<*driver> \NeedsTeXFormat{LaTeX2e}[2015/01/01] -\ProvidesFile{footnoterange.drv}[2018/10/15 v1.0b +\ProvidesFile{footnoterange.drv}[2019/11/24 v1.0c References to ranges of footnotes (HMM)] \documentclass{ltxdoc}[2015/03/26]% v2.0w \usepackage{holtxdoc}[2012/03/21]% v0.24 @@ -274,7 +274,7 @@ In memoriam % \DoNotIndex{\arabic, \Alph, \alph, \alphalph, \Roman, \roman, \fnsymbol} % % \title{The \xpackage{footnoterange} package} -% \date{2018/10/15 v1.0b} +% \date{2019/11/24 v1.0c} % \author{H.-Martin M\"{u}nch\\\xemail{Martin.Muench at Uni-Bonn.de}} % % \maketitle @@ -305,7 +305,7 @@ In memoriam % $2\unit{g}$ CO$_{2}$ and $2\unit{g}$ wood: % Therefore please print only if this is really necessary. % -% \bigskip +% \medskip % % \tableofcontents % @@ -435,7 +435,7 @@ In memoriam hyperfootnotes=true% ]{hyperref}[2012/11/06]% v6.83m -\usepackage{footnoterange}[2018/10/15]% v1.0b +\usepackage{footnoterange}[2019/11/24]% v1.0c \gdef\unit#1{\mathord{\thinspace\mathrm{#1}}}% \listfiles @@ -444,7 +444,7 @@ In memoriam \section*{Example for footnoterange} This example demonstrates the use of package\newline -\textsf{footnoterange}, v1.0b as of 2018/10/15 (HMM).\newline +\textsf{footnoterange}, v1.0c as of 2019/11/24 (HMM).\newline The package does not use options.\newline \verb|footnoterange-example.pdf| can be created by\newline \verb|pdflatex footnoterange-example.tex|,\newline @@ -538,7 +538,7 @@ are probably not very clear. % % \begin{macrocode} \NeedsTeXFormat{LaTeX2e}[2011/06/27] -\ProvidesPackage{footnoterange}[2018/10/15 v1.0b +\ProvidesPackage{footnoterange}[2019/11/24 v1.0c References to ranges of footnotes (HMM)] % \end{macrocode} % @@ -604,7 +604,7 @@ are probably not very clear. % \begin{macrocode} \xdef\fnr@opt{#1}% contains the optional argument \xdef\fnr@arabic{\arabic\@mpfn}% - \edef\fnr@formated{\thefootnote}% + \protected@edef\fnr@formated{\thefootnote}% % \end{macrocode} % % The |\footnotemark| is not set (yet), but the |\footnotetext|, @@ -881,7 +881,7 @@ are probably not very clear. % \item[-] class \xpackage{article}, 2007/10/19, v1.4h, from \xpackage{classes.dtx}:\newline % \url{https://www.ctan.org/tex-archive/macros/latex/base/} % -% \item[-] package \xpackage{footnoterange}, 2018/10/15, v1.0b,\newline +% \item[-] package \xpackage{footnoterange}, 2019/11/24, v1.0c,\newline % \url{https://www.ctan.org/pkg/footnoterange}\newline % (Well, it is the example file for this package, and because you are % reading the documentation for the \xpackage{footnoterange} package, @@ -1088,21 +1088,22 @@ are probably not very clear. % which I also got everything I know about creating a file in \xext{dtx} % format, ok, say it: copying), \textsc{Frank Mittelbach} for several bug reports, % for code for improving the package, and for pointing me to the \xpackage{fnpct} -% package as alternative, everybody of the CTAN team for managing CTAN, and the -% \Newsgroup{comp.text.tex} and \Newsgroup{de.comp.text.tex} -% newsgroups and everybody at \url{https://tex.stackexchange.com/} +% package as alternative, Willie Wong for reporting a bug and its fix, +% everybody of the CTAN team for managing CTAN, +% the \Newsgroup{comp.text.tex} and \Newsgroup{de.comp.text.tex} newsgroups, +% and everybody at \url{https://tex.stackexchange.com/} % for their help in all things \hbox{\TeX{}.} % This package was created as response to question % \textquotedblleft Compressing consecutive footnote % marks\textquotedblright{} by user001\newline -% (\url{http://tex.stackexchange.com/users/10127/user001}) on\newline -% \url{http://tex.stackexchange.com/q/44165/6865}. +% (\url{https://tex.stackexchange.com/users/10127/user001}) on\newline +% \url{https://tex.stackexchange.com/q/44165/6865}. % % \newpage % \phantomsection % \begin{History}\label{History} % \begin{Version}{2011/02/11 v0.1ff.} -% \item Some versions at \url{http://tex.stackexchange.com/q/44165/6865}. +% \item Some versions at \url{https://tex.stackexchange.com/q/44165/6865}. % \end{Version} % \begin{Version}{2012/02/17 v1.0a} % \item Package created and uploaded to CTAN. @@ -1113,6 +1114,9 @@ are probably not very clear. % \item Listing the \href{https://www.ctan.org/pkg/fnpct}{\xpackage{fnpct}} % package as alternative. % \end{Version} +% \begin{Version}{2019/11/24 v1.0c} +% \item Bug fix: Issue with footnote symbols. +% \end{Version} % \end{History} % % \bigskip diff --git a/macros/latex/contrib/footnoterange/footnoterange.pdf b/macros/latex/contrib/footnoterange/footnoterange.pdf index 06e83948ef..6cc3317374 100644 Binary files a/macros/latex/contrib/footnoterange/footnoterange.pdf and b/macros/latex/contrib/footnoterange/footnoterange.pdf differ diff --git a/macros/latex/contrib/newfloat/CHANGELOG b/macros/latex/contrib/newfloat/CHANGELOG new file mode 100644 index 0000000000..68e6585889 --- /dev/null +++ b/macros/latex/contrib/newfloat/CHANGELOG @@ -0,0 +1,13 @@ +Changes made in the newfloat package +==================================== + +Please note that this document does not reflect bugfix-releases, and that the dates given are the dates of the release w/o bugfixes. + +If you are interested in a complete changelog -- including bugfixes -- process the dtx files with \RecordChanges and \PrintChanges. + +v1.0 (2011/10/30) +- 1st published version + +v1.1 (2013/04/27) +- New command \PrepareListOf + diff --git a/macros/latex/contrib/newfloat/README b/macros/latex/contrib/newfloat/README new file mode 100644 index 0000000000..5d5ce91248 --- /dev/null +++ b/macros/latex/contrib/newfloat/README @@ -0,0 +1,38 @@ +========================================================================== + +The `newfloat' package +Copyright (C) 2011-2019 Axel Sommerfeldt (axel.sommerfeldt@f-m.fm) + +License: LPPL = LaTeX Project Public Licence +Maintenance Status: maintained (by Axel Sommerfeldt) + +Home page: + https://gitlab.com/axelsommerfeldt/newfloat + +If you need help for installation please visit: + https://texfaq.org/FAQ-inst-miktexstar + https://texfaq.org/FAQ-installthings + https://texfaq.org/FAQ-privinst + +If you need help using these packages please visit: + https://latex.org/forum/ + https://tex.stackexchange.com/ + https://golatex.de/ (German) + https://texwelt.de/ (German) + +If you think you may have found a bug in these packages, +or want to report a suggestion for improvement, please either visit + https://gitlab.com/axelsommerfeldt/newfloat/issues (preferred) +or send an e-mail to + axel.sommerfeldt@f-m.fm + +-------------------------------------------------------------------------- + +The `newfloat' package v1.1 offers the command \DeclareFloatingEnvironment +for defining new floating environments which behave like the existing +floating environments "figure" and "table". + +User Manual: newfloat.pdf (English) + +========================================================================== + diff --git a/macros/latex/contrib/newfloat/SUMMARY b/macros/latex/contrib/newfloat/SUMMARY new file mode 100644 index 0000000000..21d118cffc --- /dev/null +++ b/macros/latex/contrib/newfloat/SUMMARY @@ -0,0 +1 @@ +This LaTeX package offers the command \DeclareFloatingEnvironment for defining new floating environments which behave like the existing floating environments "figure" and "table". diff --git a/macros/latex/contrib/newfloat/newfloat.dtx b/macros/latex/contrib/newfloat/newfloat.dtx new file mode 100644 index 0000000000..eed00a0f96 --- /dev/null +++ b/macros/latex/contrib/newfloat/newfloat.dtx @@ -0,0 +1,2076 @@ +% \iffalse meta-comment +% +% This is file `newfloat.dtx'. +% +% Copyright (C) 2011-2019 Axel Sommerfeldt (axel.sommerfeldt@f-m.fm) +% +% -------------------------------------------------------------------------- +% +% 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 2003/12/01 or later. +% +% This work has the LPPL maintenance status "maintained". +% +% This Current Maintainer of this work is Axel Sommerfeldt. +% +% This work consists of the files newfloat.ins, newfloat.dtx, +% and the derived file newfloat.sty. +% +% \fi +% \CheckSum{1609} +% +% \iffalse +%<*driver> +\NeedsTeXFormat{LaTeX2e}[1994/12/01] +\ProvidesFile{newfloat.drv}% + [2013/04/27 v1.1 This package offers a command for defining new floating environments] +\hbadness=9999 \newcount\hbadness \hfuzz=48pt % Make TeX shut up. +% +\documentclass{ltxdoc} +\setlength\parindent{0pt} +\setlength\parskip{\smallskipamount} +% +\usepackage{ifpdf} +\ifpdf + \usepackage{mathptmx,courier} + \usepackage[scaled=0.90]{helvet} +% \addtolength\marginparwidth{15pt} +\fi +% +\usepackage[bottom]{footmisc} +% +\usepackage{hypdoc} +\ifpdf\usepackage{hypdestopt}\fi +\hypersetup{pdfkeywords={LaTeX, package, newfloat},pdfstartpage={},pdfstartview={}} +% +\usepackage{newfloat} +% +\DeclareRobustCommand*\eTeX{\texorpdfstring + {\leavevmode\hbox{$\varepsilon$}-\TeX}% + {e-TeX}} +\DeclareRobustCommand*\AmS{\texorpdfstring + {{\protect\usefont{OMS}{cmsy}{m}{n}A\kern-.1667em\lower.5ex\hbox{M}\kern-.125emS}}% + {AMS}} +\DeclareRobustCommand*\KOMAScript{\texorpdfstring + {\textsf{K\kern.05em O\kern.05em M\kern.05em A\kern.1em-\kern.1em Script}}% + {KOMA-Script}} +\DeclareRobustCommand*\NTG{NTG} +\DeclareRobustCommand*\SmF{SMF} +% +\begin{document} + \DocInput{newfloat.dtx} +\end{document} +% +% \fi +% +% \newcommand*\purerm[1]{{\upshape\mdseries\rmfamily #1}} +% \newcommand*\puresf[1]{{\upshape\mdseries\sffamily #1}} +% \newcommand*\purett[1]{{\upshape\mdseries\ttfamily #1}} +% \let\class\puresf \let\package\puresf +% \let\env\purett \let\opt\purett +% +% \def\thispackage{the \package{newfloat} package} +% \def\Thispackage{The \package{newfloat} package} +% +% \newcommand*\csmarg[1]{\texttt{\char`\{#1\char`\}}} +% \newcommand*\csoarg[1]{\texttt{\char`\[#1\char`\]}} +% \newcommand*\version[2][]{\textit{v#2}} +% +% \setlength\leftmargini{1.5em} +% +% \GetFileInfo{newfloat.drv} +% \let\docdate\filedate +% \let\docversion\fileversion +% \GetFileInfo{newfloat.sty} +% +% \title{\texorpdfstring{\Thispackage\thanks{%^^A +% This package has version number \docversion.}}%^^A +% {The newfloat package}} +% \author{Axel Sommerfeldt\\ +% \url{https://gitlab.com/axelsommerfeldt/newfloat}} +% \date{\docdate} +% \maketitle +% +% \begin{abstract} +% \centering +% This package offers the command +% |\Declare|\-|Floating|\-|Environment| for defining new floating environments +% which behave like |figure| and |table|. +% \end{abstract} +% +% \tableofcontents +% +% \clearpage +% \section{Loading the package} +% +% First of all you need to include this package into your document with +% \begin{quote} +% |\usepackage|\oarg{options}|{newfloat}| +% \end{quote} +% where \meta{options} are one or more of +% \begin{quote}\begin{tabular}{r@{\,}l} +% |within=| & \meta{``within'' counter} \emph{or} \texttt{none}\quad\\ +% |chapterlistsgap=| & \meta{value}~\footnotemark[1] +% \end{tabular}\end{quote} +% +% The ``within'' counter specifies the counter which will be used to reset +% the counter of the floating environments |figure| and |table| . +% (Furthermore this setting will be used as default setting for +% |\Declare|\-|Floating|\-|Environment|.) +% +% So for example |within=chapter| will give you a numbering scheme +% \meta{chapter}.\meta{x} for floating environments, +% while |within=section| will give you a numbering scheme +% \meta{chapter}.\meta{section}.\meta{x}, or \meta{section}.\meta{x} +% if the document class does not offer |\chapter|. +% |within=none| will result in a continuous numbering throughout the document, +% i.e.~the numbering scheme will be simply \meta{x}. +% +% The option |chapterlistsgap=|\meta{value} sets the amount of the +% vertical gap inserted into the ``List of Figure'', ``List of Tables'', +% and all lists created with |\Declare|\-|Floating|\-|Environment| +% when a new chapter will be started. +% The default value is |10pt|. +% (This option will only be available if the document class used offer +% the usage of chapters, e.g.~the |book| or |report| document class.) +% +% \pagebreak[3] +% Both options can be changed later on, too, by using the command +% \begin{quote} +% |\newfloatsetup|\meta{options}\quad, +% \end{quote} +% +% \pagebreak[3] +% \section{\cs{DeclareFloatingEnvironment}} +% +% After loading \thispackage\ you can define your own floating environments with +% \begin{quote} +% \iffalse +% \setlength{\leftmargin}{6cm} +% \fi +% |\DeclareFloatingEnvironment|\oarg{options}\marg{type}% +% \iffalse +% \oarg{name}\oarg{list name} +% \fi +% \end{quote} +% where \meta{options} are one or more of +% \begin{quote}\begin{tabular}{r@{\,}l} +% |fileext=| & \meta{file extension}\\ +% |listname=| & \meta{list name}\\ +% |name=| & \meta{prosa name}\\ +% |placement=| & \meta{combination of \,\purett{htbp}}\\ +% |within=| & \meta{``within'' counter} \emph{or} \texttt{none}\\ +% |chapterlistsgaps=| & \texttt{on} \emph{or} \texttt{off}~\footnotemark[1] +% \end{tabular}\end{quote} +% \footnotetext[1]{Please note that although \thispackage\ tries hard to offer this +% option it may not be available or is working incorrectly in cooperation with +% your document class since there is no standard interface which we could use +% for that purpose. Therefore we have to try to patch the \cs{chapter} command, +% and if this fails, we try to patch \cs{addtocontents} (in an unusual way) instead.} +% +% If no \meta{options} are given, +% ``lo\meta{type}'' will be used as \meta{file extension} for the list, +% ``List of \meta{name}s'' as \meta{list name}. +% ``\meta{name}'' as \meta{name} (but with the first letter capitalized), +% ``|tbp|'' as \meta{placement} specifier, +% and ``|chapter|'' resp. ``|none|'' as \meta{``within'' counter}, +% i.e., the counter which resets the numbering. +% +% The default value of the |chapterlistsgaps=| option depends on the +% ``within'' setting, it is set to |on| if |chapter| or |section| is selected, +% otherwise it is set to |off|. +% (This option will only be available if the document class used offer +% the usage of chapters, e.g.~the |book| or |report| document class.) +% +% The list will be typeset using the command |\list|\-|of|\meta{type}|s| +% resp.~|\list|\-|of|\meta{type}|es|, +% analogous to |\list|\-|of|\-|figures| and |\list|\-|of|\-|tables|. +% +% If the \package{fltpage} package is loaded, an environment called +% |FP|\meta{type} will be defined additionally, same for |sideways|\meta{type} +% (\package{rotating} package), |SC|\meta{type} (\package{sidecap} package), +% and |wrap|\meta{type} (\package{wrapfig} package). +% +% \bigskip +% +% \pagebreak[3] +% So for example +% \begin{quote} +% |\DeclareFloatingEnvironment{diagram}| +% \end{quote} +% will define a new floating environment called |diagram|, +% the list will be stored in a file with the extension |lodiagram|, the name +% (used for the caption) will be ``Diagram'' and the list name +% ``List of Diagrams''. +% The list could be typeset with |\list|\-|of|\-|diagrams|. +% Dependent on which packages are loaded, the environments |FP|\-|diagram|, +% |sideways|\-|diagram|, |SC|\-|diagram|, and |wrap|\-|diagram| will be defined additionally. +% +% \pagebreak[3] +% Another example: +% \begin{quote} +% |\DeclareFloatingEnvironment[|\\ +% | fileext=lox,|\\ +% | listname={List of Matrixes},|\\ +% | name=Matrix,|\\ +% | placement=p,|\\ +% | within=section,|\\ +% | chapterlistsgaps=off,|\\ +% | ]{matrix}| +% \end{quote} +% will define a new floating environment called |matrix| with the given settings. +% Please note that names which contain spaces needs to be enclosed in curly braces. +% +% \pagebreak[3] +% \section{\cs{SetupFloatingEnvironment}} +% +% While |\DeclareFloatingEnvironment| will create new floating environments, +% \begin{quote} +% |\SetupFloatingEnvironment|\marg{floating environment}\marg{options} +% \end{quote} +% will change the settings of existing ones, i.e. either |figure| or |table|, +% or a one created with |\Declare|\-|Floating|\-|Environment|, +% or a one created with |\new|\-|float| offered by the \package{float} package, +% or a one created with |\new|\-|float| offered by the \package{memoir} document class, +% or a one created with |\Declare|\-|New|\-|Float|\-|Type| offered by the \package{floatrow} package, +% or \ldots +% +% The \meta{options} are the same as the options for +% |\Declare|\-|Floating|\-|Environment|, +% but one should avoid changing the file extension +% of existing floating environments, +% i.e.~using the |fileext=| option within |\Setup|\-|Floating|\-|Environment| +% is usually a very bad idea. +% +% \bigskip +% +% \pagebreak[3] +% An example: +% \begin{quote} +% |\SetupFloatingEnvironment{lstlisting}{chapterlistsgaps=off}| +% \end{quote} +% will switch off the chapter lists gaps for |lstlisting| environments +% offered by the \package{listings} package. +% +% \pagebreak[3] +% \section{\cs{ForEachFloatingEnvironment}} +% +% \begin{quote} +% |\ForEachFloatingEnvironment|\marg{code with \#1} +% \end{quote} +% will execute the given \meta{code} for all known floating environments, +% and for ones defined with |\Declare|\-|Floating|\-|Environment| later on. +% +% \pagebreak[3] +% So for example the \package{subcaption} packages uses +% \begin{quote} +% |\ForEachFloatingEnvironment{\DeclareCaptionSubType{#1}}| +% \end{quote} +% for initializing itself for all floating environments which are +% known to \thispackage. +% +% \medskip +% +% There is also a starred variant |\For|\-|Each|\-|Floating|\-|Environment*| +% which will execute the given code for already existing floating environments +% only, i.e.~no hook will be placed inside |\Declare|\-|Floating|\-|Environment|. +% +% \pagebreak[3] +% An example: +% \begin{quote} +% |\ForEachFloatingEnvironment*{\typeout{#1}}| +% \end{quote} +% will typeout the names of all already known floating environments to the terminal +% and log file. +% +% \pagebreak[3] +% \section{\cs{PrepareListOf}} +% +% Unfortunately there is no standardized way of typesetting and customizing +% lists of floating environments, i.e.~every document class offers it's own stuff here, +% and there are plenty of \LaTeXe\ packages for this purpose. +% +% \pagebreak[3] +% For that reason the \thispackage\ simply typesets the lists of newly +% defined floating environments as ``List of Figure'' internally (using |\list|\-|of|\-|figure|) +% but using a different list (the right one, of course) and using a different list name, +% the one you have specified with either |\Declare|\-|Floating|\-|Environment| or +% |\Setup|\-|Floating|\-|Environment|.\footnote{Please note that this is not the +% fact when using a \KOMAScript\ document class, not \cs{listoffigure} but \cs{listoftoc} +% will be used here, and therefore no problems should occur.} +% +% \pagebreak[3] +% While this usually results in the same layout as the ``List of Figure'' and +% is sufficient for most cases, there are some cases where this might +% lead to an unwanted side effect. +% +% \pagebreak[3] +% Therefore the \thispackage\ offers +% \begin{quote} +% |\PrepareListOf|\marg{floating environment}\marg{code} +% \end{quote} +% which will execute the given \meta{code} right before actually typesetting the list +% with |\list|\-|of|\-|figures| internally. +% +% \pagebreak[3] +% One example: +% \begin{quote} +% |\PrepareListOf{diagram}{%|\\ +% | \renewcommand{\cftfigpresnum}{Diagram~}}| +% \end{quote} +% will change the part typeset in front of the diagram number within the +% ``List of Diagrams'' when using the \package{tocloft} package~\cite{tocloft}. +% Without the code above you will get the part defined for figures instead. +% +% \pagebreak[3] +% However, when dealing with the \package{tocloft} package it's a better +% idea not to use |\Prepare|\-|List|\-|Of| but the customization facilities of that package +% instead, e.g.: +% \begin{quote} +% |\documentclass{book}|\\ +% \ldots\\ +% |\usepackage{newfloat,tocloft}|\\ +% |\newlistof{diagram}{lod}{List of Diagrams}|\\ +% |\DeclareFloatingEnvironment[name=Diagram,fileext=lod]{diagram}|\\ +% | % Note: Due of a bug in tocloft the file extension|\\ +% | % must be repeated at \DeclareFloatingEnvironment,|\\ +% | % otherwise you will get an empty list.|\\ +% ||\\ +% |% Customize `List of Figures'|\\ +% |\renewcommand{\cftfigpresnum}{Figure~}|\\ +% |\setlength{\cftfignumwidth}{2cm}|\\ +% ||\\ +% |% Customize `List of Diagrams'|\\ +% |\renewcommand{\cftdiagrampresnum}{Diagram~}|\\ +% |\setlength{\cftdiagramnumwidth}{2cm}|\\ +% ||\\ +% \ldots\\ +% ||\\ +% |\begin{document}|\\ +% \ldots\\ +% |\listoffigures|\\ +% |\listofdiagrams|\\ +% \ldots\\ +% |\end{document}| +% \end{quote} +% +% \iffalse +% \pagebreak[3] +% \section{For \LaTeX{} package authors} +% +% |\For|\-|Each|\-|Floating|\-|Environment| without \package{newfloat} package: +% \begin{quote} +% |\newcommand\mypackage@foreachfloat[1]{%|\\ +% | \@ifundefined{ForEachFloatingEnvironment}%|\\ +% | {\def\@elt##1{#1}%|\\ +% | \@ifundefined{c@figure}\@gobble\@elt{figure}%|\\ +% | \@ifundefined{c@table}\@gobble\@elt{table}%|\\ +% | \let\@elt\relax|\\ +% | \newfloat@addtohook{#1}}%|\\ +% | {\ForEachFloatingEnvironment{#1}}}|\\ +% |\providecommand\newfloat@addtohook[1]{%|\\ +% | \toks@=\expandafter{\newfloat@hook{##1}#1}%|\\ +% | \edef\@tempa{\def\noexpand\newfloat@hook####1{\the\toks@}}%|\\ +% | \@tempa}|\\ +% |\providecommand*\newfloat@hook[1]{}| +% \end{quote} +% +% \pagebreak[3] +% Adding environment to list of floating environments: +% \begin{quote} +% |\SetupFloatingEnvironment|\marg{environment}|{}| +% \end{quote} +% or (without \package{newfloat} package loaded): +% \begin{quote} +% |\providecommand\newfloat@list{}|\\ +% |\@cons\newfloat@list{|\marg{environment}|}| +% \end{quote} +% (Please note the doubled curly braces around the environment name.) +% \fi +% +% \iffalse +% --------------------------------------------------------------------------- % +% \fi +% +% \StopEventually{%^^A +% \pagebreak[4] +% \begin{thebibliography}{9} +% +% \bibitem{memoir} +% Peter Wilson:\\ +% \href{http://www.ctan.org/pkg/memoir}% +% {\emph{The Memoir Class for Configurable Typesetting}},\\ +% 2011/03/06 +% +% \bibitem{NTGclasses} +% Victor Eijkhout:\\ +% \href{http://www.ctan.org/pkg/ntgclass}% +% {\emph{An introduction to the Dutch \LaTeX\ document classes}},\\ +% \mbox{3~September~1989} +% +% \bibitem{KOMAScript} +% Markus Kohm \& Jens-Uwe-Morawski:\\ +% \href{http://www.ctan.org/pkg/koma-script}% +% {\emph{KOMA-Script -- a versatile \LaTeXe\ bundle}},\\ +% 2012-07-22 +% +% \bibitem{float} +% Anselm Lingnau:\\ +% \href{http://www.ctan.org/pkg/float}% +% {\emph{An Improved Environment for Floats}},\\ +% 2001/11/08 +% +% \bibitem{fltpage} +% Sebastian Gross:\\ +% \href{http://www.ctan.org/pkg/fltpage}% +% {\emph{Welcome to the beta test of fltpage package!}},\\ +% 1998/11/13 +% +% \bibitem{rotating} +% Sebastian Rahtz and Leonor Barroca:\\ +% \href{http://www.ctan.org/pkg/rotating}% +% {\emph{A style option for rotated objects in \LaTeX}},\\ +% 1997/09/26 +% +% \bibitem{sidecap} +% Rolf Niepraschk \& Hubert G\"a\ss lein:\\ +% \href{http://www.ctan.org/pkg/sidecap}% +% {\emph{The sidecap package}},\\ +% 2003/06/06 +% +% \bibitem{tocloft} +% Peter Wilson, Herries Press, Will Robertson:\\ +% \href{http://www.ctan.org/pkg/tocloft}% +% {\emph{The tocloft package}},\\ +% 2010/10/13 +% +% \bibitem{wrapfig} +% Donald Arseneau:\\ +% \href{http://www.ctan.org/pkg/wrapfig}% +% {\emph{WRAPFIG.STY ver 3.6}},\\ +% 2003/01/31 +% +% \end{thebibliography} +% } +% +% \iffalse +% --------------------------------------------------------------------------- % +% \fi +% +% \DoNotIndex{\\,\_,\ ,\@@par} +% \DoNotIndex{\@bsphack} +% \DoNotIndex{\@car,\@cdr,\@classoptionslist,\@cons,\@currext,\@currname} +% \DoNotIndex{\@ehc,\@ehd,\@empty,\@esphack,\@expandtwoargs} +% \DoNotIndex{\@for,\@firstofone,\@firstoftwo} +% \DoNotIndex{\@gobble,\@gobbletwo,\@gobblethree,\@gobblefour,\@hangfrom} +% \DoNotIndex{\@ifnextchar,\@ifpackagelater,\@ifpackageloaded} +% \DoNotIndex{\@ifstar,\@ifundefined,\@latex@error,\@namedef,\@nameuse} +% \DoNotIndex{\@onlypreamble,\@parboxrestore,\@plus,\@ptionlist} +% \DoNotIndex{\@removeelement,\@restorepar,\@secondoftwo,\@setpar} +% \DoNotIndex{\@tempa,\@tempboxa,\@tempdima,\@tempdimb,\@tempdimc,\@tempb,\@tempc} +% \DoNotIndex{\@testopt} +% \DoNotIndex{\@undefined,\@unprocessedoptions,\@unusedoptionlist} +% \DoNotIndex{\p@,\z@} +% \DoNotIndex{\active,\addtocounter,\addtolength,\advance,\aftergroup} +% \DoNotIndex{\baselineskip,\begin,\begingroup,\bfseries,\box} +% \DoNotIndex{\catcode,\centering,\changes,\csname,\def,\divide,\do,\downarrow} +% \DoNotIndex{\edef,\else,\empty,\end,\endcsname,\endgraf,\endgroup,\expandafter} +% \DoNotIndex{\fi,\footnotesize,\global} +% \DoNotIndex{\hangindent,\hbox,\hfil,\hsize,\hskip,\hspace,\hss} +% \DoNotIndex{\ifcase,\ifdim,\ifnum,\ifodd,\ifvoid,\ifvmode} +% \DoNotIndex{\ifx,\ignorespaces,\itshape} +% \DoNotIndex{\Large,\large,\leavevmode,\leftmargini,\leftskip,\let,\linewidth} +% \DoNotIndex{\llap,\long,\m@ne,\margin,\mdseries,\message} +% \DoNotIndex{\newcommand,\newdimen,\newlength,\newline,\newif,\newsavebox} +% \DoNotIndex{\next,\nobreak,\nobreakspace,\noexpand,\noindent,\numberline} +% \DoNotIndex{\normalcolor,\normalfont,\normalsize,\or,\par,\parbox,\parfillskip} +% \DoNotIndex{\parindent,\parskip,\prevdepth,\protect,\protected@edef,\protected@write} +% \DoNotIndex{\providecommand,\quad} +% \DoNotIndex{\raggedleft,\raggedright,\relax,\renewcommand,\RequirePackage} +% \DoNotIndex{\rightskip,\rmfamily} +% \DoNotIndex{\sbox,\scriptsize,\scshape,\setbox,\setlength,\sffamily,\slshape} +% \DoNotIndex{\small,\string,\space,\strut} +% \DoNotIndex{\textheight,\the,\toks@,\typeout,\ttfamily} +% \DoNotIndex{\unvbox,\uparrow,\upshape,\usebox,\usepackage} +% \DoNotIndex{\value,\vbox,\vsize,\vskip,\wd,\width,\z@skip} +% \DoNotIndex{\AtBeginDocument,\AtEndOfPackage,\CurrentOption,\DeclareOption} +% \DoNotIndex{\ExecuteOptions,\GenericWarning,\IfFileExists,\InputIfFileExists} +% \DoNotIndex{\NeedsTeXFormat,\MessageBreak} +% \DoNotIndex{\PackageError,\PackageInfo,\PackageWarning,\PackageWarningNoLine} +% \DoNotIndex{\PassOptionsToPackage,\ProcessOptions,\ProvidesPackage} +% +% \iffalse +% --------------------------------------------------------------------------- % +% \fi +% +% \setlength{\parskip}{0pt plus 1pt} +% \changes{v1.0}{2011/10/30}{First release as \package{newfloat} package, +% outsourced from the \package{caption3} package and revised} +% \changes{v1.1}{2013/04/27}{Adapted to the \package{tocloft} package} +% \changes{v1.1}{2013/04/27}{New command \cs{PrepareListOf} added} +% \changes{v1.1d}{2019/03/16}{Adapted to the \package{dgruyter} package} +% +% \iffalse +% --------------------------------------------------------------------------- % +% \fi +% +% \clearpage +% \section{The Implementation} +% \iffalse +%<*package> +% \fi +% +% \pagebreak[3] +% \subsection{Identification} +% +% \begin{macrocode} +\NeedsTeXFormat{LaTeX2e}[1994/12/01] +\ProvidesPackage{newfloat}[2019/09/02 v1.1l Defining new floating environments (AR)] +% \end{macrocode} +% +% \begin{macro}{\newfloat@Info} +% \begin{macro}{\newfloat@InfoNoLine} +% |\newfloat@Info|\marg{message} +% \begin{macrocode} +\newcommand*\newfloat@Info[1]{% + \PackageInfo{newfloat}{#1}} +\newcommand*\newfloat@InfoNoLine[1]{% + \newfloat@Info{#1\@gobble}} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\newfloat@Warning} +% \begin{macro}{\newfloat@WarningNoLine} +% |\newfloat@Warning|\marg{message} +% \begin{macrocode} +\newcommand*\newfloat@Warning[1]{% + \PackageWarning{newfloat}{#1}} +\newcommand*\newfloat@WarningNoLine[1]{% + \newfloat@Warning{#1\@gobble}} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\newfloat@Error} +% |\newfloat@Error|\marg{message} +% \begin{macrocode} +\newcommand*\newfloat@Error[1]{% + \PackageError{newfloat}{#1}\newfloat@eh} +% \end{macrocode} +% \begin{macrocode} +\newcommand*\newfloat@eh{% + If you do not understand this error, please take a closer look\MessageBreak + at the documentation of the `newfloat' package.\MessageBreak\@ehc} +% \end{macrocode} +% \end{macro} +% +% \pagebreak[3] +% \subsection{Using the keyval package} +% +% We need the \package{keyval} package for option handling, so we load it here. +% \begin{macrocode} +\RequirePackage{keyval}[1997/11/10] +% \end{macrocode} +% +% \pagebreak[3] +% \subsection{Helper macros} +% +% \begin{macro}{\newfloat@def} +% \changes{v1.1}{2013/04/27}{This macro added} +% |\newfloat@def|\marg{macro name}\marg{definition} +% \begin{macrocode} +\newcommand*\newfloat@def[2]{% + \newfloat@ifundefined{#1}{% + \@namedef{#1}{#2}}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\newfloat@let} +% \changes{v1.1}{2013/04/27}{This macro added} +% |\newfloat@let|\marg{macro name}\marg{macro} +% \begin{macrocode} +\newcommand*\newfloat@let[2]{% + \newfloat@ifundefined{#1}{% + \expandafter\let\csname #1\endcsname#2}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\newfloat@ifundefined} +% \changes{v1.1}{2013/04/27}{This macro added} +% |\newfloat@ifundefined|\marg{macro name}\marg{code} +% \begin{macrocode} +\newcommand*\newfloat@ifundefined[2]{% + \@ifundefined{#1}{#2}{% + \newfloat@Info{% + \expandafter\string\csname#1\endcsname\space is already defined}}} +% \end{macrocode} +% \end{macro} +% +% \pagebreak[3] +% \subsection{\cs{DeclareFloatingEnvironment}} +% +% \begin{macro}{\DeclareFloatingEnvironment} +% \changes{v1.0a}{2011/11/16}{Bugfix: Undefines \cs{fst@}\meta{environment} now} +% \changes{v1.1}{2013/04/27}{Revised, only defines stuff yet undefined now} +% \changes{v1.1}{2013/11/03}{Uses \cs{newfloat@capitalize} now} +% \changes{v1.1}{2015/09/16}{Support of \cs{autodot} (offered by the \KOMAScript\ classes) added} +% \changes{v1.1}{2018/03/04}{Usage of \cs{ifdefined} replaced by \cs{@ifundefined} to improve compatibility with the \package{listings} package} +% \changes{v1.1b}{2018/12/26}{Bugfix: Missing curly braces added} +% \changes{v1.1c}{2019/01/10}{Bugfix: Support of \cs{autodot} fixed} +% \changes{v1.1k}{2019/09/01}{Adapted to the \class{beamer} document class} +% |\DeclareFloatingEnvironment|\oarg{options}\marg{environment}\oarg{name}\oarg{list name} +% \begin{macrocode} +\newcommand*\DeclareFloatingEnvironment{% + \@testopt\@DeclareFloatingEnvironment{}} +\@onlypreamble\DeclareFloatingEnvironment +% \end{macrocode} +% \begin{macrocode} +\def\@DeclareFloatingEnvironment[#1]#2{% + \newfloat@Info{New float `#2' with options `#1'}% +% \end{macrocode} +% Define a counter with the same name as the floating environment +% \begin{macrocode} + \newfloat@ifundefined{c@#2}{\newcounter{#2}}% +% \end{macrocode} +% Set |\ftype@|\meta{type} which contains the type number for floats of type \meta{type}\par +% (See also \url{http://tex.stackexchange.com/q/32359/2574}) +% \begin{macrocode} + \@ifundefined{c@float@type}% from float package + {\@ifundefined{c@newflo@tctr}% from memoir document class + {\ifdefined\newfloat@ftype \else + \newcount\newfloat@ftype + \newfloat@ftype=8\relax + \fi + \expandafter\xdef\csname ftype@#2\endcsname{\the\newfloat@ftype}% + \advance\newfloat@ftype\newfloat@ftype}% + {\expandafter\edef\csname ftype@#2\endcsname{\the\c@newflo@tctr}% + \advance\c@newflo@tctr \c@newflo@tctr}}% + {\expandafter\edef\csname ftype@#2\endcsname{\the\value{float@type}}% + \addtocounter{float@type}{\value{float@type}}}% +% \end{macrocode} +% \begin{macrocode} + \newfloat@Info{float type `#2'=\@nameuse{ftype@#2}}% +% \end{macrocode} +% Define |\fnum@|\meta{type}, a macro to generate the figure number for a caption +% \begin{macrocode} + \newfloat@def{fnum@#2}% + {\@nameuse{#2name}\nobreakspace\@nameuse{the#2}% + \ifdefined\autodot\expandafter\autodot\fi}% +% \end{macrocode} +% Define |\|\meta{type}|name| used by |\fnum@|\meta{type} as \meta{type}, +% but with first letter capitalized +% \begin{macrocode} + \newfloat@capitalize\newfloat@Type{#2}% + \newfloat@let{#2name}{\newfloat@Type}% + \newfloat@def{fleg#2}{\@nameuse{#2name}}% legend naming (memoir) +% \end{macrocode} +% Legend name in ToC (memoir document class) +% \begin{macrocode} + \newfloat@ifundefined{flegtoc#2}{\@namedef{flegtoc#2}##1{}}% +% \end{macrocode} +% Define the floating environment\par +% If the \class{tufte} document class is loaded, +% |\@tufte@float| and |\end@tufte@float| will be used instead of +% |\@float|, |\end@float|, |\@dblfloat|, and |\end@dblfloat|.\par +% If the \class{beamer} document class is loaded, +% |\beamer@float| and |\end@beamer@float| will be used. +% \begin{macrocode} + \ifcsname @tufte@float\endcsname + \newenvironment{#2}[1][htbp]% + {\begin{@tufte@float}[{##1}]{#2}{}}% + {\end{@tufte@float}}% + \newenvironment{#2*}[1][htbp]% + {\begin{@tufte@float}[{##1}]{#2}{star}}% + {\end{@tufte@float}}% + \else + \@ifclassloaded{beamer}{% + \newenvironment{#2}[1][]{\beamer@float{#2}}{\end@beamer@float}% + }{% + \newenvironment{#2}{\@float{#2}}{\end@float}% + \newenvironment{#2*}{\@dblfloat{#2}}{\end@dblfloat}% + }% + \fi +% \end{macrocode} +% Define the listing command |\listof|\meta{type}(|e|)|s| +% \changes{v1.1}{2013/04/27}{Definition of list hook added} +% \begin{macrocode} + \newfloat@def{listof#2}{\newfloat@listof{#2}}% + \newfloat@def{listof#2s}{\@nameuse{listof#2}}% + \newfloat@def{listof#2es}{\@nameuse{listof#2s}}% + \newfloat@def{newfloat@listof#2@hook}{}% + \ifdefined\l@figure + \newfloat@let{l@#2}{\l@figure}% + \else + \newfloat@def{l@#2}{\@dottedtocline{1}{1.5em}{2.3em}}% + \fi + \edef\newfloat@tempa{List of \newfloat@Type s}% + \newfloat@let{list#2name}{\newfloat@tempa}% +% \end{macrocode} +% We undefine |\fst@|\meta{environment} so the new environment +% will not be recognized as defined by the \package{float} package. +% (|\fst@|\meta{type} use to hold the float style, see \package{float} package +% implementation for details.) +% \begin{macrocode} + \expandafter\let\csname fst@#2\endcsname\@undefined +% \end{macrocode} +% Set default parameters +% \begin{macrocode} + \newfloat@ifundefined{fps@#2}{\newfloat@setplacement{#2}{tbp}}% + \newfloat@ifundefined{ext@#2}{\newfloat@setfileext{#2}{lo#2}}% +% \end{macrocode} +% Apply given options +% \begin{macrocode} + \newfloat@setoptions*{#2}{#1}% +% \end{macrocode} +% Announce the new floating environment to other packages +% \begin{macrocode} + \@expandtwoargs\newfloat@announce{#2}{\@nameuse{ext@#2}}% +% \end{macrocode} +% Apply the last two optional arguments for setting names +% \begin{macrocode} + \@ifnextchar[\newfloat@DFE@setname\relax} +\@onlypreamble\@DeclareFloatingEnvironment +% \end{macrocode} +% \begin{macrocode} +\def\newfloat@DFE@setname[#1]{% + \KV@@newfloat@name{#1}% + \@ifnextchar[\newfloat@DFE@setlistname\relax} +\@onlypreamble\newfloat@DFE@setname +% \end{macrocode} +% \begin{macrocode} +\def\newfloat@DFE@setlistname[#1]{% + \KV@@newfloat@listname{#1}} +\@onlypreamble\newfloat@DFE@setlistname +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\newfloat@capitalize} +% \changes{v1.1}{2013/11/03}{Code extracted from \cs{DeclareFloatingEnvironment}} +% \changes{v1.1}{2013/11/03}{Uses \cs{newfloat@tempa} instead of \cs{@tempa} now} +% |\newfloat@capitalize|\marg{command}\marg{name}\\ +% Defines \meta{command} to \meta{name}, but with first letter capitalized. +% \begin{macrocode} +\newcommand*\newfloat@capitalize[2]{% + \edef\newfloat@tempa{\gdef\noexpand#1{\@car#2\@nil}}% + \uppercase\expandafter{\newfloat@tempa}% + \edef\newfloat@tempa{% + \noexpand\g@addto@macro\noexpand#1{\@cdr#2\@nil}}% + \newfloat@tempa} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\newfloat@listof} +% \changes{v1.1}{2013/04/27}{Revised} +% \changes{v1.1g}{2019/08/28}{Starred variant added} +% |\newfloat@listof|\marg{float type}\\ +% typesets the list, using |\listoffigure| with patched list name and file extension. +% \begin{macrocode} +\newcommand*\newfloat@listof[1]{% + \@ifstar + {\newfloat@list@of{#1}*}% + {\newfloat@list@of{#1}\relax}} +% \end{macrocode} +% \begin{macrocode} +\newcommand*\newfloat@list@of[1]{% + \@expandtwoargs\newfloat@list@of@{#1}{\@nameuse{ext@#1}}} +% \end{macrocode} +% \begin{macrocode} +\newcommand*\newfloat@list@of@[3]{% + \begingroup + \expandafter\let\expandafter\listfigurename\csname list#1name\endcsname + \def\ext@figure{#2}% + \let\newfloat@starttoc\@starttoc + \def\@starttoc##1{\newfloat@starttoc{#2}}% + \let\newfloat@listoftoc\listoftoc + \def\listoftoc##1{\newfloat@listoftoc{#2}}% + \@nameuse{newfloat@listof#1@hook}% + \listoffigures#3% + \endgroup} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\newfloat@setoptions} +% |\newfloat@setoptions*|\marg{environment}\marg{options} +% \begin{macrocode} +\newcommand*\newfloat@setoptions{% + \@ifstar + {\newfloat@@setoptions\@firstofone}% + {\newfloat@@setoptions\@gobble}} +% \end{macrocode} +% \begin{macrocode} +\newcommand*\newfloat@@setoptions[3]{% + \let\newfloat@within@value\@undefined + \let\newfloat@chapterlistsgaps@value\@undefined + #1{\KV@@newfloat@within\newfloat@within@default}% set default value for new floats + \def\newfloat@type{#2}% + \setkeys{@newfloat}{#3}% + \ifx\newfloat@within@value\@undefined \else + \newfloat@setoption{within}\newfloat@within@value + \fi + \ifx\newfloat@chapterlistsgaps@value\@undefined \else + \newfloat@setoption{chapterlistsgaps}\newfloat@chapterlistsgaps@value + \fi} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\newfloat@within@default} +% The default `within' value. +% This one will be used if no option |within=|\meta{counter} is given. +% \begin{macrocode} +\newcommand*\newfloat@within@default{% + \ifcsname c@chapter\endcsname chapter\else none\fi} +\@onlypreamble\newfloat@within@default +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\newfloat@setoption} +% \changes{v1.1}{2015/09/15}{Bugfix: \cs{@expandtwoargs} replaced by own expansion so the option value do not get expanded anymore} +% |\newfloat@setoption|\marg{option name}{options} +% \begin{macrocode} +\newcommand*\newfloat@setoption[1]{% + \edef\caption@tempa{\noexpand\@nameuse{newfloat@set#1}{\newfloat@type}}% + \caption@tempa} +% \end{macrocode} +% \end{macro} +% +% The available \meta{options} are: +% |fileext=|\meta{file extension}, +% |listname=|\meta{list name}, +% |name=|\meta{prosa name}, +% |placement=|\meta{htbp}, +% |within=|\meta{none,chapter,section}, and +% |without|. +% +% \begin{macro}{\newfloat@setfileext} +% |\newfloat@setfileext|\marg{environment}\marg{file extension} +% \begin{macrocode} +\newcommand*\newfloat@setfileext[2]{% + \@namedef{ext@#1}{#2}} +% \end{macrocode} +% \begin{macrocode} +\define@key{@newfloat}{fileext}{% + \newfloat@setoption{fileext}{#1}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\newfloat@setlistname} +% |\newfloat@setlistname|\marg{environment}\marg{list name} +% \begin{macrocode} +\newcommand*\newfloat@setlistname[2]{% + \@namedef{list#1name}{#2}} +% \end{macrocode} +% \begin{macrocode} +\define@key{@newfloat}{listname}{% + \newfloat@setoption{listname}{#1}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\newfloat@setname} +% |\newfloat@setname|\marg{environment}\marg{name} +% \begin{macrocode} +\newcommand*\newfloat@setname[2]{% + \newfloat@@setname{#1}{#2}% + \begingroup + \ifcsname languagename\endcsname + \ifcsname captions\languagename\endcsname + \expandafter\g@addto@macro\csname captions\languagename\endcsname + {\newfloat@@setname{#1}{#2}}% + \fi + \fi + \endgroup} +%%\AtBeginDocument{\let\newfloat@setname\newfloat@@setname} +% \end{macrocode} +% \begin{macrocode} +\newcommand*\newfloat@@setname[2]{% + \@namedef{#1name}{#2}} +% \end{macrocode} +% \begin{macrocode} +\define@key{@newfloat}{name}{% + \newfloat@setoption{name}{#1}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\newfloat@setplacement} +% |\newfloat@setplacement|\marg{environment}\marg{float placement} +% \begin{macrocode} +\newcommand*\newfloat@setplacement[2]{% + \@namedef{fps@#1}{#2}} +% \end{macrocode} +% \begin{macrocode} +\define@key{@newfloat}{placement}{% + \newfloat@setoption{placement}{#1}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\newfloat@setwithin} +% |\newfloat@setwithin|\marg{environment}\marg{counter}\par +% setup the counter for working ``within'' a given counter. +% Furthermore the chapters lists gap will be switched on +% (if counter $=$ |chapter|) or off (otherwise). +% \begin{macrocode} +\newcommand*\newfloat@setwithin[2]{% + \ifcsname c@chapter\endcsname + \@removefromreset{#1}{chapter}% + \fi + \@removefromreset{#1}{section}% +% \end{macrocode} +% \begin{macrocode} + \edef\@tempa{#2}% + \ifx\@tempa\@empty + \def\@tempa{none}% + \fi + \def\@tempb{none}% + \ifx\@tempa\@tempb + \ifcsname c@chapter\endcsname + \@chapterlistsgap@off{#1}% + \fi + \newfloat@@setwithin{#1}{}{}% + \else + \def\@tempb{chapter}% + \ifx\@tempa\@tempb + \@addtoreset{#1}{chapter}% + \@chapterlistsgap@on{#1}% + \newfloat@@setwithin{#1}{\ifnum\c@chapter>\z@ \thechapter.\fi}{\theHchapter.}% + \else + \def\@tempb{section}% + \ifx\@tempa\@tempb + \@addtoreset{#1}{section}% + \ifcsname c@chapter\endcsname + \@addtoreset{#1}{chapter}% + \@chapterlistsgap@on{#1}% + \newfloat@@setwithin{#1}{\thesection.}{\theHsection.}% + \else + \newfloat@@setwithin{#1}{\ifnum\c@section>\z@ \thesection.\fi}{\theHsection.}% + \fi + \else + \newfloat@Error{Invalid value `#2' for option `within'}% + \fi + \fi + \fi} +% \end{macrocode} +% Note: Since the \package{hyperref} package with version $<$ 6.82k defines +% |\the|\-|H|\-|figure| and |\the|\-|H|\-|table| with |\new|\-|command|, +% |\newfloat@@setwithin| will yield to an error message when using with an +% old version of \package{hyperref}, +% e.g. ``\texttt{LaTeX Error: Command \cs{theHfigure} already defined}''. +% \begin{macrocode} +\newcommand*\newfloat@@setwithin[3]{% + \global\@namedef{the#1}{#2\arabic{#1}}% + \global\@namedef{theH#1}{#3\arabic{#1}}} +% \end{macrocode} +% \begin{macrocode} +\define@key{@newfloat}{within}{% + \def\newfloat@within@value{#1}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\newfloat@setwithout} +% |\newfloat@setwithout|\marg{environment} +% \begin{macrocode} +\newcommand*\newfloat@setwithout[1]{% + \newfloat@setwithin{#1}{none}} +% \end{macrocode} +% \begin{macrocode} +\define@key{@newfloat}{without}[]{% + \def\newfloat@within@value{none}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\newfloat@setchapterlistsgaps} +% |\newfloat@setchapterlistsgaps|\marg{environment}\marg{on/off} +% \begin{macrocode} +\newcommand*\newfloat@setchapterlistsgaps[2]{% + \edef\@tempa{#2}% + \def\@tempb{off}% + \ifx\@tempa\@tempb + \@chapterlistsgap@off{#1}% + \else + \def\@tempb{on}% + \ifx\@tempa\@tempb + \@chapterlistsgap@on{#1}% + \else + \newfloat@Error{Invalid value `#2' for option `chapterlistsgaps'}% + \fi + \fi} +% \end{macrocode} +% \begin{macrocode} +\define@key{@newfloat}{chapterlistsgaps}{% + \def\newfloat@chapterlistsgaps@value{#1}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@removefromreset} +% This code was taken from the \package{remreset} package +% which is part of the `carlisle' package bundle. +% (Copyright 1997 David Carlisle) +% \begin{macrocode} +\providecommand*\@removefromreset[2]{{% + \expandafter\let\csname c@#1\endcsname\@removefromreset + \def\@elt##1{% + \expandafter\ifx\csname c@##1\endcsname\@removefromreset + \else + \noexpand\@elt{##1}% + \fi}% + \expandafter\xdef\csname cl@#2\endcsname{% + \csname cl@#2\endcsname}}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\newfloat@announce} +% |\newfloat@announce|\marg{environment name}\marg{list file extension} +% \begin{macrocode} +\newcommand*\newfloat@announce[2]{% +% \end{macrocode} +% \begin{macrocode} + \@cons\newfloat@list{{#1}}% + \@cons\newfloat@@list{{#1}}% +% \end{macrocode} +% \begin{macrocode} + \newfloat@ifundefined{newfloat@ext@#2}{% + \@namedef{newfloat@ext@#2}{#1}% +% \end{macrocode} +% Support of \package{memoir} document class +% \begin{macrocode} + \ifcsname c@lofdepth\endcsname + \newfloat@ifundefined{c@#2depth}{% + \newcounter{#2depth}% + \setcounter{#2depth}{1}}% + \fi +% \end{macrocode} +% Support of \package{tocbasic} package +% \begin{macrocode} + \ifcsname addtotoclist\endcsname + \addtotoclist[float]{#2}% + \newfloat@def{listof#2name}{\@nameuse{list#1name}}% + \fi +% \end{macrocode} +% \begin{macrocode} + }% +% \end{macrocode} +% Support of \package{titletoc} package +% \begin{macrocode} + \ifcsname contentsuse\endcsname + \contentsuse{#1}{#2}% + \fi +% \end{macrocode} +% \begin{macrocode} + \newfloat@hook{#1}} +\@onlypreamble\newfloat@announce +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\newfloat@@list} +% |\newfloat@@list| is an \cs{@elt}-list containing the floating environments defined +% with |\Declare|\-|Floating|\-|Environment| only. +% \begin{macrocode} +\newcommand*\newfloat@@list{} +% \end{macrocode} +% \end{macro} +% +% \pagebreak[3] +% \subsection{\cs{SetupFloatingEnvironment}} +% +% \begin{macro}{\SetupFloatingEnvironment} +% |\SetupFloatingEnvironment|\marg{environment}\marg{options} +% \begin{macrocode} +\newcommand*\SetupFloatingEnvironment[1]{% + \newfloat@addtolist{#1}% + \newfloat@setoptions{#1}} +% \end{macrocode} +% \end{macro} +% +% \pagebreak[3] +% \subsection{\cs{ForEachFloatingEnvironment}} +% +% \begin{macro}{\ForEachFloatingEnvironment} +% |\ForEachFloatingEnvironment|\marg{code} +% will execute the given code for each floating environment. +% The starred variant will only work for already existing environments, +% i.e.~no hook will be placed inside |\Declare|\-|Floating|\-|Environment|. +% \begin{macrocode} +\newcommand\ForEachFloatingEnvironment{% + \@ifstar + {\@ForEachFloatingEnvironment\@gobble}% + {\@ForEachFloatingEnvironment\@iden}} +% \end{macrocode} +% \begin{macrocode} +\newcommand\@ForEachFloatingEnvironment[2]{% + \def\@elt##1{#2}% + \newfloat@list + \let\@elt\relax + #1{\newfloat@addtohook{#2}}} +% \end{macrocode} +% \begin{macrocode} +\providecommand\newfloat@addtohook[1]{% + \toks@=\expandafter{\newfloat@hook{##1}#1}% + \edef\@tempa{\def\noexpand\newfloat@hook####1{\the\toks@}}% + \@tempa} +% \end{macrocode} +% \begin{macrocode} +\providecommand*\newfloat@hook[1]{} +% \end{macrocode} +% \end{macro} +% +% \pagebreak[3] +% \subsection{\cs{PrepareListOf}} +% +% \begin{macro}{\PrepareListOf} +% \changes{v1.1}{2013/04/27}{This macro added} +% |\PrepareListOf|\marg{float type}\marg{code}\\ +% adds \meta{code} to the one which prepares typesetting the list, +% just before |\listoffigures|. +% \begin{macrocode} +\newcommand\PrepareListOf[1]{% + \expandafter\g@addto@macro\csname newfloat@listof#1@hook\endcsname} +\@onlypreamble\PrepareListOf +% \end{macrocode} +% \end{macro} +% +% \pagebreak[3] +% \subsection{The list of floating environments} +% +% \begin{macro}{\newfloat@list} +% |\newfloat@list| is an \cs{@elt}-list containing the already existising floating +% environments as well the ones defined with |\Declare|\-|Floating|\-|Environment|. +% \begin{macrocode} +\newcommand*\newfloat@list{} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\newfloat@addtolist} +% \changes{v1.0b}{2012/05/18}{Bugfix: Definition of \cs{@ifchapterlistsgap@}\meta{environment} added} +% |\newfloat@addtolist|\marg{environment} +% adds an environment to the list of floating environments. +% \begin{macrocode} +\newcommand*\newfloat@addtolist[1]{% + \newfloat@ifinlist{#1}{}{% + \ifcsname ext@#1\endcsname + \@cons\newfloat@list{{#1}}% + \@namedef{newfloat@ext@\@nameuse{ext@#1}}{#1}% + \newfloat@let{@ifchapterlistsgap@#1}{\@iden}% + \else + \newfloat@Error{`#1' does not seem to be a floating environment}% + \fi}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\newfloat@ifinlist} +% |\newfloat@ifinlist|\marg{environment}\marg{yes code}\marg{no code} +% tests if an environment is an element of the list of floating environments. +% \begin{macrocode} +\newcommand*\newfloat@ifinlist[1]{% + \let\next\@secondoftwo + \begingroup + \expandafter\let\csname c@#1\endcsname\newfloat@ifinlist + \def\@elt##1{% + \expandafter\ifx\csname c@##1\endcsname\newfloat@ifinlist + \global\let\next\@firstoftwo + \fi}% + \newfloat@list + \endgroup + \next} +% \end{macrocode} +% \end{macro} +% +% Add |figure| and |table| to the list of floating environments. +% \begin{macrocode} +\ifcsname ext@figure\endcsname + \newfloat@addtolist{figure} +\fi +\ifcsname ext@table\endcsname + \newfloat@addtolist{table} +\fi +% \end{macrocode} +% +% \pagebreak[3] +% \subsection{Chapter lists gaps} +% +% \begin{macrocode} +\ifcsname @chapter\endcsname +% \end{macrocode} +% +% \begin{macro}{\@chapterlistsgap} +% The amount of the chapter lists gap, the default one is |10pt|. +% (This command is already defined in \KOMAScript.) +% \begin{macrocode} + \providecommand*\@chapterlistsgap{10\p@}% +% \end{macrocode} +% If the \package{dgruyter} package is loaded, the default gap is |13pt|. +% \begin{macrocode} + \@ifpackageloaded{dgruyter}{\renewcommand*\@chapterlistsgap{13\p@}}{}% +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@addchapterlistsgap} +% |\@addchapterlistsgap|\marg{float type}\marg{file extension}\par +% will add the chapter lists gap for the given float type. +% \begin{macrocode} + \providecommand*\@addchapterlistsgap[2]{% + \@nameuse{@ifchapterlistsgap@#1}{% if switched on + \@@addchapterlistsgap{#1}{#2}}} +% \end{macrocode} +% \begin{macrocode} + \providecommand*\@@addchapterlistsgap[2]{% + \@ifundefined{@addchapterlistsgap@#2}{% only once per extension + \@namedef{@addchapterlistsgap@#2}{#1}% + \@@@addchapterlistsgap{#2}}{}} +% \end{macrocode} +% \begin{macrocode} + \providecommand*\@@@addchapterlistsgap[1]{% + \ifdim \@chapterlistsgap>\z@ + \addtocontents{#1}{\protect\addvspace{\@chapterlistsgap}}% + \fi} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@addchapterlistsgaps} +% \changes{v1.0b}{2012/05/18}{Bugfix: Group added to make \cs{@addchapterlistsgap} work correctly} +% |\@addchapterlistsgaps|\par +% will add the chapter lists gaps for all floating environments in |\newfloat@list|. +% \begin{macrocode} + \providecommand*\@addchapterlistsgaps{% + \begingroup + \def\@elt##1{% + \@expandtwoargs\@addchapterlistsgap{##1}{\@nameuse{ext@##1}}}% + \newfloat@list + \endgroup} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@chapterlistsgap@off} +% |\@chapterlistsgap@off|\marg{float type}\par +% switches the chapter lists gap off for the given float type. +% Since \KOMAScript{} (still) supports |\float@exts| we need to handle +% this locally, too, even if |\unsettoc| is offered by the \package{tocbasic} package. +% (Otherwise our handling could be moved into the |\else| branch.) +% \begin{macrocode} + \providecommand*\@chapterlistsgap@off[1]{% + \expandafter\let\csname @ifchapterlistsgap@#1\endcsname\@gobble + \ifcsname unsettoc\endcsname + \@expandtwoargs\unsettoc{\@nameuse{ext@#1}}{chapteratlist}% + \fi} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@chapterlistsgap@on} +% |\@chapterlistsgap@off|\marg{float type}\par +% switches the chapter lists gap on for the given float type. +% \begin{macrocode} + \providecommand*\@chapterlistsgap@on[1]{% + \expandafter\let\csname @ifchapterlistsgap@#1\endcsname\@iden + \ifcsname setuptoc\endcsname + \@expandtwoargs\setuptoc{\@nameuse{ext@#1}}{chapteratlist}% + \fi} +% \end{macrocode} +% \end{macro} +% +% \begin{macrocode} +\fi +% \end{macrocode} +% +% \pagebreak[3] +% \subsection{Global options} +% +% \begin{macro}{chapterlistsgap=} +% The |chapterlistsgap=| option sets the vertical skip added to each list when +% starting a new chapter. +% \begin{macrocode} +\define@key{newfloat}{chapterlistsgap}{% + \renewcommand*\@chapterlistsgap{#1}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{within=} +% The |within=| option redefines the default value and modifies all +% existing floating environments. +% \begin{macrocode} +\define@key{newfloat}{within}{% + \def\newfloat@within@default{#1}% set new default value + \def\@elt##1{\newfloat@setwithin{##1}{#1}}% + \newfloat@list + \let\@elt\relax} +% \end{macrocode} +% \begin{macrocode} +\define@key{newfloat}{without}[]{% + \KV@newfloat@within{none}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{figurename=} +% \begin{macro}{listfigurename=} +% \begin{macro}{figurewithin=} +% We define these options not only for |figure| but for all existing floating environments. +% \begin{macrocode} +\def\@elt#1{% + \define@key{newfloat}{#1name}{% + \newfloat@setname{#1}{##1}}% + \define@key{newfloat}{list#1name}{% + \newfloat@setname{list#1}{##1}}% + \define@key{newfloat}{#1within}{% + \newfloat@setwithin{#1}{##1}}% + \define@key{newfloat}{#1without}[]{% + \newfloat@setwithout{#1}}% +}% +\newfloat@list +\let\@elt\relax +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{planb=} +% \changes{v1.0b}{2012/05/18}{This option added} +% This option switches the `Plan B' on or off. (default$=$true) +% \begin{macrocode} +\define@key{newfloat}{planb}[true]{% + \def\@tempa{#1}% + \def\@tempb{false}% + \ifx\@tempa\@tempb + \let\newfloat@ifplanb\@gobble + \else + \def\@tempb{true}% + \ifx\@tempa\@tempb + \let\newfloat@ifplanb\@iden + \else + \newfloat@Error{Invalid value `#1' for option `planb'}% + \fi + \fi} +% \end{macrocode} +% \end{macro} +% \begin{macro}{planb-filext=} +% \changes{v1.0b}{2012/05/19}{This option added} +% This option sets the file extension used for `Plan B'. +% (default$=$use the 1st one which seem to fit) +% \begin{macrocode} +\define@key{newfloat}{planb-fileext}{% + \newfloat@Info{Setting Plan B file extension to `#1'} + \xdef\newfloat@addtocontents@ext{#1}} +% \end{macrocode} +% \end{macro} +% +% Process the package options: +% We use |\setkeys| here instead of |\ProcessOptions|. +% \begin{macrocode} +\let\@tempc\relax +\@expandtwoargs\setkeys{newfloat}{planb,\@ptionlist{\@currname.\@currext}}% +\AtEndOfPackage{\let\@unprocessedoptions\relax} +% \end{macrocode} +% +% \begin{macro}{\newfloatsetup} +% |\newfloatsetup|\marg{options} +% sets global options after loading the package. +% \begin{macrocode} +\newcommand*\newfloatsetup{\setkeys{newfloat}} +% \end{macrocode} +% \end{macro} +% +% \pagebreak[3] +% \subsection{Patching \cs{chapter}} +% +% \begin{macro}{\newfloat@replace@chapter} +% \changes{v1.1f}{2019/08/25}{Parameter \meta{class name} added to macro} +% \changes{v1.1i}{2019/08/31}{Local definition of \cs{if@chapnum} added} +% |\newfloat@replace@chapter|\marg{class name}\marg{original code}\marg{replacement code}\par +% tries to patch |\@chapter| so |\@add|\-|chapter|\-|lists|\-|gaps| will be supported. +% It checks for |\Hy@org@chapter|, too, since the original code will be stored here +% if the \package{hyperref} package was loaded. +% \begin{macrocode} +\newcommand\newfloat@replace@chapter[3]{% + \begingroup + \let\if@twocolumn\iffalse + \let\if@mainmatter\iffalse + \let\if@thema\iffalse + \let\if@chapnum\iffalse + \def\@tempa[##1]##2{#2}% + \ifx\@tempa\@chapter + \newfloat@InfoNoLine{Document class `#1' detected}% + \gdef\@chapter[##1]##2{#3}% + \global\let\newfloat@replace@chapter\newfloat@dont@replace@chapter + \else\ifx\@tempa\Hy@org@chapter + \newfloat@InfoNoLine{Document class `#1' detected (Hy)}% + \gdef\Hy@org@chapter[##1]##2{#3}% + \global\let\newfloat@replace@chapter\newfloat@dont@replace@chapter + \fi\fi + \endgroup} +% \end{macrocode} +% \begin{macrocode} +\newcommand\newfloat@dont@replace@chapter[3]{} +% \end{macrocode} +% \begin{macrocode} +\ifcsname @chapter\endcsname \else + \let\newfloat@replace@chapter\newfloat@dont@replace@chapter +\fi +% \end{macrocode} +% \end{macro} +% +% \pagebreak[3] +% \subsubsection{Standard \LaTeX{} document classes} +% +% \begin{macrocode} +% report.cls [2005/09/16 v1.4f Standard LaTeX document class] +\newfloat@replace@chapter{report}{% + \ifnum \c@secnumdepth >\m@ne + \refstepcounter{chapter}% + \typeout{\@chapapp\space\thechapter.}% + \addcontentsline{toc}{chapter}% + {\protect\numberline{\thechapter}#1}% + \else + \addcontentsline{toc}{chapter}{#1}% + \fi + \chaptermark{#1}% + \addtocontents{lof}{\protect\addvspace{10\p@}}% + \addtocontents{lot}{\protect\addvspace{10\p@}}% + \if@twocolumn + \@topnewpage[\@makechapterhead{#2}]% + \else + \@makechapterhead{#2}% + \@afterheading + \fi +}{% + \ifnum \c@secnumdepth >\m@ne + \refstepcounter{chapter}% + \typeout{\@chapapp\space\thechapter.}% + \addcontentsline{toc}{chapter}% + {\protect\numberline{\thechapter}#1}% + \else + \addcontentsline{toc}{chapter}{#1}% + \fi + \chaptermark{#1}% + \@addchapterlistsgaps + \if@twocolumn + \@topnewpage[\@makechapterhead{#2}]% + \else + \@makechapterhead{#2}% + \@afterheading + \fi} +% \end{macrocode} +% +% \begin{macrocode} +% book.cls [2005/09/16 v1.4f Standard LaTeX document class] +\newfloat@replace@chapter{book}{% + \ifnum \c@secnumdepth >\m@ne + \if@mainmatter + \refstepcounter{chapter}% + \typeout{\@chapapp\space\thechapter.}% + \addcontentsline{toc}{chapter}% + {\protect\numberline{\thechapter}#1}% + \else + \addcontentsline{toc}{chapter}{#1}% + \fi + \else + \addcontentsline{toc}{chapter}{#1}% + \fi + \chaptermark{#1}% + \addtocontents{lof}{\protect\addvspace{10\p@}}% + \addtocontents{lot}{\protect\addvspace{10\p@}}% + \if@twocolumn + \@topnewpage[\@makechapterhead{#2}]% + \else + \@makechapterhead{#2}% + \@afterheading + \fi +}{% + \ifnum \c@secnumdepth >\m@ne + \if@mainmatter + \refstepcounter{chapter}% + \typeout{\@chapapp\space\thechapter.}% + \addcontentsline{toc}{chapter}% + {\protect\numberline{\thechapter}#1}% + \else + \addcontentsline{toc}{chapter}{#1}% + \fi + \else + \addcontentsline{toc}{chapter}{#1}% + \fi + \chaptermark{#1}% + \@addchapterlistsgaps + \if@twocolumn + \@topnewpage[\@makechapterhead{#2}]% + \else + \@makechapterhead{#2}% + \@afterheading + \fi} +% \end{macrocode} +% +% \pagebreak[3] +% \subsubsection{\AmS{} \& \SmF{} document classes} +% +% \begin{macrocode} +% amsbook.cls [2004/08/06 v2.20] +% smfbook.cls [1999/11/15 v1.2f Classe LaTeX pour les monographies editees par la SMF] +\newfloat@replace@chapter{amsbook}{% + \refstepcounter{chapter}% + \ifnum\c@secnumdepth<\z@ \let\@secnumber\@empty + \else \let\@secnumber\thechapter \fi + \typeout{\chaptername\space\@secnumber}% + \def\@toclevel{0}% + \ifx\chaptername\appendixname \@tocwriteb\tocappendix{chapter}{#2}% + \else \@tocwriteb\tocchapter{chapter}{#2}\fi + \chaptermark{#1}% + \addtocontents{lof}{\protect\addvspace{10\p@}}% + \addtocontents{lot}{\protect\addvspace{10\p@}}% + \@makechapterhead{#2}\@afterheading +}{% + \refstepcounter{chapter}% + \ifnum\c@secnumdepth<\z@ \let\@secnumber\@empty + \else \let\@secnumber\thechapter \fi + \typeout{\chaptername\space\@secnumber}% + \def\@toclevel{0}% + \ifx\chaptername\appendixname \@tocwriteb\tocappendix{chapter}{#2}% + \else \@tocwriteb\tocchapter{chapter}{#2}\fi + \chaptermark{#1}% + \@addchapterlistsgaps + \@makechapterhead{#2}\@afterheading} +% \end{macrocode} +% +% \pagebreak[3] +% \subsubsection{\KOMAScript{} document classes} +% +% If a \KOMAScript{} document class or the \package{tocbasic} package is used +% we don't need to patch anything. +% Instead we use |\setup|\-|toc| and |\un|\-|set|\-|toc| to setup the +% chapters gap in |\@chapter|\-|lists|\-|gap@on| and |\@chapter|\-|lists|\-|gap@off|. +% \begin{macrocode} +\@ifpackageloaded{tocbasic}{% + \let\newfloat@replace@chapter\newfloat@dont@replace@chapter}{} +% \end{macrocode} +% +% \pagebreak[3] +% \subsubsection{memoir document classes} +% +% If the \package{memoir} document class is used, +% replacing |\insert|\-|chapter|\-|space| by |\@add|\-|chapter|\-|lists|\-|gaps| is sufficient. +% \begin{macrocode} +\ifcsname insertchapterspace\endcsname + \renewcommand*\insertchapterspace{\@addchapterlistsgaps} + \let\newfloat@replace@chapter\newfloat@dont@replace@chapter +\fi +% \end{macrocode} +% +% \pagebreak[3] +% \subsubsection{NTG document classes} +% +% \begin{macrocode} +% rapport1/3.cls [2004/06/07 v2.1a NTG LaTeX document class] +\newfloat@replace@chapter{rapport}{% + \ifnum \c@secnumdepth >\m@ne + \refstepcounter{chapter}% + \typeout{\@chapapp\space\thechapter.}% + \addcontentsline{toc}{chapter}% + {\protect\numberline{\thechapter}\toc@font0 #1}% + \else + \addcontentsline{toc}{chapter}{\toc@font0 #1}% + \fi + \chaptermark{#1}% + \addtocontents{lof}{\protect\addvspace{10\p@}}% + \addtocontents{lot}{\protect\addvspace{10\p@}}% + \if@twocolumn + \@topnewpage[\@makechapterhead{#2}]% + \else + \@makechapterhead{#2}% + \@afterheading + \fi +}{% + \ifnum \c@secnumdepth >\m@ne + \refstepcounter{chapter}% + \typeout{\@chapapp\space\thechapter.}% + \addcontentsline{toc}{chapter}% + {\protect\numberline{\thechapter}\toc@font0 #1}% + \else + \addcontentsline{toc}{chapter}{\toc@font0 #1}% + \fi + \chaptermark{#1}% + \@addchapterlistsgaps + \if@twocolumn + \@topnewpage[\@makechapterhead{#2}]% + \else + \@makechapterhead{#2}% + \@afterheading + \fi} +% \end{macrocode} +% \begin{macrocode} +% boek(3).cls [2004/06/07 v2.1a NTG LaTeX document class] +\newfloat@replace@chapter{boek}{% + \ifnum \c@secnumdepth >\m@ne + \if@mainmatter + \refstepcounter{chapter}% + \typeout{\@chapapp\space\thechapter.}% + \addcontentsline{toc}{chapter}% + {\protect\numberline{\thechapter}\toc@font0 #1}% + \else + \addcontentsline{toc}{chapter}{\toc@font0 #1}% + \fi + \else + \addcontentsline{toc}{chapter}{\toc@font0 #1}% + \fi + \chaptermark{#1}% + \addtocontents{lof}{\protect\addvspace{10\p@}}% + \addtocontents{lot}{\protect\addvspace{10\p@}}% + \if@twocolumn + \@topnewpage[\@makechapterhead{#2}]% + \else + \@makechapterhead{#2}% + \@afterheading + \fi +}{% + \ifnum \c@secnumdepth >\m@ne + \if@mainmatter + \refstepcounter{chapter}% + \typeout{\@chapapp\space\thechapter.}% + \addcontentsline{toc}{chapter}% + {\protect\numberline{\thechapter}\toc@font0 #1}% + \else + \addcontentsline{toc}{chapter}{\toc@font0 #1}% + \fi + \else + \addcontentsline{toc}{chapter}{\toc@font0 #1}% + \fi + \chaptermark{#1}% + \@addchapterlistsgaps + \if@twocolumn + \@topnewpage[\@makechapterhead{#2}]% + \else + \@makechapterhead{#2}% + \@afterheading + \fi} +% \end{macrocode} +% +% \pagebreak[3] +% \subsubsection{The thesis document class} +% +% \begin{macrocode} +% thesis.cls [1996/25/01 1.0g LaTeX document class (wm).] +\newfloat@replace@chapter{thesis}{% + \ifnum \c@secnumdepth >\m@ne + \if@mainmatter + \refstepcounter{chapter}% + \typeout{\chaptername\space\thechapter.} + \if@thema + \ifx\@shortauthor\@empty + \addcontentsline{toc}{chapter}{% + \protect\numberline{\thechapter.}#1}% + \else + \addcontentsline{toc}{chapter}{% + \protect\numberline{\thechapter.}% + \@shortauthor\hfill\mbox{}\vskip\normallineskip #1}% + \fi + \else + \addcontentsline{toc}{chapter}{% + \protect\numberline{\thechapter.}#1}% + \fi + \else + \addcontentsline{toc}{chapter}{#1} + \fi + \else + \addcontentsline{toc}{chapter}{#1} + \fi + \chaptermark{#1} + \addtocontents{lof}{\protect\addvspace{10pt}} + \addtocontents{lot}{\protect\addvspace{10pt}} + \if@twocolumn + \@topnewpage[\@makechapterhead{#2}] + \else + \@makechapterhead{#2} + \@afterheading + \fi +}{% + \ifnum \c@secnumdepth >\m@ne + \if@mainmatter + \refstepcounter{chapter}% + \typeout{\chaptername\space\thechapter.}% + \if@thema + \ifx\@shortauthor\@empty + \addcontentsline{toc}{chapter}{% + \protect\numberline{\thechapter.}#1}% + \else + \addcontentsline{toc}{chapter}{% + \protect\numberline{\thechapter.}% + \@shortauthor\hfill\mbox{}\vskip\normallineskip #1}% + \fi + \else + \addcontentsline{toc}{chapter}{% + \protect\numberline{\thechapter.}#1}% + \fi + \else + \addcontentsline{toc}{chapter}{#1}% + \fi + \else + \addcontentsline{toc}{chapter}{#1}% + \fi + \chaptermark{#1}% + \@addchapterlistsgaps + \if@twocolumn + \@topnewpage[\@makechapterhead{#2}]% + \else + \@makechapterhead{#2}% + \@afterheading + \fi} +% \end{macrocode} +% +% \pagebreak[3] +% \subsubsection{The Springer Verlag document classes} +% \changes{v1.1f}{2019/08/25}{Support of \package{svmono} and \package{svmult} document classes added} +% +% \begin{macrocode} +% svmono.cls [2018/06/25 v5.6 Springer Verlag global LaTeX document class for monographs] +% svmult.cls [2018/01/11 v5.5 Springer Verlag global LaTeX document class for multi authored books] +\newfloat@replace@chapter{svmono}{% + \if@chapnum % war mal \ifnum \c@secnumdepth >\m@ne + \refstepcounter{chapter}% + \if@mainmatter + \typeout{\@chapapp\space\thechapter.}% + \addcontentsline{toc}{chapter}{\protect + \numberline{\thechapter\thechapterend}#1}% + \else + \addcontentsline{toc}{chapter}{#1}% + \fi + \else + \addcontentsline{toc}{chapter}{#1}% + \fi + \chaptermark{#1}% + \addtocontents{lof}{\protect\addvspace{10\p@}}% + \addtocontents{lot}{\protect\addvspace{10\p@}}% + \if@twocolumn + \@topnewpage[\@makechapterhead{#2}]% + \else + \@makechapterhead{#2}% + \@afterheading + \fi +}{% + \if@chapnum % war mal \ifnum \c@secnumdepth >\m@ne + \refstepcounter{chapter}% + \if@mainmatter + \typeout{\@chapapp\space\thechapter.}% + \addcontentsline{toc}{chapter}{\protect + \numberline{\thechapter\thechapterend}#1}% + \else + \addcontentsline{toc}{chapter}{#1}% + \fi + \else + \addcontentsline{toc}{chapter}{#1}% + \fi + \chaptermark{#1}% + \@addchapterlistsgaps + \if@twocolumn + \@topnewpage[\@makechapterhead{#2}]% + \else + \@makechapterhead{#2}% + \@afterheading + \fi} +% \end{macrocode} +% +% \pagebreak[3] +% \subsubsection{The dgruyter package} +% \changes{v1.1j}{2019/08/31}{Extended support of \package{dgruyter} package added} +% +% \begin{macrocode} +% dgruyter.sty [2017/09/19 v2.00 De Gruyter layout] +\newfloat@replace@chapter{dgruyter}{% + \let\thesection\theinchapsection + \let\theequation\theinchapequation + \let\thefigure\theinchapfigure + \let\thetable\theinchaptable + \ifx\bookDOI\@undefined + \else + \@tempcnta\numexpr\componentd@i+\@ne\relax + \xdef\componentd@i{\the\@tempcnta}% + \xdef\@DOI{% + https://doi.org/\bookDOI + -\ifx\thepage\thefrontmatterpage2\else\ifnum\@tempcnta<100 0\fi\fi + \ifnum\@tempcnta<10 0\fi\componentd@i}% + \fi + \ifnum \c@secnumdepth >\m@ne + \if@mainmatter + \refstepcounter{chapter}% + \typeout{\@chapapp\space\thechapter.}% + \addcontentsline{toc}{chapter}{\protect\numberline{\thechapter}#1}% + \else + \addcontentsline{toc}{schapter}{#1}% + \fi + \else + \addcontentsline{toc}{schapter}{#1}% + \fi + \chaptermark{#1}% + \addtocontents{lof}{\protect\addvspace{13\p@}}% + \addtocontents{lot}{\protect\addvspace{13\p@}}% + \if@twocolumn + \@topnewpage[\@makechapterhead{#2}]% + \else + \@makechapterhead{#2}% + \@afterheading + \fi +}{% + \let\thesection\theinchapsection + \let\theequation\theinchapequation + \let\thefigure\theinchapfigure + \let\thetable\theinchaptable + \ifx\bookDOI\@undefined + \else + \@tempcnta\numexpr\componentd@i+\@ne\relax + \xdef\componentd@i{\the\@tempcnta}% + \xdef\@DOI{% + https://doi.org/\bookDOI + -\ifx\thepage\thefrontmatterpage2\else\ifnum\@tempcnta<100 0\fi\fi + \ifnum\@tempcnta<10 0\fi\componentd@i}% + \fi + \ifnum \c@secnumdepth >\m@ne + \if@mainmatter + \refstepcounter{chapter}% + \typeout{\@chapapp\space\thechapter.}% + \addcontentsline{toc}{chapter}{\protect\numberline{\thechapter}#1}% + \else + \addcontentsline{toc}{schapter}{#1}% + \fi + \else + \addcontentsline{toc}{schapter}{#1}% + \fi + \chaptermark{#1}% + \@addchapterlistsgaps + \if@twocolumn + \@topnewpage[\@makechapterhead{#2}]% + \else + \@makechapterhead{#2}% + \@afterheading + \fi} +% \end{macrocode} +% +% \pagebreak[3] +% \subsubsection{Compatibility warning} +% +% \begin{macrocode} +\ifx\newfloat@replace@chapter\newfloat@dont@replace@chapter \else +% \end{macrocode} +% If we were not able to patch |\@chapter| an info message is issued +% since we may not be able to support chapter lists gaps then. +% \begin{macrocode} + \newfloat@InfoNoLine{% + Unsupported document class, or \noexpand\@chapter\MessageBreak + was already redefined by another package} + \newfloat@InfoNoLine{\string\@chapter\space=\space\meaning\@chapter} + \newfloat@InfoNoLine{\string\Hy@org@chapter\space=\space\meaning\Hy@org@chapter} +% \end{macrocode} +% Plan B: We patch |\add|\-|to|\-|contents| instead, and keep our fingers crossed +% in the hope that this redefinition actually will fit. +% (Note: Since \package{biblatex} patches |\add|\-|to|\-|contents| as well we do +% this using |\At||Begin||Document|.) +% \changes{v1.1f}{2019/08/25}{Plan B will now be done using \cs{AtBeginDocument}} +% \begin{macrocode} + \newfloat@ifplanb{\AtBeginDocument{% + \newfloat@InfoNoLine{Trying Plan B..}% + \let\newfloat@addtocontents@ORI\addtocontents + \long\def\addtocontents#1#2{% + \newfloat@addtocontents{#1}{#2}#2\addvspace\newfloat@nil}% + \long\def\newfloat@addtocontents#1#2#3\addvspace#4\newfloat@nil{% + \def\newfloat@tempa{#4}% + \ifx\newfloat@tempa\@empty + \newfloat@addtocontents@ORI{#1}{#2}% + \else + \ifx\newfloat@addtocontents@ext\@undefined + \newfloat@Info{Setting Plan B file extension to `#1'...}% + \xdef\newfloat@addtocontents@ext{#1}% + \fi + \edef\newfloat@tempa{#1}% + \ifx\newfloat@tempa\newfloat@addtocontents@ext + \begingroup + \let\addtocontents\newfloat@addtocontents@ORI + \@addchapterlistsgaps + \endgroup + \fi + \fi}}} +% \end{macrocode} +% \begin{macrocode} +\fi +% \end{macrocode} +% +% \pagebreak[3] +% \subsection{Support of document classes} +% +% \subsubsection{The beamer document class} +% +% \begin{macro}{\beamer@float} +% \changes{v1.1k}{2019/09/01}{This macro added} +% Unfortunately the \class{beamer} document class does not offer +% |\beamer@float| and |\end@beamer@float| (yet), so we have to define them +% for ourself. +% (This code was taken from beamerbaselocalstructure.sty [2019/07/23 v3.56] and adapted.) +% \begin{macrocode} +\ifcsname beamer@float\endcsname \else +% \end{macrocode} +% \begin{macrocode} + \def\beamer@float#1{% + \ifcsname caption@settype\endcsname + \caption@settype{#1}% + \else + \def\@captype{#1}% + \fi + \par\nobreak\begin{center}\nobreak} +% \end{macrocode} +% \begin{macrocode} + \def\end@beamer@float{% + \par\nobreak\end{center}} +% \end{macrocode} +% \begin{macrocode} +\fi +% \end{macrocode} +% \end{macro} +% +% \pagebreak[3] +% \subsection{Support of other packages} +% +% \begin{macro}{\newfloat@IfPackageLoaded} +% \changes{v1.1e}{2019/03/17}{This macro revised} +% \changes{v1.1h}{2019/08/31}{This macro revised again and renamed from \cs{newfloat@ForEachNew} to \cs{newfloat@IfPackageLoaded}} +% |\newfloat@IfPackageLoaded|\marg{package name}\marg{command}\marg{code} +% will execute the given code for every floating environment defined with +% |\Declare|\-|Floating|\-|Environment| if \meta{command} is not defined yet. +% (If \meta{command} is already defined a warning will be issued.) +% This will be tried |\At|\-|Begin|\-|Document| additionally so the affected package could +% be loaded after \thispackage. +% \begin{macrocode} +\newcommand\newfloat@IfPackageLoaded[3]{% + \@ifpackageloaded{#1}{% + \newfloat@@IfPackageLoaded{#1}{#2}{#3}% + }{% + \AtBeginDocument{% + \@ifpackageloaded{#1}{% + \newfloat@@IfPackageLoaded{#1}{#2}{#3}% + }{}}% + }} +\@onlypreamble\newfloat@IfPackageLoaded +% \end{macrocode} +% \begin{macrocode} +\newcommand\newfloat@@IfPackageLoaded[3]{% + \newfloat@InfoNoLine{`#1' package detected}% + % Execute code for every previous \DeclareFloatingEnvironment + \def\@elt##1{\newfloat@@@IfPackageLoaded{#1}{#2}{#3}}% + \newfloat@@list + \let\@elt\relax + % Execute code for every future \DeclareFloatingEnvironment + \newfloat@addtohook{\newfloat@@@IfPackageLoaded{#1}{#2}{#3}}} +\@onlypreamble\newfloat@@IfPackageLoaded +% \end{macrocode} +% \begin{macrocode} +\newcommand\newfloat@@@IfPackageLoaded[3]{% + \ifcsname#2\endcsname + \newfloat@WarningNoLine{% + Command \@backslashchar#2 already defined.\MessageBreak + (`#1' package support)}% + \else + #3% + \fi} +\@onlypreamble\newfloat@@@IfPackageLoaded +% \end{macrocode} +% \end{macro} +% +% \pagebreak[3] +% \subsubsection{\package{dgruyter}} +% +% The De Gruyter layout package (for preparing books for Walter de Gruyter GmbH) +% is defining |\plist@figure| and |\plist@table|, and expects this to be +% defined for other floating environments as well. +% (This will be used as prefix for the ``List of''.) +% \begin{macrocode} +\newfloat@IfPackageLoaded{dgruyter}{plist@#1}{% + \expandafter\newcommand\csname plist@#1\endcsname{% + \@nameuse{#1name}\space}} +% \end{macrocode} +% +% \pagebreak[3] +% \subsubsection{\package{float}} +% +% If the \package{float} package is used we fill up |\float@exts| with our file +% extensions, too. Since this list will be used for inserting chapters gaps +% we only add the ones which are configured for chapters gaps on.\par +% Note: This has to be done |\At|\-|Begin|\-|Document| so the settings for +% chapter gaps could be changed by the user within the preamble of the document. +% \begin{macrocode} +\AtBeginDocument{% + \ifcsname float@exts\endcsname + \newfloat@@IfPackageLoaded{float}{newfloat@undefined}{% + \@nameuse{@ifchapterlistsgap@#1}{% if switched on + \let\float@do=\relax + \edef\@tempa{% + \noexpand\float@exts{\the\float@exts\float@do{\@nameuse{ext@#1}}}}% + \@tempa}}% + \fi} +% \end{macrocode} +% +% \pagebreak[3] +% \subsubsection{\package{fltpage}} +% +% We define a FP-variant of new floating environments here. +% \begin{macrocode} +\newfloat@IfPackageLoaded{fltpage}{FP#1}{% + \newcounter{FP@#1C}% + \newenvironment{FP#1}{\FP@floatBegin{#1}}{\FP@floatEnd}} +% \end{macrocode} +% +% \pagebreak[3] +% \subsubsection{\package{listings}} +% +% \begin{macro}{\ext@lstlisting} +% Since the \package{listings} package do not define |\ext@lst|\-|listing| +% but we needed it when |Setup|\-|Floating|\-|Environment{lst|\-|listing}{|\ldots|}| +% will be done by the end user, we define it here. +% \begin{macrocode} +\providecommand*\ext@lstlisting{lol}% +% \end{macrocode} +% \end{macro} +% +% \pagebreak[3] +% \subsubsection{\package{rotating}} +% +% We define a sideways-variant of new floating environments here. +% \begin{macrocode} +\newfloat@IfPackageLoaded{rotating}{sideways#1}{% + \newenvironment{sideways#1}{\@rotfloat{#1}}{\end@rotfloat}% + \newenvironment{sideways#1*}{\@rotdblfloat{#1}}{\end@rotdblfloat}} +% \end{macrocode} +% +% \pagebreak[3] +% \subsubsection{\package{sidecap}} +% +% We define a SC-variant of new floating environments here. +% \begin{macro}{\SC@float} +% \changes{v1.1b}{2018/12/26}{Bugfix: Missing curly braces added} +% \begin{macrocode} +\newcommand*\newfloat@For@SC[2]{% + \def#1{b}% = \sidecaptionvpos{#2}{b} (v1.6) + \newenvironment{SC#2}% + {\SC@float[{#1}]{#2}}{\endSC@float}% + \newenvironment{SC#2*}% + {\SC@dblfloat[{#1}]{#2}}{\endSC@dblfloat}} +\@onlypreamble\newfloat@For@SC +% \end{macrocode} +% \begin{macrocode} +\newfloat@IfPackageLoaded{sidecap}{SC#1}{% + \expandafter\newfloat@For@SC\csname SC@#1@vpos\endcsname{#1}} +% \end{macrocode} +% \end{macro} +% +% \pagebreak[3] +% \subsubsection{\package{wrapfig}} +% +% We define a wrap-variant of new floating environments here. +% \begin{macrocode} +\newfloat@IfPackageLoaded{wrapfig}{wrap#1}{% + \newenvironment{wrap#1}{\wrapfloat{#1}}{\endwrapfloat}} +% \end{macrocode} +% +% \iffalse +% +% \fi +% +% \iffalse +% --------------------------------------------------------------------------- % +% \fi +% +% \Finale +% +\endinput diff --git a/macros/latex/contrib/newfloat/newfloat.ins b/macros/latex/contrib/newfloat/newfloat.ins new file mode 100644 index 0000000000..889504d534 --- /dev/null +++ b/macros/latex/contrib/newfloat/newfloat.ins @@ -0,0 +1,42 @@ +\def\batchfile{newfloat.ins} +\input docstrip + +\askforoverwritefalse +\keepsilent + +\preamble + +Copyright (C) 2011-2019 Axel Sommerfeldt (axel.sommerfeldt@f-m.fm) + +https://gitlab.com/axelsommerfeldt/newfloat + +-------------------------------------------------------------------------- + +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 2003/12/01 or later. + +This work has the LPPL maintenance status "maintained". + +This Current Maintainer of this work is Axel Sommerfeldt. + +This work consists of the files newfloat.ins, newfloat.dtx, +and the derived file newfloat.sty. + +\endpreamble + +\generate{\file{newfloat.sty}{\from{newfloat.dtx}{package}}} + +\Msg{***********************************************************} +\Msg{*} +\Msg{* To finish the installation you have to move the file} +\Msg{* `newfloat.sty' into a directory searched by TeX.} +\Msg{*} +\Msg{* To produce the documentation run the file} +\Msg{* `newfloat.dtx' through LaTeX.} +\Msg{*} +\Msg{***********************************************************} diff --git a/macros/latex/contrib/newfloat/newfloat.pdf b/macros/latex/contrib/newfloat/newfloat.pdf new file mode 100644 index 0000000000..0300dfdec8 Binary files /dev/null and b/macros/latex/contrib/newfloat/newfloat.pdf differ diff --git a/macros/latex/contrib/oberdiek/README.txt b/macros/latex/contrib/oberdiek/README.txt index 978bccd476..b1526c4308 100644 --- a/macros/latex/contrib/oberdiek/README.txt +++ b/macros/latex/contrib/oberdiek/README.txt @@ -1,4 +1,4 @@ -README 2019/11/12 +README 2019/11/24 This file describes the directory CTAN:macros/latex/contrib/oberdiek/ @@ -12,10 +12,6 @@ Just download CTAN:install/macros/latex/contrib/oberdiek.tds.zip and unzip it in your preferred TDS (texmf) tree. -Hint for attachfile2: This package comes with a Perl script pdfatfi.pl -that should be installed somewhere in PATH as `pdfatfi', see also -package documentation. - Other files in the CTAN directory: * README: This file. diff --git a/macros/latex/contrib/oberdiek/accsupp.dtx b/macros/latex/contrib/oberdiek/accsupp.dtx index 981873bce2..c615aa5944 100644 --- a/macros/latex/contrib/oberdiek/accsupp.dtx +++ b/macros/latex/contrib/oberdiek/accsupp.dtx @@ -991,14 +991,6 @@ ed as % \paragraph{Script installation.} % Check the directory \xfile{TDS:scripts/oberdiek/} for % scripts that need further installation steps. -% Package \xpackage{attachfile2} comes with the Perl script -% \xfile{pdfatfi.pl} that should be installed in such a way -% that it can be called as \texttt{pdfatfi}. -% Example (linux): -% \begin{quote} -% |chmod +x scripts/oberdiek/pdfatfi.pl|\\ -% |cp scripts/oberdiek/pdfatfi.pl /usr/local/bin/| -% \end{quote} % % \subsection{Package installation} % diff --git a/macros/latex/contrib/oberdiek/accsupp.pdf b/macros/latex/contrib/oberdiek/accsupp.pdf index 6f4ded0698..f6c729b350 100644 Binary files a/macros/latex/contrib/oberdiek/accsupp.pdf and b/macros/latex/contrib/oberdiek/accsupp.pdf differ diff --git a/macros/latex/contrib/oberdiek/aliascnt.dtx b/macros/latex/contrib/oberdiek/aliascnt.dtx index fa0504ab83..dc3e8d4081 100644 --- a/macros/latex/contrib/oberdiek/aliascnt.dtx +++ b/macros/latex/contrib/oberdiek/aliascnt.dtx @@ -407,14 +407,6 @@ and the derived files % \paragraph{Script installation.} % Check the directory \xfile{TDS:scripts/oberdiek/} for % scripts that need further installation steps. -% Package \xpackage{attachfile2} comes with the Perl script -% \xfile{pdfatfi.pl} that should be installed in such a way -% that it can be called as \texttt{pdfatfi}. -% Example (linux): -% \begin{quote} -% |chmod +x scripts/oberdiek/pdfatfi.pl|\\ -% |cp scripts/oberdiek/pdfatfi.pl /usr/local/bin/| -% \end{quote} % % \subsection{Package installation} % diff --git a/macros/latex/contrib/oberdiek/aliascnt.pdf b/macros/latex/contrib/oberdiek/aliascnt.pdf index ceba0f2071..779f5a4c2d 100644 Binary files a/macros/latex/contrib/oberdiek/aliascnt.pdf and b/macros/latex/contrib/oberdiek/aliascnt.pdf differ diff --git a/macros/latex/contrib/oberdiek/alphalph.dtx b/macros/latex/contrib/oberdiek/alphalph.dtx index 42d9f00288..98c506a3c2 100644 --- a/macros/latex/contrib/oberdiek/alphalph.dtx +++ b/macros/latex/contrib/oberdiek/alphalph.dtx @@ -1684,14 +1684,6 @@ and the derived files % \paragraph{Script installation.} % Check the directory \xfile{TDS:scripts/oberdiek/} for % scripts that need further installation steps. -% Package \xpackage{attachfile2} comes with the Perl script -% \xfile{pdfatfi.pl} that should be installed in such a way -% that it can be called as \texttt{pdfatfi}. -% Example (linux): -% \begin{quote} -% |chmod +x scripts/oberdiek/pdfatfi.pl|\\ -% |cp scripts/oberdiek/pdfatfi.pl /usr/local/bin/| -% \end{quote} % % \subsection{Package installation} % diff --git a/macros/latex/contrib/oberdiek/alphalph.pdf b/macros/latex/contrib/oberdiek/alphalph.pdf index 260650f030..28a908b8c1 100644 Binary files a/macros/latex/contrib/oberdiek/alphalph.pdf and b/macros/latex/contrib/oberdiek/alphalph.pdf differ diff --git a/macros/latex/contrib/oberdiek/askinclude.dtx b/macros/latex/contrib/oberdiek/askinclude.dtx index eb335f0936..1e28340f58 100644 --- a/macros/latex/contrib/oberdiek/askinclude.dtx +++ b/macros/latex/contrib/oberdiek/askinclude.dtx @@ -2694,14 +2694,6 @@ and the derived files % \paragraph{Script installation.} % Check the directory \xfile{TDS:scripts/oberdiek/} for % scripts that need further installation steps. -% Package \xpackage{attachfile2} comes with the Perl script -% \xfile{pdfatfi.pl} that should be installed in such a way -% that it can be called as \texttt{pdfatfi}. -% Example (linux): -% \begin{quote} -% |chmod +x scripts/oberdiek/pdfatfi.pl|\\ -% |cp scripts/oberdiek/pdfatfi.pl /usr/local/bin/| -% \end{quote} % % \subsection{Package installation} % diff --git a/macros/latex/contrib/oberdiek/askinclude.pdf b/macros/latex/contrib/oberdiek/askinclude.pdf index ba2c3aaaea..092af562b6 100644 Binary files a/macros/latex/contrib/oberdiek/askinclude.pdf and b/macros/latex/contrib/oberdiek/askinclude.pdf differ diff --git a/macros/latex/contrib/oberdiek/atbegshi.dtx b/macros/latex/contrib/oberdiek/atbegshi.dtx index 472a25ebdc..27659be45a 100644 --- a/macros/latex/contrib/oberdiek/atbegshi.dtx +++ b/macros/latex/contrib/oberdiek/atbegshi.dtx @@ -2165,14 +2165,6 @@ Hello World % \paragraph{Script installation.} % Check the directory \xfile{TDS:scripts/oberdiek/} for % scripts that need further installation steps. -% Package \xpackage{attachfile2} comes with the Perl script -% \xfile{pdfatfi.pl} that should be installed in such a way -% that it can be called as \texttt{pdfatfi}. -% Example (linux): -% \begin{quote} -% |chmod +x scripts/oberdiek/pdfatfi.pl|\\ -% |cp scripts/oberdiek/pdfatfi.pl /usr/local/bin/| -% \end{quote} % % \subsection{Package installation} % diff --git a/macros/latex/contrib/oberdiek/atbegshi.pdf b/macros/latex/contrib/oberdiek/atbegshi.pdf index 67176c62b7..2f3af47ee6 100644 Binary files a/macros/latex/contrib/oberdiek/atbegshi.pdf and b/macros/latex/contrib/oberdiek/atbegshi.pdf differ diff --git a/macros/latex/contrib/oberdiek/atenddvi.dtx b/macros/latex/contrib/oberdiek/atenddvi.dtx index 3632f221f0..7f4adc689c 100644 --- a/macros/latex/contrib/oberdiek/atenddvi.dtx +++ b/macros/latex/contrib/oberdiek/atenddvi.dtx @@ -423,14 +423,6 @@ and the derived files % \paragraph{Script installation.} % Check the directory \xfile{TDS:scripts/oberdiek/} for % scripts that need further installation steps. -% Package \xpackage{attachfile2} comes with the Perl script -% \xfile{pdfatfi.pl} that should be installed in such a way -% that it can be called as \texttt{pdfatfi}. -% Example (linux): -% \begin{quote} -% |chmod +x scripts/oberdiek/pdfatfi.pl|\\ -% |cp scripts/oberdiek/pdfatfi.pl /usr/local/bin/| -% \end{quote} % % \subsection{Package installation} % diff --git a/macros/latex/contrib/oberdiek/atenddvi.pdf b/macros/latex/contrib/oberdiek/atenddvi.pdf index c0a3a54a89..f3899ce414 100644 Binary files a/macros/latex/contrib/oberdiek/atenddvi.pdf and b/macros/latex/contrib/oberdiek/atenddvi.pdf differ diff --git a/macros/latex/contrib/oberdiek/attachfile2.dtx b/macros/latex/contrib/oberdiek/attachfile2.dtx deleted file mode 100644 index 6a0dfdc5de..0000000000 --- a/macros/latex/contrib/oberdiek/attachfile2.dtx +++ /dev/null @@ -1,3290 +0,0 @@ -% \iffalse meta-comment -% -% File: attachfile2.dtx -% Version: 2019/07/24 v2.9 -% Info: Attach files into PDF -% -% Copyright (C) 2005-2010, 2012 by -% Heiko Oberdiek -% 2019 -% https://github.com/ho-tex/oberdiek/issues -% -% This work may be distributed and/or modified under the -% conditions of the LaTeX Project Public License, either -% version 1.3c of this license or (at your option) any later -% version. This version of this license is in -% https://www.latex-project.org/lppl/lppl-1-3c.txt -% and the latest version of this license is in -% https://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". -% -% The Current Maintainers of this work are -% Heiko Oberdiek and the Oberdiek Package Support Group -% https://github.com/ho-tex/oberdiek/issues -% -% This work consists of the main source file attachfile2.dtx -% and the derived files -% attachfile2.sty, attachfile2.pdf, attachfile2.ins, attachfile2.drv, -% atfi-dvips.def, atfi-pdftex.def, atfi-dvipdfmx.def,atfi-luatex.def -% pdfatfi.pl. -% -% Distribution: -% CTAN:macros/latex/contrib/oberdiek/attachfile2.dtx -% CTAN:macros/latex/contrib/oberdiek/attachfile2.pdf -% -% Unpacking: -% (a) If attachfile2.ins is present: -% tex attachfile2.ins -% (b) Without attachfile2.ins: -% tex attachfile2.dtx -% (c) If you insist on using LaTeX -% latex \let\install=y\input{attachfile2.dtx} -% (quote the arguments according to the demands of your shell) -% -% Documentation: -% (a) If attachfile2.drv is present: -% latex attachfile2.drv -% (b) Without attachfile2.drv: -% latex attachfile2.dtx; ... -% The class ltxdoc loads the configuration file ltxdoc.cfg -% if available. Here you can specify further options, e.g. -% use A4 as paper format: -% \PassOptionsToClass{a4paper}{article} -% -% Programm calls to get the documentation (example): -% pdflatex attachfile2.dtx -% makeindex -s gind.ist attachfile2.idx -% pdflatex attachfile2.dtx -% makeindex -s gind.ist attachfile2.idx -% pdflatex attachfile2.dtx -% -% Installation: -% TDS:tex/latex/oberdiek/attachfile2.sty -% TDS:tex/latex/oberdiek/atfi-dvips.def -% TDS:tex/latex/oberdiek/atfi-pdftex.def -% TDS:tex/latex/oberdiek/atfi-dvipdfmx.def -% TDS:tex/latex/oberdiek/atfi-luatex.def -% TDS:scripts/oberdiek/pdfatfi.pl (exec flag) -% TDS:doc/latex/oberdiek/attachfile2.pdf -% TDS:source/latex/oberdiek/attachfile2.dtx -% -%<*ignore> -\begingroup - \catcode123=1 % - \catcode125=2 % - \def\x{LaTeX2e}% -\expandafter\endgroup -\ifcase 0\ifx\install y1\fi\expandafter - \ifx\csname processbatchFile\endcsname\relax\else1\fi - \ifx\fmtname\x\else 1\fi\relax -\else\csname fi\endcsname -% -%<*install> -\input docstrip.tex -\Msg{************************************************************************} -\Msg{* Installation} -\Msg{* Package: attachfile2 2019/07/24 v2.9 Attach files into PDF (HO)} -\Msg{************************************************************************} - -\keepsilent -\askforoverwritefalse - -\let\MetaPrefix\relax -\preamble - -This is a generated file. - -Project: attachfile2 -Version: 2019/07/24 v2.9 - -Copyright (C) 2005-2010, 2012 by - Heiko Oberdiek - -This work may be distributed and/or modified under the -conditions of the LaTeX Project Public License, either -version 1.3c of this license or (at your option) any later -version. This version of this license is in - https://www.latex-project.org/lppl/lppl-1-3c.txt -and the latest version of this license is in - https://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". - -The Current Maintainers of this work are -Heiko Oberdiek and the Oberdiek Package Support Group -https://github.com/ho-tex/oberdiek/issues - - -This work consists of the main source file attachfile2.dtx -and the derived files - attachfile2.sty, attachfile2.pdf, attachfile2.ins, attachfile2.drv, - atfi-dvips.def, atfi-pdftex.def, atfi-dvipdfmx.def, - pdfatfi.pl. - -\endpreamble -\let\MetaPrefix\DoubleperCent - -\generate{% - \file{attachfile2.ins}{\from{attachfile2.dtx}{install}}% - \file{attachfile2.drv}{\from{attachfile2.dtx}{driver}}% - \usedir{tex/latex/oberdiek}% - \file{attachfile2.sty}{\from{attachfile2.dtx}{package}}% - \file{atfi-dvips.def}{\from{attachfile2.dtx}{dvips}}% - \file{atfi-pdftex.def}{\from{attachfile2.dtx}{pdftex}}% - \file{atfi-luatex.def}{\from{attachfile2.dtx}{luatex}}% - \file{atfi-dvipdfmx.def}{\from{attachfile2.dtx}{dvipdfmx}}% - \nopreamble - \nopostamble - \usedir{scripts/oberdiek}% - \csname execfiletrue\endcsname - \file{pdfatfi.pl}{\from{attachfile2.dtx}{pdfatfi}}% -% \usedir{source/latex/oberdiek/catalogue}% -% \file{attachfile2.xml}{\from{attachfile2.dtx}{catalogue}}% -} - -\catcode32=13\relax% active space -\let =\space% -\Msg{************************************************************************} -\Msg{*} -\Msg{* To finish the installation you have to move the following} -\Msg{* files into a directory searched by TeX:} -\Msg{*} -\Msg{* attachfile2.sty, atfi-dvips.def, atfi-pdftex.def,} -\Msg{* atfi-dvipdfmx.def} -\Msg{*} -\Msg{* And install the following script file:} -\Msg{*} -\Msg{* pdfatfi.pl} -\Msg{*} -\Msg{* To produce the documentation run the file `attachfile2.drv'} -\Msg{* through LaTeX.} -\Msg{*} -\Msg{* Happy TeXing!} -\Msg{*} -\Msg{************************************************************************} - -\endbatchfile -% -%<*ignore> -\fi -% -%<*driver> -\NeedsTeXFormat{LaTeX2e} -\ProvidesFile{attachfile2.drv}% - [2019/07/24 v2.9 Attach files into PDF (HO)]% -\documentclass{ltxdoc} -\usepackage{holtxdoc}[2011/11/22] -\begin{document} - \DocInput{attachfile2.dtx}% -\end{document} -% -% \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{attachfile2.drv} -% -% \title{The \xpackage{attachfile2} package} -% \date{2019/07/24 v2.9} -% \author{Heiko Oberdiek\thanks -% {Please report any issues at \url{https://github.com/ho-tex/oberdiek/issues}}} -% -% \maketitle -% -% \begin{abstract} -% This package can be used to attach files to a PDF document. -% It is a further development of Scott Pakin's package -% \xpackage{attachfile} for \pdfTeX. Apart from bug fixes, -% package \xpackage{attachfile2} adds support for \xoption{dvips}, -% some new options, gets and writes meta information data about -% the attached files. -% \end{abstract} -% -% \tableofcontents -% -% \section{Documentation} -% -% \subsection{Introduction} -% -% The PDF format (\cite{pdfspec}) allows the inclusion of files -% inside the PDF document. The included files can be bound to an -% annotation on a page. Or they can be recorded in a sorted -% list of embedded files. The packages \xpackage{attachfile} -% or \xpackage{attachfile2} follow the first approach, -% package \xpackage{embedfile} uses the latter method. -% -% \subsubsection{Future development} -% -% My dream is a large package that merges the features of -% all these packages meantioned before: -% \begin{itemize} -% \item Files can be attached to a page. -% \item Files can be attached to the document. -% \item An easy user interface for simple, common tasks and -% beginners. -% \item An interface for the advanced users that want to setup -% every detail. -% \item Support of many drivers (pdftex, dvips, dvipdfm, \dots). -% \item \dots -% \end{itemize} -% However, I have not managed to take the time for this project. -% Instead: -% \begin{itemize} -% \item First I experimented with package \xpackage{attachfile}, -% adding driver support, fixing bugs, \dots. The result is -% currently named as \xpackage{attachfile2}. It uses an external -% script to get file properties (size, date, checksum, \dots). -% \item In order to avoid an external program for getting basic -% file properties I provided a patch ``EscapeAndOther'' for -% pdfTeX that was accepted for version 1.30. -% \item Package \xpackage{embedfile} closes a gap left by the -% packages for attaching -% files and allows the embedding of files to the document. -% Also it makes use of the new primitives of \pdfTeX. -% \end{itemize} -% Until this future becomes true, I provide the intermediate -% step \xpackage{attachfile2} at its current state. -% There are many things to do: -% \begin{itemize} -% \item Documentation, documentation, \dots -% \item Improving portability of the Perl script \xfile{pdfatfi.pl} -% (Windows, non-GNU, \dots). -% \item Comfortable program for extracting embeddd files. -% \item Embedding files to the document, see package \xpackage{embedfile}. -% \item Additionally use featurs of \pdfTeX\ 1.30. With a recent -% \pdfTeX\ the Perl script step is then obsolete. -% \item GoToE links. -% \item Layout of PinPush, especially the tip does not scale well. -% \item Driver for \xoption{dvipsone}, similar to \xoption{dvips}, changes: -% \begin{itemize} -% \item coordinate transformation need to be fixed here, -% \xfile{hdvipson.def} contains: -% \begin{quote} -%\begin{verbatim} -%/DvipsToPDF { 65781 div } def -%/PDFToDvips { 65781 mul } def -%\end{verbatim} -% \end{quote} -% \item Syntax for \cs{special}: \xfile{hdvipson.def} contains -% both \verb|\special{! #1}| and -% \verb|\special{headertext= #1}|. Are bothe the same? -% \end{itemize} -% \item File name conversion, see PDF specification: -% \begin{quote} -% \verb|c:\somewhere\foobar.txt| $\rightarrow$ -% \verb|/c/somewhere/foobar.txt| -% \end{quote} -% \item Option \xoption{scale} for icons? -% \item Compatibility for \plainTeX. -% \item ToDos for \xfile{atfidvips.def}. -% \end{itemize} -% -% \subsection{User interface} -% -% Basically this package \xpackage{attachfile2} follows the -% user interface of package \xpackage{attachfile}, -% look into its documentation (\cite{attachfile}). -% -% \subsubsection{New options} -% \begin{itemize} -% \item Driver options \xoption{dvips}, \xoption{pdftex}, -% \xoption{dvipdfmx} and \xoption{xetex} that is an -% alias for \xoption{dvipdfmx}. -% \item Option \xoption{driverfallback} specifies a DVI driver -% if the driver cannot be detected automatically. -% \item New options \xoption{final} and \xoption{draft}. -% \item New option \xoption{scale} for scaling the annotation rectangle. -% \item Options \xoption{file} and \xoption{nofile} for controlling -% the generation of the auxiliary file \xfile{.atfi}. -% \item New option \xoption{ucfilespec} for file names with -% characters outside ASCII (PDF 1.7). -% \end{itemize} -% -% \subsubsection{Option \xoption{color}} -% -% Package \xpackage{attachfile}'s option \xoption{color} only -% understands explicit RGB values as three space separated -% real numbers in the range from 0 to 1. -% -% This package \xpackage{attachfile2} extends the syntax. -% The usual color specifications of packages \xpackage{color} -% or \xpackage{xcolor} may be used. The latter one requires -% that package \xpackage{xcolor} is loaded. -% Without package \xpackage{xcolor} a limited range of -% explicit color specifications are supported, the color models -% \texttt{rgb} and \texttt{gray} (and \texttt{cmyk} if -% package \xpackage{hyperref}'s option \xoption{pdfversion} is set -% to \texttt{1.7} or greater. -% -% Example without package \xpackage{xcolor}: -%\begin{quote} -%\begin{verbatim} -%\documentclass{article} -%\usepackage[color={1 0 .5}]{attachfile2} -% % Spaces in option values in \usepackage or \documentclass -% % must be protected by curly braces. Otherwise LaTeX strips -% % the spaces and the package would see `color=10.5'. -% % This protection is not necessary for \attachfilesetup. -%\attachfilesetup{color=1 0 .5} -%\attachfilesetup{color=[rgb]{1,0,.5}} -%\attachfilesetup{color=[gray]{.5}} -%\end{verbatim} -%\end{quote} -% -% The following example with package \xpackage{xcolor} shows -% additional color specifications: -%\begin{quote} -%\begin{verbatim} -%\documentclass{article} -%\usepackage{xcolor} -%\definecolor{attachfilecolor}{cmyk}{.1,.2,.3,.4} -%\usepackage{color=red}{attachfile2} -%\attachfilesetup{color=red} -%\attachfilesetup{color=attachfilecolor} -%\end{verbatim} -%\end{quote} -% -% \paragraph{For experts.}% -% If the color is used in annotations, the color is converted -% with the help of package \xpackage{xcolor} to RGB. -% PDF versions 1.7 or later also understand color models Gray and -% CMYK. The PDF version is detected if the experimental -% option \xoption{pdfversion} -% of package \xpackage{hyperref} is used, example: -%\begin{quote} -%\begin{verbatim} -%\documentclass{article} -%\usepackage[pdfversion=1.7]{hyperref} -%\usepackage{attachfile2} -%\end{verbatim} -%\end{quote} -% However, currently only driver \xoption{pdftex} also supports -% the actual setting of the PDF version in the output PDF file. -% -% \subsubsection{Perl script \xfile{pdfatfi.pl}} -% -% This package also tries to get and add meta information data, -% such as file size, file date, checksum, \dots. -% As package \xpackage{embedfile} shows the new features -% of \pdfTeX\ 1.30 are very useful for getting this kind of -% data. Since version 2.6 these data are used if available. -% -% For older versions of \pdfTeX\ and \XeTeX\ the Perl script -% \xfile{pdfatfi.pl} is provided to get this data. -% The use of the Perl script is not mandatory. This data can be shown -% by PDF viewers, but they are not a requirement of the PDF specification. -% -% Package \xpackage{attachfile2} and the Perl script communicate -% via an auxiliary file with file extension \xfile{.atfi}. The script -% is used between two \LaTeX\ runs and updates the auxiliary file, -% example for \xoption{dvips}: -% \begin{quote} -%\begin{verbatim} -%latex test -%pdfatfi test -%latex test -%dvips test -%ps2pdf test.ps test.pdf -%\end{verbatim} -% \end{quote} -% -% \subsection{Changes to \xpackage{attachfile}} -% -% Some of the changes I can remember: -% \begin{itemize} -% \item Support for dvips. -% \item Support for dvipdfmx/\XeTeX. -% \item Setting and filling the /Param entry for files -% (file date, file size, \dots). -% \item Perl script \xfile{pdfatfi.pl}. -% \item New options. -% \item Bug fixes. -% \item \dots -% \end{itemize} -% -% \StopEventually{ -% } -% -% \section{Implementation} -% -% \subsection{Package} -% -% \begin{macrocode} -%<*package> -\NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{attachfile2}% - [2019/07/24 v2.9 Attach files into PDF (HO)]% -% \end{macrocode} -% -% \subsubsection{Loading of packages} -% -% \begin{macrocode} -\RequirePackage{ifpdf}[2009/04/10] -\RequirePackage{ifxetex} -\RequirePackage{ifluatex}[2009/04/10] -\RequirePackage{keyval} -\RequirePackage{color} -\RequirePackage{infwarerr}[2010/04/08] -\RequirePackage{ltxcmds}[2010/04/26] -\RequirePackage{kvoptions}[2009/07/21] -\RequirePackage{pdftexcmds}[2010/04/01] -\RequirePackage{pdfescape}[2007/11/11] -% \end{macrocode} -% Package \xpackage{hyperref} is needed because of \cs{pdfstringdef}. -% \begin{macrocode} -\RequirePackage{hyperref} -\RequirePackage{hycolor}[2008/07/29] -% \end{macrocode} -% -% \subsubsection{Value checking} -% -% \begin{macro}{\atfi@Match} -% \begin{macrocode} -\ltx@IfUndefined{pdfmatch}{% - \def\atfi@Match#1#2#3#4#5{}% -}{% - \def\atfi@Match#1#2#3{% - \begingroup - \edef\^{\ltx@backslashchar\string^}% - \edef\.{\ltx@backslashchar.}% - \let\#\ltx@hashchar - \edef\[{\ltx@backslashchar[}% ]] - \edef\${\ltx@backslashchar$}% - \let\%\ltx@percentchar - \edef\&{\string&}% - \edef\({\ltx@backslashchar(}% - \edef\){\ltx@backslashchar)}% - \edef\|{\ltx@backslashchar|}% - \edef\*{\ltx@backslashchar*}% - \edef\+{\ltx@backslashchar+}% - \edef\?{\ltx@backslashchar?}% - \edef\{{\ltx@backslashchar\ltx@leftbracechar}% - \edef\}{\ltx@rightbracechar}% - \edef\\{\ltx@backslashchar\ltx@backslashchar}% - \edef\~{\string~}% - \ifcase\pdfmatch#3{#2}{#1} % - \endgroup - \expandafter\ltx@secondoftwo - \or - \endgroup - \expandafter\ltx@firstoftwo - \else - \atfi@Warning{% - Internal error: Wrong pattern!\MessageBreak - --> #2 <--\MessageBreak - Pattern check ignored% - }% - \endgroup - \expandafter\ltx@firstoftwo - \fi - }% -% \end{macrocode} -% \end{macro} -% \begin{macro}{\atfi@PatToken} -% \begin{macrocode} - \def\atfi@PatToken{% - [% - -% first character - !% - \#$\%\&'% - \*\+\.% - 0-9% - A-Z% - \^_`% - a-z% - \{\}\|\~% - ]+% - }% -% \end{macrocode} -% \end{macro} -% \begin{macro}{\atfi@CR} -% \begin{macrocode} - \begingroup - \lccode64=13 % @ - \lowercase{\endgroup - \def\atfi@CR{@}% - }% -% \end{macrocode} -% \end{macro} -% \begin{macro}{\atfi@PatQuotedString} -% \begin{macrocode} - \def\atfi@PatQuotedString{% - "% - ([^"\\\atfi@CR]|\\.)*% - "% - }% -% \end{macrocode} -% \end{macro} -% \begin{macrocode} - \ltx@ifpackagelater{ltxcmds}{2010/09/11}{}{% -% \end{macrocode} -% \begin{macro}{\atfi@ltx@leftbracechar} -% \begin{macrocode} - \begingroup - \lccode`0=`\{\relax - \lowercase{\endgroup - \def\ltx@leftbracechar{0}% - }% -% \end{macrocode} -% \end{macro} -% \begin{macro}{\ltx@rightbracechar} -% \begin{macrocode} - \begingroup - \lccode`0=`\}\relax - \lowercase{\endgroup - \def\ltx@rightbracechar{0}% - }% -% \end{macrocode} -% \end{macro} -% \begin{macrocode} - }% -} -% \end{macrocode} -% -% \begin{macro}{\atfi@Warning} -% \begin{macrocode} -\def\atfi@Warning{\PackageWarning{attachfile2}} -% \end{macrocode} -% \end{macro} -% -% \subsubsection{Option declarations} -% -% \begin{macrocode} -\SetupKeyvalOptions{% - family=AtFi,% - prefix=atfi@% -} -% \end{macrocode} -% \begin{macro}{\atfi@setup} -% \begin{macrocode} -\def\atfi@setup{\setkeys{AtFi}} -% \end{macrocode} -% \end{macro} -% -% Options \xoption{draft} and \xoption{final}. -% \begin{macrocode} -\DeclareBoolOption{draft} -\DeclareComplementaryOption{final}{draft} -% \end{macrocode} -% -% Option \xoption{mimetype}. -% \begin{macro}{\atfi@mimetype} -% \begin{macrocode} -\def\atfi@mimetype{} -% \end{macrocode} -% \end{macro} -% \begin{macrocode} -\define@key{AtFi}{mimetype}{% - \edef\atfi@mimetype{#1}% - \ifx\atfi@mimetype\ltx@empty - \else - \atfi@Match\atfi@mimetype{% - ^(application|audio|image|model|text|video|x-\atfi@PatToken)% - /% - ([a-z\-\+_\.0-9]+)% - (; ?\atfi@PatToken=(\atfi@PatToken|\atfi@PatQuotedString))*$% - }{icase}{}{% - \atfi@Warning{% - Invalid value `\atfi@mimetype'\MessageBreak - of option `mimetype'.\MessageBreak - Value is discarded% - }% - \let\atfi@mimetype\ltx@empty - }% - \fi - \ifx\atfi@mimetype\ltx@empty - \else - \EdefEscapeName\atfi@mimetype{\atfi@mimetype}% - \edef\atfi@mimetype{/Subtype/\atfi@mimetype}% - \fi -} -% \end{macrocode} -% -% Option \xoption{icon} -% \begin{macrocode} -\define@key{AtFi}{icon}{% - \def\atfi@icon{/Name/#1}% - \def\atfi@icon@icon{#1}% -} -\atfi@setup{icon=PushPin} -% \end{macrocode} -% -% Option \xoption{color} -% \begin{macrocode} -\define@key{AtFi}{color}{% - \HyColor@AttachfileColor{#1}% - \atfi@color@tex\atfi@color@inline\atfi@color@annot - {attachfile2}{color}% -} -\atfi@setup{color=1 0.9255 0.7765} -% \end{macrocode} -% -% time options timezone and date -% \begin{macro}{\atfi@pad@ii} -% \begin{macrocode} -\def\atfi@pad@ii#1{% - \ifnum#1>9 % - \number#1% - \else - 0\number#1% - \fi% -} -% \end{macrocode} -% \end{macro} -% \begin{macro}{atfi@timezone} -% \begin{macrocode} -\let\atfi@timezone\ltx@empty -% \end{macrocode} -% \end{macro} -% \begin{macrocode} -\define@key{AtFi}{timezone}{\def\atfi@timezone{#1}} -% \end{macrocode} -% \begin{macro}{\atfi@time} -% \begin{macrocode} -\edef\atfi@time{\the\time} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\atfi@hours} -% \begin{macrocode} -\def\atfi@hours{% - \numexpr\dimexpr0.01667\dimexpr\atfi@time sp\relax\relax\relax -} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\atfi@minutes} -% \begin{macrocode} -\def\atfi@minutes{% - \numexpr\atfi@time-60*\atfi@hours\relax -} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\atfi@seconds} -% \begin{macrocode} -\def\atfi@seconds{0} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\atfi@date} -% \begin{macrocode} -\def\atfi@date{% - /M(D:\the\year - \atfi@pad@ii\month - \atfi@pad@ii\day - \atfi@pad@ii\atfi@hours - \atfi@pad@ii\atfi@minutes - \atfi@pad@ii\atfi@seconds - \atfi@timezone)% -} -% \end{macrocode} -% \end{macro} -% \begin{macrocode} -\define@key{AtFi}{date}{% - \EdefEscapeString\atfi@date{#1}% - \edef\atfi@date{/M(\atfi@date)}% -} -% \end{macrocode} -% -% Text options author, description, and subject -% \begin{macro}{\atfi@pdfstringdef} -% \begin{macrocode} -\DeclareRobustCommand{\atfi@pdfstringdef}[2]{% - \pdfstringdef\atfi@temp@string{#2}% - \edef#1{\atfi@temp@string}% -} -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\atfi@NoValue} -% \begin{macrocode} -\def\atfi@NoValue{\NoValue} -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\atfi@DefNoValueName} -% \begin{macrocode} -\def\atfi@DefNoValueName#1#2#3{% - \def#1{#3}% - \ifx#1\atfi@NoValue - \let#1\ltx@empty - \else - \atfi@pdfstringdef#1{#1}% - \edef#1{/#2(#1)}% - \fi -} -% \end{macrocode} -% \end{macro} -% -% Name for annotation to be used in GoToE actions -% \begin{macro}{\atfi@annotname} -% \begin{macrocode} -\let\atfi@annotname\ltx@empty -% \end{macrocode} -% \end{macro} -% \begin{macrocode} -\define@key{AtFi}{annotname}[\NoValue]{% - \atfi@DefNoValueName\atfi@annotname{NM}{#1}% -} -% \end{macrocode} -% -% Option \xoption{author}. -% \begin{macro}{\atfi@author} -% \begin{macrocode} -\def\atfi@author{} -% \end{macrocode} -% \end{macro} -% \begin{macrocode} -\define@key{AtFi}{author}[\NoValue]{% - \atfi@DefNoValueName\atfi@author{T}{#1}% -} -% \end{macrocode} -% -% Option \xoption{description}. -% \begin{macro}{\atfi@description} -% \begin{macrocode} -\def\atfi@description{} -% \end{macrocode} -% \end{macro} -% \begin{macrocode} -\define@key{AtFi}{description}[\NoValue]{% - \atfi@DefNoValueName\atfi@description{Contents}{#1}% -} -% \end{macrocode} -% -% Option \xoption{subject}. -% \begin{macro}{\atfi@subject} -% \begin{macrocode} -\def\atfi@subject{} -% \end{macrocode} -% \end{macro} -% \begin{macrocode} -\define@key{AtFi}{subject}[\NoValue]{% - \atfi@DefNoValueName\atfi@subject{Subj}{#1}% -} -% \end{macrocode} -% -% Option \xoption{print}. -% \begin{macrocode} -\DeclareBoolOption[true]{print} -% \end{macrocode} -% -% Option \xoption{zoom}. -% \begin{macrocode} -\DeclareBoolOption[true]{zoom} -% \end{macrocode} -% -% Option \xoption{appearance}. -% \begin{macrocode} -\DeclareBoolOption[true]{appearance} -% \end{macrocode} -% -% Option \xoption{scale}. -% \begin{macrocode} -\DeclareStringOption[1]{scale} -% \end{macrocode} -% -% Option \xoption{ucfilespec}. -% \begin{macro}{\atfi@ucfilespec} -% \begin{macrocode} -\def\atfi@ucfilespec{} -% \end{macrocode} -% \end{macro} -% \begin{macrocode} -\define@key{AtFi}{ucfilespec}[1]{% - \def\atfi@ucfilespec{#1}% - \ifx\atfi@ucfilespec\ltx@empty - \else - \atfi@pdfstringdef\atfi@ucfilespec{#1}% - \fi -} -% \end{macrocode} -% -% Option \xoption{nofiles}. -% \begin{macrocode} -\DeclareBoolOption{nofiles} -% \end{macrocode} -% -% Driver options. -% \begin{macrocode} -\let\atfi@driver\ltx@empty -\def\atfi@driver@pdftex{pdftex} -\def\atfi@driver@luatex{luatex} -\def\atfi@driver@dvips{dvips} -\def\atfi@driver@dvipdfmx{dvipdfmx} -% \end{macrocode} -% \begin{macrocode} -\DeclareVoidOption{pdftex}{% - \ifpdf - \let\atfi@driver\atfi@driver@pdftex - \else - \let\atfi@driver\ltx@empty - \PackageError{attachfile2}{% - Wrong driver option `pdftex',\MessageBreak - because pdfTeX in PDF mode is not detected% - }\@ehc - \fi -} -\DeclareVoidOption{luatex}{% - \let\atfi@driver\atfi@driver@luatex -} -\DeclareVoidOption{dvips}{% - \let\atfi@driver\atfi@driver@dvips -} -\DeclareVoidOption{dvipdfmx}{% - \let\atfi@driver\atfi@driver@dvipdfmx -} -\DeclareVoidOption{xetex}{% - \let\atfi@driver\atfi@driver@dvipdfmx -} -% \end{macrocode} -% \begin{macrocode} -\DeclareStringOption{driverfallback} -% \end{macrocode} -% -% \begin{macro}{\attachfilesetup} -% \begin{macrocode} -\DeclareRobustCommand{\attachfilesetup}[1]{\setkeys{AtFi}{#1}} -% \end{macrocode} -% \end{macro} -% -% \begin{macrocode} -\DeclareLocalOptions{% - annotname,% - appearance,% - author,% - color,% - date,% - description,% - icon,% - mimetype,% - nofiles,% - print,% - scale,% - subject,% - timezone,% - ucfilespec,% - zoom,% -} -% \end{macrocode} -% -% \subsubsection{Option calling} -% -% Timezone setting, \dots -% \begin{macrocode} -\InputIfFileExists{attachfile.cfg}{}{} -% \end{macrocode} -% \begin{macrocode} -\ProcessKeyvalOptions* -% \end{macrocode} -% -% \begin{macro}{\atfi@DisableOption} -% \begin{macrocode} -\def\atfi@DisableOption{% - \DisableKeyvalOption[action=error,package=attachfile2]{AtFi}% -} -% \end{macrocode} -% \end{macro} -% -% \subsubsection{Evaluate driver options} -% -% \begin{macrocode} -\ifpdf - \ifluatex - \let\atfi@driver\atfi@driver@luatex - \else - \let\atfi@driver\atfi@driver@pdftex - \fi -\else - \ifxetex - \let\atfi@driver\atfi@driver@dvipdfmx - \else - \ifx\atfi@driver\ltx@empty - \ifx\atfi@driverfallback\ltx@empty - \else - \expandafter\let\expandafter\atfi@driver - \csname atfi@driver@\atfi@driverfallback\endcsname - \ifx\atfi@driver\atfi@driver@dvips - \else - \ifx\atfi@driver\atfi@driver@dvipdfmx - \else - \let\atfi@driver\ltx@empty - \PackageWarningNoLine{attachfile2}{% - Option `driverfallback' with unsupported\MessageBreak - DVI driver (\atfi@driverfallback)% - }% - \fi - \fi - \fi - \ifx\atfi@driver\ltx@empty - \PackageWarningNoLine{attachfile2}{% - Driver is not specified,\MessageBreak - enforce draft settings% - }% - \atfi@drafttrue - \fi - \fi - \fi -\fi -% \end{macrocode} -% \begin{macrocode} -\atfi@DisableOption{pdftex} -\atfi@DisableOption{dvips} -\atfi@DisableOption{dvipdfmx} -\atfi@DisableOption{xetex} -\atfi@DisableOption{driverfallback} -% \end{macrocode} -% -% \subsubsection{Evaluate options \xoption{draft}/\xoption{final}} -% -% \begin{macro}{\notextattachfile} -% \begin{macrocode} -\DeclareRobustCommand{\notextattachfile}[2][]{% - \begingroup - \atfi@setup{#1}% - \ifatfi@print - \leavevmode - \begingroup - \HyColor@UseColor\atfi@color@tex - #2\strut - \endgroup - \else - \sbox\ltx@zero{#2\strut}% - \makebox[\wd0]{}% - \fi - \endgroup -} -% \end{macrocode} -% \end{macro} -% \begin{macrocode} -\atfi@DisableOption{draft}% -\atfi@DisableOption{final}% -\ifatfi@draft - \def\atfi@dummy@pushpin{% - \raisebox{-1.25bp}{\parbox[b][14bp]{24bp}{}}% - }% - \DeclareRobustCommand{\textattachfile}[3][]{% - \notextattachfile[{#1}]{#3}% - }% - \DeclareRobustCommand{\noattachfile}[1][]{% - \notextattachfile[{#1}]{\atfi@dummy@pushpin}% - }% - \DeclareRobustCommand{\attachfile}[2][]{% - \noattachfile[{#1}]% - }% - \expandafter\endinput -\fi -% \end{macrocode} -% -% \subsubsection{Load driver file} -% -% \begin{macrocode} -\input{atfi-\atfi@driver.def} -% \end{macrocode} -% -% \subsubsection{Graphics} -% -% \begin{macro}{\atfi@acroGraph@data} -% \begin{macrocode} -\def\atfi@acroGraph@data{% - \atfi@GSAVE - 0.5 \atfi@SETGRAYFILL - 1.1133 0 20.7202 18.2754 \atfi@RECTFILL - 0 \atfi@SETFLAT - 0.5 \atfi@SETLINEWIDTH - 4 \atfi@SETMITERLIMIT - \atfi@RECTSTROKEFILL{% - 1 \atfi@SETGRAYFILL - }{% - 0 \atfi@SETGRAYSTROKE - }{% - 0.25 1.6453 20.145 17.7715 % - }% - 0 \atfi@SETGRAYFILL - 2.7319 4.1367 3.9571 13.8867 \atfi@RECTFILL - 8.7031 4.1367 3.9571 9.8867 \atfi@RECTFILL - 14.7471 4.1367 3.9571 11.8867 \atfi@RECTFILL - \atfi@color@inline{FILL}% - 1.689 3.0938 3.9571 13.8867 \atfi@RECTFILL - 7.6602 3.0938 3.9571 9.8867 \atfi@RECTFILL - 13.7041 3.0938 3.9571 11.8867 \atfi@RECTFILL - \atfi@GRESTORE -} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\atfi@acroGraph} -% \begin{macrocode} -\def\atfi@acroGraph{% - \raisebox{-1.5bp}{\parbox[b][20bp]{22bp}{% - \rule{0pt}{0pt}\atfi@literal{\atfi@acroGraph@data}}% - }% -} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\atfi@acroPaperclip@data} -% \begin{macrocode} -\newcommand{\atfi@acroPaperclip@data}{% - \atfi@GSAVE - 0.75 \atfi@SETGRAYSTROKE - 0 \atfi@SETFLAT - 2.5 \atfi@SETLINEWIDTH - 1 \atfi@SETLINECAP - 4 \atfi@SETMITERLIMIT - 1.9619 11.7559 \atfi@MOVETO - 1.9619 3.3037 1.9619 2.5059 \atfi@CURVETOV - 1.9619 1.707 4.0947 1.25 \atfi@CURVETOY - 7.4141 1.25 \atfi@LINETO - 9.4292 1.8223 9.4292 3.3066 \atfi@CURVETOV - 9.4292 4.79 9.4292 16.8945 \atfi@CURVETOY - 9.7852 18.1514 8.481 18.1514 \atfi@CURVETOV - 7.1768 18.1514 5.1616 18.1514 \atfi@CURVETOY - 3.8574 17.9209 3.8574 16.8945 \atfi@CURVETOV - 3.8574 15.8652 3.8574 6.6172 \atfi@CURVETOY - 4.3325 5.418 5.1025 5.418 \atfi@CURVETOV - 5.8726 5.418 6.5845 5.418 \atfi@CURVETOY - 7.6812 5.6455 7.6812 6.4736 \atfi@CURVETOV - 7.6812 7.3027 7.6812 11.5264 \atfi@CURVETOY - \atfi@STROKE - 0 \atfi@SETGRAYSTROKE - 1.2495 12.4404 \atfi@MOVETO - 1.2495 3.9883 1.2495 3.1895 \atfi@CURVETOV - 1.2495 2.3906 3.3833 1.9326 \atfi@CURVETOY - 6.7026 1.9326 \atfi@LINETO - 8.7178 2.5068 8.7178 3.9902 \atfi@CURVETOV - 8.7178 5.4736 8.7178 17.5781 \atfi@CURVETOY - 9.0732 18.834 7.769 18.834 \atfi@CURVETOV - 6.4653 18.834 4.4497 18.834 \atfi@CURVETOY - 3.146 18.6055 3.146 17.5781 \atfi@CURVETOV - 3.146 16.5498 3.146 7.3018 \atfi@CURVETOY - 3.6201 6.1016 4.3911 6.1016 \atfi@CURVETOV - 5.1611 6.1016 5.873 6.1016 \atfi@CURVETOY - 6.9692 6.3301 6.9692 7.1572 \atfi@CURVETOV - 6.9692 7.9863 6.9692 12.21 \atfi@CURVETOY - \atfi@STROKE - \atfi@color@inline{STROKE}% - 1 \atfi@SETLINEWIDTH - 1.2495 12.4404 \atfi@MOVETO - 1.2495 3.9883 1.2495 3.1895 \atfi@CURVETOV - 1.2495 2.3906 3.3833 1.9326 \atfi@CURVETOY - 6.7026 1.9326 \atfi@LINETO - 8.7178 2.5068 8.7178 3.9902 \atfi@CURVETOV - 8.7178 5.4736 8.7178 17.5781 \atfi@CURVETOY - 9.0732 18.834 7.769 18.834 \atfi@CURVETOV - 6.4653 18.834 4.4497 18.834 \atfi@CURVETOY - 3.146 18.6055 3.146 17.5781 \atfi@CURVETOV - 3.146 16.5498 3.146 7.3018 \atfi@CURVETOY - 3.6201 6.1016 4.3911 6.1016 \atfi@CURVETOV - 5.1611 6.1016 5.873 6.1016 \atfi@CURVETOY - 6.9692 6.3301 6.9692 7.1572 \atfi@CURVETOV - 6.9692 7.9863 6.9692 12.21 \atfi@CURVETOY - \atfi@STROKE - \atfi@GRESTORE -} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\atfi@acroPaperclip} -% \begin{macrocode} -\def\atfi@acroPaperclip{% - \raisebox{-1.25bp}{\parbox[b][21bp]{12bp}{% - \rule{0pt}{0pt}\atfi@literal{\atfi@acroPaperclip@data}}% - }% -} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\atfi@acroPushPin@data} -% \begin{macrocode} -\def\atfi@acroPushPin@data{% - \atfi@GSAVE - 1 \atfi@SETLINEWIDTH - 1 6 \atfi@MOVETO - 11 6 \atfi@LINETO - 11 13 \atfi@LINETO - 12 13 \atfi@LINETO - 14 11 \atfi@LINETO - 21 11 \atfi@LINETO - 22 12 \atfi@LINETO - 23 12 \atfi@LINETO - 23 2 \atfi@LINETO - 22 2 \atfi@LINETO - 21 3 \atfi@LINETO - 14 3 \atfi@LINETO - 12 1 \atfi@LINETO - 11 1 \atfi@LINETO - 11 6 \atfi@LINETO - \atfi@FILLSTROKE{% - \atfi@color@inline{FILL}% - }{% - 0 \atfi@SETGRAYSTROKE - }% - 0.5 \atfi@SETGRAYSTROKE - 0 7 \atfi@MOVETO - 10 7 \atfi@LINETO - 10 8 \atfi@LINETO - 1 8 \atfi@LINETO - \atfi@STROKE - 1 \atfi@SETGRAYSTROKE - 12 12 \atfi@MOVETO - 14 10 \atfi@LINETO - 22 10 \atfi@LINETO - 22 11 \atfi@LINETO - \atfi@STROKE - \atfi@GRESTORE -} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\atfi@acroPushPin} -% \begin{macrocode} -\def\atfi@acroPushPin{% - \raisebox{-1.25bp}{\parbox[b][14bp]{24bp}{% - \rule{0pt}{0pt}\atfi@literal{\atfi@acroPushPin@data}}% - }% -} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\atfi@acroTag@data} -% \begin{macrocode} -\def\atfi@acroTag@data{% - \atfi@GSAVE - 0.5 \atfi@SETGRAYFILL - 10.0542 14.9873 \atfi@MOVETO - 24.27 14.9873 \atfi@LINETO - 25.252 14.0059 \atfi@LINETO - 25.252 1.1455 \atfi@LINETO - 24.1064 0 \atfi@LINETO - 9.9609 0 \atfi@LINETO - 6.0327 6.0088 \atfi@LINETO - 6.0327 9.002 \atfi@LINETO - 10.0542 14.9873 \atfi@LINETO - 9.3994 9.376 \atfi@MOVETO - 8.5215 9.376 7.8096 8.5596 7.8096 7.5527 \atfi@CURVETO - 7.8096 6.5449 8.5215 5.7285 9.3994 5.7285 \atfi@CURVETO - 10.2778 5.7285 10.9897 6.5449 10.9897 7.5527 \atfi@CURVETO - 10.9897 8.5596 10.2778 9.376 9.3994 9.376 \atfi@CURVETO - \atfi@CLOSEPATH - \atfi@FILL - 0 \atfi@SETFLAT - 0.5 \atfi@SETLINEWIDTH - 4 \atfi@SETMITERLIMIT - 1 \atfi@SETLINEJOIN - 8.5107 16.5313 \atfi@MOVETO - 22.7266 16.5313 \atfi@LINETO - 23.7085 15.5488 \atfi@LINETO - 23.7085 2.6895 \atfi@LINETO - 22.563 1.543 \atfi@LINETO - 8.4175 1.543 \atfi@LINETO - 4.4893 7.5527 \atfi@LINETO - 4.4893 10.5449 \atfi@LINETO - 8.5107 16.5313 \atfi@LINETO - 7.856 10.9199 \atfi@MOVETO - 6.978 10.9199 6.2661 10.1035 6.2661 9.0957 \atfi@CURVETO - 6.2661 8.0879 6.978 7.2715 7.856 7.2715 \atfi@CURVETO - 8.7344 7.2715 9.4463 8.0879 9.4463 9.0957 \atfi@CURVETO - 9.4463 10.1035 8.7344 10.9199 7.856 10.9199 \atfi@CURVETO - \atfi@CLOSEPATH - \atfi@FILLSTROKE{% - \atfi@color@inline{FILL}% - }{% - 0 \atfi@SETGRAYSTROKE - }% - 1 \atfi@SETLINEWIDTH - 12.3291 12.2656 \atfi@MOVETO - 21.1206 12.2656 \atfi@LINETO - \atfi@STROKE - 12.3291 9.1797 \atfi@MOVETO - 21.1206 9.1797 \atfi@LINETO - \atfi@STROKE - 12.3291 6.1875 \atfi@MOVETO - 21.1206 6.1875 \atfi@LINETO - \atfi@STROKE - % 0 \atfi@SETGRAYSTROKE % redundant? - 0.5 \atfi@SETLINEWIDTH - 0 9.0488 \atfi@MOVETO - 6.2661 9.0957 \atfi@LINETO - \atfi@STROKE - 1.4028 5.2148 \atfi@MOVETO - 1.4028 9.6094 \atfi@LINETO - 1.6831 10.6387 2.4316 10.6387 \atfi@CURVETOV - 3.6475 10.6387 3.5542 9.0488 \atfi@CURVETOY - \atfi@STROKE - \atfi@GRESTORE -} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\atfi@acroTag} -% \begin{macrocode} -\def\atfi@acroTag{% - \raisebox{-1.6bp}{\parbox[b][17bp]{25bp}{% - \rule{0pt}{0pt}\atfi@literal{\atfi@acroTag@data}}% - }% -} -% \end{macrocode} -% \end{macro} -% -% \subsubsection{Reading the \xext{atfi} file} -% -% Commands used in \cs{jobname}\xext{atfi}: -% \begin{itemize} -% \item |attachfile@timezone{}| -% \item -%\begin{verbatim} -%\attachfile@file[ -% Size=, -% CreationDate=, % local time without "D:" and timezone -% ModDateTZ=, -% ModDate=, -% CheckSum= -%]{} -%\end{verbatim} -% \end{itemize} -% -% \begin{macro}{\attachfile@timezone} -% \begin{macrocode} -\def\attachfile@timezone#1{% - \ifx\\#1\\% - % no timezone information given - \else - \def\atfi@timezone{#1}% - \fi -} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\attachfile@file} -% \begin{macrocode} -\newcommand*{\attachfile@file}[2][]{% - \EdefUnescapeHex\atfi@filename{#2}% - \ifx\atfi@filename\ltx@empty - \PackageError{attachfile2}{Empty file name}\@ehc - \else - \@namedef{atfi@file@\atfi@filename}{#1}% - \fi -} -% \end{macrocode} -% \end{macro} -% -% \begin{macrocode} -\InputIfFileExists{\jobname.atfi}{}{}% -% \end{macrocode} -% -% \begin{macrocode} -\newif\ifatfi@checksum -\define@key{AtFi@file}{CheckSum}{% - \atfi@checksumtrue - \edef\atfi@params{\atfi@params/CheckSum<#1>}% -} -% \end{macrocode} -% \begin{macrocode} -\newif\ifatfi@creationdate -\define@key{AtFi@file}{CreationDateTZ}{% - \ifatfi@creationdate - \else - \atfi@creationdatetrue - \edef\atfi@params{% - \atfi@params - /CreationDate(#1)% - }% - \fi -} -% \end{macrocode} -% \begin{macrocode} -\define@key{AtFi@file}{CreationDate}{% - \ifatfi@creationdate - \else - \atfi@creationdatetrue - \edef\atfi@params{% - \atfi@params - /CreationDate(#1\atfi@timezone)% - }% - \fi -} -% \end{macrocode} -% \begin{macrocode} -\newif\ifatfi@moddate -\define@key{AtFi@file}{ModDateTZ}{% - \ifatfi@moddate - \else - \atfi@moddatetrue - \edef\atfi@params{% - \atfi@params - /ModDate(#1)% - }% - \fi -} -% \end{macrocode} -% \begin{macrocode} -\define@key{AtFi@file}{ModDate}{% - \ifatfi@moddate - \else - \atfi@moddatetrue - \edef\atfi@params{% - \atfi@params - /ModDate(D:#1\atfi@timezone)% - }% - \fi -} -% \end{macrocode} -% -% \begin{macro}{\atfi@pdftexdata} -% \begin{macrocode} -\let\atfi@temp\ltx@one -\ltx@IfUndefined{pdf@filesize}{% - \let\atfi@temp\ltx@zero -}{} -\ltx@IfUndefined{pdf@filemoddate}{% - \let\atfi@temp\ltx@zero -}{} -\ltx@IfUndefined{pdf@filemdfivesum}{% - \let\atfi@temp\ltx@zero -}{} -\ifcase\atfi@temp - \let\atfi@pdftexdata\ltx@gobble -\or - \def\atfi@pdftexdata#1{% - \edef\atfi@temp{\pdf@filesize{#1}}% - \ifx\atfi@temp\ltx@empty - \else - \setkeys{AtFi@file}{Size=\atfi@temp}% - \edef\atfi@temp{\pdf@filemoddate{#1}}% - \ifx\atfi@temp\ltx@empty - \else - \setkeys{AtFi@file}{ModDateTZ=\atfi@temp}% - \fi - \edef\atfi@temp{\pdf@filemdfivesum{#1}}% - \ifx\atfi@temp\ltx@empty - \else - \setkeys{AtFi@file}{CheckSum=\atfi@temp}% - \fi - \fi - }% -\fi -% \end{macrocode} -% \end{macro} -% -% \subsubsection{Writing the \xext{atfi} file} -% -% Respect \cs{nofiles} and option \xoption{nofiles}. -% \cs{nofiles} has more weight than option \xoption{nofiles}. -% \begin{macrocode} -\if@filesw -\else - \atfi@nofilestrue -\fi -\ifatfi@nofiles - \PackageInfo{attachfile2}{% - File `\jobname.atfi' will not be written because of\MessageBreak - \string\nofiles\space or option `nofiles'% - }% -% \end{macrocode} -% \begin{macro}{\atfi@writefile} -% \begin{macrocode} - \let\atfi@writefile\ltx@gobble -% \end{macrocode} -% \end{macro} -% \begin{macrocode} -\else -% \end{macrocode} -% \begin{macro}{\atfi@stream} -% \begin{macrocode} - \newwrite\atfi@stream -% \end{macrocode} -% \end{macro} -% \begin{macrocode} - \immediate\openout\atfi@stream=\jobname.atfi\relax - \immediate\write\atfi@stream{% - \string\attachfile@timezone{\atfi@timezone}% - }% -% \end{macrocode} -% \begin{macro}{\atfi@writefile} -% \begin{macrocode} - \def\atfi@writefile#1{% - \begingroup - \EdefEscapeHex\atfi@temp{#1}% - \immediate\write\atfi@stream{% - \string\attachfile@file[% - \ltx@ifundefined{atfi@file@#1}{}{\@nameuse{atfi@file@#1}}% - ]{\atfi@temp}% - }% - \endgroup - }% -% \end{macrocode} -% \end{macro} -% \begin{macrocode} -\fi -\atfi@DisableOption{nofiles} -% \end{macrocode} -% -% \begin{macro}{\atfi@attachfile} -% \begin{macrocode} -\def\atfi@attachfile#1#2{% - \ltx@IfUndefined{atfi@fileobj@#2}{% - \atfi@writefile{#2}% - }{% - % don't need duplicates - }% - \atfi@setup{#1}% - \atfi@embedfile{#2}% - \atfi@set@appearance@icon - \atfi@flags@to@int - \atfi@insert@file@annot{#2}% - \endgroup -} -% \end{macrocode} -% \end{macro} -% -% \subsubsection{Annotation appearance} -% -% \begin{macro}{\atfi@appearancewidth} -% \begin{macrocode} -\newlength{\atfi@appearancewidth} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\atfi@appearanceheight} -% \begin{macrocode} -\newlength{\atfi@appearanceheight} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\atfi@appearancedepth} -% \begin{macrocode} -\newlength{\atfi@appearancedepth} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\atfi@appearancebox} -% \begin{macrocode} -\newsavebox{\atfi@appearancebox} -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\atfi@set@appearance@icon} -% \begin{macrocode} -\def\atfi@set@appearance@icon{% - \ltx@IfUndefined{atfi@appobj@\atfi@icon@icon}{% - \savebox{\atfi@appearancebox}{% - \@nameuse{atfi@acro\atfi@icon@icon}% - }% - \expandafter - \xdef\csname atfi@appwidth@\atfi@icon@icon\endcsname{% - \the\wd\atfi@appearancebox - }% - \expandafter - \xdef\csname atfi@appheight@\atfi@icon@icon\endcsname{% - \the\ht\atfi@appearancebox - }% - \expandafter - \xdef\csname atfi@appdepth@\atfi@icon@icon\endcsname{% - \the\dp\atfi@appearancebox - }% - \atfi@xform@icon - \global\expandafter\let - \csname atfi@appobj@\atfi@icon@icon\endcsname - \atfi@appearanceobj - }{% - }% - % optimization: \setlength dropped - \atfi@appearancewidth=% - \@nameuse{atfi@appwidth@\atfi@icon@icon}\relax - \atfi@appearanceheight=% - \@nameuse{atfi@appheight@\atfi@icon@icon}\relax - \atfi@appearancedepth=% - \@nameuse{atfi@appdepth@\atfi@icon@icon}\relax - \expandafter\let\expandafter\atfi@appearanceobj - \csname atfi@appobj@\atfi@icon@icon\endcsname -} -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\atfi@set@appearance} -% \begin{macrocode} -\def\atfi@set@appearance#1{% - \savebox{\atfi@appearancebox}{#1}% - \atfi@appearancewidth=\wd\atfi@appearancebox - \atfi@appearanceheight=\ht\atfi@appearancebox - \atfi@appearancedepth=\dp\atfi@appearancebox - \atfi@xform -} -% \end{macrocode} -% \end{macro} -% -% \begin{macrocode} -\newcounter{atfi@flags} -% \end{macrocode} -% \begin{macro}{\atfi@flags@to@int} -% \begin{macrocode} -\DeclareRobustCommand{\atfi@flags@to@int}{% - \setcounter{atfi@flags}{0}% - \ifatfi@print - \addtocounter{atfi@flags}{4}% - \fi% - \ifatfi@zoom - \else - \addtocounter{atfi@flags}{8}% - \fi% -} -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\atfi@textattachfile} -% \begin{macrocode} -\def\atfi@textattachfile#1#2{% - \endgroup - \atfi@textattachfile@i{#1}{#2}% -} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\atfi@textattachfile@i} -% \begin{macrocode} -\def\atfi@textattachfile@i#1#2#3{% - \ltx@IfUndefined{atfi@fileobj@#2}{% - \atfi@writefile{#2}% - }{% - % don't need duplicates - }% - \atfi@setup{#1}% - \atfi@embedfile{#2}% - \atfi@set@appearance{% - \leavevmode - \begingroup - \HyColor@UseColor\atfi@color@tex - #3\strut - \endgroup - }% - \atfi@flags@to@int - \atfi@insert@file@annot{#2}% - \endgroup -} -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\attachfile} -% \begin{macrocode} -\DeclareRobustCommand{\attachfile}[1][]{% - \begingroup - \let\do\@makeother - \dospecials - \catcode`\{=1\relax - \catcode`\}=2\relax - \atfi@attachfile{#1}% -} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\textattachfile} -% \begin{macrocode} -\DeclareRobustCommand{\textattachfile}[1][]{% - \begingroup - \begingroup - \let\do\@makeother - \dospecials - \catcode`\{=1\relax - \catcode`\}=2\relax - \atfi@textattachfile{#1}% -} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\noattachfile} -% \begin{macrocode} -\DeclareRobustCommand{\noattachfile}[1][]{% - \begingroup - \atfi@setup{#1}% - \atfi@set@appearance@icon - \ifatfi@print - \expandafter - \atfi@refxform\csname atfi@appobj@\atfi@icon@icon\endcsname - \else - \makebox[\atfi@appearancewidth]{}% - \fi - \endgroup -} -% \end{macrocode} -% \end{macro} -% -% \begin{macrocode} -% -% \end{macrocode} -% -% \subsection{Drivers} -% -% \subsubsection{\pdfTeX} -% -% \begin{macrocode} -%<*pdftex> -\NeedsTeXFormat{LaTeX2e} -\ProvidesFile{atfi-pdftex.def}% - [2019/07/24 v2.9 attachfile2 driver for pdfTeX (HO)]% -% \end{macrocode} -% -% \paragraph{Macros for graphics data} -% -% \begin{macro}{\atfi@literal} -% \begin{macrocode} -\let\atfi@literal\pdfliteral -% \end{macrocode} -% \end{macro} -% -% \begin{macrocode} -\def\atfi@GSAVE{q } -\def\atfi@GRESTORE{Q } -\def\atfi@SETLINEWIDTH{w } -\def\atfi@LINETO{l } -\def\atfi@MOVETO{m } -\def\atfi@STROKE{S } -\def\atfi@FILL{f } -% \atfi@FILLSTROKE{}{} -\def\atfi@FILLSTROKE#1#2{#1#2B } -% \end{macrocode} -% color: uppercase are stroke colors, lowercase non-stroke (fill) colors -% PS, however, does not different between stroke and not-stroke colors -% \begin{macrocode} -\def\atfi@SETRGBCOLORSTROKE{RG } -\def\atfi@SETRGBCOLORFILL{rg } -\def\atfi@SETGRAYSTROKE{G } -\def\atfi@SETGRAYFILL{g } -\def\atfi@SETCMYKCOLORSTROKE{K } -\def\atfi@SETCMYKCOLORFILL{k } -\def\atfi@RECTFILL{re f } -\def\atfi@RECTSTROKEFILL#1#2#3{#1#2#3re B } -\def\atfi@SETMITERLIMIT{M } -\def\atfi@SETFLAT{i } -\def\atfi@SETLINECAP{J } -\def\atfi@CURVETO{c } -\def\atfi@CURVETOV{v } -\def\atfi@CURVETOY{y } -\def\atfi@CLOSEPATH{h } -\def\atfi@SETLINEJOIN{j } -% \end{macrocode} -% -% \paragraph{File embedding} -% -% \begin{macrocode} -\define@key{AtFi@file}{Size}{% - \edef\atfi@params{\atfi@params/Size #1}% -} -% \end{macrocode} -% \begin{macro}{\atfi@embedfile} -% \begin{macrocode} -\def\atfi@embedfile#1{% - \ltx@IfUndefined{atfi@fileobj@#1}{% - \begingroup - \let\atfi@params\ltx@empty - \expandafter\let\expandafter\atfi@temp - \csname atfi@file@#1\endcsname - \ifx\atfi@temp\ltx@empty - \let\atfi@temp\relax - \fi - \ifx\atfi@temp\relax - \atfi@pdftexdata{#1}% - \else - \edef\x{% - \noexpand\setkeys{AtFi@file}{\@nameuse{atfi@file@#1}}% - }% - \x - \fi - \ifx\atfi@params\ltx@empty - \else - \edef\atfi@params{/Params<<\atfi@params>>}% - \fi - \immediate\pdfobj stream attr {% - /Type/EmbeddedFile% - \atfi@mimetype - \atfi@params - } file {#1}% - \expandafter - \xdef\csname atfi@fileobj@#1\endcsname{\the\pdflastobj}% - \endgroup - }{% - % file already embedded - }% -} -% \end{macrocode} -% \end{macro} -% -% \paragraph{Annotation appearance} -% -% \begin{macro}{\atfi@xform} -% input: \cs{atfi@appearancebox}, output: \cs{atfi@appearanceobj} -% \begin{macrocode} -\def\atfi@xform{% - \immediate\pdfxform\atfi@appearancebox - \edef\atfi@appearanceobj{\the\pdflastxform}% -} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\atfi@xform@icon} -% \begin{macrocode} -\let\atfi@xform@icon\atfi@xform -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\atfi@refxform} -% \begin{macrocode} -\def\atfi@refxform#1{% - \pdfrefxform#1\relax -} -% \end{macrocode} -% \end{macro} -% -% \paragraph{File attachment annotation} -% -% \begin{macro}{\atfi@insert@file@annot} -% \begin{macrocode} -\def\atfi@insert@file@annot#1{% - \rule{0pt}{0pt}% - \ifatfi@appearance - \def\atfi@appearance@dict{% - /AP<<% - /N \atfi@appearanceobj\space 0 R% - /R \atfi@appearanceobj\space 0 R% - /D \atfi@appearanceobj\space 0 R% - >>% - }% - \else - \let\atfi@appearance@dict\ltx@empty - \fi - \ltx@IfUndefined{atfi@fsobj@#1}{% - \begingroup - \hypersetup{unicode=false}% - \atfi@pdfstringdef\atfi@file{#1}% - \immediate\pdfobj{% - <<% - /Type/Filespec% - /F(\atfi@file)% - \ifx\atfi@ucfilespec\ltx@empty - \else - /UF(\atfi@ucfilespec)% - \fi - /EF<<% - /F \@nameuse{atfi@fileobj@#1} 0 R% - >>% - >>% - }% - \expandafter\xdef\csname atfi@fsobj@#1\endcsname{% - \the\pdflastobj - }% - \endgroup - }{% - }% - \pdfannot width \atfi@scale\atfi@appearancewidth - height \atfi@scale\atfi@appearanceheight - depth \atfi@scale\atfi@appearancedepth {% - /Subtype/FileAttachment% - \atfi@icon - \atfi@color@annot - \atfi@author - \atfi@date - \atfi@annotname - \atfi@description - \atfi@subject - \atfi@appearance@dict - /F \theatfi@flags - /FS \@nameuse{atfi@fsobj@#1} 0 R% - }% - \rule{0pt}{\atfi@appearanceheight}% - \rule[-\atfi@appearancedepth]{0pt}{\atfi@appearancedepth}% - \rule{\atfi@appearancewidth}{0pt}% -} -% \end{macrocode} -% \end{macro} -% -% \begin{macrocode} -% -% \end{macrocode} -% -% \subsection{luatex} -% \begin{macrocode} -%<*luatex> -\NeedsTeXFormat{LaTeX2e} -\ProvidesFile{atfi-luatex.def}% - [2019/07/24 v2.9 attachfile2 driver for luaTeX (HO)]% -\protected\def\atfi@literal {\pdfextension literal} -\def\atfi@GSAVE{q } -\def\atfi@GRESTORE{Q } -\def\atfi@SETLINEWIDTH{w } -\def\atfi@LINETO{l } -\def\atfi@MOVETO{m } -\def\atfi@STROKE{S } -\def\atfi@FILL{f } -\def\atfi@FILLSTROKE#1#2{#1#2B } -\def\atfi@SETRGBCOLORSTROKE{RG } -\def\atfi@SETRGBCOLORFILL{rg } -\def\atfi@SETGRAYSTROKE{G } -\def\atfi@SETGRAYFILL{g } -\def\atfi@SETCMYKCOLORSTROKE{K } -\def\atfi@SETCMYKCOLORFILL{k } -\def\atfi@RECTFILL{re f } -\def\atfi@RECTSTROKEFILL#1#2#3{#1#2#3re B } -\def\atfi@SETMITERLIMIT{M } -\def\atfi@SETFLAT{i } -\def\atfi@SETLINECAP{J } -\def\atfi@CURVETO{c } -\def\atfi@CURVETOV{v } -\def\atfi@CURVETOY{y } -\def\atfi@CLOSEPATH{h } -\def\atfi@SETLINEJOIN{j } -\define@key{AtFi@file}{Size}{% - \edef\atfi@params{\atfi@params/Size #1}% -} -\def\atfi@embedfile#1{% - \ltx@IfUndefined{atfi@fileobj@#1}{% - \begingroup - \let\atfi@params\ltx@empty - \expandafter\let\expandafter\atfi@temp - \csname atfi@file@#1\endcsname - \ifx\atfi@temp\ltx@empty - \let\atfi@temp\relax - \fi - \ifx\atfi@temp\relax - \atfi@pdftexdata{#1}% - \else - \edef\x{% - \noexpand\setkeys{AtFi@file}{\@nameuse{atfi@file@#1}}% - }% - \x - \fi - \ifx\atfi@params\ltx@empty - \else - \edef\atfi@params{/Params<<\atfi@params>>}% - \fi - \immediate\pdfextension obj stream attr {% - /Type/EmbeddedFile% - \atfi@mimetype - \atfi@params - } file {#1}% - \expandafter - \xdef\csname atfi@fileobj@#1\endcsname{\the\numexpr\pdffeedback lastobj\relax}% - \endgroup - }{% - % file already embedded - }% -} -\def\atfi@xform{% - \immediate\saveboxresource\atfi@appearancebox - \edef\atfi@appearanceobj{\the\lastsavedboxresourceindex}% -} -\let\atfi@xform@icon\atfi@xform -\def\atfi@refxform#1{% - \useboxresource#1\relax -} -\def\atfi@insert@file@annot#1{% - \rule{0pt}{0pt}% - \ifatfi@appearance - \def\atfi@appearance@dict{% - /AP<<% - /N \atfi@appearanceobj\space 0 R% - /R \atfi@appearanceobj\space 0 R% - /D \atfi@appearanceobj\space 0 R% - >>% - }% - \else - \let\atfi@appearance@dict\ltx@empty - \fi - \ltx@IfUndefined{atfi@fsobj@#1}{% - \begingroup - \hypersetup{unicode=false}% - \atfi@pdfstringdef\atfi@file{#1}% - \immediate\pdfextension obj{% - <<% - /Type/Filespec% - /F(\atfi@file)% - \ifx\atfi@ucfilespec\ltx@empty - \else - /UF(\atfi@ucfilespec)% - \fi - /EF<<% - /F \@nameuse{atfi@fileobj@#1} 0 R% - >>% - >>% - }% - \expandafter\xdef\csname atfi@fsobj@#1\endcsname{% - \the\numexpr\pdffeedback lastobj\relax - }% - \endgroup - }{% - }% - \pdfextension annot width \atfi@scale\atfi@appearancewidth - height \atfi@scale\atfi@appearanceheight - depth \atfi@scale\atfi@appearancedepth {% - /Subtype/FileAttachment% - \atfi@icon - \atfi@color@annot - \atfi@author - \atfi@date - \atfi@annotname - \atfi@description - \atfi@subject - \atfi@appearance@dict - /F \theatfi@flags - /FS \@nameuse{atfi@fsobj@#1} 0 R% - }% - \rule{0pt}{\atfi@appearanceheight}% - \rule[-\atfi@appearancedepth]{0pt}{\atfi@appearancedepth}% - \rule{\atfi@appearancewidth}{0pt}% -} -% -% \end{macrocode} -% -% \subsubsection{dvips} -% -% \begin{macrocode} -%<*dvips> -\NeedsTeXFormat{LaTeX2e} -\ProvidesFile{atfi-dvips.def}% - [2019/07/24 v2.9 attachfile2 driver for dvips (HO)]% -% \end{macrocode} -% -% \paragraph{Macros for graphics data} -% -% \begin{macro}{\atfi@literal} -% \begin{macrocode} -\def\atfi@literal#1{% - \special{ps:atfi_dict begin{#1}atfi_?pdfmark end}% -} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\atfi@header} -% \begin{macrocode} -\def\atfi@header#1{% - \special{! #1}% -} -% \end{macrocode} -% \end{macro} -% -% \begin{macrocode} -\atfi@header{% - userdict begin 20 dict dup /atfi_dict exch def end begin% - /atfi_?pdfmark systemdict % - dup/pdfmark known% - {% - /exec get def% - }{% - /pop get def% - } ifelse% - {% - % - % x y width height atfi_re -> - languagelevel 2 ge {% - /atfi_rectfill { rectfill } bind def% - /atfi_rectstroke { rectstroke } bind def% - }{% - /atfi_rect {% - /atfi_height exch def% - /atfi_width exch def% - /atfi_x exch def% - /atfi_y exch def % - newpath % - atfi_x atfi_y moveto % - atfi_x atfi_width add atfi_y lineto % - atfi_x atfi_width add atfi_y atfi_height add lineto % - atfi_x atfi_y atfi_height add lineto % - closepath% - } bind def% - /atfi_rectfill {% - atfi_rect fill% - } bind def% - /atfi_rectstroke {% - atfi_rect stroke% - } bind def% - } ifelse% - /atfi_curveto_v {% - currentpoint 6 2 roll curveto% - } bind def% - /atfi_curveto_y {% - 2 copy curveto% - } bind def% - % - % help macro for atfi_convert_date - /atfi_two {% - dup 10 lt% - {% - 1 string cvs % - exch 1 add exch% - }{% - 2 string cvs% - } ifelse % - putinterval% - } bind def% - % - % atfi_convert_date -> (D:...Z) - /atfi_convert_date {% - dup% - /atfi_days exch 3600 idiv 24 idiv def% - % calc date part - /atfi_year 1970 def% - {% - atfi_year 400 mod 0 eq % - atfi_year 100 mod 0 ne % - atfi_year 4 mod 0 eq % - and or% - {366} {365} ifelse % - dup atfi_days lt% - {% - atfi_days exch sub /atfi_days exch def% - /atfi_year atfi_year 1 add def% - }{% - exit% - } ifelse% - } loop% - /atfi_month 1 def% - /atfi_days atfi_days 1 add def % - 31 atfi_days lt% - {% - atfi_days 31 sub /atfi_days exch def% - /atfi_month atfi_month 1 add def % - 366 eq {29} {28} ifelse dup atfi_days lt% - {% - atfi_days exch sub /atfi_days exch def% - /atfi_month atfi_month 1 add def % - 31 atfi_days lt% - {% - atfi_days 31 sub /atfi_days exch def% - /atfi_month atfi_month 1 add def % - 30 atfi_days lt% - {% - atfi_days 30 sub /atfi_days exch def% - /atfi_month atfi_month 1 add def % - 31 atfi_days lt% - {% - atfi_days 31 sub /atfi_days exch def% - /atfi_month atfi_month 1 add def % - 30 atfi_days lt% - {% - atfi_days 30 sub /atfi_days exch def% - /atfi_month atfi_month 1 add def % - 31 atfi_days lt% - {% - atfi_days 31 sub /atfi_days exch def% - /atfi_month atfi_month 1 add def % - 31 atfi_days lt% - {% - atfi_days 31 sub /atfi_days exch def% - /atfi_month atfi_month 1 add def % - 30 atfi_days lt% - {% - atfi_days 30 sub /atfi_days exch def% - /atfi_month atfi_month 1 add def % - 31 atfi_days lt% - {% - atfi_days 31 sub /atfi_days exch def% - /atfi_month atfi_month 1 add def % - 30 atfi_days lt% - {% - atfi_days 30 sub /atfi_days exch def% - /atfi_month atfi_month 1 add def % - 31 atfi_days lt% - {% - atfi_days 31 sub /atfi_days exch def% - /atfi_month atfi_month 1 add def% - } if% - } if% - } if% - } if% - } if% - } if% - } if% - } if% - } if% - } if% - } { pop } ifelse% - }{ pop } ifelse % - % calc time part - 3600 24 mul mod % - dup 3600 idiv dup /atfi_hour exch def % - 3600 mul sub % - dup 60 idiv dup /atfi_min exch def % - 60 mul sub % - /atfi_sec exch def% - (D:19700101000000Z)% - dup 2 atfi_year 4 string cvs putinterval % - dup 6 atfi_month atfi_two % - dup 8 atfi_days atfi_two % - dup 10 atfi_hour atfi_two % - dup 12 atfi_min atfi_two % - dup 14 atfi_sec atfi_two% - } bind def % - % - % atfi_calc_checksum -> /CheckSum - % or returns nothing, if MD5Encode is not given - false % - languagelevel 2 ge {% - (MD5Encode)% - { pop true or }% - (MD5Encode) length string% - /Filter % - resourceforall% - } if% - {% - /atfi_calc_checksum {% - /atfi_checksum 16 string def% - /atfi_file exch (r) file def% - /atfi_md5sum atfi_checksum /MD5Encode filter def % - % not too efficient to read and write byte by byte, - % using a buffer is probably faster - atfi_size {% - atfi_file read% - {% - atfi_md5sum exch write% - } if% - } repeat % - atfi_md5sum closefile % - atfi_file closefile% - /CheckSum atfi_checksum% - } bind def% - }{% - /atfi_calc_checksum { pop } bind def% - } ifelse% - % - /atfi_pttobp { 72.27 div 72 mul } bind def% - /atfi_pdftodvipsx { 72.27 div Resolution mul } bind def% - /atfi_pdftodvipsy { 72.27 div VResolution mul } bind def% - % - } atfi_?pdfmark % - end% -} -% \end{macrocode} -% \begin{macrocode} -\def\atfi@GSAVE{gsave } -\def\atfi@GRESTORE{grestore } -\def\atfi@SETLINEWIDTH{setlinewidth } -\def\atfi@LINETO{lineto } -\def\atfi@MOVETO{moveto } -\def\atfi@STROKE{stroke } -\def\atfi@FILL{fill } -\def\atfi@FILLSTROKE#1#2{gsave #1 fill grestore #2 stroke } -\def\atfi@SETRGBCOLORSTROKE{setrgbcolor } -\def\atfi@SETRGBCOLORFILL{setrgbcolor } -\def\atfi@SETGRAYSTROKE{setgray } -\def\atfi@SETGRAYFILL{setgray } -\def\atfi@SETCMYKCOLORSTROKE{setcmykcolor } -\def\atfi@SETCMYKCOLORFILL{setcmykcolor } -\def\atfi@RECTFILL{atfi_rectfill } -\def\atfi@RECTSTROKEFILL#1#2#3{% - #3% - #1% - gsave atfi_rectfill grestore % - #2% - #3% - atfi_rectstroke % - #1% -} -\def\atfi@SETMITERLIMIT{setmiterlimit } -\def\atfi@SETFLAT{setflat } -\def\atfi@SETLINECAP{setlinecap } -\def\atfi@CURVETO{curveto } -\def\atfi@CURVETOV{atfi_curveto_v } -\def\atfi@CURVETOY{atfi_curveto_y } -\def\atfi@CLOSEPATH{closepath } -\def\atfi@SETLINEJOIN{setlinejoin } -% \end{macrocode} -% -% \begin{macrocode} -\newcounter{atfi@obj} -\renewcommand*{\theatfi@obj}{% - {atfi_obj_\number\c@atfi@obj}% -} -% \end{macrocode} -% -% \paragraph{File embedding} -% -% Most values for Params dictionary found in the \xext{atfi} file -% have priority: -% \begin{itemize} -% \item Recalculation (md5sum, \dots) is avoided. -% \item An external script has more possibilities than programming -% at PostScript level (operating system, getting the date and -% time values of the file with correct interpretation. -% \item Exception: status is called to test file existence, thus -% we get the value of size for free. -% \end{itemize} -% \begin{macrocode} -\define@key{AtFi@file}{Size}{} -% \end{macrocode} -% \begin{macro}{\atfi@embedfile} -% \begin{macrocode} -\def\atfi@embedfile#1{% - \ltx@IfUndefined{atfi@fileobj@#1}{% - \atfi@pdfstringdef\atfi@psfilename{#1}% - \stepcounter{atfi@obj}% - \expandafter\xdef\csname atfi@fileobj@#1\endcsname{\theatfi@obj}% - \begingroup - \let\atfi@params\ltx@empty - \expandafter\let\expandafter\atfi@temp - \csname atfi@file@#1\endcsname - \ifx\atfi@temp\ltx@empty - \let\atfi@temp\relax - \fi - \ifx\atfi@temp\relax - \atfi@pdftexdata{#1}% - \else - \edef\x{% - \noexpand\setkeys{AtFi@file}{\@nameuse{atfi@file@#1}}% - }% - \x - \fi - \atfi@literal{% - /atfi_filename(\atfi@psfilename)def % - atfi_filename status% - {% -% \end{macrocode} -% ok: file found\\ -% save parameters of status command -% \begin{macrocode} - /atfi_created exch def% - /atfi_referenced exch def% - /atfi_size exch def % - pop % -% \end{macrocode} -%\begin{verbatim} -%drop parameter "pages" (storage space), never needed -%ghostscript: -% created: stat.st_ctime -% referenced: stat.st_mtime -% stat.st_ctime: interpretion depends on operating system: -% * unix: inode change time (not interesting) -% * win32: probably creation time -% --> /CreationDate -% stat.st_mtime: modification time --> /ModDate -% time values are seconds since 1970-01-01, GMT -%TODO: ghostscript offers "getenv" for getting the value -% of an environment variable. That could be used to -% to detect windows and settingthe /CreationDate entry. -%TODO: how are these values interpreted by other distiller -% programs? -%\end{verbatim} -% \begin{macrocode} - [% - /_objdef \theatfi@obj - /type/stream% - /OBJ pdfmark% - [% - \theatfi@obj - <<% - /Type/EmbeddedFile% - \atfi@mimetype - /Params% - <<% - \atfi@params - % - /Size atfi_size% - % - /product where% - {% - pop % -% \end{macrocode} -% check for ghostscript -% \begin{macrocode} - product (Ghostscript) search% - {% - pop pop pop % -% \end{macrocode} -% ghostscript is running -% \begin{macrocode} - \ifatfi@creationdate - \else - false % TODO: test for windows - {% - /CreationDate atfi_created atfi_convert_date% - } if% - \fi - \ifatfi@moddate - \else - /ModDate atfi_referenced atfi_convert_date% - \fi - } if% -% \end{macrocode} -% look for MD5Encode filter and calculate CheckSum -% \begin{macrocode} - } if % - \ifatfi@checksum - \else - atfi_filename atfi_calc_checksum% - \fi - >>% - >>% - /PUT pdfmark% - [% - \theatfi@obj - atfi_filename (r) file% - /PUT pdfmark% - [% - \theatfi@obj - /CLOSE pdfmark% - }{% -% \end{macrocode} -% error: file not found\\ -% currently nothing is done -% \begin{macrocode} - } ifelse% - }% - \endgroup - }{% -% \end{macrocode} -% file already embedded -% \begin{macrocode} - }% -} -% \end{macrocode} -% \end{macro} -% -% -% \paragraph{Annotation appearance} -% -% output: \cs{atfi@appearanceobj}\\ -% input: \cs{atfi@appearancebox}, \cs{atfi@icon@icon} -% \begin{macro}{atfi@xfrom@icon} -% \begin{macrocode} -\def\atfi@xform@icon{% - \stepcounter{atfi@obj}% - \edef\atfi@appearanceobj{\theatfi@obj}% - \atfi@literal{% - [% - /_objdef \atfi@appearanceobj - /BBox[% - 0 % - 0 % - \strip@pt\wd\atfi@appearancebox\space atfi_pttobp % - \strip@pt\dimexpr\dp\atfi@appearancebox - +\ht\atfi@appearancebox\relax\space atfi_pttobp% - ]% - /BP pdfmark % - \csname atfi@acro\atfi@icon@icon @data\endcsname - [% - /EP pdfmark% - }% -} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\atfi@xform} -% output: \cs{atfi@appearanceobj}, -% input: \cs{atfi@appearancebox} -% \begin{macrocode} -\def\atfi@xform{% - \stepcounter{atfi@obj}% - \edef\atfi@appearanceobj{\theatfi@obj}% - \begingroup - \setbox\ltx@zero=\hbox{% - \atfi@literal{% - [% - /_objdef \atfi@appearanceobj - /BBox[% - currentpoint % - \strip@pt\dp\atfi@appearancebox\space sub % - currentpoint % - exch \strip@pt\wd\atfi@appearancebox\space add % - exch \strip@pt\ht\atfi@appearancebox\space add% - ]% - /BP pdfmark % - gsave % - currentpoint % - 2 copy translate % - 72.27 Resolution div 72.27 VResolution div neg scale % - exch neg exch neg translate% - }% - \usebox{\atfi@appearancebox}% - \atfi@literal{% - grestore% - [% - /EP pdfmark% - }% - }% - % do not allocate any space for xobject definition - \dp\ltx@zero=\z@ - \ht\ltx@zero=\z@ - \wd\ltx@zero=\z@ - \mbox{\usebox\ltx@zero}% - \endgroup -} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\atfi@refxform} -% \begin{macrocode} -\def\atfi@refxform#1{% - \raisebox{-\atfi@appearancedepth}{% - \atfi@literal{% - gsave % - currentpoint translate % - Resolution 72 div VResolution neg 72 div scale% - [#1 /SP pdfmark % hash-ok - grestore% - }% - \makebox[\atfi@appearancewidth]{}% - }% - \rule{0pt}{\atfi@appearanceheight}% -} -% \end{macrocode} -% \end{macro} -% -% \paragraph{File attachment annotation} -% -% \begin{macro}{\atfi@insert@file@annot} -% \begin{macrocode} -\def\atfi@insert@file@annot#1{% - \rule{0pt}{0pt}% - \ifatfi@appearance - \def\atfi@appearance@dict{% - /AP<<% - /N \atfi@appearanceobj - /R \atfi@appearanceobj - /D \atfi@appearanceobj - >>% - }% - \else - \let\atfi@appearance@dict\ltx@empty - \fi - \ltx@IfUndefined{atfi@fsobj@#1}{% - \stepcounter{atfi@obj}% - \expandafter - \xdef\csname atfi@fsobj@#1\endcsname{\theatfi@obj}% - \begingroup - \hypersetup{unicode=false}% - \atfi@pdfstringdef\atfi@file{#1}% - \atfi@literal{% - [% - /_objdef \theatfi@obj - /type/dict% - /OBJ pdfmark% - [% - \theatfi@obj - <<% - /Type/Filespec% - /F(\atfi@file)% - \ifx\atfi@ucfilespec\ltx@empty - \else - /UF(\atfi@ucfilespec)% - \fi - /EF<<% - /F \csname atfi@fileobj@#1\endcsname - >>% - >>% - /PUT pdfmark% - }% - \endgroup - }{% - }% - \atfi@literal{% - [% - /Subtype/FileAttachment% - \atfi@icon - \atfi@color@annot - \atfi@author - \atfi@date - \atfi@annotname - \atfi@description - \atfi@subject - \atfi@appearance@dict - /F \theatfi@flags - /FS \csname atfi@fsobj@#1\endcsname - /Rect[% - currentpoint % - \strip@pt\dimexpr\atfi@scale\atfi@appearancedepth\relax - \space atfi_pdftodvipsy add % - currentpoint % - exch % - \strip@pt\dimexpr\atfi@scale\atfi@appearancewidth\relax - \space atfi_pdftodvipsx add % - exch % - \strip@pt\dimexpr\atfi@scale\atfi@appearanceheight\relax - \space atfi_pdftodvipsy sub % - ]% - /ANN pdfmark% - }% - \rule{0pt}{\atfi@appearanceheight}% - \rule[-\atfi@appearancedepth]{0pt}{\atfi@appearancedepth}% - \rule{\atfi@appearancewidth}{0pt}% -} -% \end{macrocode} -% \end{macro} -% -% \begin{macrocode} -% -% \end{macrocode} -% -% \subsubsection{dvipdfmx} -% -% \begin{macrocode} -%<*dvipdfmx> -\NeedsTeXFormat{LaTeX2e} -\ProvidesFile{atfi-dvipdfmx.def}% - [2019/07/24 v2.9 attachfile2 driver for dvipdfmx/XeTeX (HO)]% -% \end{macrocode} -% -% \paragraph{Macros for graphics data} -% -% \begin{macro}{\atfi@special} -% \begin{macrocode} -\def\atfi@special#1{% - \special{pdf:#1}% -} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\atfi@literal} -% \begin{macrocode} -\def\atfi@literal#1{% - \atfi@special{content #1}% -} -% \end{macrocode} -% \end{macro} -% -% \begin{macrocode} -\def\atfi@GSAVE{q } -\def\atfi@GRESTORE{Q } -\def\atfi@SETLINEWIDTH{w } -\def\atfi@LINETO{l } -\def\atfi@MOVETO{m } -\def\atfi@STROKE{S } -\def\atfi@FILL{f } -\def\atfi@FILLSTROKE#1#2{#1#2B } -\def\atfi@SETRGBCOLORSTROKE{RG } -\def\atfi@SETRGBCOLORFILL{rg } -\def\atfi@SETGRAYSTROKE{G } -\def\atfi@SETGRAYFILL{g } -\def\atfi@SETCMYKCOLORSTROKE{K } -\def\atfi@SETCMYKCOLORFILL{k } -\def\atfi@RECTFILL{re f } -\def\atfi@RECTSTROKEFILL#1#2#3{#1#2#3re B } -\def\atfi@SETMITERLIMIT{M } -\def\atfi@SETFLAT{i } -\def\atfi@SETLINECAP{J } -\def\atfi@CURVETO{c } -\def\atfi@CURVETOV{v } -\def\atfi@CURVETOY{y } -\def\atfi@CLOSEPATH{h } -\def\atfi@SETLINEJOIN{j } -% \end{macrocode} -% -% \begin{macrocode} -\newcounter{atfi@obj} -\renewcommand*{\theatfi@obj}{% - @atfi_obj_\number\c@atfi@obj -} -% \end{macrocode} -% -% \paragraph{File embedding} -% -% \begin{macrocode} -\define@key{AtFi@file}{Size}{% - \edef\atfi@params{\atfi@params/Size #1}% -} -% \end{macrocode} -% \begin{macro}{\atfi@embedfile} -% \begin{macrocode} -\def\atfi@embedfile#1{% - \ltx@IfUndefined{atfi@fileobj@#1}{% - \stepcounter{atfi@obj}% - \begingroup - \let\atfi@params\ltx@empty - \expandafter\let\expandafter\atfi@temp - \csname atfi@file@#1\endcsname - \ifx\atfi@temp\ltx@empty - \let\atfi@temp\relax - \fi - \ifx\atfi@temp\relax - \atfi@pdftexdata{#1}% - \else - \edef\x{% - \noexpand\setkeys{AtFi@file}{\@nameuse{atfi@file@#1}}% - }% - \x - \fi - \ifx\atfi@params\ltx@empty - \else - \edef\atfi@params{/Params<<\atfi@params>>}% - \fi - \edef\atfi@FILE{#1}% - \filename@parse\atfi@FILE - \ifx\filename@area\ltx@empty - \edef\atfi@FILE{./\atfi@FILE}% - \fi - \EdefEscapeString\atfi@FILE{\atfi@FILE}% - \atfi@special{fstream % - \theatfi@obj - (\atfi@FILE)% - <<% - /Type/EmbeddedFile% - \atfi@mimetype - \atfi@params - >>% - }% - \atfi@special{close \theatfi@obj}% - \expandafter - \xdef\csname atfi@fileobj@#1\endcsname{\theatfi@obj}% - \endgroup - }{% - % file already embedded - }% -} -% \end{macrocode} -% \end{macro} -% -% \paragraph{Annotation appearance} -% -% \begin{macro}{\atfi@xform} -% input: \cs{atfi@appearancebox}, output: \cs{atfi@appearanceobj} -% \begin{macrocode} -\def\atfi@xform{% - \stepcounter{atfi@obj}% - \smash{% - \rlap{% - \atfi@special{bxobj \theatfi@obj\space - width \the\wd\atfi@appearancebox\space - height \the\ht\atfi@appearancebox\space - depth \the\dp\atfi@appearancebox - }% - \usebox\atfi@appearancebox - \atfi@special{exobj}% - }% - }% - \edef\atfi@appearanceobj{\theatfi@obj}% -} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\atfi@xform@icon} -% \begin{macrocode} -\let\atfi@xform@icon\atfi@xform -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\atfi@refxform} -% \begin{macrocode} -\def\atfi@refxform#1{% - \leavevmode - \atfi@special{uxobj #1}% -} -% \end{macrocode} -% \end{macro} -% -% \paragraph{File attachment annotation} -% -% \begin{macro}{\atfi@insert@file@annot} -% \begin{macrocode} -\def\atfi@insert@file@annot#1{% - \rule{0pt}{0pt}% - \ifatfi@appearance - \def\atfi@appearance@dict{% - /AP<<% - /N \atfi@appearanceobj - /R \atfi@appearanceobj - /D \atfi@appearanceobj - >>% - }% - \else - \let\atfi@appearance@dict\ltx@empty - \fi - \ltx@IfUndefined{atfi@fsobj@#1}{% - \begingroup - \ifxetex - \let\atfi@temp\Hy@Warning - \let\Hy@Warning\ltx@gobble - \fi - \hypersetup{unicode=false}% - \ifxetex - \let\Hy@Warning\atfi@temp - \fi - \atfi@pdfstringdef\atfi@file{#1}% - \stepcounter{atfi@obj}% - \atfi@special{obj \theatfi@obj <<% - /Type/Filespec% - /F(\atfi@file)% - \ifx\atfi@ucfilespec\ltx@empty - \else - /UF(\atfi@ucfilespec)% - \fi - /EF<<% - /F \@nameuse{atfi@fileobj@#1}% - >>% - >>% - }% - \expandafter\xdef\csname atfi@fsobj@#1\endcsname{% - \theatfi@obj - }% - \endgroup - }{% - }% - \begingroup - \dimen@=\atfi@scale\atfi@appearancewidth - \edef\atfi@rule{width \the\dimen@}% - \dimen@=\atfi@scale\atfi@appearanceheight - \edef\atfi@rule{\atfi@rule\space height \the\dimen@}% - \dimen@=\atfi@scale\atfi@appearancedepth - \edef\atfi@rule{\atfi@rule\space depth \the\dimen@}% - \atfi@special{ann \atfi@rule - <<% - /Subtype/FileAttachment% - \atfi@icon - \atfi@color@annot - \atfi@author - \atfi@date - \atfi@annotname - \atfi@description - \atfi@subject - \atfi@appearance@dict - /F \theatfi@flags - /FS \@nameuse{atfi@fsobj@#1}% - >>% - }% - \endgroup - \rule{0pt}{\atfi@appearanceheight}% - \rule[-\atfi@appearancedepth]{0pt}{\atfi@appearancedepth}% - \rule{\atfi@appearancewidth}{0pt}% -} -% \end{macrocode} -% \end{macro} -% -% -% \begin{macrocode} -% -% \end{macrocode} -% -% \subsection{Perl script \xfile{pdfatfi.pl}} -% -% \begin{macrocode} -%<*pdfatfi> -% \end{macrocode} -% \begingroup\small -% \SpecialEscapechar\| -% \begin{macrocode} -#!/usr/bin/env perl -use strict; -$^W=1; # turn warning on -# -# pdfatfi.pl -# -# Copyright (C) 2005-2010, 2012 Heiko Oberdiek. -# -# This work may be distributed and/or modified under the -# conditions of the LaTeX Project Public License, either -# version 1.3c of this license or (at your option) any later -# version. This version of this license is in -# https://www.latex-project.org/lppl/lppl-1-3c.txt -# and the latest version of this license is in -# https://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". -# -# The Current Maintainers of this work are -Heiko Oberdiek and the Oberdiek Package Support Group -https://github.com/ho-tex/oberdiek/issues - -# -# See file "attachfile2.pdf" for a list of files that belong to -# this project. -# -# This file "pdfatfi.pl" may be renamed to "pdfatfi" -# for installation purposes. -# -my $prj = 'pdfatfi'; -my $file = "$prj.pl"; -my $program = uc($&) if $file =~ /^\w+/; -my $version = "2.9"; -my $date = "2019/07/24"; -my $author = "Heiko Oberdiek"; -my $copyright = "Copyright (c) 2005-2010, 2012 by $author."; -# -# History: -# 2005/05/21 v1.0: First release. -# 2006/08/16 v2.2: Included in DTX file of attachfile2.dtx. -# 2010/09/27 v2.6: Keys ModDateTZ and CreationDateTZ added. -# 2016/05/16 v2.8: Option --version added. -# 2019/07/24 v2.9: adapted version to attachfile2 version. -# - -use POSIX qw(strftime); # %z is used (GNU) -use Digest::MD5; - -### program identification -my $title = "$program $version, $date - $copyright\n"; - -### error strings -my $Error = "!!! Error:"; # error prefix - -### variables -my $atfifile; - -### option variables -my @bool = ("false", "true"); -$::opt_help = 0; -$::opt_quiet = 0; -$::opt_debug = 0; -$::opt_verbose = 0; -$::opt_version = 0; - -my $usage = <<"END_OF_USAGE"; -${title}Syntax: \L$program\E [options] -Function: Help program for LaTeX package "attachfile2". -Options: (defaults:) - --help print usage - --version print version number - --(no)quiet suppress messages ($bool[$::opt_quiet]) - --(no)verbose verbose printing ($bool[$::opt_verbose]) - --(no)debug debug informations ($bool[$::opt_debug]) -END_OF_USAGE - -### process options -my @OrgArgv = @ARGV; -use Getopt::Long; -GetOptions( - "help!", - "version!", - "quiet!", - "debug!", - "verbose!", -) or die $usage; -!$::opt_help or die $usage; -if ($::opt_version) { - print "$prj $date v$version\n"; - exit(0); -} -@ARGV == 1 or die "$usage$Error Missing jobname!\n"; - -$::opt_quiet = 0 if $::opt_verbose; - -print $title unless $::opt_quiet; - -### get jobname -$atfifile = $ARGV[0]; -if (!-f $atfifile && -f "$atfifile.atfi") { - $atfifile .= ".atfi"; -} --f $atfifile or die "$Error File `$atfifile' not found!\n"; - -print "* job file = $atfifile\n" if $::opt_verbose; - -if ($::opt_debug) { - print <<"END_DEB"; -* OSNAME: $^O -* PERL_VERSION: $] -* ARGV: @OrgArgv -END_DEB -} - -my $tmpfile = $atfifile . ".tmp"; - -my $timezone = strftime "%z", localtime; - -sub gettz ($) { - my $time = shift; - my $tz = strftime "%z", localtime($time); - return '' unless $tz; - return 'Z' if $tz eq '+0000'; - $tz =~ s/^([+\-]\d\d)(\d\d)$/$1'$2'/; - return $tz; -} - -open(IN, $atfifile) or die "$Error Cannot open `$atfifile'!\n"; -open(OUT, ">$tmpfile") or die "$Error Cannot write `$tmpfile'!\n"; - -while() { - # timezone - if (s/^(\\attachfile\@timezone\{).*(\})$/$1$timezone$2/) { - print "* timezone = $timezone\n" if $::opt_verbose; - } - - # file entry - if (/^\\attachfile\@file\[[^\]]*\]\{(.*)\}$/) { - my $hexfile = $1; - my $file = pack('H*', $hexfile); - my @s = stat($file); - if (@s == 0) { - print "!!! Warning: File `$file' not found!\n"; - } - else { - my $size = @s[7]; - my $mtime = @s[9]; - my $ctime = @s[10]; # inode change time - - my ($sec, $min, $hour, $mday, $mon, $year) = - localtime($mtime); - my $moddate = sprintf("%04d%02d%02d%02d%02d%02d", - $year + 1900, $mon + 1, $mday, - $hour, $min, $sec); - my $moddatetz = 'D:' . $moddate . gettz($mtime); - - # Manual page "perlport" says that "ctime" is creation - # time instead of inode change time for "Win32" and - # "Mac OS", but it is unsupported for "Mac OS X". - my $creationdate = ""; - my $creationdatetz = ""; - if ($^O eq 'MSWin32') { # cygwin? - ($sec, $min, $hour, $mday, $mon, $year) = - localtime($ctime); - $creationdate = sprintf("%04d%02d%02d%02d%02d%02d", - $year + 1900, $mon + 1, $mday, - $hour, $min, $sec); - $creationdatetz = - 'D:' . $creationdate . gettz($ctime); - } - - # md5 checksum - my $checksum = ""; - my $ctx = Digest::MD5->new; - if (open(FILE, $file)) { - $ctx->addfile(*FILE); - $checksum = $ctx->hexdigest; - close(FILE); - } - else { - print "!!! Warning: File `$file' cannot be read," - . " dropping checksum!\n"; - } - - $_ = "\\attachfile\@file[" - . "ModDateTZ=$moddatetz" - . ",Size=$size" - . ($checksum ? ",CheckSum=$checksum" : "") - . ($creationdatetz ? - ",CreationDateTZ=$creationdatetz" : - ($creationdate ? - ",CreationDate=$creationdate" : "")) - . "]{$hexfile}\n"; - if ($::opt_verbose) { - print "* file entry = $file\n"; - print " size = $size\n"; - print " moddate = $moddate\n"; - print " creationdate = $creationdate\n" - if $creationdate; - print " checksum = $checksum\n" if $checksum; - } - } - } - - print OUT $_; -} - -close(IN); -close(OUT); - -unlink($atfifile) or die "$Error Cannot delete old `$atfifile'!\n"; -rename $tmpfile, $atfifile - or die "$Error Cannot move `$tmpfile' to `$atfifile'!\n"; - -print "*** ready. ***\n" unless $::opt_quiet; - -__END__ -% \end{macrocode} -% \endgroup -% \begin{macrocode} -% -% \end{macrocode} -% -% -% \section{Installation} -% -% \subsection{Download} -% -% \paragraph{Package.} This package is available on -% CTAN\footnote{\CTANpkg{attachfile2}}: -% \begin{description} -% \item[\CTAN{macros/latex/contrib/oberdiek/attachfile2.dtx}] The source file. -% \item[\CTAN{macros/latex/contrib/oberdiek/attachfile2.pdf}] Documentation. -% \end{description} -% -% -% \paragraph{Bundle.} All the packages of the bundle `oberdiek' -% are also available in a TDS compliant ZIP archive. There -% the packages are already unpacked and the documentation files -% are generated. The files and directories obey the TDS standard. -% \begin{description} -% \item[\CTANinstall{install/macros/latex/contrib/oberdiek.tds.zip}] -% \end{description} -% \emph{TDS} refers to the standard ``A Directory Structure -% for \TeX\ Files'' (\CTAN{tds/tds.pdf}). Directories -% with \xfile{texmf} in their name are usually organized this way. -% -% \subsection{Bundle installation} -% -% \paragraph{Unpacking.} Unpack the \xfile{oberdiek.tds.zip} in the -% TDS tree (also known as \xfile{texmf} tree) of your choice. -% Example (linux): -% \begin{quote} -% |unzip oberdiek.tds.zip -d ~/texmf| -% \end{quote} -% -% \paragraph{Script installation.} -% Check the directory \xfile{TDS:scripts/oberdiek/} for -% scripts that need further installation steps. -% Package \xpackage{attachfile2} comes with the Perl script -% \xfile{pdfatfi.pl} that should be installed in such a way -% that it can be called as \texttt{pdfatfi}. -% Example (linux): -% \begin{quote} -% |chmod +x scripts/oberdiek/pdfatfi.pl|\\ -% |cp scripts/oberdiek/pdfatfi.pl /usr/local/bin/| -% \end{quote} -% -% \subsection{Package installation} -% -% \paragraph{Unpacking.} The \xfile{.dtx} file is a self-extracting -% \docstrip\ archive. The files are extracted by running the -% \xfile{.dtx} through \plainTeX: -% \begin{quote} -% \verb|tex attachfile2.dtx| -% \end{quote} -% -% \paragraph{TDS.} Now the different files must be moved into -% the different directories in your installation TDS tree -% (also known as \xfile{texmf} tree): -% \begin{quote} -% \def\t{^^A -% \begin{tabular}{@{}>{\ttfamily}l@{ $\rightarrow$ }>{\ttfamily}l@{}} -% attachfile2.sty & tex/latex/oberdiek/attachfile2.sty\\ -% atfi-dvips.def & tex/latex/oberdiek/atfi-dvips.def\\ -% atfi-pdftex.def & tex/latex/oberdiek/atfi-pdftex.def\\ -% atfi-dvipdfmx.def & tex/latex/oberdiek/atfi-dvipdfmx.def\\ -% pdfatfi.pl & scripts/oberdiek/pdfatfi.pl\\ -% attachfile2.pdf & doc/latex/oberdiek/attachfile2.pdf\\ -% attachfile2.dtx & source/latex/oberdiek/attachfile2.dtx\\ -% \end{tabular}^^A -% }^^A -% \sbox0{\t}^^A -% \ifdim\wd0>\linewidth -% \begingroup -% \advance\linewidth by\leftmargin -% \advance\linewidth by\rightmargin -% \edef\x{\endgroup -% \def\noexpand\lw{\the\linewidth}^^A -% }\x -% \def\lwbox{^^A -% \leavevmode -% \hbox to \linewidth{^^A -% \kern-\leftmargin\relax -% \hss -% \usebox0 -% \hss -% \kern-\rightmargin\relax -% }^^A -% }^^A -% \ifdim\wd0>\lw -% \sbox0{\small\t}^^A -% \ifdim\wd0>\linewidth -% \ifdim\wd0>\lw -% \sbox0{\footnotesize\t}^^A -% \ifdim\wd0>\linewidth -% \ifdim\wd0>\lw -% \sbox0{\scriptsize\t}^^A -% \ifdim\wd0>\linewidth -% \ifdim\wd0>\lw -% \sbox0{\tiny\t}^^A -% \ifdim\wd0>\linewidth -% \lwbox -% \else -% \usebox0 -% \fi -% \else -% \lwbox -% \fi -% \else -% \usebox0 -% \fi -% \else -% \lwbox -% \fi -% \else -% \usebox0 -% \fi -% \else -% \lwbox -% \fi -% \else -% \usebox0 -% \fi -% \else -% \lwbox -% \fi -% \else -% \usebox0 -% \fi -% \end{quote} -% If you have a \xfile{docstrip.cfg} that configures and enables \docstrip's -% TDS installing feature, then some files can already be in the right -% place, see the documentation of \docstrip. -% -% \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 -% \verb|mktexlsr|. -% -% \subsection{Script installation} -% This package comes with a Perl script \xfile{pdfatfi.pl}. -% Install it somewhere so that it is executed, when it is called -% as \verb|pdfatfi| on the command line. Example for -% installing it under Linux: -% \begin{quote} -%\begin{verbatim} -%cp pdfatfi.pl /usr/local/bin/pdfatfi -%chmod +x /usr/local/bin/pdfatfi -%\end{verbatim} -% \end{quote} -% -% -% \subsection{Some details for the interested} -% -% \paragraph{Unpacking with \LaTeX.} -% The \xfile{.dtx} chooses its action depending on the format: -% \begin{description} -% \item[\plainTeX:] Run \docstrip\ and extract the files. -% \item[\LaTeX:] Generate the documentation. -% \end{description} -% If you insist on using \LaTeX\ for \docstrip\ (really, -% \docstrip\ does not need \LaTeX), then inform the autodetect routine -% about your intention: -% \begin{quote} -% \verb|latex \let\install=y\input{attachfile2.dtx}| -% \end{quote} -% Do not forget to quote the argument according to the demands -% of your shell. -% -% \paragraph{Generating the documentation.} -% You can use both the \xfile{.dtx} or the \xfile{.drv} to generate -% the documentation. The process can be configured by the -% configuration file \xfile{ltxdoc.cfg}. For instance, put this -% line into this file, if you want to have A4 as paper format: -% \begin{quote} -% \verb|\PassOptionsToClass{a4paper}{article}| -% \end{quote} -% An example follows how to generate the -% documentation with pdf\LaTeX: -% \begin{quote} -%\begin{verbatim} -%pdflatex attachfile2.dtx -%makeindex -s gind.ist attachfile2.idx -%pdflatex attachfile2.dtx -%makeindex -s gind.ist attachfile2.idx -%pdflatex attachfile2.dtx -%\end{verbatim} -% \end{quote} -% -% \begin{thebibliography}{9} -% \bibitem{attachfile} -% Scott Pakin: \textit{The \xpackage{attachfile} package}; -% 2005/02/20 v1.2; -% \CTANpkg{attachfile}. -% -% \bibitem{embedfile} -% Heiko Oberdiek: \textit{The \xpackage{embedfile} package}; -% 2006/08/16 v1.0; -% \CTAN{macros/latex/contrib/oberdiek/embedfile.pdf}. -% -% \bibitem{pdfspec} -% Adobe Systems Incorporated: -% \href{https://www.adobe.com/devnet/pdf/pdf_reference.html}% -% {\textit{PDF Reference, Version 1.7}},% -% -% \bibitem{mime} -% Network Working Group: RFC 2046, \textit{Multipurpose Internet Mail Extensions (MIME) Part Two: -% Media Types}, November 1996; \url{http://www.rfc-editor.org/}. -% -% \bibitem{types} -% IANA (Internet Assigned Numbers Authority): -% \textit{MIME Media Types}, May 2006; -% \url{http://www.iana.org/assignments/media-types/}. -% -% \end{thebibliography} -% -% \begin{History} -% \begin{Version}{2005/02/23 v2.0} -% \item -% New options: \xoption{draft}/\xoption{final}. -% \item -% New option scale for scaling the annotation rectangle. -% \item -% Supported driver options: \xoption{pdftex}, \xoption{dvips}. -% \item -% Configuration file `attachfile.cfg' supported. -% \item -% Dependency of package calc dropped. -% \item -% \eTeX\ (\cs{numexpr}, \cs{dimexpr}) used. -% \item -% New auxiliary file \cs{jobname.atfi} to get data unavailable -% by (pdf)\TeX, controlled by \cs{nofiles} and option nofiles. -% \item -% Use of package \xpackage{prokvopt} (never released). -% \end{Version} -% \begin{Version}{2005/10/07 v2.1} -% \item -% Option \xoption{annotname} for naming annotations -% (this name can be used for embedded go-to actions). -% \end{Version} -% \begin{Version}{2006/08/17 v2.2} -% \item -% Use of package \xpackage{kvoptions} instead of \xpackage{prokvopt}. -% \item -% DTX framework. -% \item -% A little documentation. -% \end{Version} -% \begin{Version}{2007/04/11 v2.3} -% \item -% Line ends sanitized. -% \end{Version} -% \begin{Version}{2008/07/29 v2.4} -% \item -% Improved color support. Option \xoption{color} now understands -% the usual color specifications if package \xpackage{xcolor} is -% loaded. -% \end{Version} -% \begin{Version}{2009/09/25 v2.5} -% \item -% New option \xoption{ucfilespec} (since PDF 1.7). -% \item -% Fix: \xpackage{hyperref}'s option \xoption{unicode} is disabled -% for file names except for \xoption{ucfilespec}. -% \end{Version} -% \begin{Version}{2010/09/27 v2.6} -% \item -% Support for dvipdfmx added, new option \xoption{dvipdfmx} -% and alias option \xoption{xetex}. -% (Thanks Will Robertson for pointing to |\special{pdf:fstream ...}|). -% \item -% New option \xoption{driverfallback}. -% \item -% All options except driver options are local options, -% that means they are ignored as global options. -% \item -% Some options are disabled after they are used -% (driver options, \xoption{draft}, \xoption{final}, \xoption{nofiles}). -% \item -% Driver files renamed from \texttt{atfi.def} to -% \texttt{atfi-.def}. -% \item -% Bug fix: \cs{textattachfile} now adds an entry into -% the \xext{atfi} file. -% \item -% Program \xfile{pdfatfi.pl} sets modification and creation time with -% time zone, because the time zone offset might differ with -% the file date. -% \end{Version} -% \begin{Version}{2012/04/18 v2.7} -% \item -% Program \xfile{pdfatfi.pl}: Option \xoption{version} added. -% \end{Version} -% \begin{Version}{2016/05/16 v2.8} -% \item -% Documentation updates. -% \end{Version} -% \begin{Version}{2019/07/24 v2.9} -% \item -% Added luatex driver (UF, issue 69) -% \end{Version} -% \end{History} -% -% \PrintIndex -% -% \Finale -\endinput diff --git a/macros/latex/contrib/oberdiek/attachfile2.pdf b/macros/latex/contrib/oberdiek/attachfile2.pdf deleted file mode 100644 index 1b8e6b30b3..0000000000 Binary files a/macros/latex/contrib/oberdiek/attachfile2.pdf and /dev/null differ diff --git a/macros/latex/contrib/oberdiek/atveryend.dtx b/macros/latex/contrib/oberdiek/atveryend.dtx index 0c47c7950e..00a9fe9808 100644 --- a/macros/latex/contrib/oberdiek/atveryend.dtx +++ b/macros/latex/contrib/oberdiek/atveryend.dtx @@ -1332,14 +1332,6 @@ and the derived files % \paragraph{Script installation.} % Check the directory \xfile{TDS:scripts/oberdiek/} for % scripts that need further installation steps. -% Package \xpackage{attachfile2} comes with the Perl script -% \xfile{pdfatfi.pl} that should be installed in such a way -% that it can be called as \texttt{pdfatfi}. -% Example (linux): -% \begin{quote} -% |chmod +x scripts/oberdiek/pdfatfi.pl|\\ -% |cp scripts/oberdiek/pdfatfi.pl /usr/local/bin/| -% \end{quote} % % \subsection{Package installation} % diff --git a/macros/latex/contrib/oberdiek/atveryend.pdf b/macros/latex/contrib/oberdiek/atveryend.pdf index e9b4f26623..5175f2cb22 100644 Binary files a/macros/latex/contrib/oberdiek/atveryend.pdf and b/macros/latex/contrib/oberdiek/atveryend.pdf differ diff --git a/macros/latex/contrib/oberdiek/auxhook.dtx b/macros/latex/contrib/oberdiek/auxhook.dtx index 37a1dc4aab..206f3f2675 100644 --- a/macros/latex/contrib/oberdiek/auxhook.dtx +++ b/macros/latex/contrib/oberdiek/auxhook.dtx @@ -451,14 +451,6 @@ and the derived files % \paragraph{Script installation.} % Check the directory \xfile{TDS:scripts/oberdiek/} for % scripts that need further installation steps. -% Package \xpackage{attachfile2} comes with the Perl script -% \xfile{pdfatfi.pl} that should be installed in such a way -% that it can be called as \texttt{pdfatfi}. -% Example (linux): -% \begin{quote} -% |chmod +x scripts/oberdiek/pdfatfi.pl|\\ -% |cp scripts/oberdiek/pdfatfi.pl /usr/local/bin/| -% \end{quote} % % \subsection{Package installation} % diff --git a/macros/latex/contrib/oberdiek/auxhook.pdf b/macros/latex/contrib/oberdiek/auxhook.pdf index 87d7ba7ed2..13d218773a 100644 Binary files a/macros/latex/contrib/oberdiek/auxhook.pdf and b/macros/latex/contrib/oberdiek/auxhook.pdf differ diff --git a/macros/latex/contrib/oberdiek/bigintcalc.dtx b/macros/latex/contrib/oberdiek/bigintcalc.dtx index dbe43326ce..78156448dd 100644 --- a/macros/latex/contrib/oberdiek/bigintcalc.dtx +++ b/macros/latex/contrib/oberdiek/bigintcalc.dtx @@ -4354,14 +4354,6 @@ $ \BIC@Temp 9{18\or27\or36\or45\or54\or63\or72\or81}% % \paragraph{Script installation.} % Check the directory \xfile{TDS:scripts/oberdiek/} for % scripts that need further installation steps. -% Package \xpackage{attachfile2} comes with the Perl script -% \xfile{pdfatfi.pl} that should be installed in such a way -% that it can be called as \texttt{pdfatfi}. -% Example (linux): -% \begin{quote} -% |chmod +x scripts/oberdiek/pdfatfi.pl|\\ -% |cp scripts/oberdiek/pdfatfi.pl /usr/local/bin/| -% \end{quote} % % \subsection{Package installation} % diff --git a/macros/latex/contrib/oberdiek/bigintcalc.pdf b/macros/latex/contrib/oberdiek/bigintcalc.pdf index 9697f34014..314ab812e5 100644 Binary files a/macros/latex/contrib/oberdiek/bigintcalc.pdf and b/macros/latex/contrib/oberdiek/bigintcalc.pdf differ diff --git a/macros/latex/contrib/oberdiek/bitset.dtx b/macros/latex/contrib/oberdiek/bitset.dtx index cfb470b749..9b810c7104 100644 --- a/macros/latex/contrib/oberdiek/bitset.dtx +++ b/macros/latex/contrib/oberdiek/bitset.dtx @@ -4049,14 +4049,6 @@ and the derived files % \paragraph{Script installation.} % Check the directory \xfile{TDS:scripts/oberdiek/} for % scripts that need further installation steps. -% Package \xpackage{attachfile2} comes with the Perl script -% \xfile{pdfatfi.pl} that should be installed in such a way -% that it can be called as \texttt{pdfatfi}. -% Example (linux): -% \begin{quote} -% |chmod +x scripts/oberdiek/pdfatfi.pl|\\ -% |cp scripts/oberdiek/pdfatfi.pl /usr/local/bin/| -% \end{quote} % % \subsection{Package installation} % diff --git a/macros/latex/contrib/oberdiek/bitset.pdf b/macros/latex/contrib/oberdiek/bitset.pdf index 9417a95cc0..78e84ad24a 100644 Binary files a/macros/latex/contrib/oberdiek/bitset.pdf and b/macros/latex/contrib/oberdiek/bitset.pdf differ diff --git a/macros/latex/contrib/oberdiek/bmpsize.dtx b/macros/latex/contrib/oberdiek/bmpsize.dtx index 6dc71d1a25..256379b43a 100644 --- a/macros/latex/contrib/oberdiek/bmpsize.dtx +++ b/macros/latex/contrib/oberdiek/bmpsize.dtx @@ -3776,14 +3776,6 @@ and the derived files % \paragraph{Script installation.} % Check the directory \xfile{TDS:scripts/oberdiek/} for % scripts that need further installation steps. -% Package \xpackage{attachfile2} comes with the Perl script -% \xfile{pdfatfi.pl} that should be installed in such a way -% that it can be called as \texttt{pdfatfi}. -% Example (linux): -% \begin{quote} -% |chmod +x scripts/oberdiek/pdfatfi.pl|\\ -% |cp scripts/oberdiek/pdfatfi.pl /usr/local/bin/| -% \end{quote} % % \subsection{Package installation} % diff --git a/macros/latex/contrib/oberdiek/bmpsize.pdf b/macros/latex/contrib/oberdiek/bmpsize.pdf index 9f4ba7a9b4..e8dc87c32b 100644 Binary files a/macros/latex/contrib/oberdiek/bmpsize.pdf and b/macros/latex/contrib/oberdiek/bmpsize.pdf differ diff --git a/macros/latex/contrib/oberdiek/bookmark.dtx b/macros/latex/contrib/oberdiek/bookmark.dtx index 021ff10c4d..79f0fad2b8 100644 --- a/macros/latex/contrib/oberdiek/bookmark.dtx +++ b/macros/latex/contrib/oberdiek/bookmark.dtx @@ -3113,14 +3113,6 @@ and the derived files % \paragraph{Script installation.} % Check the directory \xfile{TDS:scripts/oberdiek/} for % scripts that need further installation steps. -% Package \xpackage{attachfile2} comes with the Perl script -% \xfile{pdfatfi.pl} that should be installed in such a way -% that it can be called as \texttt{pdfatfi}. -% Example (linux): -% \begin{quote} -% |chmod +x scripts/oberdiek/pdfatfi.pl|\\ -% |cp scripts/oberdiek/pdfatfi.pl /usr/local/bin/| -% \end{quote} % % \subsection{Package installation} % diff --git a/macros/latex/contrib/oberdiek/bookmark.pdf b/macros/latex/contrib/oberdiek/bookmark.pdf index 39d08ee548..4564879759 100644 Binary files a/macros/latex/contrib/oberdiek/bookmark.pdf and b/macros/latex/contrib/oberdiek/bookmark.pdf differ diff --git a/macros/latex/contrib/oberdiek/catchfile.dtx b/macros/latex/contrib/oberdiek/catchfile.dtx index 86bbfc2d83..019eb4776a 100644 --- a/macros/latex/contrib/oberdiek/catchfile.dtx +++ b/macros/latex/contrib/oberdiek/catchfile.dtx @@ -924,14 +924,6 @@ and the derived files % \paragraph{Script installation.} % Check the directory \xfile{TDS:scripts/oberdiek/} for % scripts that need further installation steps. -% Package \xpackage{attachfile2} comes with the Perl script -% \xfile{pdfatfi.pl} that should be installed in such a way -% that it can be called as \texttt{pdfatfi}. -% Example (linux): -% \begin{quote} -% |chmod +x scripts/oberdiek/pdfatfi.pl|\\ -% |cp scripts/oberdiek/pdfatfi.pl /usr/local/bin/| -% \end{quote} % % \subsection{Package installation} % diff --git a/macros/latex/contrib/oberdiek/catchfile.pdf b/macros/latex/contrib/oberdiek/catchfile.pdf index 83906d4a7e..1d012ce838 100644 Binary files a/macros/latex/contrib/oberdiek/catchfile.pdf and b/macros/latex/contrib/oberdiek/catchfile.pdf differ diff --git a/macros/latex/contrib/oberdiek/centernot.dtx b/macros/latex/contrib/oberdiek/centernot.dtx index 44cefabee2..4ef3fda03f 100644 --- a/macros/latex/contrib/oberdiek/centernot.dtx +++ b/macros/latex/contrib/oberdiek/centernot.dtx @@ -364,14 +364,6 @@ and the derived files % \paragraph{Script installation.} % Check the directory \xfile{TDS:scripts/oberdiek/} for % scripts that need further installation steps. -% Package \xpackage{attachfile2} comes with the Perl script -% \xfile{pdfatfi.pl} that should be installed in such a way -% that it can be called as \texttt{pdfatfi}. -% Example (linux): -% \begin{quote} -% |chmod +x scripts/oberdiek/pdfatfi.pl|\\ -% |cp scripts/oberdiek/pdfatfi.pl /usr/local/bin/| -% \end{quote} % % \subsection{Package installation} % diff --git a/macros/latex/contrib/oberdiek/centernot.pdf b/macros/latex/contrib/oberdiek/centernot.pdf index 02f00e47c7..c07a5f8fd9 100644 Binary files a/macros/latex/contrib/oberdiek/centernot.pdf and b/macros/latex/contrib/oberdiek/centernot.pdf differ diff --git a/macros/latex/contrib/oberdiek/chemarr.dtx b/macros/latex/contrib/oberdiek/chemarr.dtx index 13f584a7b8..6e37198ed9 100644 --- a/macros/latex/contrib/oberdiek/chemarr.dtx +++ b/macros/latex/contrib/oberdiek/chemarr.dtx @@ -359,14 +359,6 @@ and the derived files % \paragraph{Script installation.} % Check the directory \xfile{TDS:scripts/oberdiek/} for % scripts that need further installation steps. -% Package \xpackage{attachfile2} comes with the Perl script -% \xfile{pdfatfi.pl} that should be installed in such a way -% that it can be called as \texttt{pdfatfi}. -% Example (linux): -% \begin{quote} -% |chmod +x scripts/oberdiek/pdfatfi.pl|\\ -% |cp scripts/oberdiek/pdfatfi.pl /usr/local/bin/| -% \end{quote} % % \subsection{Package installation} % diff --git a/macros/latex/contrib/oberdiek/chemarr.pdf b/macros/latex/contrib/oberdiek/chemarr.pdf index fd5924f8e2..30a3c37a0f 100644 Binary files a/macros/latex/contrib/oberdiek/chemarr.pdf and b/macros/latex/contrib/oberdiek/chemarr.pdf differ diff --git a/macros/latex/contrib/oberdiek/classlist.dtx b/macros/latex/contrib/oberdiek/classlist.dtx index cc2e65b46b..7d15bd431d 100644 --- a/macros/latex/contrib/oberdiek/classlist.dtx +++ b/macros/latex/contrib/oberdiek/classlist.dtx @@ -448,14 +448,6 @@ and the derived files % \paragraph{Script installation.} % Check the directory \xfile{TDS:scripts/oberdiek/} for % scripts that need further installation steps. -% Package \xpackage{attachfile2} comes with the Perl script -% \xfile{pdfatfi.pl} that should be installed in such a way -% that it can be called as \texttt{pdfatfi}. -% Example (linux): -% \begin{quote} -% |chmod +x scripts/oberdiek/pdfatfi.pl|\\ -% |cp scripts/oberdiek/pdfatfi.pl /usr/local/bin/| -% \end{quote} % % \subsection{Package installation} % diff --git a/macros/latex/contrib/oberdiek/classlist.pdf b/macros/latex/contrib/oberdiek/classlist.pdf index 1f1510104f..d82cedc6e8 100644 Binary files a/macros/latex/contrib/oberdiek/classlist.pdf and b/macros/latex/contrib/oberdiek/classlist.pdf differ diff --git a/macros/latex/contrib/oberdiek/colonequals.dtx b/macros/latex/contrib/oberdiek/colonequals.dtx index 53ceae893c..9506db5480 100644 --- a/macros/latex/contrib/oberdiek/colonequals.dtx +++ b/macros/latex/contrib/oberdiek/colonequals.dtx @@ -472,14 +472,6 @@ and the derived files % \paragraph{Script installation.} % Check the directory \xfile{TDS:scripts/oberdiek/} for % scripts that need further installation steps. -% Package \xpackage{attachfile2} comes with the Perl script -% \xfile{pdfatfi.pl} that should be installed in such a way -% that it can be called as \texttt{pdfatfi}. -% Example (linux): -% \begin{quote} -% |chmod +x scripts/oberdiek/pdfatfi.pl|\\ -% |cp scripts/oberdiek/pdfatfi.pl /usr/local/bin/| -% \end{quote} % % \subsection{Package installation} % diff --git a/macros/latex/contrib/oberdiek/colonequals.pdf b/macros/latex/contrib/oberdiek/colonequals.pdf index b07e4758c8..59bd704097 100644 Binary files a/macros/latex/contrib/oberdiek/colonequals.pdf and b/macros/latex/contrib/oberdiek/colonequals.pdf differ diff --git a/macros/latex/contrib/oberdiek/dvipscol.dtx b/macros/latex/contrib/oberdiek/dvipscol.dtx index 22f9555e7d..96ad58bcc1 100644 --- a/macros/latex/contrib/oberdiek/dvipscol.dtx +++ b/macros/latex/contrib/oberdiek/dvipscol.dtx @@ -357,14 +357,6 @@ and the derived files % \paragraph{Script installation.} % Check the directory \xfile{TDS:scripts/oberdiek/} for % scripts that need further installation steps. -% Package \xpackage{attachfile2} comes with the Perl script -% \xfile{pdfatfi.pl} that should be installed in such a way -% that it can be called as \texttt{pdfatfi}. -% Example (linux): -% \begin{quote} -% |chmod +x scripts/oberdiek/pdfatfi.pl|\\ -% |cp scripts/oberdiek/pdfatfi.pl /usr/local/bin/| -% \end{quote} % % \subsection{Package installation} % diff --git a/macros/latex/contrib/oberdiek/dvipscol.pdf b/macros/latex/contrib/oberdiek/dvipscol.pdf index f228486395..dcdebac9f4 100644 Binary files a/macros/latex/contrib/oberdiek/dvipscol.pdf and b/macros/latex/contrib/oberdiek/dvipscol.pdf differ diff --git a/macros/latex/contrib/oberdiek/embedfile.dtx b/macros/latex/contrib/oberdiek/embedfile.dtx index 6d4d2a0042..344ff89b8e 100644 --- a/macros/latex/contrib/oberdiek/embedfile.dtx +++ b/macros/latex/contrib/oberdiek/embedfile.dtx @@ -1904,14 +1904,6 @@ Test (plain-\TeX): {\tt embedfile.dtx} should be embedded.% % \paragraph{Script installation.} % Check the directory \xfile{TDS:scripts/oberdiek/} for % scripts that need further installation steps. -% Package \xpackage{attachfile2} comes with the Perl script -% \xfile{pdfatfi.pl} that should be installed in such a way -% that it can be called as \texttt{pdfatfi}. -% Example (linux): -% \begin{quote} -% |chmod +x scripts/oberdiek/pdfatfi.pl|\\ -% |cp scripts/oberdiek/pdfatfi.pl /usr/local/bin/| -% \end{quote} % % \subsection{Package installation} % @@ -2056,7 +2048,7 @@ Test (plain-\TeX): {\tt embedfile.dtx} should be embedded.% % \bibitem{attachfile2} % Heiko Oberdiek: \textit{The \xpackage{attachfile2} package}; % 2006/08/16 v2.2; -% \CTAN{macros/latex/contrib/oberdiek/attachfile2.pdf}. +% \CTAN{macros/latex/contrib/attachfile2/attachfile2.pdf}. % % \bibitem{pdfspec} % Adobe Systems Incorporated: diff --git a/macros/latex/contrib/oberdiek/embedfile.pdf b/macros/latex/contrib/oberdiek/embedfile.pdf index 9276b50ef2..15832c100f 100644 Binary files a/macros/latex/contrib/oberdiek/embedfile.pdf and b/macros/latex/contrib/oberdiek/embedfile.pdf differ diff --git a/macros/latex/contrib/oberdiek/engord.dtx b/macros/latex/contrib/oberdiek/engord.dtx index 335c147520..2a81c3a3e2 100644 --- a/macros/latex/contrib/oberdiek/engord.dtx +++ b/macros/latex/contrib/oberdiek/engord.dtx @@ -800,14 +800,6 @@ and the derived files % \paragraph{Script installation.} % Check the directory \xfile{TDS:scripts/oberdiek/} for % scripts that need further installation steps. -% Package \xpackage{attachfile2} comes with the Perl script -% \xfile{pdfatfi.pl} that should be installed in such a way -% that it can be called as \texttt{pdfatfi}. -% Example (linux): -% \begin{quote} -% |chmod +x scripts/oberdiek/pdfatfi.pl|\\ -% |cp scripts/oberdiek/pdfatfi.pl /usr/local/bin/| -% \end{quote} % % \subsection{Package installation} % diff --git a/macros/latex/contrib/oberdiek/engord.pdf b/macros/latex/contrib/oberdiek/engord.pdf index c3aaa41896..a5ec829fff 100644 Binary files a/macros/latex/contrib/oberdiek/engord.pdf and b/macros/latex/contrib/oberdiek/engord.pdf differ diff --git a/macros/latex/contrib/oberdiek/enparen.dtx b/macros/latex/contrib/oberdiek/enparen.dtx index 1bad972131..5a8b66efd3 100644 --- a/macros/latex/contrib/oberdiek/enparen.dtx +++ b/macros/latex/contrib/oberdiek/enparen.dtx @@ -818,14 +818,6 @@ and the derived files % \paragraph{Script installation.} % Check the directory \xfile{TDS:scripts/oberdiek/} for % scripts that need further installation steps. -% Package \xpackage{attachfile2} comes with the Perl script -% \xfile{pdfatfi.pl} that should be installed in such a way -% that it can be called as \texttt{pdfatfi}. -% Example (linux): -% \begin{quote} -% |chmod +x scripts/oberdiek/pdfatfi.pl|\\ -% |cp scripts/oberdiek/pdfatfi.pl /usr/local/bin/| -% \end{quote} % % \subsection{Package installation} % diff --git a/macros/latex/contrib/oberdiek/enparen.pdf b/macros/latex/contrib/oberdiek/enparen.pdf index ce913c04ea..7614eaccd0 100644 Binary files a/macros/latex/contrib/oberdiek/enparen.pdf and b/macros/latex/contrib/oberdiek/enparen.pdf differ diff --git a/macros/latex/contrib/oberdiek/eolgrab.dtx b/macros/latex/contrib/oberdiek/eolgrab.dtx index 8862ed738c..433219f435 100644 --- a/macros/latex/contrib/oberdiek/eolgrab.dtx +++ b/macros/latex/contrib/oberdiek/eolgrab.dtx @@ -867,14 +867,6 @@ and the derived files % \paragraph{Script installation.} % Check the directory \xfile{TDS:scripts/oberdiek/} for % scripts that need further installation steps. -% Package \xpackage{attachfile2} comes with the Perl script -% \xfile{pdfatfi.pl} that should be installed in such a way -% that it can be called as \texttt{pdfatfi}. -% Example (linux): -% \begin{quote} -% |chmod +x scripts/oberdiek/pdfatfi.pl|\\ -% |cp scripts/oberdiek/pdfatfi.pl /usr/local/bin/| -% \end{quote} % % \subsection{Package installation} % diff --git a/macros/latex/contrib/oberdiek/eolgrab.pdf b/macros/latex/contrib/oberdiek/eolgrab.pdf index 368ccd0435..aee278d71d 100644 Binary files a/macros/latex/contrib/oberdiek/eolgrab.pdf and b/macros/latex/contrib/oberdiek/eolgrab.pdf differ diff --git a/macros/latex/contrib/oberdiek/epstopdf.dtx b/macros/latex/contrib/oberdiek/epstopdf.dtx deleted file mode 100644 index be5938f44d..0000000000 --- a/macros/latex/contrib/oberdiek/epstopdf.dtx +++ /dev/null @@ -1,1602 +0,0 @@ -% \iffalse meta-comment -% -% File: epstopdf.dtx -% Version: 2016/05/15 v2.6 -% Info: Conversion with epstopdf on the fly -% -% Copyright (C) 2001, 2006-2010 by -% Heiko Oberdiek -% -% This work may be distributed and/or modified under the -% conditions of the LaTeX Project Public License, either -% version 1.3c of this license or (at your option) any later -% version. This version of this license is in -% https://www.latex-project.org/lppl/lppl-1-3c.txt -% and the latest version of this license is in -% https://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". -% -% The Current Maintainers of this work are -% Heiko Oberdiek and the Oberdiek Package Support Group -% https://github.com/ho-tex/oberdiek/issues -% -% This work consists of the main source file epstopdf.dtx -% and the derived files -% epstopdf.sty, epstopdf.pdf, epstopdf.ins, epstopdf.drv, -% epstopdf-base.sty, epstopdf-test1.tex. -% -% Distribution: -% CTAN:macros/latex/contrib/oberdiek/epstopdf.dtx -% CTAN:macros/latex/contrib/oberdiek/epstopdf.pdf -% -% Unpacking: -% (a) If epstopdf.ins is present: -% tex epstopdf.ins -% (b) Without epstopdf.ins: -% tex epstopdf.dtx -% (c) If you insist on using LaTeX -% latex \let\install=y\input{epstopdf.dtx} -% (quote the arguments according to the demands of your shell) -% -% Documentation: -% (a) If epstopdf.drv is present: -% latex epstopdf.drv -% (b) Without epstopdf.drv: -% latex epstopdf.dtx; ... -% The class ltxdoc loads the configuration file ltxdoc.cfg -% if available. Here you can specify further options, e.g. -% use A4 as paper format: -% \PassOptionsToClass{a4paper}{article} -% -% Programm calls to get the documentation (example): -% pdflatex epstopdf.dtx -% makeindex -s gind.ist epstopdf.idx -% pdflatex epstopdf.dtx -% makeindex -s gind.ist epstopdf.idx -% pdflatex epstopdf.dtx -% -% Installation: -% TDS:tex/latex/oberdiek/epstopdf.sty -% TDS:tex/latex/oberdiek/epstopdf-base.sty -% TDS:doc/latex/oberdiek/epstopdf.pdf -% TDS:doc/latex/oberdiek/test/epstopdf-test1.tex -% TDS:source/latex/oberdiek/epstopdf.dtx -% -%<*ignore> -\begingroup - \catcode123=1 % - \catcode125=2 % - \def\x{LaTeX2e}% -\expandafter\endgroup -\ifcase 0\ifx\install y1\fi\expandafter - \ifx\csname processbatchFile\endcsname\relax\else1\fi - \ifx\fmtname\x\else 1\fi\relax -\else\csname fi\endcsname -% -%<*install> -\input docstrip.tex -\Msg{************************************************************************} -\Msg{* Installation} -\Msg{* Package: epstopdf 2016/05/15 v2.6 Conversion with epstopdf on the fly (HO)} -\Msg{************************************************************************} - -\keepsilent -\askforoverwritefalse - -\let\MetaPrefix\relax -\preamble - -This is a generated file. - -Project: epstopdf -Version: 2016/05/15 v2.6 - -Copyright (C) 2001, 2006-2010 by - Heiko Oberdiek - -This work may be distributed and/or modified under the -conditions of the LaTeX Project Public License, either -version 1.3c of this license or (at your option) any later -version. This version of this license is in - https://www.latex-project.org/lppl/lppl-1-3c.txt -and the latest version of this license is in - https://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". - -The Current Maintainers of this work are -Heiko Oberdiek and the Oberdiek Package Support Group -https://github.com/ho-tex/oberdiek/issues - - -This work consists of the main source file epstopdf.dtx -and the derived files - epstopdf.sty, epstopdf.pdf, epstopdf.ins, epstopdf.drv, - epstopdf-base.sty, epstopdf-test1.tex. - -\endpreamble -\let\MetaPrefix\DoubleperCent - -\generate{% - \file{epstopdf.ins}{\from{epstopdf.dtx}{install}}% - \file{epstopdf.drv}{\from{epstopdf.dtx}{driver}}% - \usedir{tex/latex/oberdiek}% - \file{epstopdf.sty}{\from{epstopdf.dtx}{package}}% - \file{epstopdf-base.sty}{\from{epstopdf.dtx}{base}}% -% \usedir{doc/latex/oberdiek/test}% -% \file{epstopdf-test1.tex}{\from{epstopdf.dtx}{test1}}% - \nopreamble - \nopostamble -% \usedir{source/latex/oberdiek/catalogue}% -% \file{epstopdf-pkg.xml}{\from{epstopdf.dtx}{catalogue}}% -} - -\catcode32=13\relax% active space -\let =\space% -\Msg{************************************************************************} -\Msg{*} -\Msg{* To finish the installation you have to move the following} -\Msg{* files into a directory searched by TeX:} -\Msg{*} -\Msg{* epstopdf.sty, epstopdf-base.sty} -\Msg{*} -\Msg{* To produce the documentation run the file `epstopdf.drv'} -\Msg{* through LaTeX.} -\Msg{*} -\Msg{* Happy TeXing!} -\Msg{*} -\Msg{************************************************************************} - -\endbatchfile -% -%<*ignore> -\fi -% -%<*driver> -\NeedsTeXFormat{LaTeX2e} -\ProvidesFile{epstopdf.drv}% - [2016/05/15 v2.6 Conversion with epstopdf on the fly (HO)]% -\documentclass{ltxdoc} -\usepackage{holtxdoc}[2011/11/22] -\begin{document} - \DocInput{epstopdf.dtx}% -\end{document} -% -% \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{epstopdf.drv} -% -% \title{The \xpackage{epstopdf} package} -% \date{2016/05/15 v2.6} -% \author{Heiko Oberdiek\thanks -% {Please report any issues at \url{https://github.com/ho-tex/oberdiek/issues}}} -% -% \maketitle -% -% \begin{abstract} -% This packages adds support of handling eps images -% to package \xpackage{graphics} or \xpackage{graphicx} -% with option \xoption{pdftex}. If an eps image is detected, -% epstopdf is automatically called to convert it to pdf format. -% \end{abstract} -% -% \tableofcontents -% -% \providecommand*{\xprogram}[1]{\textsf{#1}} -% -% \section{Documentation} -% -% \subsection{Introduction} -% -% \LaTeX\ provides its graphics bundle to include graphics files. -% Both packages \xpackage{graphics} or \xpackage{graphicx} may -% be used. the latter one loads the first and adds options -% in key value style for \cs{includegraphics}. -% -% Usually the drivers do not support all kind of graphics files. -% Other image types must be converted, before they become -% usuable. In case of driver \xprogram{dvips}, the graphics -% rule may contain a conversion rule. Then all that package -% \xpackage{graphics} must know is the bounding box, the command -% is passed to \xprogram{dvips} that calls it and embeds the -% converted image. -% -% However, \pdfTeX\ has its driver for PDF output already -% build in. It's graphics inclusion commands (\cs{pdfximage}) -% does not allow the execution of external commands. -% Therefore commands in the last argument of -% \cs{DeclareGraphicsRule} were of no use. -% But external programs can be called within \pdfTeX. -% This feature is called ``shell escape'' or ``write 18'' -% and must usually enabled explicitely because of security reasons. -% Now, this package \xpackage{epstopdf} hooks -% into package \xpackage{graphics}' code to catch -% that argument with the external command and executes it -% to convert the graphics file to a supported format and -% passes the control of graphics inclusion back to package -% \xpackage{graphics}. -% -% \subsection{Requirements} -% -% \begin{itemize} -% \item -% The feature \cs{write18} must be enabled. This allows the -% running of external programs during \TeX's compile run. -% Keep in mind that this is a security risk. The feature is an -% addition to \cs{TeX}. Mik\TeX, te\TeX, \TeX\ Live support it. -% In Web2C based \TeX\ distributions (te\TeX, \TeX\ Live) it can be -% enabled in the configuration file \xfile{texmf.cnf}: -% \begin{quote} -% |shell_escape = 1| -% \end{quote} -% Because of the security risk, it is better to do it on the -% command line only: -% \begin{quote} -% \texttt{--shell-escape} (te\TeX, \TeX\ Live)\\ -% \texttt{--enable-write18} (MiK\TeX) -% \end{quote} -% Example: -% \begin{quote} -% |pdflatex -shell-escape test.tex| -% \end{quote} -% \item -% The program \xprogram{epstopdf} for the conversion from EPS -% to PDF. However, other programs can -% be used and configured by \cs{DeclareGraphicsRule}. -% Example: -% \begin{quote} -% |\epstopdfDeclareGraphicsRule{.eps}{pdf}{.pdf}{%|\\ -% | ps2pdf -dEPSCrop #1 \OutputFile|\\ -% |}| -% \end{quote} -% \end{itemize} -% -% \subsection{Usage} -% -% The package is loaded after graphic\{s,x\}, e.g.: -% \begin{quote} -% |\usepackage[pdftex]{graphicx}|\\ -% |\usepackage{epstopdf}| -% \end{quote} -% Now images with file name extension \xfile{.eps} are detected -% and supported using \cs{includegraphics}. -% -% If the graphics file name is explicitly specified with extension -% \xfile{.eps} the new rule for EPS files is called and -% the conversion performed. If option \xoption{update} is in force -% then the conversion step is dropped if the target file already -% exists and is not older then the EPS file. -% -% The situation is more complicate if the graphics file is -% given without file name extension. Then the \xpackage{graphics} -% package must search for a supported image file. -% The possible extensions are stored in the graphics extension -% list, that can be set by \cs{DeclareGraphicsExtensions}. -% The algorithm: -% \begin{quote} -% \def\>{\mbox{}\quad} -% function search( \meta{filebase} )\\ -% \>foreach \meta{ext} in \meta{graphics extensions}\\ -% \>\>foreach \meta{dir} in \meta{current directory}, \meta{\cs{graphicspath}}\\ -% \>\>\>\meta{file} := \meta{dir} + \meta{filebase} + \meta{ext}\\ -% \>\>\>if exist \meta{file}\\ -% \>\>\>\>return found\\ -% \>return not found -% \end{quote} -% Package \xpackage{epstopdf} puts \xfile{.eps} at the end of the -% graphics extension search list. This is the behaviour of option -% \xoption{append} that is enabled by default. -% That means, the conversion is called last -% unless a supported file type cannot be found earlier. This avoids -% unnecessary conversion steps that slow down the \LaTeX\ run. -% If you want to use option \xoption{update} and your \pdfTeX\ supports -% it, then an outdated PDF file also would be found earlier unless -% \xoption{suffix} is used that is the default since version 2.0. -% -% With an empty option \xoption{suffix} and option -% \xoption{prepend} there is a risk that an original PDF file is overwritten: -% -% If the original image file is the PDF file and there is also a generated -% EPS file, then the original PDF file can be regenerated (depending -% on the option settings) and the original PDF file gets lost. -% Therefore option \xoption{suffix} is introduced in version 1.9 -% to create a separate name space for generated output files. -% -% \textbf{Note:} Usually the conversion program needs the exact location -% of the image file. Usually the current directory works. -% Also if the image file is found using \cs{graphicspath}, the -% location is known. However, if the image is somewhere -% in a directory of environment variable |TEXINPUTS|, then -% the package does not know the exact location and the -% conversion program will not find the image file unless it -% implements a search using |TEXINPUTS| (program \xprogram{kpsewhich} -% may be of help in this task). -% -% \subsection{Options} -% -% Options can be given as package options or later using: -% \begin{declcs}{epstopdfsetup} \M{key value list} -% \end{declcs} -% \LaTeX\ expands the option list before passing the option list -% to the package's option handling code. This can fail -% for option \xoption{suffix} if it contains some of the macros -% described below. Use \cs{epstopdfsetup} after the package is loaded. -% Or load package \xpackage{kvoptions-patch} before. This package -% is also loaded by option \xoption{patch} of package \xpackage{kvoptions}. -% \LaTeX's option code is redefined to respect key value options and -% let the values untouched. -% -% \begin{description} -% \def\It#1{\item[\xoption{#1}:]}^^A -% \It{update} -% The conversion program is only called, if the target file -% does not exist or is older than the source image file. -% \It{append} -% Puts the extension \xfile{.eps} at the end of the graphics extension list -% (default). -% \It{prepend} -% Puts the extension \xfile{.eps} at the begin of the graphics extension list. -% \It{outdir} -% The converted file may put in an other output directory. -% The value of \xoption{outdir} must include the directory separator. -% Example for the current directory: -% \begin{quote} -% |\epstopdfsetup{outdir=./}| -% \end{quote} -% For other directories ensure, that they can be found. -% See \cs{graphicspath} or |TEXINPUTS|. -% \It{suffix} -% This option takes a string that is put between the file name base -% and the extension of the output file. Rationale: It can happen, -% that a PDF file is the original file and the EPS file the -% generated file. If now the package thinks, that the PDF file -% is the generated file, it will `regnerate' it. But in reality -% the original file is lost. Therefore I recommend to use this -% option always to generate a separate name space for generated -% files. Proposed value is \texttt{-generated} or \texttt{.generated}. -% The suffix \texttt{.generated} will also work here without the need for -% package \xpackage{grffile}). -% -% Example: -% \begin{quote} -% |\epstopdfsetup{suffix=-generated}|\\ -% Then \xfile{foo.eps} is converted to \xfile{foo-generated.pdf}. -% \end{quote} -% \cs{SourceExt} can be used inside the suffix string. -% It's will be replaced by the extension of the image source -% file without the leading dot, for instance: -% \begin{quote} -% |\epstopdfsetup{suffix=-\SourceExt-converted-to}|\\ -% \xfile{foo.eps} $\Rightarrow$ \xfile{foo-eps-converted-to.pdf} -% \end{quote} -% See also the next option \xoption{prefersuffix} that -% modifies the behaviour of option \xoption{suffix} in some -% cases. -% -% Default for \xoption{suffix} is `|-\SourceExt-converted-to|'. -% -% \It{prefersuffix} -% If a suffix is set by option \xoption{suffix}, then there can be -% two image file names that could be taken into account for inclusion: -% A image file name with the suffix string inside -% its name and a image file name without; e.g. for \xfile{foo.eps} -% the names could be: -% \begin{quote} -% \xfile{foo-suffix.pdf}, \xfile{foo.pdf} -% \end{quote} -% If option \xoption{perfersuffix} is turned on, the -% file \xfile{foo-suffix.pdf} and its generation is preferred -% over using \xfile{foo.pdf}. Otherwise \xfile{foo.pdf} is included -% without generating \xfile{foo-suffix.pdf}. -% The default of option \xoption{prefersuffix} is \texttt{true}. -% \It{program@epstopdf} -% The name for the conversion program from EPS to PDF, -% default is `|epstopdf|'. -% \It{verbose} -% It prints some information about the image in the \xfile{.log} file -% (default). -% \end{description} -% -% \subsection{Configuration} -% -% \subsubsection{System configuration file \xfile{epstopdf-sys.cfg}} -% -% If \xfile{epstopdf-sys} exists it is loaded at the end of the -% package \xpackage{epstopdf-base} and before the user configuration -% file. It's intended for TeX distributors. Thus they could add -% additional conversion rules (e.g., .gif -> .png) or set options. -% -% \subsubsection{User configuration file \xfile{epstopdf.cfg}} -% -% A configuration file \xfile{epstopdf.cfg} is loaded at the end -% of the package if it exists. It can be used for changing -% the default option setting. Example: -% \begin{quote} -% |\epstopdfsetup{verbose=false}| -% \end{quote} -% -% \subsubsection{Conversion program} -% -% You can use \cs{DeclareGraphicsRule} in a similar way as the -% route via \xprogram{dvips} to specify the conversion -% command line. -% The conversion argument starts with a back tick, followed -% by the conversion command including parameters. -% -% The whole conversion argument should also be wrapped inside -% \cs{epstopdfcall}. This reduces the problem with packages -% (e.g. \xpackage{pst-pdf}) that use the conversion argument -% and expands it. Macros \cs{SourceFile}, \cs{OutputFile}, and -% \cs{SourceExt} are not defined outside \xpackage{epstopdf-base}'s -% \cs{Gin@setfile} and error messages because of undefined -% command names are the result. If \cs{epstopdfcall} detects that -% it is called outside \xpackage{epstopdf-base}'s \cs{Gin@setfile} -% then it replaces the conversion argument by -% package \xpackage{graphics}'s -% default, usually the image file. -% -% The following macros are available inside: -% \begin{description} -% \def\It#1{\item[\cs{#1}:]} -% \It{OutputFile}: output file name (with known path and extension) -% \It{SourceFile}: source file name (with known path and extension), -% usually the same as |#1|, -% \It{SourceExt}: source extension without leading dot. -% \end{description} -% -% \paragraph{Conversion from EPS to PDF.} -% Other programs than \xprogram{epstopdf} can be used to convert from -% EPS to PDF. Example that uses \xprogram{Ghostscript}: -% \begin{quote} -% |\DeclareGraphicsRule{.eps}{pdf}{.pdf}{%|\\ -% | \epstopdfcall{`ps2pdf -dEPSCrop #1 \noexpand\OutputFile}%|\\ -% |}| -% \end{quote} -% \cs{DeclareGraphicsRule} expands the argument, therefore \cs{noexpand} -% is necessary. As convenience package \xpackage{epstopdf-base} defines -% \cs{epstopdfDeclareGraphicsRule}. Then the conversion argument -% is not expanded, \cs{epstopdfcall} and the back tick are added: -% \begin{quote} -% |\epstopdfDeclareGraphicsRule{.eps}{pdf}{.pdf}{%|\\ -% | ps2pdf -dEPSCrop #1 \OutputFile|\\ -% |}| -% \end{quote} -% -% Also \cs{OutputFile} respects the setting of option \xoption{outdir}. -% -% \subsection{Other image formats} -% -% The support that package \xpackage{epstopdf} implements is not -% limited to EPS files. Other image conversions can be declared. -% The following example shows it for GIF images under Unix with -% ImageMagick's \xprogram{convert}: -%\begin{quote} -%\begin{verbatim} -%\epstopdfDeclareGraphicsRule{.gif}{png}{.png}{% -% convert #1 \OutputFile -%} -%\end{verbatim} -%\end{quote} -% The file extension \xfile{.gif} can be added to the extension list that -% package \xpackage{graphics} searches if the file extension -% is not given in \cs{includegraphics}. -% The list can be set by \cs{GraphicsExtensions}. -% \begin{quote} -% |\AppendGraphicsExtensions{.gif}|\\ -% or\\ -% |\PrependGraphicsExtensions{.gif}| -% \end{quote} -% -% \StopEventually{ -% } -% -% \section{Implementation} -% -% \begin{macrocode} -%<*package> -% \end{macrocode} -% -% \subsection{Wrapper package} -% -% Reload check, especially if the package is not used with \LaTeX. -% \begin{macrocode} -\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@epstopdf.sty\endcsname - \ifx\x\relax % plain-TeX, first loading - \else - \def\empty{}% - \ifx\x\empty % LaTeX, first loading, - % variable is initialized, but \ProvidesPackage not yet seen - \else - \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{epstopdf}{The package is already loaded}% - \aftergroup\endinput - \fi - \fi -\endgroup% -% \end{macrocode} -% Package identification: -% \begin{macrocode} -\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}% - \xdef#1{#4}% - }% - \else - \def\x#1#2[#3]{\endgroup - #2[{#3}]% - \ifx#1\@undefined - \xdef#1{#3}% - \fi - \ifx#1\relax - \xdef#1{#3}% - \fi - }% - \fi -\expandafter\x\csname ver@epstopdf.sty\endcsname -\ProvidesPackage{epstopdf}% - [2016/05/15 v2.6 Conversion with epstopdf on the fly (HO)]% -% \end{macrocode} -% Larger catcode set because of configuration files needed. -% \begin{macrocode} -\begingroup\catcode61\catcode48\catcode32=10\relax% - \catcode13=5 % ^^M - \endlinechar=13 % - \catcode123=1 % { - \catcode125=2 % } - \catcode64=11 % @ - \def\x{\endgroup - \expandafter\edef\csname ETE@AtEnd\endcsname{% - \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\catcode61\catcode48\catcode32=10\relax% -\catcode13=5 % ^^M -\endlinechar=13 % -\catcode35=6 % # -\catcode64=11 % @ -\catcode123=1 % { -\catcode125=2 % } -\def\TMP@EnsureCode#1#2{% - \edef\ETE@AtEnd{% - \ETE@AtEnd - \catcode#1=\the\catcode#1\relax - }% - \catcode#1=#2\relax -} -\TMP@EnsureCode{39}{12}% ' -\TMP@EnsureCode{40}{12}% ( -\TMP@EnsureCode{41}{12}% ) -\TMP@EnsureCode{42}{12}% * -\TMP@EnsureCode{45}{12}% - -\TMP@EnsureCode{47}{12}% / -\TMP@EnsureCode{91}{12}% [ -\TMP@EnsureCode{93}{12}% ] -\edef\ETE@AtEnd{\ETE@AtEnd\noexpand\endinput} -% \end{macrocode} -% -% \begin{macrocode} -\let\ETE@SavedAtEnd\ETE@AtEnd -\RequirePackage{epstopdf-base}[2016/05/15] -\let\ETE@AtEnd\ETE@SavedAtEnd -% \end{macrocode} -% -% \subsubsection{Option handling} -% -% \begin{macrocode} -\DeclareOption*{% - \expandafter\epstopdfsetup\expandafter{\CurrentOption}% -} -\ProcessOptions*\relax -% \end{macrocode} -% -% \begin{macrocode} -\ETE@AtEnd% -% -% \end{macrocode} -% -% \subsection{Base package} -% -% \begin{macrocode} -%<*base> -% \end{macrocode} -% -% \subsection{Preparations} -% -% \subsubsection{Relead check and identification} -% -% Reload check, especially if the package is not used with \LaTeX. -% \begin{macrocode} -\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@epstopdf-base.sty\endcsname - \ifx\x\relax % plain-TeX, first loading - \else - \def\empty{}% - \ifx\x\empty % LaTeX, first loading, - % variable is initialized, but \ProvidesPackage not yet seen - \else - \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{epstopdf-base}{The package is already loaded}% - \aftergroup\endinput - \fi - \fi -\endgroup% -% \end{macrocode} -% Package identification: -% \begin{macrocode} -\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}% - \xdef#1{#4}% - }% - \else - \def\x#1#2[#3]{\endgroup - #2[{#3}]% - \ifx#1\@undefined - \xdef#1{#3}% - \fi - \ifx#1\relax - \xdef#1{#3}% - \fi - }% - \fi -\expandafter\x\csname ver@epstopdf-base.sty\endcsname -\ProvidesPackage{epstopdf-base}% - [2016/05/15 v2.6 Base part for package epstopdf]% -% \end{macrocode} -% -% \subsubsection{Catcodes} -% -% \begin{macrocode} -\begingroup\catcode61\catcode48\catcode32=10\relax% - \catcode13=5 % ^^M - \endlinechar=13 % - \catcode123=1 % { - \catcode125=2 % } - \catcode64=11 % @ - \def\x{\endgroup - \expandafter\edef\csname ETE@AtEnd\endcsname{% - \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\catcode61\catcode48\catcode32=10\relax% -\catcode13=5 % ^^M -\endlinechar=13 % -\catcode35=6 % # -\catcode64=11 % @ -\catcode123=1 % { -\catcode125=2 % } -\def\TMP@EnsureCode#1#2{% - \edef\ETE@AtEnd{% - \ETE@AtEnd - \catcode#1=\the\catcode#1\relax - }% - \catcode#1=#2\relax -} -\TMP@EnsureCode{33}{12}% ! -\TMP@EnsureCode{39}{12}% ' -\TMP@EnsureCode{42}{12}% * -\TMP@EnsureCode{44}{12}% , -\TMP@EnsureCode{45}{12}% - -\TMP@EnsureCode{46}{12}% . -\TMP@EnsureCode{47}{12}% / -\TMP@EnsureCode{58}{12}% : -\TMP@EnsureCode{60}{12}% < -\TMP@EnsureCode{62}{12}% > -\TMP@EnsureCode{96}{12}% ` -\edef\ETE@AtEnd{\ETE@AtEnd\noexpand\endinput} -% \end{macrocode} -% -% \subsubsection{Load packages} -% -% \begin{macrocode} -\RequirePackage{infwarerr}[2007/09/09] -\RequirePackage{grfext}\relax -\RequirePackage{kvoptions}[2007/10/02] -\RequirePackage{pdftexcmds}[2007/11/11] -% \end{macrocode} -% -% \subsection{Checks} -% -% Check, whether package graphics is loaded -% (also graphicx loads graphics). -% Because miniltx.tex does not know \cs{@ifpackageloaded} -% we test for \cs{Gin@setfile} instead. -% \begin{macrocode} -\begingroup\expandafter\expandafter\expandafter\endgroup -\expandafter\ifx\csname Gin@setfile\endcsname\relax - \@PackageWarningNoLine{epstopdf}{% - No graphics package \string`graphic{s,x}\string' loaded% - }% - \newcommand*{\epstopdfsetup}[1]{}% - \expandafter\ETE@AtEnd -\fi% -% \end{macrocode} -% -% Check, whether pdftex.def is loaded. \cs{ver@pdftex.def} is not -% available with miniltx.tex, thus we test for \cs{Gin@driver}. -% \begin{macrocode} -\begingroup - \def\x{luatex.def}% - \ifx\Gin@driver\x - \else - \def\x{pdftex.def}% - \ifx\Gin@driver\x - \else - \@PackageWarningNoLine{epstopdf}{% - Drivers other than `pdftex' and `luatex' are not supported% - }% - \endgroup - \newcommand*{\epstopdfsetup}[1]{}% - \expandafter\ETE@AtEnd - \fi% - \fi% -\endgroup -% \end{macrocode} -% -% Check, whether the shell escape feature is enabled. -% -% \begin{macrocode} -\begingroup - \expandafter\ifx\csname pdf@shellescape\endcsname\relax - \else - \ifnum\pdf@shellescape>0 % - \else - \@PackageWarningNoLine{epstopdf}{% - Shell escape feature is not enabled% - }% - \fi - \fi -\endgroup -% \end{macrocode} -% -% \subsection{Package loading} -% -% \begin{macrocode} -% \end{macrocode} -% -% \subsection{Options} -% -% \begin{macrocode} -\SetupKeyvalOptions{family=ETE,prefix=ETE@} -\DeclareBoolOption{update} -\DeclareBoolOption{verbose} -\newif\ifETE@prepend -\DeclareVoidOption{prepend}{\ETE@prependtrue} -\DeclareVoidOption{append}{\ETE@prependfalse} -\DeclareStringOption{outdir} -\DeclareStringOption{suffix} -\DeclareBoolOption{prefersuffix} -\DeclareStringOption{program@epstopdf} -% \end{macrocode} -% Options \xoption{disable} and \xoption{enable} are for testing -% only. Therefore they are not documented on purpose. -% \begin{macrocode} -\DeclareBoolOption{disable} -\DeclareComplementaryOption{enable}{disable} -% \end{macrocode} -% \begin{macrocode} -\newcommand*{\epstopdfsetup}{\setkeys{ETE}} -% \end{macrocode} -% -% \subsubsection{Default setting} -% -% \begin{macrocode} -\epstopdfsetup{% - verbose,% - enable,% - append,% - update,% - prefersuffix,% - suffix=-\SourceExt-converted-to,% - program@epstopdf=epstopdf% -} -% \end{macrocode} -% -% \subsection{Make and verbose} -% -% \begin{macrocode} -\begingroup\expandafter\expandafter\expandafter\endgroup -\expandafter\ifx\csname pdf@filemoddate\endcsname\relax - \def\ETE@Make#1#2{% - \ifETE@update - \ETE@WarnModDate - \fi - \@firstofone - }% - \def\ETE@WarnModDate{% - \@PackageWarningNoLine{epstopdf}{% - \string\pdffilemoddate\space is not available,\MessageBreak - option `update' will be ignored% - }% - \global\let\ETE@WarnModDate\relax - }% - \def\ETE@FileInfo#1#2{#1 file: <#2>}% -\else - \def\ETE@Make#1#2{% - \ifETE@update - \ifnum\pdf@strcmp{\pdf@filemoddate{#1}}{\pdf@filemoddate{#2}}>0 % - \expandafter\expandafter\expandafter\@firstofone - \else - \@PackageInfoNoLine{epstopdf}{% - Output file is already uptodate% - }% - \expandafter\expandafter\expandafter\@gobble - \fi - \else - \expandafter\@firstofone - \fi - }% - \def\ETE@FileInfo#1#2{% - #1 file: <#2>% - \expandafter\expandafter\expandafter - \ETE@Date\pdf@filemoddate{#2}\@nil - \expandafter\expandafter\expandafter - \ETE@Size\pdf@filesize{#2}\@nil - }% - \def\ETE@Date#1\@nil{% - \ifx\\#1\\% - \else - \ETE@@Date#1\@nil - \fi - }% - \def\ETE@@Date#1:#2#3#4#5#6#7#8#9{% - \MessageBreak - \@spaces\space\space\space date: #2#3#4#5-#6#7-#8#9 % - \ETE@@Time - }% - \def\ETE@@Time#1#2#3#4#5#6#7\@nil{% - #1#2:#3#4:#5#6% - }% - \def\ETE@Size#1\@nil{% - \ifx\\#1\\% - \else - \MessageBreak - \@spaces\space\space\space size: #1 bytes% - \fi - }% -\fi -% \end{macrocode} -% -% \subsection{Adding conversion support} -% -% Patch \cs{Gin@setfile} to execute |#3|, if it contains -% a command. -% \begin{macrocode} -\expandafter\ifx\csname ETE@OrgGin@setfile\endcsname\relax - \let\ETE@OrgGin@setfile\Gin@setfile -\else - \@PackageError{epstopdf}{% - Command \string\ETE@OrgGin@setfile\space - already defined.\MessageBreak - }{% - Probably some package has included the code of this package% - \MessageBreak - instead of using \string\RequirePackage{epstopdf}.% - \MessageBreak - \@ehc - }% -\fi -\def\ETE@IfFileExists{% - \begingroup\expandafter\expandafter\expandafter\endgroup - \expandafter\ifx\csname grffile@IfFileExists\endcsname\relax - \expandafter\IfFileExists - \else - \global\let\ETE@IfFileExists\grffile@IfFileExists - \expandafter\grffile@IfFileExists - \fi -} -\def\ETE@Skip#1#2\x\fi\fi{% - \fi - \fi - \endgroup - \fi - \fi - #1% -} -\newif\ifETE@InsideSetfile -\newcommand*{\epstopdfcall}[1]{% - \ifETE@InsideSetfile - \expandafter\@firstoftwo - \else - \expandafter\@secondoftwo - \fi - {`#1}% - {\Gin@base\Gin@ext}% -} -\def\ETE@DefCommandLine#1{% - \edef\CommandLine{\expandafter\fi\if`#1}% -} -\def\ETE@DefX#1{% - \expandafter\expandafter\expandafter\def - \expandafter\expandafter\expandafter\x - \expandafter\expandafter\expandafter{% - \expandafter\fi\if`#1\relax\else - }% -} -\def\ETE@Gin@setfile#1#2#3{% - \ifETE@disable - \ETE@OrgGin@setfile{#1}{#2}{#3}% - \else - \begingroup - \ETE@InsideSetfiletrue - \ETE@DefX{#3}% - \expandafter\endgroup - \ifx\x\@empty - \ETE@OrgGin@setfile{#1}{#2}{#3}% - \else - \begingroup - \ETE@InsideSetfiletrue - \def\GraphicsType{#1}% - \def\GraphicsRead{#2}% - \ifETE@prefersuffix - \else - \ifx\ETE@suffix\@empty - \else - \ETE@IfFileExists{\Gin@base\GraphicsRead}{% - \ETE@Skip{% - \ETE@OrgGin@setfile{#1}{#2}{\Gin@base#2}% - }% - }{% - \let\next\relax - }% - \next - \fi - \fi - \ifx\Gin@ext\relax - \let\SourceExt\Gin@eext - \def\SourceFile{\Gin@base\Gin@eext}% - \else - \let\SourceExt\Gin@ext - \def\SourceFile{\Gin@base\Gin@ext}% - \fi - \edef\SourceExt{% remove dot - \expandafter\@cdr\SourceExt\@empty\@nil - }% - \let\OutputDirectory\ETE@outdir - \ifx\OutputDirectory\@empty - \edef\OutputFile{\ETE@GenerateName{\Gin@base}{#2}}% - \else - \begingroup - \filename@parse{\Gin@base#2}% - \edef\x{\endgroup - \def\noexpand\OutputFile{% - \ETE@GenerateName{% - \OutputDirectory\filename@base - }{#2}% - }% - }% - \x - \fi - \ETE@DefCommandLine{#3}% - \ifETE@verbose - \@PackageInfo{epstopdf}{% - \ETE@FileInfo{Source}\SourceFile\MessageBreak - \ETE@FileInfo{Output}\OutputFile\MessageBreak - Command: <\CommandLine>\MessageBreak - \string\includegraphics - }% - \fi - \ETE@Make\SourceFile\OutputFile{% - \pdf@system{\CommandLine}% - \ifETE@verbose - \@PackageInfoNoLine{epstopdf}{% - \ETE@FileInfo{Result}\OutputFile - }% - \fi - }% - \edef\x{\endgroup - \ifx\OutputDirectory\@empty - \else - \def\noexpand\Gin@base{% - \OutputDirectory\noexpand\filename@base - }% - \fi - \ifx\ETE@suffix\@empty - \else - \edef\noexpand\Gin@base{% - \noexpand\Gin@base\ETE@suffix - }% - \fi - \noexpand\ETE@OrgGin@setfile{% - \GraphicsType - }{% - \GraphicsRead - }{% - \OutputFile - }% - }% - \x - \fi - \fi -} -\let\Gin@setfile\ETE@Gin@setfile -\def\ETE@GenerateName#1#2{% - #1\ETE@suffix#2% -} -% \end{macrocode} -% -% \subsection{Declare graphics rule} -% -% \begin{macrocode} -\newcommand*{\epstopdfDeclareGraphicsRule}[4]{% - \ifx\\#4\\% - \@PackageError{epstopdf-base}{% - Conversion command is missing% - }\@ehc - \else - \begingroup - \@ifundefined{Gin@rule@#1}{% - }{% - \@PackageInfo{epstopdf-base}{% - Redefining graphics rule for `#1'% - }% - }% - \endgroup - \@namedef{Gin@rule@#1}##1{{#2}{#3}{\epstopdfcall{#4}}}% - \fi -} -% \end{macrocode} -% -% \cs{DeclareGraphicsRule} for .eps -% \begin{macrocode} -\epstopdfDeclareGraphicsRule{.eps}{pdf}{.pdf}{% - \ETE@epstopdf{#1}% -} -\def\ETE@epstopdf#1{% - \ETE@program@epstopdf\space - \ifcase\ifx\OutputDirectory\@empty - \ifx\ETE@suffix\@empty - 1% - \fi - \fi - 0 % - --outfile=\OutputFile\space - \fi - #1% -} -% \end{macrocode} -% -% \begin{macrocode} -\ifETE@prepend - \expandafter\PrependGraphicsExtensions -\else - \expandafter\AppendGraphicsExtensions -\fi -{.eps} -\let\ETE@prepend\@undefined -\DeclareVoidOption{prepend}{% - \PrependGraphicsExtensions{.eps}% -} -\let\ETE@append\@undefined -\DeclareVoidOption{append}{% - \AppendGraphicsExtensions{.eps}% -} -% \end{macrocode} -% -% \begin{macrocode} -\InputIfFileExists{epstopdf-sys.cfg}{}{} -\InputIfFileExists{epstopdf.cfg}{}{} -% \end{macrocode} -% -% \begin{macrocode} -\ETE@AtEnd% -% -% \end{macrocode} -% -% \section{Test} -% -% \subsection{Preface for standard catcode check} -% -% \begin{macrocode} -%<*test1> -\input miniltx.tex\relax -\def\Gin@driver{pdftex.def} -\input graphicx.sty\relax -\resetatcatcode -% -% \end{macrocode} -% -% \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 epstopdf.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} -% -% \end{macrocode} -% -% \section{Installation} -% -% \subsection{Download} -% -% \paragraph{Package.} This package is available on -% CTAN\footnote{\CTANpkg{epstopdf}}: -% \begin{description} -% \item[\CTAN{macros/latex/contrib/oberdiek/epstopdf.dtx}] The source file. -% \item[\CTAN{macros/latex/contrib/oberdiek/epstopdf.pdf}] Documentation. -% \end{description} -% -% -% \paragraph{Bundle.} All the packages of the bundle `oberdiek' -% are also available in a TDS compliant ZIP archive. There -% the packages are already unpacked and the documentation files -% are generated. The files and directories obey the TDS standard. -% \begin{description} -% \item[\CTANinstall{install/macros/latex/contrib/oberdiek.tds.zip}] -% \end{description} -% \emph{TDS} refers to the standard ``A Directory Structure -% for \TeX\ Files'' (\CTAN{tds/tds.pdf}). Directories -% with \xfile{texmf} in their name are usually organized this way. -% -% \subsection{Bundle installation} -% -% \paragraph{Unpacking.} Unpack the \xfile{oberdiek.tds.zip} in the -% TDS tree (also known as \xfile{texmf} tree) of your choice. -% Example (linux): -% \begin{quote} -% |unzip oberdiek.tds.zip -d ~/texmf| -% \end{quote} -% -% \paragraph{Script installation.} -% Check the directory \xfile{TDS:scripts/oberdiek/} for -% scripts that need further installation steps. -% Package \xpackage{attachfile2} comes with the Perl script -% \xfile{pdfatfi.pl} that should be installed in such a way -% that it can be called as \texttt{pdfatfi}. -% Example (linux): -% \begin{quote} -% |chmod +x scripts/oberdiek/pdfatfi.pl|\\ -% |cp scripts/oberdiek/pdfatfi.pl /usr/local/bin/| -% \end{quote} -% -% \subsection{Package installation} -% -% \paragraph{Unpacking.} The \xfile{.dtx} file is a self-extracting -% \docstrip\ archive. The files are extracted by running the -% \xfile{.dtx} through \plainTeX: -% \begin{quote} -% \verb|tex epstopdf.dtx| -% \end{quote} -% -% \paragraph{TDS.} Now the different files must be moved into -% the different directories in your installation TDS tree -% (also known as \xfile{texmf} tree): -% \begin{quote} -% \def\t{^^A -% \begin{tabular}{@{}>{\ttfamily}l@{ $\rightarrow$ }>{\ttfamily}l@{}} -% epstopdf.sty & tex/latex/oberdiek/epstopdf.sty\\ -% epstopdf-base.sty & tex/latex/oberdiek/epstopdf-base.sty\\ -% epstopdf.pdf & doc/latex/oberdiek/epstopdf.pdf\\ -% test/epstopdf-test1.tex & doc/latex/oberdiek/test/epstopdf-test1.tex\\ -% epstopdf.dtx & source/latex/oberdiek/epstopdf.dtx\\ -% \end{tabular}^^A -% }^^A -% \sbox0{\t}^^A -% \ifdim\wd0>\linewidth -% \begingroup -% \advance\linewidth by\leftmargin -% \advance\linewidth by\rightmargin -% \edef\x{\endgroup -% \def\noexpand\lw{\the\linewidth}^^A -% }\x -% \def\lwbox{^^A -% \leavevmode -% \hbox to \linewidth{^^A -% \kern-\leftmargin\relax -% \hss -% \usebox0 -% \hss -% \kern-\rightmargin\relax -% }^^A -% }^^A -% \ifdim\wd0>\lw -% \sbox0{\small\t}^^A -% \ifdim\wd0>\linewidth -% \ifdim\wd0>\lw -% \sbox0{\footnotesize\t}^^A -% \ifdim\wd0>\linewidth -% \ifdim\wd0>\lw -% \sbox0{\scriptsize\t}^^A -% \ifdim\wd0>\linewidth -% \ifdim\wd0>\lw -% \sbox0{\tiny\t}^^A -% \ifdim\wd0>\linewidth -% \lwbox -% \else -% \usebox0 -% \fi -% \else -% \lwbox -% \fi -% \else -% \usebox0 -% \fi -% \else -% \lwbox -% \fi -% \else -% \usebox0 -% \fi -% \else -% \lwbox -% \fi -% \else -% \usebox0 -% \fi -% \else -% \lwbox -% \fi -% \else -% \usebox0 -% \fi -% \end{quote} -% If you have a \xfile{docstrip.cfg} that configures and enables \docstrip's -% TDS installing feature, then some files can already be in the right -% place, see the documentation of \docstrip. -% -% \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 -% \verb|mktexlsr|. -% -% \subsection{Some details for the interested} -% -% \paragraph{Unpacking with \LaTeX.} -% The \xfile{.dtx} chooses its action depending on the format: -% \begin{description} -% \item[\plainTeX:] Run \docstrip\ and extract the files. -% \item[\LaTeX:] Generate the documentation. -% \end{description} -% If you insist on using \LaTeX\ for \docstrip\ (really, -% \docstrip\ does not need \LaTeX), then inform the autodetect routine -% about your intention: -% \begin{quote} -% \verb|latex \let\install=y\input{epstopdf.dtx}| -% \end{quote} -% Do not forget to quote the argument according to the demands -% of your shell. -% -% \paragraph{Generating the documentation.} -% You can use both the \xfile{.dtx} or the \xfile{.drv} to generate -% the documentation. The process can be configured by the -% configuration file \xfile{ltxdoc.cfg}. For instance, put this -% line into this file, if you want to have A4 as paper format: -% \begin{quote} -% \verb|\PassOptionsToClass{a4paper}{article}| -% \end{quote} -% An example follows how to generate the -% documentation with pdf\LaTeX: -% \begin{quote} -%\begin{verbatim} -%pdflatex epstopdf.dtx -%makeindex -s gind.ist epstopdf.idx -%pdflatex epstopdf.dtx -%makeindex -s gind.ist epstopdf.idx -%pdflatex epstopdf.dtx -%\end{verbatim} -% \end{quote} -% -% \begin{History} -% \begin{Version}{2001/01/06 v1.0} -% \item -% First public version, -% published in the \pdfTeX\ mailing list. -% \end{Version} -% \begin{Version}{2001/02/04 v1.1} -% \item -% Minor documentation update. -% \item -% CTAN. -% \end{Version} -% \begin{Version}{2006/02/20 v1.2} -% \item -% DTX framework. -% \item -% Compatibility for \xfile{miniltx.tex}. -% \end{Version} -% \begin{Version}{2006/08/26 v1.3} -% \item -% Check for \cs{write18} if available and print a warning -% if the feature is not enabled. -% \end{Version} -% \begin{Version}{2007/04/26 v1.4} -% \item -% Documentation rewritten and extended. -% \end{Version} -% \begin{Version}{2007/10/02 v1.5} -% \item -% New option \xoption{update}: If the converted file exists, it will be only -% converted if it is out of date. -% \item -% Updating the extension list is delegated to package \xpackage{grfext}. -% Fine tuning is done by the new options \xoption{append}, \xoption{prepend}. -% \item -% New option \xoption{outdir} for changing the output directory. -% \item -% New option \xoption{verbose}. -% \item -% \cs{SourceFile} and \cs{OutputFile} introduced. -% \item -% Configuration file support added. -% \end{Version} -% \begin{Version}{2007/11/11 v1.6} -% \item -% Use of package \xpackage{pdftexcmds} for \LuaTeX\ support. -% \end{Version} -% \begin{Version}{2008/05/06 v1.7} -% \item -% Warning messages uses ``loaded'' instead of ``found''. -% \end{Version} -% \begin{Version}{2009/03/01 v1.8} -% \item -% Warning message for missing \xfile{pdftex.def} changed. -% \end{Version} -% \begin{Version}{2009/07/06 v1.9} -% \item -% Option \xoption{suffix} added. -% \end{Version} -% \begin{Version}{2009/07/07 v1.10} -% \item -% \cs{SourceExt} added. -% \item -% If option \xoption{suffix} is set, the inclusion of -% an image without the suffix namespace is preferred over generating the -% the image within the suffix namespace. -% \end{Version} -% \begin{Version}{2009/07/12 v2.0} -% \item -% New default settings. -% \item -% Package is split into \xpackage{epstopdf} that only takes package -% options and loads \xpackage{epstopdf-base} that does the work. -% \item -% \cs{epstopdfDeclareGraphicsRule} and \cs{epstopdfcall} added. -% \item -% \xfile{epstopdf-sys.cfg} is loaded before \xfile{epstopdf.cfg} -% if \xfile{epstopdf-sys.cfg} exists. -% \end{Version} -% \begin{Version}{2009/07/15 v2.1} -% \item -% Default setting: \xoption{verbose} is now turned on as the -% documentation for v2.0 said. -% \item -% Documentation fixes. -% \end{Version} -% \begin{Version}{2009/07/16 v2.2} -% \item -% Fixed redefined \cs{Gin@setfile}. -% \item -% Documentation extended for package options. -% \end{Version} -% \begin{Version}{2009/09/24 v2.3} -% \item -% Bug fix for the case that both option \xoption{suffix} and -% \xoption{outdir} are used. -% \end{Version} -% \begin{Version}{2009/10/17 v2.4} -% \item -% The name of the program `epstopdf' can be configured via -% the new option \xoption{program@epstopdf}. -% \end{Version} -% \begin{Version}{2016/05/15 v2.5} -% \item -% Wording of warning message fixed (Karl Berry). -% \item -% \cs{ETE@Gin@setfile} added (Karl Berry). -% \end{Version} -% \begin{Version}{2016/05/15 v2.6} -% \item -% luaTeX compatibility -% \end{Version} -% \end{History} -% -% \PrintIndex -% -% \Finale -\endinput diff --git a/macros/latex/contrib/oberdiek/epstopdf.pdf b/macros/latex/contrib/oberdiek/epstopdf.pdf deleted file mode 100644 index 2245631c92..0000000000 Binary files a/macros/latex/contrib/oberdiek/epstopdf.pdf and /dev/null differ diff --git a/macros/latex/contrib/oberdiek/etexcmds.dtx b/macros/latex/contrib/oberdiek/etexcmds.dtx index b34e4d9891..ccbc050951 100644 --- a/macros/latex/contrib/oberdiek/etexcmds.dtx +++ b/macros/latex/contrib/oberdiek/etexcmds.dtx @@ -762,14 +762,6 @@ and the derived files % \paragraph{Script installation.} % Check the directory \xfile{TDS:scripts/oberdiek/} for % scripts that need further installation steps. -% Package \xpackage{attachfile2} comes with the Perl script -% \xfile{pdfatfi.pl} that should be installed in such a way -% that it can be called as \texttt{pdfatfi}. -% Example (linux): -% \begin{quote} -% |chmod +x scripts/oberdiek/pdfatfi.pl|\\ -% |cp scripts/oberdiek/pdfatfi.pl /usr/local/bin/| -% \end{quote} % % \subsection{Package installation} % diff --git a/macros/latex/contrib/oberdiek/etexcmds.pdf b/macros/latex/contrib/oberdiek/etexcmds.pdf index 66cb7f202a..e3d8d2698d 100644 Binary files a/macros/latex/contrib/oberdiek/etexcmds.pdf and b/macros/latex/contrib/oberdiek/etexcmds.pdf differ diff --git a/macros/latex/contrib/oberdiek/fibnum.dtx b/macros/latex/contrib/oberdiek/fibnum.dtx index 5fb29a91f2..2da9127410 100644 --- a/macros/latex/contrib/oberdiek/fibnum.dtx +++ b/macros/latex/contrib/oberdiek/fibnum.dtx @@ -1014,14 +1014,6 @@ and the derived files % \paragraph{Script installation.} % Check the directory \xfile{TDS:scripts/oberdiek/} for % scripts that need further installation steps. -% Package \xpackage{attachfile2} comes with the Perl script -% \xfile{pdfatfi.pl} that should be installed in such a way -% that it can be called as \texttt{pdfatfi}. -% Example (linux): -% \begin{quote} -% |chmod +x scripts/oberdiek/pdfatfi.pl|\\ -% |cp scripts/oberdiek/pdfatfi.pl /usr/local/bin/| -% \end{quote} % % \subsection{Package installation} % diff --git a/macros/latex/contrib/oberdiek/fibnum.pdf b/macros/latex/contrib/oberdiek/fibnum.pdf index 2daaba8c3a..7bed8c0826 100644 Binary files a/macros/latex/contrib/oberdiek/fibnum.pdf and b/macros/latex/contrib/oberdiek/fibnum.pdf differ diff --git a/macros/latex/contrib/oberdiek/flags.dtx b/macros/latex/contrib/oberdiek/flags.dtx index 2de01a65a0..0be6f023d7 100644 --- a/macros/latex/contrib/oberdiek/flags.dtx +++ b/macros/latex/contrib/oberdiek/flags.dtx @@ -507,14 +507,6 @@ and the derived files % \paragraph{Script installation.} % Check the directory \xfile{TDS:scripts/oberdiek/} for % scripts that need further installation steps. -% Package \xpackage{attachfile2} comes with the Perl script -% \xfile{pdfatfi.pl} that should be installed in such a way -% that it can be called as \texttt{pdfatfi}. -% Example (linux): -% \begin{quote} -% |chmod +x scripts/oberdiek/pdfatfi.pl|\\ -% |cp scripts/oberdiek/pdfatfi.pl /usr/local/bin/| -% \end{quote} % % \subsection{Package installation} % diff --git a/macros/latex/contrib/oberdiek/flags.pdf b/macros/latex/contrib/oberdiek/flags.pdf index 4d68750740..b974adc59f 100644 Binary files a/macros/latex/contrib/oberdiek/flags.pdf and b/macros/latex/contrib/oberdiek/flags.pdf differ diff --git a/macros/latex/contrib/oberdiek/gettitlestring.dtx b/macros/latex/contrib/oberdiek/gettitlestring.dtx index a99f0af4ee..7af4516a66 100644 --- a/macros/latex/contrib/oberdiek/gettitlestring.dtx +++ b/macros/latex/contrib/oberdiek/gettitlestring.dtx @@ -801,14 +801,6 @@ and the derived files % \paragraph{Script installation.} % Check the directory \xfile{TDS:scripts/oberdiek/} for % scripts that need further installation steps. -% Package \xpackage{attachfile2} comes with the Perl script -% \xfile{pdfatfi.pl} that should be installed in such a way -% that it can be called as \texttt{pdfatfi}. -% Example (linux): -% \begin{quote} -% |chmod +x scripts/oberdiek/pdfatfi.pl|\\ -% |cp scripts/oberdiek/pdfatfi.pl /usr/local/bin/| -% \end{quote} % % \subsection{Package installation} % diff --git a/macros/latex/contrib/oberdiek/gettitlestring.pdf b/macros/latex/contrib/oberdiek/gettitlestring.pdf index c750737b38..3037ca2109 100644 Binary files a/macros/latex/contrib/oberdiek/gettitlestring.pdf and b/macros/latex/contrib/oberdiek/gettitlestring.pdf differ diff --git a/macros/latex/contrib/oberdiek/grfext.dtx b/macros/latex/contrib/oberdiek/grfext.dtx index 8ebd84fa4a..f0f2910e83 100644 --- a/macros/latex/contrib/oberdiek/grfext.dtx +++ b/macros/latex/contrib/oberdiek/grfext.dtx @@ -972,14 +972,6 @@ and the derived files % \paragraph{Script installation.} % Check the directory \xfile{TDS:scripts/oberdiek/} for % scripts that need further installation steps. -% Package \xpackage{attachfile2} comes with the Perl script -% \xfile{pdfatfi.pl} that should be installed in such a way -% that it can be called as \texttt{pdfatfi}. -% Example (linux): -% \begin{quote} -% |chmod +x scripts/oberdiek/pdfatfi.pl|\\ -% |cp scripts/oberdiek/pdfatfi.pl /usr/local/bin/| -% \end{quote} % % \subsection{Package installation} % diff --git a/macros/latex/contrib/oberdiek/grfext.pdf b/macros/latex/contrib/oberdiek/grfext.pdf index f756c2bce0..26b796e92a 100644 Binary files a/macros/latex/contrib/oberdiek/grfext.pdf and b/macros/latex/contrib/oberdiek/grfext.pdf differ diff --git a/macros/latex/contrib/oberdiek/hologo.dtx b/macros/latex/contrib/oberdiek/hologo.dtx index 8b3d38914e..8d4e216205 100644 --- a/macros/latex/contrib/oberdiek/hologo.dtx +++ b/macros/latex/contrib/oberdiek/hologo.dtx @@ -4732,14 +4732,6 @@ $ #1{\string ^^^^0395}{\string ^^^^03b5}% % \paragraph{Script installation.} % Check the directory \xfile{TDS:scripts/oberdiek/} for % scripts that need further installation steps. -% Package \xpackage{attachfile2} comes with the Perl script -% \xfile{pdfatfi.pl} that should be installed in such a way -% that it can be called as \texttt{pdfatfi}. -% Example (linux): -% \begin{quote} -% |chmod +x scripts/oberdiek/pdfatfi.pl|\\ -% |cp scripts/oberdiek/pdfatfi.pl /usr/local/bin/| -% \end{quote} % % \subsection{Package installation} % diff --git a/macros/latex/contrib/oberdiek/hologo.pdf b/macros/latex/contrib/oberdiek/hologo.pdf index a5ff0a727b..8ce9820d88 100644 Binary files a/macros/latex/contrib/oberdiek/hologo.pdf and b/macros/latex/contrib/oberdiek/hologo.pdf differ diff --git a/macros/latex/contrib/oberdiek/holtxdoc.dtx b/macros/latex/contrib/oberdiek/holtxdoc.dtx index 62debb1dae..b08f46f77d 100644 --- a/macros/latex/contrib/oberdiek/holtxdoc.dtx +++ b/macros/latex/contrib/oberdiek/holtxdoc.dtx @@ -580,14 +580,6 @@ and the derived files % \paragraph{Script installation.} % Check the directory \xfile{TDS:scripts/oberdiek/} for % scripts that need further installation steps. -% Package \xpackage{attachfile2} comes with the Perl script -% \xfile{pdfatfi.pl} that should be installed in such a way -% that it can be called as \texttt{pdfatfi}. -% Example (linux): -% \begin{quote} -% |chmod +x scripts/oberdiek/pdfatfi.pl|\\ -% |cp scripts/oberdiek/pdfatfi.pl /usr/local/bin/| -% \end{quote} % % \subsection{Package installation} % diff --git a/macros/latex/contrib/oberdiek/holtxdoc.pdf b/macros/latex/contrib/oberdiek/holtxdoc.pdf index ecd091880c..64d0578a3f 100644 Binary files a/macros/latex/contrib/oberdiek/holtxdoc.pdf and b/macros/latex/contrib/oberdiek/holtxdoc.pdf differ diff --git a/macros/latex/contrib/oberdiek/hopatch.dtx b/macros/latex/contrib/oberdiek/hopatch.dtx index 259be51436..8782afcdf8 100644 --- a/macros/latex/contrib/oberdiek/hopatch.dtx +++ b/macros/latex/contrib/oberdiek/hopatch.dtx @@ -720,14 +720,6 @@ and the derived files % \paragraph{Script installation.} % Check the directory \xfile{TDS:scripts/oberdiek/} for % scripts that need further installation steps. -% Package \xpackage{attachfile2} comes with the Perl script -% \xfile{pdfatfi.pl} that should be installed in such a way -% that it can be called as \texttt{pdfatfi}. -% Example (linux): -% \begin{quote} -% |chmod +x scripts/oberdiek/pdfatfi.pl|\\ -% |cp scripts/oberdiek/pdfatfi.pl /usr/local/bin/| -% \end{quote} % % \subsection{Package installation} % diff --git a/macros/latex/contrib/oberdiek/hopatch.pdf b/macros/latex/contrib/oberdiek/hopatch.pdf index 614aa20e65..cfca55a7ea 100644 Binary files a/macros/latex/contrib/oberdiek/hopatch.pdf and b/macros/latex/contrib/oberdiek/hopatch.pdf differ diff --git a/macros/latex/contrib/oberdiek/hycolor.dtx b/macros/latex/contrib/oberdiek/hycolor.dtx index 85f2903936..5370ed03c4 100644 --- a/macros/latex/contrib/oberdiek/hycolor.dtx +++ b/macros/latex/contrib/oberdiek/hycolor.dtx @@ -1996,14 +1996,6 @@ and the derived files % \paragraph{Script installation.} % Check the directory \xfile{TDS:scripts/oberdiek/} for % scripts that need further installation steps. -% Package \xpackage{attachfile2} comes with the Perl script -% \xfile{pdfatfi.pl} that should be installed in such a way -% that it can be called as \texttt{pdfatfi}. -% Example (linux): -% \begin{quote} -% |chmod +x scripts/oberdiek/pdfatfi.pl|\\ -% |cp scripts/oberdiek/pdfatfi.pl /usr/local/bin/| -% \end{quote} % % \subsection{Package installation} % diff --git a/macros/latex/contrib/oberdiek/hycolor.pdf b/macros/latex/contrib/oberdiek/hycolor.pdf index 65bd09f63f..67bd050df9 100644 Binary files a/macros/latex/contrib/oberdiek/hycolor.pdf and b/macros/latex/contrib/oberdiek/hycolor.pdf differ diff --git a/macros/latex/contrib/oberdiek/hypbmsec.dtx b/macros/latex/contrib/oberdiek/hypbmsec.dtx index 60a716fca8..e90890d3bb 100644 --- a/macros/latex/contrib/oberdiek/hypbmsec.dtx +++ b/macros/latex/contrib/oberdiek/hypbmsec.dtx @@ -634,14 +634,6 @@ and the derived files % \paragraph{Script installation.} % Check the directory \xfile{TDS:scripts/oberdiek/} for % scripts that need further installation steps. -% Package \xpackage{attachfile2} comes with the Perl script -% \xfile{pdfatfi.pl} that should be installed in such a way -% that it can be called as \texttt{pdfatfi}. -% Example (linux): -% \begin{quote} -% |chmod +x scripts/oberdiek/pdfatfi.pl|\\ -% |cp scripts/oberdiek/pdfatfi.pl /usr/local/bin/| -% \end{quote} % % \subsection{Package installation} % diff --git a/macros/latex/contrib/oberdiek/hypbmsec.pdf b/macros/latex/contrib/oberdiek/hypbmsec.pdf index e3d7743e3c..ef23aa4c87 100644 Binary files a/macros/latex/contrib/oberdiek/hypbmsec.pdf and b/macros/latex/contrib/oberdiek/hypbmsec.pdf differ diff --git a/macros/latex/contrib/oberdiek/hypcap.dtx b/macros/latex/contrib/oberdiek/hypcap.dtx index 9ef57eb82e..2a51a21d74 100644 --- a/macros/latex/contrib/oberdiek/hypcap.dtx +++ b/macros/latex/contrib/oberdiek/hypcap.dtx @@ -543,14 +543,6 @@ and the derived files % \paragraph{Script installation.} % Check the directory \xfile{TDS:scripts/oberdiek/} for % scripts that need further installation steps. -% Package \xpackage{attachfile2} comes with the Perl script -% \xfile{pdfatfi.pl} that should be installed in such a way -% that it can be called as \texttt{pdfatfi}. -% Example (linux): -% \begin{quote} -% |chmod +x scripts/oberdiek/pdfatfi.pl|\\ -% |cp scripts/oberdiek/pdfatfi.pl /usr/local/bin/| -% \end{quote} % % \subsection{Package installation} % diff --git a/macros/latex/contrib/oberdiek/hypcap.pdf b/macros/latex/contrib/oberdiek/hypcap.pdf index eb0ee6e7af..b90dd42fd1 100644 Binary files a/macros/latex/contrib/oberdiek/hypcap.pdf and b/macros/latex/contrib/oberdiek/hypcap.pdf differ diff --git a/macros/latex/contrib/oberdiek/hypdestopt.dtx b/macros/latex/contrib/oberdiek/hypdestopt.dtx index b8c9a76df0..e0d604d69a 100644 --- a/macros/latex/contrib/oberdiek/hypdestopt.dtx +++ b/macros/latex/contrib/oberdiek/hypdestopt.dtx @@ -798,14 +798,6 @@ and the derived files % \paragraph{Script installation.} % Check the directory \xfile{TDS:scripts/oberdiek/} for % scripts that need further installation steps. -% Package \xpackage{attachfile2} comes with the Perl script -% \xfile{pdfatfi.pl} that should be installed in such a way -% that it can be called as \texttt{pdfatfi}. -% Example (linux): -% \begin{quote} -% |chmod +x scripts/oberdiek/pdfatfi.pl|\\ -% |cp scripts/oberdiek/pdfatfi.pl /usr/local/bin/| -% \end{quote} % % \subsection{Package installation} % diff --git a/macros/latex/contrib/oberdiek/hypdestopt.pdf b/macros/latex/contrib/oberdiek/hypdestopt.pdf index 8c5809d295..a2f929825c 100644 Binary files a/macros/latex/contrib/oberdiek/hypdestopt.pdf and b/macros/latex/contrib/oberdiek/hypdestopt.pdf differ diff --git a/macros/latex/contrib/oberdiek/hypdoc.dtx b/macros/latex/contrib/oberdiek/hypdoc.dtx index 7d37511812..b185b416b2 100644 --- a/macros/latex/contrib/oberdiek/hypdoc.dtx +++ b/macros/latex/contrib/oberdiek/hypdoc.dtx @@ -1179,14 +1179,6 @@ and the derived files % \paragraph{Script installation.} % Check the directory \xfile{TDS:scripts/oberdiek/} for % scripts that need further installation steps. -% Package \xpackage{attachfile2} comes with the Perl script -% \xfile{pdfatfi.pl} that should be installed in such a way -% that it can be called as \texttt{pdfatfi}. -% Example (linux): -% \begin{quote} -% |chmod +x scripts/oberdiek/pdfatfi.pl|\\ -% |cp scripts/oberdiek/pdfatfi.pl /usr/local/bin/| -% \end{quote} % % \subsection{Package installation} % diff --git a/macros/latex/contrib/oberdiek/hypdoc.pdf b/macros/latex/contrib/oberdiek/hypdoc.pdf index 9cbdc090c4..c37c6938b2 100644 Binary files a/macros/latex/contrib/oberdiek/hypdoc.pdf and b/macros/latex/contrib/oberdiek/hypdoc.pdf differ diff --git a/macros/latex/contrib/oberdiek/hypgotoe.dtx b/macros/latex/contrib/oberdiek/hypgotoe.dtx index ecf5b50782..ec03d08f3b 100644 --- a/macros/latex/contrib/oberdiek/hypgotoe.dtx +++ b/macros/latex/contrib/oberdiek/hypgotoe.dtx @@ -522,14 +522,6 @@ Anker foobar is here. % \paragraph{Script installation.} % Check the directory \xfile{TDS:scripts/oberdiek/} for % scripts that need further installation steps. -% Package \xpackage{attachfile2} comes with the Perl script -% \xfile{pdfatfi.pl} that should be installed in such a way -% that it can be called as \texttt{pdfatfi}. -% Example (linux): -% \begin{quote} -% |chmod +x scripts/oberdiek/pdfatfi.pl|\\ -% |cp scripts/oberdiek/pdfatfi.pl /usr/local/bin/| -% \end{quote} % % \subsection{Package installation} % diff --git a/macros/latex/contrib/oberdiek/hypgotoe.pdf b/macros/latex/contrib/oberdiek/hypgotoe.pdf index 39b5f67c81..891b138e51 100644 Binary files a/macros/latex/contrib/oberdiek/hypgotoe.pdf and b/macros/latex/contrib/oberdiek/hypgotoe.pdf differ diff --git a/macros/latex/contrib/oberdiek/hyphsubst.dtx b/macros/latex/contrib/oberdiek/hyphsubst.dtx index 50e8de4636..1d16f8347e 100644 --- a/macros/latex/contrib/oberdiek/hyphsubst.dtx +++ b/macros/latex/contrib/oberdiek/hyphsubst.dtx @@ -763,14 +763,6 @@ and the derived files % \paragraph{Script installation.} % Check the directory \xfile{TDS:scripts/oberdiek/} for % scripts that need further installation steps. -% Package \xpackage{attachfile2} comes with the Perl script -% \xfile{pdfatfi.pl} that should be installed in such a way -% that it can be called as \texttt{pdfatfi}. -% Example (linux): -% \begin{quote} -% |chmod +x scripts/oberdiek/pdfatfi.pl|\\ -% |cp scripts/oberdiek/pdfatfi.pl /usr/local/bin/| -% \end{quote} % % \subsection{Package installation} % diff --git a/macros/latex/contrib/oberdiek/hyphsubst.pdf b/macros/latex/contrib/oberdiek/hyphsubst.pdf index adcaaea2e5..4221328b6f 100644 Binary files a/macros/latex/contrib/oberdiek/hyphsubst.pdf and b/macros/latex/contrib/oberdiek/hyphsubst.pdf differ diff --git a/macros/latex/contrib/oberdiek/ifdraft.dtx b/macros/latex/contrib/oberdiek/ifdraft.dtx index fb5e0a22bb..6f4346cc3e 100644 --- a/macros/latex/contrib/oberdiek/ifdraft.dtx +++ b/macros/latex/contrib/oberdiek/ifdraft.dtx @@ -371,14 +371,6 @@ and the derived files % \paragraph{Script installation.} % Check the directory \xfile{TDS:scripts/oberdiek/} for % scripts that need further installation steps. -% Package \xpackage{attachfile2} comes with the Perl script -% \xfile{pdfatfi.pl} that should be installed in such a way -% that it can be called as \texttt{pdfatfi}. -% Example (linux): -% \begin{quote} -% |chmod +x scripts/oberdiek/pdfatfi.pl|\\ -% |cp scripts/oberdiek/pdfatfi.pl /usr/local/bin/| -% \end{quote} % % \subsection{Package installation} % diff --git a/macros/latex/contrib/oberdiek/ifdraft.pdf b/macros/latex/contrib/oberdiek/ifdraft.pdf index 61b4f95bd5..1778fe4fab 100644 Binary files a/macros/latex/contrib/oberdiek/ifdraft.pdf and b/macros/latex/contrib/oberdiek/ifdraft.pdf differ diff --git a/macros/latex/contrib/oberdiek/iflang.dtx b/macros/latex/contrib/oberdiek/iflang.dtx index f5d1303239..608411678f 100644 --- a/macros/latex/contrib/oberdiek/iflang.dtx +++ b/macros/latex/contrib/oberdiek/iflang.dtx @@ -1023,14 +1023,6 @@ and the derived files % \paragraph{Script installation.} % Check the directory \xfile{TDS:scripts/oberdiek/} for % scripts that need further installation steps. -% Package \xpackage{attachfile2} comes with the Perl script -% \xfile{pdfatfi.pl} that should be installed in such a way -% that it can be called as \texttt{pdfatfi}. -% Example (linux): -% \begin{quote} -% |chmod +x scripts/oberdiek/pdfatfi.pl|\\ -% |cp scripts/oberdiek/pdfatfi.pl /usr/local/bin/| -% \end{quote} % % \subsection{Package installation} % diff --git a/macros/latex/contrib/oberdiek/iflang.pdf b/macros/latex/contrib/oberdiek/iflang.pdf index 5a903f19f4..3edc46a927 100644 Binary files a/macros/latex/contrib/oberdiek/iflang.pdf and b/macros/latex/contrib/oberdiek/iflang.pdf differ diff --git a/macros/latex/contrib/oberdiek/infwarerr.dtx b/macros/latex/contrib/oberdiek/infwarerr.dtx index 89003edc2c..e95d9733d6 100644 --- a/macros/latex/contrib/oberdiek/infwarerr.dtx +++ b/macros/latex/contrib/oberdiek/infwarerr.dtx @@ -1036,14 +1036,6 @@ and the derived files % \paragraph{Script installation.} % Check the directory \xfile{TDS:scripts/oberdiek/} for % scripts that need further installation steps. -% Package \xpackage{attachfile2} comes with the Perl script -% \xfile{pdfatfi.pl} that should be installed in such a way -% that it can be called as \texttt{pdfatfi}. -% Example (linux): -% \begin{quote} -% |chmod +x scripts/oberdiek/pdfatfi.pl|\\ -% |cp scripts/oberdiek/pdfatfi.pl /usr/local/bin/| -% \end{quote} % % \subsection{Package installation} % diff --git a/macros/latex/contrib/oberdiek/infwarerr.pdf b/macros/latex/contrib/oberdiek/infwarerr.pdf index 1d196229aa..2c8fabc81c 100644 Binary files a/macros/latex/contrib/oberdiek/infwarerr.pdf and b/macros/latex/contrib/oberdiek/infwarerr.pdf differ diff --git a/macros/latex/contrib/oberdiek/inputenx.dtx b/macros/latex/contrib/oberdiek/inputenx.dtx index 25688526bb..cab72230e5 100644 --- a/macros/latex/contrib/oberdiek/inputenx.dtx +++ b/macros/latex/contrib/oberdiek/inputenx.dtx @@ -11788,14 +11788,6 @@ and the derived files % \paragraph{Script installation.} % Check the directory \xfile{TDS:scripts/oberdiek/} for % scripts that need further installation steps. -% Package \xpackage{attachfile2} comes with the Perl script -% \xfile{pdfatfi.pl} that should be installed in such a way -% that it can be called as \texttt{pdfatfi}. -% Example (linux): -% \begin{quote} -% |chmod +x scripts/oberdiek/pdfatfi.pl|\\ -% |cp scripts/oberdiek/pdfatfi.pl /usr/local/bin/| -% \end{quote} % % \subsection{Package installation} % diff --git a/macros/latex/contrib/oberdiek/inputenx.pdf b/macros/latex/contrib/oberdiek/inputenx.pdf index b203bf17d6..3a0c1ed620 100644 Binary files a/macros/latex/contrib/oberdiek/inputenx.pdf and b/macros/latex/contrib/oberdiek/inputenx.pdf differ diff --git a/macros/latex/contrib/oberdiek/intcalc.dtx b/macros/latex/contrib/oberdiek/intcalc.dtx index d52390fa74..226b69c92d 100644 --- a/macros/latex/contrib/oberdiek/intcalc.dtx +++ b/macros/latex/contrib/oberdiek/intcalc.dtx @@ -4101,14 +4101,6 @@ and the derived files % \paragraph{Script installation.} % Check the directory \xfile{TDS:scripts/oberdiek/} for % scripts that need further installation steps. -% Package \xpackage{attachfile2} comes with the Perl script -% \xfile{pdfatfi.pl} that should be installed in such a way -% that it can be called as \texttt{pdfatfi}. -% Example (linux): -% \begin{quote} -% |chmod +x scripts/oberdiek/pdfatfi.pl|\\ -% |cp scripts/oberdiek/pdfatfi.pl /usr/local/bin/| -% \end{quote} % % \subsection{Package installation} % diff --git a/macros/latex/contrib/oberdiek/intcalc.pdf b/macros/latex/contrib/oberdiek/intcalc.pdf index 69eb837905..be6415bced 100644 Binary files a/macros/latex/contrib/oberdiek/intcalc.pdf and b/macros/latex/contrib/oberdiek/intcalc.pdf differ diff --git a/macros/latex/contrib/oberdiek/kvdefinekeys.dtx b/macros/latex/contrib/oberdiek/kvdefinekeys.dtx index 67ebac712d..2019ccc720 100644 --- a/macros/latex/contrib/oberdiek/kvdefinekeys.dtx +++ b/macros/latex/contrib/oberdiek/kvdefinekeys.dtx @@ -573,14 +573,6 @@ and the derived files % \paragraph{Script installation.} % Check the directory \xfile{TDS:scripts/oberdiek/} for % scripts that need further installation steps. -% Package \xpackage{attachfile2} comes with the Perl script -% \xfile{pdfatfi.pl} that should be installed in such a way -% that it can be called as \texttt{pdfatfi}. -% Example (linux): -% \begin{quote} -% |chmod +x scripts/oberdiek/pdfatfi.pl|\\ -% |cp scripts/oberdiek/pdfatfi.pl /usr/local/bin/| -% \end{quote} % % \subsection{Package installation} % diff --git a/macros/latex/contrib/oberdiek/kvdefinekeys.pdf b/macros/latex/contrib/oberdiek/kvdefinekeys.pdf index 51e4ac2df5..74e04e6613 100644 Binary files a/macros/latex/contrib/oberdiek/kvdefinekeys.pdf and b/macros/latex/contrib/oberdiek/kvdefinekeys.pdf differ diff --git a/macros/latex/contrib/oberdiek/kvoptions.dtx b/macros/latex/contrib/oberdiek/kvoptions.dtx index 54e188aed2..f79bbc0909 100644 --- a/macros/latex/contrib/oberdiek/kvoptions.dtx +++ b/macros/latex/contrib/oberdiek/kvoptions.dtx @@ -3075,14 +3075,6 @@ and the derived files % \paragraph{Script installation.} % Check the directory \xfile{TDS:scripts/oberdiek/} for % scripts that need further installation steps. -% Package \xpackage{attachfile2} comes with the Perl script -% \xfile{pdfatfi.pl} that should be installed in such a way -% that it can be called as \texttt{pdfatfi}. -% Example (linux): -% \begin{quote} -% |chmod +x scripts/oberdiek/pdfatfi.pl|\\ -% |cp scripts/oberdiek/pdfatfi.pl /usr/local/bin/| -% \end{quote} % % \subsection{Package installation} % diff --git a/macros/latex/contrib/oberdiek/kvoptions.pdf b/macros/latex/contrib/oberdiek/kvoptions.pdf index c4dea083e3..26adcf06c9 100644 Binary files a/macros/latex/contrib/oberdiek/kvoptions.pdf and b/macros/latex/contrib/oberdiek/kvoptions.pdf differ diff --git a/macros/latex/contrib/oberdiek/kvsetkeys.dtx b/macros/latex/contrib/oberdiek/kvsetkeys.dtx index a467e2e8fb..9d6db6682f 100644 --- a/macros/latex/contrib/oberdiek/kvsetkeys.dtx +++ b/macros/latex/contrib/oberdiek/kvsetkeys.dtx @@ -1893,14 +1893,6 @@ $ \x % \paragraph{Script installation.} % Check the directory \xfile{TDS:scripts/oberdiek/} for % scripts that need further installation steps. -% Package \xpackage{attachfile2} comes with the Perl script -% \xfile{pdfatfi.pl} that should be installed in such a way -% that it can be called as \texttt{pdfatfi}. -% Example (linux): -% \begin{quote} -% |chmod +x scripts/oberdiek/pdfatfi.pl|\\ -% |cp scripts/oberdiek/pdfatfi.pl /usr/local/bin/| -% \end{quote} % % \subsection{Package installation} % diff --git a/macros/latex/contrib/oberdiek/kvsetkeys.pdf b/macros/latex/contrib/oberdiek/kvsetkeys.pdf index 2a9dfc7751..feb64634fd 100644 Binary files a/macros/latex/contrib/oberdiek/kvsetkeys.pdf and b/macros/latex/contrib/oberdiek/kvsetkeys.pdf differ diff --git a/macros/latex/contrib/oberdiek/letltxmacro.dtx b/macros/latex/contrib/oberdiek/letltxmacro.dtx index 8b0440d361..4e230dca0d 100644 --- a/macros/latex/contrib/oberdiek/letltxmacro.dtx +++ b/macros/latex/contrib/oberdiek/letltxmacro.dtx @@ -992,14 +992,6 @@ and the derived files % \paragraph{Script installation.} % Check the directory \xfile{TDS:scripts/oberdiek/} for % scripts that need further installation steps. -% Package \xpackage{attachfile2} comes with the Perl script -% \xfile{pdfatfi.pl} that should be installed in such a way -% that it can be called as \texttt{pdfatfi}. -% Example (linux): -% \begin{quote} -% |chmod +x scripts/oberdiek/pdfatfi.pl|\\ -% |cp scripts/oberdiek/pdfatfi.pl /usr/local/bin/| -% \end{quote} % % \subsection{Package installation} % diff --git a/macros/latex/contrib/oberdiek/letltxmacro.pdf b/macros/latex/contrib/oberdiek/letltxmacro.pdf index be2595a9a4..6f43879fe1 100644 Binary files a/macros/latex/contrib/oberdiek/letltxmacro.pdf and b/macros/latex/contrib/oberdiek/letltxmacro.pdf differ diff --git a/macros/latex/contrib/oberdiek/listingsutf8.dtx b/macros/latex/contrib/oberdiek/listingsutf8.dtx index bc0389081d..e62f889200 100644 --- a/macros/latex/contrib/oberdiek/listingsutf8.dtx +++ b/macros/latex/contrib/oberdiek/listingsutf8.dtx @@ -625,14 +625,6 @@ public class ExampleUTF8 { % \paragraph{Script installation.} % Check the directory \xfile{TDS:scripts/oberdiek/} for % scripts that need further installation steps. -% Package \xpackage{attachfile2} comes with the Perl script -% \xfile{pdfatfi.pl} that should be installed in such a way -% that it can be called as \texttt{pdfatfi}. -% Example (linux): -% \begin{quote} -% |chmod +x scripts/oberdiek/pdfatfi.pl|\\ -% |cp scripts/oberdiek/pdfatfi.pl /usr/local/bin/| -% \end{quote} % % \subsection{Package installation} % diff --git a/macros/latex/contrib/oberdiek/listingsutf8.pdf b/macros/latex/contrib/oberdiek/listingsutf8.pdf index 3da5802937..c0685ac033 100644 Binary files a/macros/latex/contrib/oberdiek/listingsutf8.pdf and b/macros/latex/contrib/oberdiek/listingsutf8.pdf differ diff --git a/macros/latex/contrib/oberdiek/ltxcmds.dtx b/macros/latex/contrib/oberdiek/ltxcmds.dtx index 9dfd932ed7..d0e75a14b7 100644 --- a/macros/latex/contrib/oberdiek/ltxcmds.dtx +++ b/macros/latex/contrib/oberdiek/ltxcmds.dtx @@ -2940,14 +2940,6 @@ X=% % \paragraph{Script installation.} % Check the directory \xfile{TDS:scripts/oberdiek/} for % scripts that need further installation steps. -% Package \xpackage{attachfile2} comes with the Perl script -% \xfile{pdfatfi.pl} that should be installed in such a way -% that it can be called as \texttt{pdfatfi}. -% Example (linux): -% \begin{quote} -% |chmod +x scripts/oberdiek/pdfatfi.pl|\\ -% |cp scripts/oberdiek/pdfatfi.pl /usr/local/bin/| -% \end{quote} % % \subsection{Package installation} % diff --git a/macros/latex/contrib/oberdiek/ltxcmds.pdf b/macros/latex/contrib/oberdiek/ltxcmds.pdf index bc96f1bd42..5c397d0b3c 100644 Binary files a/macros/latex/contrib/oberdiek/ltxcmds.pdf and b/macros/latex/contrib/oberdiek/ltxcmds.pdf differ diff --git a/macros/latex/contrib/oberdiek/luacolor.dtx b/macros/latex/contrib/oberdiek/luacolor.dtx index 65959b4982..310689bd88 100644 --- a/macros/latex/contrib/oberdiek/luacolor.dtx +++ b/macros/latex/contrib/oberdiek/luacolor.dtx @@ -1024,14 +1024,6 @@ end % \paragraph{Script installation.} % Check the directory \xfile{TDS:scripts/oberdiek/} for % scripts that need further installation steps. -% Package \xpackage{attachfile2} comes with the Perl script -% \xfile{pdfatfi.pl} that should be installed in such a way -% that it can be called as \texttt{pdfatfi}. -% Example (linux): -% \begin{quote} -% |chmod +x scripts/oberdiek/pdfatfi.pl|\\ -% |cp scripts/oberdiek/pdfatfi.pl /usr/local/bin/| -% \end{quote} % % \subsection{Package installation} % diff --git a/macros/latex/contrib/oberdiek/luacolor.pdf b/macros/latex/contrib/oberdiek/luacolor.pdf index 36d0822d66..a11284092d 100644 Binary files a/macros/latex/contrib/oberdiek/luacolor.pdf and b/macros/latex/contrib/oberdiek/luacolor.pdf differ diff --git a/macros/latex/contrib/oberdiek/magicnum.dtx b/macros/latex/contrib/oberdiek/magicnum.dtx index 0147bf1f05..8b2b087a89 100644 --- a/macros/latex/contrib/oberdiek/magicnum.dtx +++ b/macros/latex/contrib/oberdiek/magicnum.dtx @@ -1377,14 +1377,6 @@ end % \paragraph{Script installation.} % Check the directory \xfile{TDS:scripts/oberdiek/} for % scripts that need further installation steps. -% Package \xpackage{attachfile2} comes with the Perl script -% \xfile{pdfatfi.pl} that should be installed in such a way -% that it can be called as \texttt{pdfatfi}. -% Example (linux): -% \begin{quote} -% |chmod +x scripts/oberdiek/pdfatfi.pl|\\ -% |cp scripts/oberdiek/pdfatfi.pl /usr/local/bin/| -% \end{quote} % % \subsection{Package installation} % diff --git a/macros/latex/contrib/oberdiek/magicnum.pdf b/macros/latex/contrib/oberdiek/magicnum.pdf index d529d45b95..3b0f3c9926 100644 Binary files a/macros/latex/contrib/oberdiek/magicnum.pdf and b/macros/latex/contrib/oberdiek/magicnum.pdf differ diff --git a/macros/latex/contrib/oberdiek/mleftright.dtx b/macros/latex/contrib/oberdiek/mleftright.dtx index cc83370e41..857d12cde0 100644 --- a/macros/latex/contrib/oberdiek/mleftright.dtx +++ b/macros/latex/contrib/oberdiek/mleftright.dtx @@ -751,14 +751,6 @@ and the derived files % \paragraph{Script installation.} % Check the directory \xfile{TDS:scripts/oberdiek/} for % scripts that need further installation steps. -% Package \xpackage{attachfile2} comes with the Perl script -% \xfile{pdfatfi.pl} that should be installed in such a way -% that it can be called as \texttt{pdfatfi}. -% Example (linux): -% \begin{quote} -% |chmod +x scripts/oberdiek/pdfatfi.pl|\\ -% |cp scripts/oberdiek/pdfatfi.pl /usr/local/bin/| -% \end{quote} % % \subsection{Package installation} % diff --git a/macros/latex/contrib/oberdiek/mleftright.pdf b/macros/latex/contrib/oberdiek/mleftright.pdf index 9e541703d2..46ecd58cfd 100644 Binary files a/macros/latex/contrib/oberdiek/mleftright.pdf and b/macros/latex/contrib/oberdiek/mleftright.pdf differ diff --git a/macros/latex/contrib/oberdiek/oberdiek.pdf b/macros/latex/contrib/oberdiek/oberdiek.pdf index 3fc83d1dc4..ac156a5948 100644 Binary files a/macros/latex/contrib/oberdiek/oberdiek.pdf and b/macros/latex/contrib/oberdiek/oberdiek.pdf differ diff --git a/macros/latex/contrib/oberdiek/oberdiek.tex b/macros/latex/contrib/oberdiek/oberdiek.tex index 0b5cb9e742..e22263796a 100644 --- a/macros/latex/contrib/oberdiek/oberdiek.tex +++ b/macros/latex/contrib/oberdiek/oberdiek.tex @@ -7,7 +7,7 @@ \newcommand*{\Author}{Heiko Oberdiek} \newcommand*{\Email}{ho-tex at tug.org} -\newcommand*{\Date}{2019/11/12} +\newcommand*{\Date}{2019/11/24} % Copyright (C) 2006-2016 by % Heiko Oberdiek @@ -189,8 +189,6 @@ [\entrysep] \entry{atenddvi}{2007/04/17}{1.1}{At end DVI hook}% [\entrysep] -\entry{attachfile2}{2019/07/24}{2.9}{Attach files into PDF}% -[\entrysep] \entry{atveryend}{2011/06/30}{1.8}{Hooks at the very end of document}% [\entrysep] \entry{auxhook}{2011/03/04}{1.3}{Hooks for auxiliary files}% @@ -223,8 +221,6 @@ [\entrysep] \entry{eolgrab}{2011/01/12}{1.0}{Catch arguments delimited by end of line}% [\entrysep] -\entry{epstopdf}{2010/02/09}{2.5}{Conversion with epstopdf on the fly}% -[\entrysep] \entry{etexcmds}{2011/02/16}{1.5}{Avoid name clashes with \hologo{eTeX} commands}% [\entrysep] \entry{fibnum}{2012/04/08}{1.0}{Fibonacci numbers}% @@ -297,8 +293,6 @@ [\entrysep] \entry{pdfcolfoot}{2012/01/02}{1.2}{Color stack for footnotes with \hologo{pdfTeX}}% [\entrysep] -\entry{pdfcolmk}{2008/08/11}{1.2}{Color support for \hologo{pdfTeX} via marks}% -[\entrysep] \entry{pdfcolparallel}{2010/01/11}{1.3}{Color stacks support for parallel}% [\entrysep] \entry{pdfcolparcolumns}{2010/01/11}{1.3}{Color stacks for parcolumns}% @@ -311,8 +305,6 @@ [\entrysep] \entry{pdfrender}{2010/01/28}{1.2}{Access to some PDF graphics parameters}% [\entrysep] -\entry{pdftexcmds}{2019/07/25}{0.30}{Utility functions of \hologo{pdfTeX} for \hologo{LuaTeX}}% -[\entrysep] \entry{picture}{2009/10/11}{1.3}{Dimens for picture macros}% [\entrysep] \entry{pmboxdraw}{2011/03/24}{1.1}{Poor man's box drawing characters}% @@ -424,19 +416,6 @@ to \cs{AtEndDocument}. \end{abstract} \tocinclude{atenddvi} -\newpage -\subsection{\pkgsectformat{attachfile2}} -\label{attachfile2} -\begin{abstract} -This package can be used to attach files to a PDF document. -It is a further development of Scott Pakin's package -\xpackage{attachfile} for \pdfTeX. Apart from bug fixes, -package \xpackage{attachfile2} adds support for \xoption{dvips}, -some new options, gets and writes meta information data about -the attached files. -\end{abstract} -\tocinclude{attachfile2} - \newpage \subsection{\pkgsectformat{atveryend}} \label{atveryend} @@ -601,17 +580,6 @@ to catch an argument that is delimited by the line end. \end{abstract} \tocinclude{eolgrab} -\newpage -\subsection{\pkgsectformat{epstopdf}} -\label{epstopdf} -\begin{abstract} -This packages adds support of handling eps images -to package \xpackage{graphics} or \xpackage{graphicx} -with option \xoption{pdftex}. If an eps image is detected, -epstopdf is automatically called to convert it to pdf format. -\end{abstract} -\tocinclude{epstopdf} - \newpage \subsection{\pkgsectformat{etexcmds}} \label{etexcmds} @@ -948,15 +916,6 @@ across pages. \end{abstract} \tocinclude{pdfcolfoot} -\newpage -\subsection{\pkgsectformat{pdfcolmk}} -\label{pdfcolmk} -\begin{abstract} -This package tries a solution for the missing color -stack of \pdfTeX. -\end{abstract} -\tocinclude{pdfcolmk} - \newpage \subsection{\pkgsectformat{pdfcolparallel}} \label{pdfcolparallel} @@ -1016,15 +975,6 @@ provides an interface for setting these parameters. \end{abstract} \tocinclude{pdfrender} -\newpage -\subsection{\pkgsectformat{pdftexcmds}} -\label{pdftexcmds} -\begin{abstract} -\hologo{LuaTeX} provides most of the commands of \hologo{pdfTeX} 1.40. However -a number of utility functions are removed. This package tries to fill -the gap and implements some of the missing primitive using Lua. -\end{abstract} -\tocinclude{pdftexcmds} \newpage \subsection{\pkgsectformat{picture}} diff --git a/macros/latex/contrib/oberdiek/pagegrid.dtx b/macros/latex/contrib/oberdiek/pagegrid.dtx index 1efb0cde26..6e81bfaa7c 100644 --- a/macros/latex/contrib/oberdiek/pagegrid.dtx +++ b/macros/latex/contrib/oberdiek/pagegrid.dtx @@ -917,14 +917,6 @@ and the derived files % \paragraph{Script installation.} % Check the directory \xfile{TDS:scripts/oberdiek/} for % scripts that need further installation steps. -% Package \xpackage{attachfile2} comes with the Perl script -% \xfile{pdfatfi.pl} that should be installed in such a way -% that it can be called as \texttt{pdfatfi}. -% Example (linux): -% \begin{quote} -% |chmod +x scripts/oberdiek/pdfatfi.pl|\\ -% |cp scripts/oberdiek/pdfatfi.pl /usr/local/bin/| -% \end{quote} % % \subsection{Package installation} % diff --git a/macros/latex/contrib/oberdiek/pagegrid.pdf b/macros/latex/contrib/oberdiek/pagegrid.pdf index 3d63d631d0..04fa0160f6 100644 Binary files a/macros/latex/contrib/oberdiek/pagegrid.pdf and b/macros/latex/contrib/oberdiek/pagegrid.pdf differ diff --git a/macros/latex/contrib/oberdiek/pagesel.dtx b/macros/latex/contrib/oberdiek/pagesel.dtx index acde4c62b9..161c25b813 100644 --- a/macros/latex/contrib/oberdiek/pagesel.dtx +++ b/macros/latex/contrib/oberdiek/pagesel.dtx @@ -670,14 +670,6 @@ and the derived files % \paragraph{Script installation.} % Check the directory \xfile{TDS:scripts/oberdiek/} for % scripts that need further installation steps. -% Package \xpackage{attachfile2} comes with the Perl script -% \xfile{pdfatfi.pl} that should be installed in such a way -% that it can be called as \texttt{pdfatfi}. -% Example (linux): -% \begin{quote} -% |chmod +x scripts/oberdiek/pdfatfi.pl|\\ -% |cp scripts/oberdiek/pdfatfi.pl /usr/local/bin/| -% \end{quote} % % \subsection{Package installation} % diff --git a/macros/latex/contrib/oberdiek/pagesel.pdf b/macros/latex/contrib/oberdiek/pagesel.pdf index 9b0f8db976..927d5b3b4a 100644 Binary files a/macros/latex/contrib/oberdiek/pagesel.pdf and b/macros/latex/contrib/oberdiek/pagesel.pdf differ diff --git a/macros/latex/contrib/oberdiek/pdfcol.dtx b/macros/latex/contrib/oberdiek/pdfcol.dtx index d99d11fa25..3b08d0a6c1 100644 --- a/macros/latex/contrib/oberdiek/pdfcol.dtx +++ b/macros/latex/contrib/oberdiek/pdfcol.dtx @@ -973,14 +973,6 @@ and the derived files % \paragraph{Script installation.} % Check the directory \xfile{TDS:scripts/oberdiek/} for % scripts that need further installation steps. -% Package \xpackage{attachfile2} comes with the Perl script -% \xfile{pdfatfi.pl} that should be installed in such a way -% that it can be called as \texttt{pdfatfi}. -% Example (linux): -% \begin{quote} -% |chmod +x scripts/oberdiek/pdfatfi.pl|\\ -% |cp scripts/oberdiek/pdfatfi.pl /usr/local/bin/| -% \end{quote} % % \subsection{Package installation} % diff --git a/macros/latex/contrib/oberdiek/pdfcol.pdf b/macros/latex/contrib/oberdiek/pdfcol.pdf index e1aa8be514..370fa5b870 100644 Binary files a/macros/latex/contrib/oberdiek/pdfcol.pdf and b/macros/latex/contrib/oberdiek/pdfcol.pdf differ diff --git a/macros/latex/contrib/oberdiek/pdfcolfoot.dtx b/macros/latex/contrib/oberdiek/pdfcolfoot.dtx index be01c4650e..b812a47dd4 100644 --- a/macros/latex/contrib/oberdiek/pdfcolfoot.dtx +++ b/macros/latex/contrib/oberdiek/pdfcolfoot.dtx @@ -564,14 +564,6 @@ and the derived files % \paragraph{Script installation.} % Check the directory \xfile{TDS:scripts/oberdiek/} for % scripts that need further installation steps. -% Package \xpackage{attachfile2} comes with the Perl script -% \xfile{pdfatfi.pl} that should be installed in such a way -% that it can be called as \texttt{pdfatfi}. -% Example (linux): -% \begin{quote} -% |chmod +x scripts/oberdiek/pdfatfi.pl|\\ -% |cp scripts/oberdiek/pdfatfi.pl /usr/local/bin/| -% \end{quote} % % \subsection{Package installation} % diff --git a/macros/latex/contrib/oberdiek/pdfcolfoot.pdf b/macros/latex/contrib/oberdiek/pdfcolfoot.pdf index da4a567e70..1c70a6ee25 100644 Binary files a/macros/latex/contrib/oberdiek/pdfcolfoot.pdf and b/macros/latex/contrib/oberdiek/pdfcolfoot.pdf differ diff --git a/macros/latex/contrib/oberdiek/pdfcolmk.dtx b/macros/latex/contrib/oberdiek/pdfcolmk.dtx deleted file mode 100644 index fc74f05fb3..0000000000 --- a/macros/latex/contrib/oberdiek/pdfcolmk.dtx +++ /dev/null @@ -1,1011 +0,0 @@ -% \iffalse meta-comment -% -% File: pdfcolmk.dtx -% Version: 2016/05/16 v1.3 -% Info: Color support for pdfTeX via marks -% -% Copyright (C) 2000, 2005-2008 by -% Heiko Oberdiek -% 2016 -% https://github.com/ho-tex/oberdiek/issues -% -% This work may be distributed and/or modified under the -% conditions of the LaTeX Project Public License, either -% version 1.3c of this license or (at your option) any later -% version. This version of this license is in -% https://www.latex-project.org/lppl/lppl-1-3c.txt -% and the latest version of this license is in -% https://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". -% -% The Current Maintainers of this work are -% Heiko Oberdiek and the Oberdiek Package Support Group -% https://github.com/ho-tex/oberdiek/issues -% -% This work consists of the main source file pdfcolmk.dtx -% and the derived files -% pdfcolmk.sty, pdfcolmk.pdf, pdfcolmk.ins, pdfcolmk.drv. -% -% Distribution: -% CTAN:macros/latex/contrib/oberdiek/pdfcolmk.dtx -% CTAN:macros/latex/contrib/oberdiek/pdfcolmk.pdf -% -% Unpacking: -% (a) If pdfcolmk.ins is present: -% tex pdfcolmk.ins -% (b) Without pdfcolmk.ins: -% tex pdfcolmk.dtx -% (c) If you insist on using LaTeX -% latex \let\install=y\input{pdfcolmk.dtx} -% (quote the arguments according to the demands of your shell) -% -% Documentation: -% (a) If pdfcolmk.drv is present: -% latex pdfcolmk.drv -% (b) Without pdfcolmk.drv: -% latex pdfcolmk.dtx; ... -% The class ltxdoc loads the configuration file ltxdoc.cfg -% if available. Here you can specify further options, e.g. -% use A4 as paper format: -% \PassOptionsToClass{a4paper}{article} -% -% Programm calls to get the documentation (example): -% pdflatex pdfcolmk.dtx -% makeindex -s gind.ist pdfcolmk.idx -% pdflatex pdfcolmk.dtx -% makeindex -s gind.ist pdfcolmk.idx -% pdflatex pdfcolmk.dtx -% -% Installation: -% TDS:tex/latex/oberdiek/pdfcolmk.sty -% TDS:doc/latex/oberdiek/pdfcolmk.pdf -% TDS:source/latex/oberdiek/pdfcolmk.dtx -% -%<*ignore> -\begingroup - \catcode123=1 % - \catcode125=2 % - \def\x{LaTeX2e}% -\expandafter\endgroup -\ifcase 0\ifx\install y1\fi\expandafter - \ifx\csname processbatchFile\endcsname\relax\else1\fi - \ifx\fmtname\x\else 1\fi\relax -\else\csname fi\endcsname -% -%<*install> -\input docstrip.tex -\Msg{************************************************************************} -\Msg{* Installation} -\Msg{* Package: pdfcolmk 2016/05/16 v1.3 Color support for pdfTeX via marks (HO)} -\Msg{************************************************************************} - -\keepsilent -\askforoverwritefalse - -\let\MetaPrefix\relax -\preamble - -This is a generated file. - -Project: pdfcolmk -Version: 2016/05/16 v1.3 - -Copyright (C) 2000, 2005-2008 by - Heiko Oberdiek - -This work may be distributed and/or modified under the -conditions of the LaTeX Project Public License, either -version 1.3c of this license or (at your option) any later -version. This version of this license is in - https://www.latex-project.org/lppl/lppl-1-3c.txt -and the latest version of this license is in - https://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". - -The Current Maintainers of this work are -Heiko Oberdiek and the Oberdiek Package Support Group -https://github.com/ho-tex/oberdiek/issues - - -This work consists of the main source file pdfcolmk.dtx -and the derived files - pdfcolmk.sty, pdfcolmk.pdf, pdfcolmk.ins, pdfcolmk.drv. - -\endpreamble -\let\MetaPrefix\DoubleperCent - -\generate{% - \file{pdfcolmk.ins}{\from{pdfcolmk.dtx}{install}}% - \file{pdfcolmk.drv}{\from{pdfcolmk.dtx}{driver}}% - \usedir{tex/latex/oberdiek}% - \file{pdfcolmk.sty}{\from{pdfcolmk.dtx}{package}}% - \nopreamble - \nopostamble -% \usedir{source/latex/oberdiek/catalogue}% -% \file{pdfcolmk.xml}{\from{pdfcolmk.dtx}{catalogue}}% -} - -\catcode32=13\relax% active space -\let =\space% -\Msg{************************************************************************} -\Msg{*} -\Msg{* To finish the installation you have to move the following} -\Msg{* file into a directory searched by TeX:} -\Msg{*} -\Msg{* pdfcolmk.sty} -\Msg{*} -\Msg{* To produce the documentation run the file `pdfcolmk.drv'} -\Msg{* through LaTeX.} -\Msg{*} -\Msg{* Happy TeXing!} -\Msg{*} -\Msg{************************************************************************} - -\endbatchfile -% -%<*ignore> -\fi -% -%<*driver> -\NeedsTeXFormat{LaTeX2e} -\ProvidesFile{pdfcolmk.drv}% - [2016/05/16 v1.3 Color support for pdfTeX via marks (HO)]% -\documentclass{ltxdoc} -\usepackage{holtxdoc}[2011/11/22] -\begin{document} - \DocInput{pdfcolmk.dtx}% -\end{document} -% -% \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{pdfcolmk.drv} -% -% \title{The \xpackage{pdfcolmk} package} -% \date{2016/05/16 v1.3} -% \author{Heiko Oberdiek\thanks -% {Please report any issues at \url{https://github.com/ho-tex/oberdiek/issues}}} -% -% \maketitle -% -% \begin{abstract} -% This package tries a solution for the missing color -% stack of \pdfTeX. -% \end{abstract} -% -% \tableofcontents -% -% \section{Documentation} -% -% \subsection{Introduction} -% -% This package uses a mark register in order to solve the -% problem of a missing color stack of \pdfTeX\ prior 1.40.0. -% Since this version of \pdfTeX\ a color stack is available -% and supported by \xfile{pdftex.def} 2007/01/01 v0.04a. -% In this case this package is obsolete and the package -% stops its loading. -% -% \subsection{Background} -% -% After the Dante meeting (Clausthal 2000) I have started -% to experiment with the eTeX method of a \emph{colour} mark. -% One of the major problems is the understanding of the -% output routine and the need to rewrite it because of -% missing hooks. Currently I have made some tests in -% in onecolumn and twocolumn mode, but the state is -% experimental. -% -% \subsection{Limitations} -% -% \begin{itemize} -% \item Mark limitations: page breaks in math. -% \item \LaTeX's output routine is redefinded. -% \begin{itemize} -% \item Changes in the output routine of newer versions -% of LaTeX are not detected. -% \item Packages that change the output routine are not -% supported. -% \end{itemize} -% \item It does not support several independent text -% streams like footnotes. -% \item Limitations in float and marginpar support. -% \end{itemize} -% -% \subsection{Recommendation} -% -% \eTeX\ (for additional mark register) -% Without \eTeX\ \LaTeX's mark commands are redefined -% to store an additional color value. -% -% \subsection{Usage} -% -% Load after package color: -% \begin{quote} -% |\usepackage[pdftex]{color}|\\ -% |\usepackage{pdfcolmk}| -% \end{quote} -% -% \subsection{Compatibility} -% -% \begin{itemize} -% \item Load the following packages after \xpackage{pdfcolmk}: -% \begin{quote} -% \xpackage{mparhack.sty} -% \end{quote} -% \item Load the following packages before \xpackage{pdfcolmk}: -% \begin{quote} -% \xpackage{marn.sty}\\ -% \xpackage{newmarn.sty} -% \end{quote} -% \item Supported \cs{@addmarginpar} patch: -% \begin{quote} -% \xpackage{latex/base/latex.ltx}\\ -% \xpackage{memoir.cls}\\ -% \xpackage{poemscol/marn.sty}, \xpackage{poemscol/newmarn.sty}\\ -% \xpackage{mparhack.sty} -% \end{quote} -% \item Unsupported \cs{@addmarginpar} patch: -% \begin{quote} -% \xpackage{lineno.sty}\\ -% \xpackage{sttools/marginal.sty}\\ -% \xpackage{revtex4.cls} -% \end{quote} -% \end{itemize} -% -% \StopEventually{ -% } -% -% \section{Implementation} -% -% \begin{macrocode} -%<*package> -% \end{macrocode} -% Package identification. -% \begin{macrocode} -\NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{pdfcolmk}% - [2016/05/16 v1.3 Color support for pdfTeX via marks (HO)] -% \end{macrocode} -% -% \begin{macrocode} -\@ifundefined{ver@pdftex.def}{% - \PackageWarningNoLine{pdfcolmk}{% - Nothing to fix, because \string`pdftex.def\string' not loaded% - }% - \endinput -}{} -\@ifpackageloaded{color}{}{% - \PackageWarningNoLine{pdfcolmk}{% - Nothing to fix, because \string`color.sty\string' not loaded% - }% - \endinput -} -\begingroup\expandafter\expandafter\expandafter\endgroup -\expandafter\ifx\csname main@pdfcolorstack\endcsname\relax -\else - % pdftex.def >= 2007/01/01 0.04a and pdfTeX >= 1.40.0 - \begingroup - \let\on@line\@empty - \PackageInfo{pdfcolmk}{% - The color stack of pdfTeX \string>\string= 1.40 is used. % - Therefore\MessageBreak - this package is not necessary and not loaded% - }% - \endgroup - \expandafter\endinput -\fi - -\PackageInfo{pdfcolmk}{% - This package tries to simulate dvips's color stack\MessageBreak - for pdfTeX based on a mark register of e-TeX.\MessageBreak - It redefines LaTeX's output routine. Therefore\MessageBreak - use with care, no warranties% -} - -\ifx\marks\@undefined - - \let\pec@mark\mark - \let\pec@value\empty - \long\def\mark#1{% - \protected@xdef\pec@value{#1}% - \pec@setmark - }% - \def\pec@setmark{% - \begingroup - \@temptokena\expandafter{\pec@value}% - \pec@mark{{\current@color}\the\@temptokena}% - \endgroup - }% - \def\pec@getmark{% - \xdef\pec@botcolor{% - \expandafter\@firstofthree\botmark\@empty\@empty\@empty - }% - }% - \long\def\@firstofthree#1#2#3{#1}% - \CheckCommand{\@leftmark}[2]{#1}% - \CheckCommand{\@rightmark}[2]{#2}% - \CheckCommand*{\leftmark}{% - \expandafter\@leftmark\botmark\@empty\@empty - }% - \CheckCommand*{\rightmark}{% - \expandafter\@rightmark\firstmark\@empty\@empty - }% - \long\def\@leftmark#1#2#3{#2}% - \long\def\@rightmark#1#2#3{#3}% - \g@addto@macro\leftmark\@empty - \g@addto@macro\rightmark\@empty - -\else - - \RequirePackage{etex}[1998/03/26]% - \newmarks\pec@marks - \def\pec@setmark{\marks\pec@marks{\current@color}}% - \def\pec@getmark{\xdef\pec@botcolor{\botmarks\pec@marks}}% - -\fi -% \end{macrocode} -% -% \subsection{\cs{marginpar} fix} -% -% \begin{macrocode} -\chardef\pec@result\z@ -\def\pec@temp#1{% - \chardef\pec@result\@ne - \begingroup - \let\on@line\@empty - \PackageInfo{pdfcolmk}{% - Patch for \string\@addmarginpar\space applied (#1)% - }% - \endgroup -} -% \end{macrocode} -% -% \subsubsection{latex/base/latex.ltx} -% -% \begin{macrocode} -\def\pec@addmarginpar{% - \@next\@marbox\@currlist{% - \@cons\@freelist\@marbox - \@cons\@freelist\@currbox - }\@latexbug - \@tempcnta\@ne - \if@twocolumn - \if@firstcolumn - \@tempcnta\m@ne - \fi - \else - \if@mparswitch - \ifodd\c@page - \else - \@tempcnta\m@ne - \fi - \fi - \if@reversemargin \@tempcnta -\@tempcnta \fi - \fi - \ifnum\@tempcnta <\z@ \global\setbox\@marbox\box\@currbox \fi - \@tempdima\@mparbottom - \advance\@tempdima -\@pageht - \advance\@tempdima\ht\@marbox - \ifdim\@tempdima >\z@ - \@latex@warning@no@line{Marginpar on page \thepage\space moved}% - \else - \@tempdima\z@ - \fi - \global\@mparbottom\@pageht - \global\advance\@mparbottom\@tempdima - \global\advance\@mparbottom\dp\@marbox - \global\advance\@mparbottom\marginparpush - \advance\@tempdima -\ht\@marbox - \global\setbox\@marbox\vbox{% - \vskip \@tempdima - \box \@marbox - }% - \global \ht\@marbox \z@ - \global \dp\@marbox \z@ - \kern -\@pagedp - \nointerlineskip - \hb@xt@\columnwidth{% - \ifnum \@tempcnta >\z@ - \hskip\columnwidth - \hskip\marginparsep - \else - \hskip -\marginparsep - \hskip -\marginparwidth - \fi - \box\@marbox \hss - }% - \nointerlineskip - \hbox{\vrule \@height\z@ \@width\z@ \@depth\@pagedp}% -} -\ifx\pec@addmarginpar\@addmarginpar - \pec@temp{latex/base}% -\fi -% \end{macrocode} -% -% \subsubsection{memoir.cls} -% -% \begin{macrocode} -\def\pec@addmarginpar{% - \checkoddpage - \@next\@marbox\@currlist{% - \@cons\@freelist\@marbox - \@cons\@freelist\@currbox - }\@latexbug - \@tempcnta\@ne - \if@twocolumn - \if@firstcolumn - \@tempcnta\m@ne - \fi - \else - \if@mparswitch - \ifoddpage - \else - \@tempcnta\m@ne - \fi - \fi - \if@reversemargin - \@tempcnta -\@tempcnta - \fi - \fi - \ifnum\@tempcnta <\z@ - \global\setbox\@marbox\box\@currbox - \fi - \@tempdima\@mparbottom - \advance\@tempdima -\@pageht - \advance\@tempdima\ht\@marbox - \ifdim\@tempdima >\z@ - \@latex@warning@no@line{% - Marginpar on page \thepage\space moved by \the\@tempdima - }% - \else - \@tempdima\z@ - \fi - \global\@mparbottom\@pageht - \global\advance\@mparbottom\@tempdima - \global\advance\@mparbottom\dp\@marbox - \global\advance\@mparbottom\marginparpush - \advance\@tempdima -\ht\@marbox - \global\setbox\@marbox\vbox{% - \vskip \@tempdima - \box \@marbox - }% - \global \ht\@marbox \z@ - \global \dp\@marbox \z@ - \kern -\@pagedp - \nointerlineskip - \hb@xt@\columnwidth{% - \ifnum \@tempcnta >\z@ - \hskip\columnwidth - \hskip\marginparsep - \else - \hskip -\marginparsep - \hskip -\marginparwidth - \fi - \box\@marbox - \hss - }% - \nointerlineskip - \hbox{\vrule \@height\z@ \@width\z@ \@depth\@pagedp}% -}% -\ifx\pec@addmarginpar\@addmarginpar - \pec@temp{memoir.cls}% -\fi -% \end{macrocode} -% -% \subsubsection{poemscol/marn.sty, poemscol/newmarn.sty} -% -% \begin{macrocode} -\def\pec@addmarginpar{% - \@next \@marbox\@currlist{% - \@cons\@freelist\@marbox - \@cons\@freelist\@currbox - }\@latexbug - \global\advance\@mpar@count\m@ne - \@ifundefined{@marn@\the\@mpar@count @}{% was location logged last time? - \@tempcnta\@ne % NO: use original LaTeX logic - \if@twocolumn - \if@firstcolumn - \@tempcnta\m@ne - \fi - \else - \if@mparswitch - \ifodd\c@page - \else - \@tempcnta\m@ne - \fi - \fi - \if@reversemargin - \@tempcnta -\@tempcnta - \fi - \fi - }{% - \@tempcnta % YES: use record from last time to decide side. - \@nameuse{@marn@\the\@mpar@count @}% - \if@reversemargin -\fi \@ne - }% - \ifnum\@tempcnta <\z@ - \global\setbox\@marbox\box\@currbox - \global\let\@marnbottom\@mparbottoml - \else - \global\let\@marnbottom\@mparbottom - \fi - \@tempdima\@marnbottom \advance\@tempdima -\@pageht - \advance\@tempdima\ht\@marbox - \ifdim\@tempdima >\z@ - \@@warning{Marginpar on page \thepage\space moved}% - \else - \@tempdima\z@ - \fi - \global\@marnbottom\@pageht - \global\advance\@marnbottom\@tempdima - \global\advance\@marnbottom\dp\@marbox - \global\advance\@marnbottom\marginparpush - \advance\@tempdima -\ht\@marbox - \global\ht\@marbox\z@ - \global\dp\@marbox\z@ - \vskip -\@pagedp - \vskip\@tempdima\nointerlineskip - \hbox to\columnwidth{% - \ifnum \@tempcnta >\z@ - \hskip\columnwidth - \hskip\marginparsep - \else - \hskip -\marginparsep - \hskip -\marginparwidth - \fi - \if@filesw % record where this is for use next time: - \@marn@log\@mpar@count - \fi - \box\@marbox - \hss - }% - \nobreak %% RmS 91/06/21 \nobreak added - \vskip -\@tempdima - \nointerlineskip - \hbox{\vrule \@height\z@ \@width\z@ \@depth\@pagedp}% -} -\ifx\pec@addmarginpar\@addmarginpar - \pec@temp{poemscol/(new)marn.sty}% -\fi -% \end{macrocode} -% -% \subsubsection{refman/refart.cls, refnam/refrep.cls} -% -% \begin{macrocode} -\def\pec@addmarginpar{% - \@next\@marbox\@currlist{% - \@cons\@freelist\@marbox - \@cons\@freelist\@currbox - }\@latexbug - \@tempcnta\@ne - \if@twocolumn - \if@firstcolumn - \@tempcnta\m@ne - \fi - \else - \@tempcnta\m@ne - \fi - \ifnum\@tempcnta <\z@ - \global\setbox\@marbox\box\@currbox - \fi - \@tempdima\@mparbottom - \advance\@tempdima -\@pageht - \advance\@tempdima\ht\@marbox - \ifdim\@tempdima >\z@ - \@@warning{Marginpar on page \thepage\space moved}% - \else - \@tempdima\z@ - \fi - \global\@mparbottom\@pageht - \global\advance\@mparbottom\@tempdima - \global\advance\@mparbottom\dp\@marbox - \global\advance\@mparbottom\marginparpush - \advance\@tempdima -\ht\@marbox - \global\setbox\@marbox\vbox{% - \vskip \@tempdima \box \@marbox - }% - \global \ht\@marbox \z@ - \global \dp\@marbox \z@ - \kern -\@pagedp - \nointerlineskip - \hb@xt@\columnwidth{% - \ifnum \@tempcnta >\z@ - \hskip\columnwidth - \hskip\marginparsep - \else - \hskip -\marginparsep - \hskip -\marginparwidth - \fi - \box\@marbox - \hss - }% - \nointerlineskip - \hbox{\vrule \@height\z@ \@width\z@ \@depth\@pagedp}% -} -\ifx\pec@addmarginpar\@addmarginpar - \pec@temp{ref(art|rep).cls}% -\fi - -\ifcase\pec@result - \PackageInfo{pdfcolmk}{% - Fix for \string\@addmarginpar\space is omitted, % - because this variant\MessageBreak - of \string\@addmarginpar\space - is not recognized% - }% -\else - % apply patch for \@addmarginpar - \def\pec@PatchAddMarginpar#1\columnwidth#2#3\@nil{% - \pec@PatchAddMarginparI#2\@nil{#1}{#3}% - }% - \def\pec@PatchAddMarginparI#1\box\@marbox\hss#2\@nil#3#4{% - \def\@addmarginpar{% - #3% - \columnwidth{% - #1% - \pdfliteral{q}% - \rlap{% - \box\@marbox - }% - \pdfliteral{Q}% - \hss - #2% - }% - #4% - }% - }% - \expandafter\pec@PatchAddMarginpar\@addmarginpar\@nil -\fi -% \end{macrocode} -% -% \subsection{Color fix} -% -% \begin{macrocode} -\def\set@color{% - \pdfliteral{\current@color}% - \ifinner - \else - \pec@setmark - \fi - \aftergroup\reset@color -} -\def\reset@color{% - \pdfliteral{\current@color}% - \ifinner - \else - \pec@setmark - \fi -} - -\let\pec@botcolor\current@color - -\def\pec@PatchVBoxCCLV{% - \ifx\pec@botcolor\@empty - \else - \setbox\@cclv\vbox{% - \pdfliteral{\pec@botcolor}% - \unvbox\@cclv - }% - \fi - \pec@getmark -} - -\def\pec@PatchAlreadyInBox{% - \ifx\pec@botcolor\@empty - \else - \pdfliteral{\pec@botcolor}% - \fi - \pec@getmark -} - -\@ifclassloaded{memoir}{% - \expandafter\def\expandafter\mem@makecol\expandafter{% - \expandafter\pec@PatchVBoxCCLV - \mem@makecol - }% - \endinput -}{} - -\@ifclassloaded{seminar}{% - \newcommand\pec@org@makeslide{}% - \let\pec@org@makeslide\@makeslide - \def\@makeslide{% - \pec@PatchVBoxCCLV - \pec@org@makeslide - }% - \endinput -}{} - -\long\def\pec@output#1\@specialoutput\else#2\pec@end{% - \begingroup - \def\x{#2}% - \expandafter\endgroup - \ifx\x\@empty - \PackageWarningNoLine{pdfcolmk}{% - Unexpected \string\output\space routine detected,% - \MessageBreak - loading of package stopped% - }% - \expandafter\endinput - \fi -} -\expandafter\expandafter\expandafter\pec@output -\expandafter\@firstofone\the\output\@specialoutput\else\pec@end - -\long\def\pec@output#1\@specialoutput\else#2\pec@end{% - \output{% - #1\@specialoutput\else - \pec@PatchVBoxCCLV - #2% - }% -} -\expandafter\expandafter\expandafter\pec@output -\expandafter\@firstofone\the\output\pec@end -% \end{macrocode} -% -% \begin{macrocode} -% -% \end{macrocode} -% -% \section{Installation} -% -% \subsection{Download} -% -% \paragraph{Package.} This package is available on -% CTAN\footnote{\CTANpkg{pdfcolmk}}: -% \begin{description} -% \item[\CTAN{macros/latex/contrib/oberdiek/pdfcolmk.dtx}] The source file. -% \item[\CTAN{macros/latex/contrib/oberdiek/pdfcolmk.pdf}] Documentation. -% \end{description} -% -% -% \paragraph{Bundle.} All the packages of the bundle `oberdiek' -% are also available in a TDS compliant ZIP archive. There -% the packages are already unpacked and the documentation files -% are generated. The files and directories obey the TDS standard. -% \begin{description} -% \item[\CTANinstall{install/macros/latex/contrib/oberdiek.tds.zip}] -% \end{description} -% \emph{TDS} refers to the standard ``A Directory Structure -% for \TeX\ Files'' (\CTAN{tds/tds.pdf}). Directories -% with \xfile{texmf} in their name are usually organized this way. -% -% \subsection{Bundle installation} -% -% \paragraph{Unpacking.} Unpack the \xfile{oberdiek.tds.zip} in the -% TDS tree (also known as \xfile{texmf} tree) of your choice. -% Example (linux): -% \begin{quote} -% |unzip oberdiek.tds.zip -d ~/texmf| -% \end{quote} -% -% \paragraph{Script installation.} -% Check the directory \xfile{TDS:scripts/oberdiek/} for -% scripts that need further installation steps. -% Package \xpackage{attachfile2} comes with the Perl script -% \xfile{pdfatfi.pl} that should be installed in such a way -% that it can be called as \texttt{pdfatfi}. -% Example (linux): -% \begin{quote} -% |chmod +x scripts/oberdiek/pdfatfi.pl|\\ -% |cp scripts/oberdiek/pdfatfi.pl /usr/local/bin/| -% \end{quote} -% -% \subsection{Package installation} -% -% \paragraph{Unpacking.} The \xfile{.dtx} file is a self-extracting -% \docstrip\ archive. The files are extracted by running the -% \xfile{.dtx} through \plainTeX: -% \begin{quote} -% \verb|tex pdfcolmk.dtx| -% \end{quote} -% -% \paragraph{TDS.} Now the different files must be moved into -% the different directories in your installation TDS tree -% (also known as \xfile{texmf} tree): -% \begin{quote} -% \def\t{^^A -% \begin{tabular}{@{}>{\ttfamily}l@{ $\rightarrow$ }>{\ttfamily}l@{}} -% pdfcolmk.sty & tex/latex/oberdiek/pdfcolmk.sty\\ -% pdfcolmk.pdf & doc/latex/oberdiek/pdfcolmk.pdf\\ -% pdfcolmk.dtx & source/latex/oberdiek/pdfcolmk.dtx\\ -% \end{tabular}^^A -% }^^A -% \sbox0{\t}^^A -% \ifdim\wd0>\linewidth -% \begingroup -% \advance\linewidth by\leftmargin -% \advance\linewidth by\rightmargin -% \edef\x{\endgroup -% \def\noexpand\lw{\the\linewidth}^^A -% }\x -% \def\lwbox{^^A -% \leavevmode -% \hbox to \linewidth{^^A -% \kern-\leftmargin\relax -% \hss -% \usebox0 -% \hss -% \kern-\rightmargin\relax -% }^^A -% }^^A -% \ifdim\wd0>\lw -% \sbox0{\small\t}^^A -% \ifdim\wd0>\linewidth -% \ifdim\wd0>\lw -% \sbox0{\footnotesize\t}^^A -% \ifdim\wd0>\linewidth -% \ifdim\wd0>\lw -% \sbox0{\scriptsize\t}^^A -% \ifdim\wd0>\linewidth -% \ifdim\wd0>\lw -% \sbox0{\tiny\t}^^A -% \ifdim\wd0>\linewidth -% \lwbox -% \else -% \usebox0 -% \fi -% \else -% \lwbox -% \fi -% \else -% \usebox0 -% \fi -% \else -% \lwbox -% \fi -% \else -% \usebox0 -% \fi -% \else -% \lwbox -% \fi -% \else -% \usebox0 -% \fi -% \else -% \lwbox -% \fi -% \else -% \usebox0 -% \fi -% \end{quote} -% If you have a \xfile{docstrip.cfg} that configures and enables \docstrip's -% TDS installing feature, then some files can already be in the right -% place, see the documentation of \docstrip. -% -% \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 -% \verb|mktexlsr|. -% -% \subsection{Some details for the interested} -% -% \paragraph{Unpacking with \LaTeX.} -% The \xfile{.dtx} chooses its action depending on the format: -% \begin{description} -% \item[\plainTeX:] Run \docstrip\ and extract the files. -% \item[\LaTeX:] Generate the documentation. -% \end{description} -% If you insist on using \LaTeX\ for \docstrip\ (really, -% \docstrip\ does not need \LaTeX), then inform the autodetect routine -% about your intention: -% \begin{quote} -% \verb|latex \let\install=y\input{pdfcolmk.dtx}| -% \end{quote} -% Do not forget to quote the argument according to the demands -% of your shell. -% -% \paragraph{Generating the documentation.} -% You can use both the \xfile{.dtx} or the \xfile{.drv} to generate -% the documentation. The process can be configured by the -% configuration file \xfile{ltxdoc.cfg}. For instance, put this -% line into this file, if you want to have A4 as paper format: -% \begin{quote} -% \verb|\PassOptionsToClass{a4paper}{article}| -% \end{quote} -% An example follows how to generate the -% documentation with pdf\LaTeX: -% \begin{quote} -%\begin{verbatim} -%pdflatex pdfcolmk.dtx -%makeindex -s gind.ist pdfcolmk.idx -%pdflatex pdfcolmk.dtx -%makeindex -s gind.ist pdfcolmk.idx -%pdflatex pdfcolmk.dtx -%\end{verbatim} -% \end{quote} -% -% \begin{History} -% \begin{Version}{2000/08/27 v0.1} -% \item -% First published version in newsgroup \xnewsgroup{comp.text.tex}:\\ -% \URL{``\link{pdftex: bug with colors?}''}^^A -% {https://groups.google.com/group/comp.text.tex/msg/6f088e69e4085d2c} -% \end{Version} -% \begin{Version}{2000/09/02 v0.2} -% \item -% Next try. -% \end{Version} -% \begin{Version}{2000/09/02 v0.3} -% \item -% Solution without \eTeX\ added. -% \end{Version} -% \begin{Version}{2000/09/06 v0.4} -% \item -% Patch commands added. -% \item -% Patch for seminar.cls added. -% \end{Version} -% \begin{Version}{2000/09/06 v0.5} -% \item -% Bug fix: initialization of \cs{pec@value} added. -% \end{Version} -% \begin{Version}{2005/06/15 v0.6} -% \item -% Support for \cs{marginpar} added. -% See thread in \xnewsgroup{comp.text.tex}:\\ -% \URL{``\link{Using \cs{textcolor} and \cs{marginpar} together}''}^^A -% {https://groups.google.com/group/comp.text.tex/msg/38ed58f8845a2a4f} -% \end{Version} -% \begin{Version}{2005/07/09 v0.7} -% \item -% Output support added for \xpackage{memoir}, -% provided by Lars Madsen. -% \end{Version} -% \begin{Version}{2006/02/20 v0.8} -% \item -% Code is not changed. -% \item -% DTX framework. -% \end{Version} -% \begin{Version}{2007/01/01 v1.0} -% \item -% If \xfile{pdftex.def} \textgreater= 2007/01/01 v0.04a is used with -% \pdfTeX\ \textgreater= 1.40.0, then package \xpackage{pdfcolmk} is obsolete. -% \end{Version} -% \begin{Version}{2007/04/11 v1.1} -% \item -% Line ends sanitized. -% \end{Version} -% \begin{Version}{2008/08/11 v1.2} -% \item -% Code is not changed. -% \item -% URLs updated. -% \end{Version} -% \begin{Version}{2016/05/16 v1.3} -% \item -% Documentation updates. -% \end{Version} -% \end{History} -% -% \PrintIndex -% -% \Finale -\endinput diff --git a/macros/latex/contrib/oberdiek/pdfcolmk.pdf b/macros/latex/contrib/oberdiek/pdfcolmk.pdf deleted file mode 100644 index 202eeb6933..0000000000 Binary files a/macros/latex/contrib/oberdiek/pdfcolmk.pdf and /dev/null differ diff --git a/macros/latex/contrib/oberdiek/pdfcolparallel.dtx b/macros/latex/contrib/oberdiek/pdfcolparallel.dtx index 755000fb16..4dc572d785 100644 --- a/macros/latex/contrib/oberdiek/pdfcolparallel.dtx +++ b/macros/latex/contrib/oberdiek/pdfcolparallel.dtx @@ -929,14 +929,6 @@ and the derived files % \paragraph{Script installation.} % Check the directory \xfile{TDS:scripts/oberdiek/} for % scripts that need further installation steps. -% Package \xpackage{attachfile2} comes with the Perl script -% \xfile{pdfatfi.pl} that should be installed in such a way -% that it can be called as \texttt{pdfatfi}. -% Example (linux): -% \begin{quote} -% |chmod +x scripts/oberdiek/pdfatfi.pl|\\ -% |cp scripts/oberdiek/pdfatfi.pl /usr/local/bin/| -% \end{quote} % % \subsection{Package installation} % diff --git a/macros/latex/contrib/oberdiek/pdfcolparallel.pdf b/macros/latex/contrib/oberdiek/pdfcolparallel.pdf index cd06a4a9ed..eaea95a370 100644 Binary files a/macros/latex/contrib/oberdiek/pdfcolparallel.pdf and b/macros/latex/contrib/oberdiek/pdfcolparallel.pdf differ diff --git a/macros/latex/contrib/oberdiek/pdfcolparcolumns.dtx b/macros/latex/contrib/oberdiek/pdfcolparcolumns.dtx index ce340c0379..db8b4cdb7c 100644 --- a/macros/latex/contrib/oberdiek/pdfcolparcolumns.dtx +++ b/macros/latex/contrib/oberdiek/pdfcolparcolumns.dtx @@ -612,14 +612,6 @@ and the derived files % \paragraph{Script installation.} % Check the directory \xfile{TDS:scripts/oberdiek/} for % scripts that need further installation steps. -% Package \xpackage{attachfile2} comes with the Perl script -% \xfile{pdfatfi.pl} that should be installed in such a way -% that it can be called as \texttt{pdfatfi}. -% Example (linux): -% \begin{quote} -% |chmod +x scripts/oberdiek/pdfatfi.pl|\\ -% |cp scripts/oberdiek/pdfatfi.pl /usr/local/bin/| -% \end{quote} % % \subsection{Package installation} % diff --git a/macros/latex/contrib/oberdiek/pdfcolparcolumns.pdf b/macros/latex/contrib/oberdiek/pdfcolparcolumns.pdf index 1f1ebd1ccf..7343948a4c 100644 Binary files a/macros/latex/contrib/oberdiek/pdfcolparcolumns.pdf and b/macros/latex/contrib/oberdiek/pdfcolparcolumns.pdf differ diff --git a/macros/latex/contrib/oberdiek/pdfcrypt.dtx b/macros/latex/contrib/oberdiek/pdfcrypt.dtx index 39ed3c78e9..ed5e896c87 100644 --- a/macros/latex/contrib/oberdiek/pdfcrypt.dtx +++ b/macros/latex/contrib/oberdiek/pdfcrypt.dtx @@ -906,14 +906,6 @@ and the derived files % \paragraph{Script installation.} % Check the directory \xfile{TDS:scripts/oberdiek/} for % scripts that need further installation steps. -% Package \xpackage{attachfile2} comes with the Perl script -% \xfile{pdfatfi.pl} that should be installed in such a way -% that it can be called as \texttt{pdfatfi}. -% Example (linux): -% \begin{quote} -% |chmod +x scripts/oberdiek/pdfatfi.pl|\\ -% |cp scripts/oberdiek/pdfatfi.pl /usr/local/bin/| -% \end{quote} % % \subsection{Package installation} % diff --git a/macros/latex/contrib/oberdiek/pdfcrypt.pdf b/macros/latex/contrib/oberdiek/pdfcrypt.pdf index d206cacf36..1cd5861f3d 100644 Binary files a/macros/latex/contrib/oberdiek/pdfcrypt.pdf and b/macros/latex/contrib/oberdiek/pdfcrypt.pdf differ diff --git a/macros/latex/contrib/oberdiek/pdfescape.dtx b/macros/latex/contrib/oberdiek/pdfescape.dtx index 3a77f65261..391d608d3e 100644 --- a/macros/latex/contrib/oberdiek/pdfescape.dtx +++ b/macros/latex/contrib/oberdiek/pdfescape.dtx @@ -2072,14 +2072,6 @@ $ \the\count\ltx@cclv % \paragraph{Script installation.} % Check the directory \xfile{TDS:scripts/oberdiek/} for % scripts that need further installation steps. -% Package \xpackage{attachfile2} comes with the Perl script -% \xfile{pdfatfi.pl} that should be installed in such a way -% that it can be called as \texttt{pdfatfi}. -% Example (linux): -% \begin{quote} -% |chmod +x scripts/oberdiek/pdfatfi.pl|\\ -% |cp scripts/oberdiek/pdfatfi.pl /usr/local/bin/| -% \end{quote} % % \subsection{Package installation} % diff --git a/macros/latex/contrib/oberdiek/pdfescape.pdf b/macros/latex/contrib/oberdiek/pdfescape.pdf index d733ba1bf1..e70cef8999 100644 Binary files a/macros/latex/contrib/oberdiek/pdfescape.pdf and b/macros/latex/contrib/oberdiek/pdfescape.pdf differ diff --git a/macros/latex/contrib/oberdiek/pdflscape.dtx b/macros/latex/contrib/oberdiek/pdflscape.dtx index 547a06e1d3..3df9d44327 100644 --- a/macros/latex/contrib/oberdiek/pdflscape.dtx +++ b/macros/latex/contrib/oberdiek/pdflscape.dtx @@ -861,14 +861,6 @@ public class ExtractRotate { % \paragraph{Script installation.} % Check the directory \xfile{TDS:scripts/oberdiek/} for % scripts that need further installation steps. -% Package \xpackage{attachfile2} comes with the Perl script -% \xfile{pdfatfi.pl} that should be installed in such a way -% that it can be called as \texttt{pdfatfi}. -% Example (linux): -% \begin{quote} -% |chmod +x scripts/oberdiek/pdfatfi.pl|\\ -% |cp scripts/oberdiek/pdfatfi.pl /usr/local/bin/| -% \end{quote} % % \subsection{Package installation} % diff --git a/macros/latex/contrib/oberdiek/pdflscape.pdf b/macros/latex/contrib/oberdiek/pdflscape.pdf index 15750dc4d7..36ae64fad7 100644 Binary files a/macros/latex/contrib/oberdiek/pdflscape.pdf and b/macros/latex/contrib/oberdiek/pdflscape.pdf differ diff --git a/macros/latex/contrib/oberdiek/pdfrender.dtx b/macros/latex/contrib/oberdiek/pdfrender.dtx index 4bbcec9a2a..ad095e871c 100644 --- a/macros/latex/contrib/oberdiek/pdfrender.dtx +++ b/macros/latex/contrib/oberdiek/pdfrender.dtx @@ -1696,14 +1696,6 @@ After % % \paragraph{Script installation.} % Check the directory \xfile{TDS:scripts/oberdiek/} for % scripts that need further installation steps. -% Package \xpackage{attachfile2} comes with the Perl script -% \xfile{pdfatfi.pl} that should be installed in such a way -% that it can be called as \texttt{pdfatfi}. -% Example (linux): -% \begin{quote} -% |chmod +x scripts/oberdiek/pdfatfi.pl|\\ -% |cp scripts/oberdiek/pdfatfi.pl /usr/local/bin/| -% \end{quote} % % \subsection{Package installation} % diff --git a/macros/latex/contrib/oberdiek/pdfrender.pdf b/macros/latex/contrib/oberdiek/pdfrender.pdf index c2002436aa..ad9e8c443d 100644 Binary files a/macros/latex/contrib/oberdiek/pdfrender.pdf and b/macros/latex/contrib/oberdiek/pdfrender.pdf differ diff --git a/macros/latex/contrib/oberdiek/pdftexcmds.dtx b/macros/latex/contrib/oberdiek/pdftexcmds.dtx deleted file mode 100644 index a7ce8e7c2a..0000000000 --- a/macros/latex/contrib/oberdiek/pdftexcmds.dtx +++ /dev/null @@ -1,2689 +0,0 @@ -% \iffalse meta-comment -% -% File: pdftexcmds.dtx -% Version: 2019/07/25 v0.30 -% Info: Utility functions of pdfTeX for LuaTeX -% -% Copyright (C) 2007, 2009-2011 by -% Heiko Oberdiek -% -% This work may be distributed and/or modified under the -% conditions of the LaTeX Project Public License, either -% version 1.3c of this license or (at your option) any later -% version. This version of this license is in -% https://www.latex-project.org/lppl/lppl-1-3c.txt -% and the latest version of this license is in -% https://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". -% -% The Current Maintainers of this work are -% Heiko Oberdiek and the Oberdiek Package Support Group -% https://github.com/ho-tex/oberdiek/issues -% -% The Base Interpreter refers to any `TeX-Format', -% because some files are installed in TDS:tex/generic//. -% -% This work consists of the main source file pdftexcmds.dtx -% and the derived files -% pdftexcmds.sty, pdftexcmds.pdf, pdftexcmds.ins, pdftexcmds.drv, -% pdftexcmds.bib, pdftexcmds-test1.tex, pdftexcmds-test2.tex, -% pdftexcmds-test-shell.tex, pdftexcmds-test-escape.tex, -% oberdiek.pdftexcmds.lua, pdftexcmds.lua. -% -% Distribution: -% CTAN:macros/latex/contrib/oberdiek/pdftexcmds.dtx -% CTAN:macros/latex/contrib/oberdiek/pdftexcmds.pdf -% -% Unpacking: -% (a) If pdftexcmds.ins is present: -% tex pdftexcmds.ins -% (b) Without pdftexcmds.ins: -% tex pdftexcmds.dtx -% (c) If you insist on using LaTeX -% latex \let\install=y\input{pdftexcmds.dtx} -% (quote the arguments according to the demands of your shell) -% -% Documentation: -% (a) If pdftexcmds.drv is present: -% latex pdftexcmds.drv -% (b) Without pdftexcmds.drv: -% latex pdftexcmds.dtx; ... -% The class ltxdoc loads the configuration file ltxdoc.cfg -% if available. Here you can specify further options, e.g. -% use A4 as paper format: -% \PassOptionsToClass{a4paper}{article} -% -% Programm calls to get the documentation (example): -% pdflatex pdftexcmds.dtx -% bibtex pdftexcmds.aux -% makeindex -s gind.ist pdftexcmds.idx -% pdflatex pdftexcmds.dtx -% makeindex -s gind.ist pdftexcmds.idx -% pdflatex pdftexcmds.dtx -% -% Installation: -% TDS:tex/generic/oberdiek/pdftexcmds.sty -% TDS:scripts/oberdiek/oberdiek.pdftexcmds.lua -% TDS:scripts/oberdiek/pdftexcmds.lua -% TDS:doc/latex/oberdiek/pdftexcmds.pdf -% TDS:doc/latex/oberdiek/test/pdftexcmds-test1.tex -% TDS:doc/latex/oberdiek/test/pdftexcmds-test2.tex -% TDS:doc/latex/oberdiek/test/pdftexcmds-test-shell.tex -% TDS:doc/latex/oberdiek/test/pdftexcmds-test-escape.tex -% TDS:source/latex/oberdiek/pdftexcmds.dtx -% -%<*ignore> -\begingroup - \catcode123=1 % - \catcode125=2 % - \def\x{LaTeX2e}% -\expandafter\endgroup -\ifcase 0\ifx\install y1\fi\expandafter - \ifx\csname processbatchFile\endcsname\relax\else1\fi - \ifx\fmtname\x\else 1\fi\relax -\else\csname fi\endcsname -% -%<*install> -\input docstrip.tex -\Msg{************************************************************************} -\Msg{* Installation} -\Msg{* Package: pdftexcmds 2019/07/25 v0.30 Utility functions of pdfTeX for LuaTeX (HO)} -\Msg{************************************************************************} - -\keepsilent -\askforoverwritefalse - -\let\MetaPrefix\relax -\preamble - -This is a generated file. - -Project: pdftexcmds -Version: 2019/07/25 v0.30 - -Copyright (C) 2007, 2009-2011 by - Heiko Oberdiek - -This work may be distributed and/or modified under the -conditions of the LaTeX Project Public License, either -version 1.3c of this license or (at your option) any later -version. This version of this license is in - https://www.latex-project.org/lppl/lppl-1-3c.txt -and the latest version of this license is in - https://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". - -The Current Maintainers of this work are -Heiko Oberdiek and the Oberdiek Package Support Group -https://github.com/ho-tex/oberdiek/issues - - -The Base Interpreter refers to any `TeX-Format', -because some files are installed in TDS:tex/generic//. - -This work consists of the main source file pdftexcmds.dtx -and the derived files - pdftexcmds.sty, pdftexcmds.pdf, pdftexcmds.ins, pdftexcmds.drv, - pdftexcmds.bib, pdftexcmds-test1.tex, pdftexcmds-test2.tex, - pdftexcmds-test-shell.tex, pdftexcmds-test-escape.tex, - oberdiek.pdftexcmds.lua, pdftexcmds.lua. - -\endpreamble -\let\MetaPrefix\DoubleperCent - -\generate{% - \file{pdftexcmds.ins}{\from{pdftexcmds.dtx}{install}}% - \file{pdftexcmds.drv}{\from{pdftexcmds.dtx}{driver}}% - \nopreamble - \nopostamble - \file{pdftexcmds.bib}{\from{pdftexcmds.dtx}{bib}}% - \usepreamble\defaultpreamble - \usepostamble\defaultpostamble - \usedir{tex/generic/oberdiek}% - \file{pdftexcmds.sty}{\from{pdftexcmds.dtx}{package}}% -% \usedir{doc/latex/oberdiek/test}% -% \file{pdftexcmds-test1.tex}{\from{pdftexcmds.dtx}{test1}}% -% \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/oberdiek/catalogue}% -% \file{pdftexcmds.xml}{\from{pdftexcmds.dtx}{catalogue}}% -} -\def\MetaPrefix{-- } -\def\defaultpostamble{% - \MetaPrefix^^J% - \MetaPrefix\space End of File `\outFileName'.% -} -\def\currentpostamble{\defaultpostamble}% -\generate{% - \usedir{scripts/oberdiek}% - \file{oberdiek.pdftexcmds.lua}{\from{pdftexcmds.dtx}{lua}}% - \file{pdftexcmds.lua}{\from{pdftexcmds.dtx}{lua}}% -} - -\catcode32=13\relax% active space -\let =\space% -\Msg{************************************************************************} -\Msg{*} -\Msg{* To finish the installation you have to move the following} -\Msg{* file into a directory searched by TeX:} -\Msg{*} -\Msg{* pdftexcmds.sty} -\Msg{*} -\Msg{* And install the following script files:} -\Msg{*} -\Msg{* oberdiek.pdftexcmds.lua, pdftexcmds.lua} -\Msg{*} -\Msg{* To produce the documentation run the file `pdftexcmds.drv'} -\Msg{* through LaTeX.} -\Msg{*} -\Msg{* Happy TeXing!} -\Msg{*} -\Msg{************************************************************************} - -\endbatchfile -% -%<*bib> -@online{AndyThomas:Analog, - author={Thomas, Andy}, - title={Analog of {\texttt{\csname textbackslash\endcsname}pdfelapsedtime} for - {\hologo{LuaTeX}} and {\hologo{XeTeX}}}, - url={http://tex.stackexchange.com/a/32531}, - urldate={2011-11-29}, -} -% -%<*ignore> -\fi -% -%<*driver> -\NeedsTeXFormat{LaTeX2e} -\ProvidesFile{pdftexcmds.drv}% - [2019/07/25 v0.30 Utility functions of pdfTeX for LuaTeX (HO)]% -\documentclass{ltxdoc} -\usepackage{holtxdoc}[2011/11/22] -\usepackage{paralist} -\usepackage{csquotes} -\usepackage[ - backend=bibtex, - bibencoding=ascii, - alldates=iso8601, -]{biblatex}[2011/11/13] -\bibliography{oberdiek-source} -\bibliography{pdftexcmds} -\begin{document} - \DocInput{pdftexcmds.dtx}% -\end{document} -% -% \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/07/25 v0.30} -% \author{Heiko Oberdiek\thanks -% {Please report any issues at \url{https://github.com/ho-tex/oberdiek/issues}}} -% -% \maketitle -% -% \begin{abstract} -% \hologo{LuaTeX} provides most of the commands of \hologo{pdfTeX} 1.40. However -% a number of utility functions are removed. This package tries to fill -% the gap and implements some of the missing primitive using Lua. -% \end{abstract} -% -% \tableofcontents -% -% \def\csi#1{\texttt{\textbackslash\textit{#1}}} -% -% \section{Documentation} -% -% Some primitives of \hologo{pdfTeX} \cite{pdftex-manual} -% are not defined by \hologo{LuaTeX} \cite{luatex-manual}. -% This package implements macro based solutions using Lua code -% for the following missing \hologo{pdfTeX} primitives; -% \begin{compactitem} -% \item \cs{pdfstrcmp} -% \item \cs{pdfunescapehex} -% \item \cs{pdfescapehex} -% \item \cs{pdfescapename} -% \item \cs{pdfescapestring} -% \item \cs{pdffilesize} -% \item \cs{pdffilemoddate} -% \item \cs{pdffiledump} -% \item \cs{pdfmdfivesum} -% \item \cs{pdfresettimer} -% \item \cs{pdfelapsedtime} -% \item |\immediate\write18| -% \end{compactitem} -% The original names of the primitives cannot be used: -% \begin{itemize} -% \item -% The syntax for their arguments cannot easily -% simulated by macros. The primitives using key words -% such as |file| (\cs{pdfmdfivesum}) or |offset| and |length| -% (\cs{pdffiledump}) and uses \meta{general text} for the other -% arguments. Using token registers assignments, \meta{general text} could -% be catched. However, the simulated primitives are expandable -% and register assignments would destroy this important property. -% (\meta{general text} allows something like |\expandafter\bgroup ...}|.) -% \item -% The original primitives can be expanded using one expansion step. -% The new macros need two expansion steps because of the additional -% macro expansion. Example: -% \begin{quote} -% |\expandafter\foo\pdffilemoddate{file}|\\ -% vs.\\ -% |\expandafter\expandafter\expandafter|\\ -% |\foo\pdf@filemoddate{file}| -% \end{quote} -% \end{itemize} -% -% \hologo{LuaTeX} isn't stable yet and thus the status of this package is -% \emph{experimental}. Feedback is welcome. -% -% \subsection{General principles} -% -% \begin{description} -% \item[Naming convention:] -% Usually this package defines a macro |\pdf@|\meta{cmd} if -% \hologo{pdfTeX} provides |\pdf|\meta{cmd}. -% \item[Arguments:] The order of arguments in |\pdf@|\meta{cmd} -% is the same as for the corresponding primitive of \hologo{pdfTeX}. -% The arguments are ordinary undelimited \hologo{TeX} arguments, -% no \meta{general text} and without additional keywords. -% \item[Expandibility:] -% The macro |\pdf@|\meta{cmd} is expandable if the -% corresponding \hologo{pdfTeX} primitive has this property. -% Exact two expansion steps are necessary (first is the macro -% expansion) except for \cs{pdf@primitive} and \cs{pdf@ifprimitive}. -% The latter ones are not macros, but have the direct meaning of the -% primitive. -% \item[Without \hologo{LuaTeX}:] -% The macros |\pdf@|\meta{cmd} are mapped to the commands -% of \hologo{pdfTeX} if they are available. Otherwise they are undefined. -% \item[Availability:] -% The macros that the packages provides are undefined, if -% the necessary primitives are not found and cannot be -% implemented by Lua. -% \end{description} -% -% \subsection{Macros} -% -% \subsubsection[Strings]{Strings \cite[``7.15 Strings'']{pdftex-manual}} -% -% \begin{declcs}{pdf@strcmp} \M{stringA} \M{stringB} -% \end{declcs} -% Same as |\pdfstrcmp{|\meta{stringA}|}{|\meta{stringB}|}|. -% -% \begin{declcs}{pdf@unescapehex} \M{string} -% \end{declcs} -% Same as |\pdfunescapehex{|\meta{string}|}|. -% The argument is a byte string given in hexadecimal notation. -% The result are character tokens from 0 until 255 with -% catcode 12 and the space with catcode 10. -% -% \begin{declcs}{pdf@escapehex} \M{string}\\ -% \cs{pdf@escapestring} \M{string}\\ -% \cs{pdf@escapename} \M{string} -% \end{declcs} -% Same as the primitives of \hologo{pdfTeX}. However \hologo{pdfTeX} does not -% know about characters with codes 256 and larger. Thus the -% string is treated as byte string, characters with more than -% eight bits are ignored. -% -% \subsubsection[Files]{Files \cite[``7.18 Files'']{pdftex-manual}} -% -% \begin{declcs}{pdf@filesize} \M{filename} -% \end{declcs} -% Same as |\pdffilesize{|\meta{filename}|}|. -% -% \begin{declcs}{pdf@filemoddate} \M{filename} -% \end{declcs} -% Same as |\pdffilemoddate{|\meta{filename}|}|. -% -% \begin{declcs}{pdf@filedump} \M{offset} \M{length} \M{filename} -% \end{declcs} -% Same as |\pdffiledump offset| \meta{offset} |length| \meta{length} -% |{|\meta{filename}|}|. Both \meta{offset} and \meta{length} must -% not be empty, but must be a valid \hologo{TeX} number. -% -% \begin{declcs}{pdf@mdfivesum} \M{string} -% \end{declcs} -% Same as |\pdfmdfivesum{|\meta{string}|}|. Keyword |file| is supported -% by macro \cs{pdf@filemdfivesum}. -% -% \begin{declcs}{pdf@filemdfivesum} \M{filename} -% \end{declcs} -% Same as |\pdfmdfivesum file{|\meta{filename}|}|. -% -% \subsubsection[Timekeeping]{Timekeeping \cite[``7.17 Timekeeping'']{pdftex-manual}} -% -% The timekeeping macros are based on Andy Thomas' work \cite{AndyThomas:Analog}. -% -% \begin{declcs}{pdf@resettimer} -% \end{declcs} -% Same as \cs{pdfresettimer}, it resets the internal timer. -% -% \begin{declcs}{pdf@elapsedtime} -% \end{declcs} -% Same as \cs{pdfelapsedtime}. It behaves like a read-only integer. -% For printing purposes it can be prefixed by \cs{the} or \cs{number}. -% It measures the time in scaled seconds (seconds multiplied with 65536) -% since the latest call of \cs{pdf@resettimer} or start of -% program/package. The resolution, the shortest time interval that -% can be measured, depends on the program and system. -% \begin{itemize} -% \item \hologo{pdfTeX} with |gettimeofday|: $\ge$ 1/65536\,s -% \item \hologo{pdfTeX} with |ftime|: $\ge$ 1\,ms -% \item \hologo{pdfTeX} with |time|: $\ge$ 1\,s -% \item \hologo{LuaTeX}: $\ge$ 10\,ms\\ -% (|os.clock()| returns a float number with two decimal digits in -% \hologo{LuaTeX} beta-0.70.1-2011061416 (rev 4277)). -% \end{itemize} -% -% \subsubsection[Miscellaneous]{Miscellaneous \cite[``7.21 Miscellaneous'']{pdftex-manual}} -% -% \begin{declcs}{pdf@draftmode} -% \end{declcs} -% If the \TeX\ compiler knows \cs{pdfdraftmode} or \cs{draftmode} -% (\hologo{pdfTeX}, -% \hologo{LuaTeX}), then \cs{pdf@draftmode} returns, whether -% this mode is enabled. The result is an implicit number: -% one means the draft mode is available and enabled. -% If the value is zero, then the mode is not active or -% \cs{pdfdraftmode} is not available. -% An explicit number is yielded by \cs{number}\cs{pdf@draftmode}. -% The macro cannot -% be used to change the mode, see \cs{pdf@setdraftmode}. -% -% \begin{declcs}{pdf@ifdraftmode} \M{true} \M{false} -% \end{declcs} -% If \cs{pdfdraftmode} is available and enabled, \meta{true} is -% called, otherwise \meta{false} is executed. -% -% \begin{declcs}{pdf@setdraftmode} \M{value} -% \end{declcs} -% Macro \cs{pdf@setdraftmode} expects the number zero or one as -% \meta{value}. Zero deactivates the mode and one enables the draft mode. -% The macro does not have an effect, if the feature \cs{pdfdraftmode} is not -% available. -% -% \begin{declcs}{pdf@shellescape} -% \end{declcs} -% Same as |\pdfshellescape|. It is or expands to |1| if external -% commands can be executed and |0| otherwise. In \hologo{pdfTeX} external -% commands must be enabled first by command line option or -% configuration option. In \hologo{LuaTeX} option |--safer| disables -% the execution of external commands. -% -% In \hologo{LuaTeX} before 0.68.0 \cs{pdf@shellescape} is not -% available due to a bug in |os.execute()|. The argumentless form -% crashes in some circumstances with segmentation fault. -% (It is fixed in version 0.68.0 or revision 4167 of \hologo{LuaTeX}. -% and packported to some version of 0.67.0). -% -% Hints for usage: -% \begin{itemize} -% \item Before its use \cs{pdf@shellescape} should be tested, -% whether it is available. Example with package \xpackage{ltxcmds} -% (loaded by package \xpackage{pdftexcmds}): -%\begin{quote} -%\begin{verbatim} -%\ltx@IfUndefined{pdf@shellescape}{% -% % \pdf@shellescape is undefined -%}{% -% % \pdf@shellescape is available -%} -%\end{verbatim} -%\end{quote} -% Use \cs{ltx@ifundefined} in expandable contexts. -% \item \cs{pdf@shellescape} might be a numerical constant, -% expands to the primitive, or expands to a plain number. -% Therefore use it in contexts where these differences does not matter. -% \item Use in comparisons, e.g.: -% \begin{quote} -% |\ifnum\pdf@shellescape=0 ...| -% \end{quote} -% \item Print the number: |\number\pdf@shellescape| -% \end{itemize} -% -% \begin{declcs}{pdf@system} \M{cmdline} -% \end{declcs} -% It is a wrapper for |\immediate\write18| in \hologo{pdfTeX} or -% |os.execute| in \hologo{LuaTeX}. -% -% In theory |os.execute| -% returns a status number. But its meaning is quite -% undefined. Are there some reliable properties? -% Does it make sense to provide an user interface to -% this status exit code? -% -% \begin{declcs}{pdf@primitive} \csi{cmd} -% \end{declcs} -% Same as \cs{pdfprimitive} in \hologo{pdfTeX} or \hologo{LuaTeX}. -% In \hologo{XeTeX} the -% primitive is called \cs{primitive}. Despite the current definition -% of the command \csi{cmd}, it's meaning as primitive is used. -% -% \begin{declcs}{pdf@ifprimitive} \csi{cmd} -% \end{declcs} -% Same as \cs{ifpdfprimitive} in \hologo{pdfTeX} or -% \hologo{LuaTeX}. \hologo{XeTeX} calls -% it \cs{ifprimitive}. It is a switch that checks if the command -% \csi{cmd} has it's primitive meaning. -% -% \subsubsection{Additional macro: \cs{pdf@isprimitive}} -% -% \begin{declcs}{pdf@isprimitive} \csi{cmd1} \csi{cmd2} \M{true} \M{false} -% \end{declcs} -% If \csi{cmd1} has the primitive meaning given by the primitive name -% of \csi{cmd2}, then the argument \meta{true} is executed, otherwise -% \meta{false}. The macro \cs{pdf@isprimitive} is expandable. -% Internally it checks the result of \cs{meaning} and is therefore -% available for all \hologo{TeX} variants, even the original \hologo{TeX}. -% Example with \hologo{LaTeX}: -%\begin{quote} -%\begin{verbatim} -%\makeatletter -%\pdf@isprimitive{@@input}{input}{% -% \typeout{\string\@@input\space is original\string\input}% -%}{% -% \typeout{Oops, \string\@@input\space is not the % -% original\string\input}% -%} -%\end{verbatim} -%\end{quote} -% -% \subsubsection{Experimental} -% -% \begin{declcs}{pdf@unescapehexnative} \M{string}\\ -% \cs{pdf@escapehexnative} \M{string}\\ -% \cs{pdf@escapenamenative} \M{string}\\ -% \cs{pdf@mdfivesumnative} \M{string} -% \end{declcs} -% The variants without |native| in the macro name are supposed to -% be compatible with \hologo{pdfTeX}. However characters with more than -% eight bits are not supported and are ignored. If \hologo{LuaTeX} is -% running, then its UTF-8 coded strings are used. Thus the full -% unicode character range is supported. However the result -% differs from \hologo{pdfTeX} for characters with eight or more bits. -% -% \begin{declcs}{pdf@pipe} \M{cmdline} -% \end{declcs} -% It calls \meta{cmdline} and returns the output of the external -% program in the usual manner as byte string (catcode 12, space with -% catcode 10). The Lua documentation says, that the used |io.popen| -% may not be available on all platforms. Then macro \cs{pdf@pipe} -% is undefined. -% -% \StopEventually{ -% } -% -% \section{Implementation} -% -% \begin{macrocode} -%<*package> -% \end{macrocode} -% -% \subsection{Reload check and package identification} -% Reload check, especially if the package is not used with \LaTeX. -% \begin{macrocode} -\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 - \def\empty{}% - \ifx\x\empty % LaTeX, first loading, - % variable is initialized, but \ProvidesPackage not yet seen - \else - \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{pdftexcmds}{The package is already loaded}% - \aftergroup\endinput - \fi - \fi -\endgroup% -% \end{macrocode} -% Package identification: -% \begin{macrocode} -\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}% - \xdef#1{#4}% - }% - \else - \def\x#1#2[#3]{\endgroup - #2[{#3}]% - \ifx#1\@undefined - \xdef#1{#3}% - \fi - \ifx#1\relax - \xdef#1{#3}% - \fi - }% - \fi -\expandafter\x\csname ver@pdftexcmds.sty\endcsname -\ProvidesPackage{pdftexcmds}% - [2019/07/25 v0.30 Utility functions of pdfTeX for LuaTeX (HO)]% -% \end{macrocode} -% -% \subsection{Catcodes} -% -% \begin{macrocode} -\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{% - \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\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=#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}% ) -\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{58}{12}% : -\TMP@EnsureCode{60}{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}% ` -\TMP@EnsureCode{126}{12}% ~ (other) -\edef\pdftexcmds@AtEnd{% - \pdftexcmds@AtEnd - \escapechar=\number\escapechar\relax - \noexpand\endinput -} -\escapechar=92 % -% \end{macrocode} -% -% \subsection{Load packages} -% -% \begin{macrocode} -\begingroup\expandafter\expandafter\expandafter\endgroup -\expandafter\ifx\csname RequirePackage\endcsname\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}[2010/12/02]% - \RequirePackage{ifpdf}[2010/09/13]% -\fi -% \end{macrocode} -% -% \subsection{Without \hologo{LuaTeX}} -% -% \begin{macrocode} -\ifluatex -\else - \@PackageInfoNoLine{pdftexcmds}{LuaTeX not detected}% - \def\pdftexcmds@nopdftex{% - \@PackageInfoNoLine{pdftexcmds}{pdfTeX >= 1.30 not detected}% - \let\pdftexcmds@nopdftex\relax - }% - \def\pdftexcmds@temp#1{% - \begingroup\expandafter\expandafter\expandafter\endgroup - \expandafter\ifx\csname pdf#1\endcsname\relax - \pdftexcmds@nopdftex - \else - \expandafter\def\csname pdf@#1\expandafter\endcsname - \expandafter##\expandafter{% - \csname pdf#1\endcsname - }% - \fi - }% - \pdftexcmds@temp{strcmp}% - \pdftexcmds@temp{escapehex}% - \let\pdf@escapehexnative\pdf@escapehex - \pdftexcmds@temp{unescapehex}% - \let\pdf@unescapehexnative\pdf@unescapehex - \pdftexcmds@temp{escapestring}% - \pdftexcmds@temp{escapename}% - \pdftexcmds@temp{filesize}% - \pdftexcmds@temp{filemoddate}% - \begingroup\expandafter\expandafter\expandafter\endgroup - \expandafter\ifx\csname pdfshellescape\endcsname\relax - \pdftexcmds@nopdftex - \ltx@IfUndefined{pdftexversion}{% - }{% - \ifnum\pdftexversion>120 % 1.21a supports \ifeof18 - \ifeof18 % - \chardef\pdf@shellescape=0 % - \else - \chardef\pdf@shellescape=1 % - \fi - \fi - }% - \else - \def\pdf@shellescape{% - \pdfshellescape - }% - \fi - \begingroup\expandafter\expandafter\expandafter\endgroup - \expandafter\ifx\csname pdffiledump\endcsname\relax - \pdftexcmds@nopdftex - \else - \def\pdf@filedump#1#2#3{% - \pdffiledump offset#1 length#2{#3}% - }% - \fi -% \end{macrocode} -% \begin{macrocode} - \begingroup\expandafter\expandafter\expandafter\endgroup - \expandafter\ifx\csname pdfmdfivesum\endcsname\relax - \begingroup\expandafter\expandafter\expandafter\endgroup - \expandafter\ifx\csname mdfivesum\endcsname\relax - \pdftexcmds@nopdftex - \else - \def\pdf@mdfivesum#{\mdfivesum}% - \let\pdf@mdfivesumnative\pdf@mdfivesum - \def\pdf@filemdfivesum#{\mdfivesum file}% - \fi - \else - \def\pdf@mdfivesum#{\pdfmdfivesum}% - \let\pdf@mdfivesumnative\pdf@mdfivesum - \def\pdf@filemdfivesum#{\pdfmdfivesum file}% - \fi -% \end{macrocode} -% \begin{macrocode} - \def\pdf@system#{% - \immediate\write18% - }% - \def\pdftexcmds@temp#1{% - \begingroup\expandafter\expandafter\expandafter\endgroup - \expandafter\ifx\csname pdf#1\endcsname\relax - \pdftexcmds@nopdftex - \else - \expandafter\let\csname pdf@#1\expandafter\endcsname - \csname pdf#1\endcsname - \fi - }% - \pdftexcmds@temp{resettimer}% - \pdftexcmds@temp{elapsedtime}% -\fi -% \end{macrocode} -% -% \subsection{\cs{pdf@primitive}, \cs{pdf@ifprimitive}} -% -% Since version 1.40.0 \hologo{pdfTeX} has \cs{pdfprimitive} and -% \cs{ifpdfprimitive}. And \cs{pdfprimitive} was fixed in -% version 1.40.4. -% -% \hologo{XeTeX} provides them under the name \cs{primitive} and -% \cs{ifprimitive}. \hologo{LuaTeX} knows both name variants, -% but they have possibly to be enabled first (|tex.enableprimitives|). -% -% Depending on the format TeX Live uses a prefix |luatex|. -% -% Caution: \cs{let} must be used for the definition of -% the macros, especially because of \cs{ifpdfprimitive}. -% -% \subsubsection{Using \hologo{LuaTeX}'s \texttt{tex.enableprimitives}} -% -% \begin{macrocode} -\ifluatex -% \end{macrocode} -% \begin{macro}{\pdftexcmds@directlua} -% \begin{macrocode} - \ifnum\luatexversion<36 % - \def\pdftexcmds@directlua{\directlua0 }% - \else - \let\pdftexcmds@directlua\directlua - \fi -% \end{macrocode} -% \end{macro} -% -% \begin{macrocode} - \begingroup - \newlinechar=10 % - \endlinechar=\newlinechar - \pdftexcmds@directlua{% - if tex.enableprimitives then - tex.enableprimitives( - 'pdf@', - {'primitive', 'ifprimitive', 'pdfdraftmode','draftmode'} - ) - tex.enableprimitives('', {'luaescapestring'}) - end - }% - \endgroup % -% \end{macrocode} -% -% \begin{macrocode} -\fi -% \end{macrocode} -% -% \subsubsection{Trying various names to find the primitives} -% -% \begin{macro}{\pdftexcmds@strip@prefix} -% \begin{macrocode} -\def\pdftexcmds@strip@prefix#1>{} -% \end{macrocode} -% \end{macro} -% \begin{macrocode} -\def\pdftexcmds@temp#1#2#3{% - \begingroup\expandafter\expandafter\expandafter\endgroup - \expandafter\ifx\csname pdf@#1\endcsname\relax - \begingroup - \def\x{#3}% - \edef\x{\expandafter\pdftexcmds@strip@prefix\meaning\x}% - \escapechar=-1 % - \edef\y{\expandafter\meaning\csname#2\endcsname}% - \expandafter\endgroup - \ifx\x\y - \expandafter\let\csname pdf@#1\expandafter\endcsname - \csname #2\endcsname - \fi - \fi -} -% \end{macrocode} -% -% \begin{macro}{\pdf@primitive} -% \begin{macrocode} -\pdftexcmds@temp{primitive}{pdfprimitive}{pdfprimitive}% pdfTeX, oldLuaTeX -\pdftexcmds@temp{primitive}{primitive}{primitive}% XeTeX, luatex -\pdftexcmds@temp{primitive}{luatexprimitive}{pdfprimitive}% oldLuaTeX -\pdftexcmds@temp{primitive}{luatexpdfprimitive}{pdfprimitive}% oldLuaTeX -% \end{macrocode} -% \end{macro} -% \begin{macro}{\pdf@ifprimitive} -% \begin{macrocode} -\pdftexcmds@temp{ifprimitive}{ifpdfprimitive}{ifpdfprimitive}% pdfTeX, oldLuaTeX -\pdftexcmds@temp{ifprimitive}{ifprimitive}{ifprimitive}% XeTeX, luatex -\pdftexcmds@temp{ifprimitive}{luatexifprimitive}{ifpdfprimitive}% oldLuaTeX -\pdftexcmds@temp{ifprimitive}{luatexifpdfprimitive}{ifpdfprimitive}% oldLuaTeX -% \end{macrocode} -% \end{macro} -% -% Disable broken \cs{pdfprimitive}. -% \begin{macrocode} -\ifluatex\else -\begingroup - \expandafter\ifx\csname pdf@primitive\endcsname\relax - \else - \expandafter\ifx\csname pdftexversion\endcsname\relax - \else - \ifnum\pdftexversion=140 % - \expandafter\ifx\csname pdftexrevision\endcsname\relax - \else - \ifnum\pdftexrevision<4 % - \endgroup - \let\pdf@primitive\@undefined - \@PackageInfoNoLine{pdftexcmds}{% - \string\pdf@primitive\space disabled, % - because\MessageBreak - \string\pdfprimitive\space is broken until pdfTeX 1.40.4% - }% - \begingroup - \fi - \fi - \fi - \fi - \fi -\endgroup -\fi -% \end{macrocode} -% -% \subsubsection{Result} -% -% \begin{macrocode} -\begingroup - \@PackageInfoNoLine{pdftexcmds}{% - \string\pdf@primitive\space is % - \expandafter\ifx\csname pdf@primitive\endcsname\relax not \fi - available% - }% - \@PackageInfoNoLine{pdftexcmds}{% - \string\pdf@ifprimitive\space is % - \expandafter\ifx\csname pdf@ifprimitive\endcsname\relax not \fi - available% - }% -\endgroup -% \end{macrocode} -% -% \subsection{\hologo{XeTeX}} -% -% Look for primitives \cs{shellescape}, \cs{strcmp}. -% \begin{macrocode} -\def\pdftexcmds@temp#1{% - \begingroup\expandafter\expandafter\expandafter\endgroup - \expandafter\ifx\csname pdf@#1\endcsname\relax - \begingroup - \escapechar=-1 % - \edef\x{\expandafter\meaning\csname#1\endcsname}% - \def\y{#1}% - \def\z##1->{}% - \edef\y{\expandafter\z\meaning\y}% - \expandafter\endgroup - \ifx\x\y - \expandafter\def\csname pdf@#1\expandafter\endcsname - \expandafter{% - \csname#1\endcsname - }% - \fi - \fi -}% -\pdftexcmds@temp{shellescape}% -\pdftexcmds@temp{strcmp}% -% \end{macrocode} -% -% \subsection{\cs{pdf@isprimitive}} -% -% \begin{macrocode} -\def\pdf@isprimitive{% - \begingroup\expandafter\expandafter\expandafter\endgroup - \expandafter\ifx\csname pdf@strcmp\endcsname\relax - \long\def\pdf@isprimitive##1{% - \expandafter\pdftexcmds@isprimitive\expandafter{\meaning##1}% - }% - \long\def\pdftexcmds@isprimitive##1##2{% - \expandafter\pdftexcmds@@isprimitive\expandafter{\string##2}{##1}% - }% - \def\pdftexcmds@@isprimitive##1##2{% - \ifnum0\pdftexcmds@equal##1\delimiter##2\delimiter=1 % - \expandafter\ltx@firstoftwo - \else - \expandafter\ltx@secondoftwo - \fi - }% - \def\pdftexcmds@equal##1##2\delimiter##3##4\delimiter{% - \ifx##1##3% - \ifx\relax##2##4\relax - 1% - \else - \ifx\relax##2\relax - \else - \ifx\relax##4\relax - \else - \pdftexcmds@equalcont{##2}{##4}% - \fi - \fi - \fi - \fi - }% - \def\pdftexcmds@equalcont##1{% - \def\pdftexcmds@equalcont####1####2##1##1##1##1{% - ##1##1##1##1% - \pdftexcmds@equal####1\delimiter####2\delimiter - }% - }% - \expandafter\pdftexcmds@equalcont\csname fi\endcsname - \else - \long\def\pdf@isprimitive##1##2{% - \ifnum\pdf@strcmp{\meaning##1}{\string##2}=0 % - \expandafter\ltx@firstoftwo - \else - \expandafter\ltx@secondoftwo - \fi - }% - \fi -} -\ifluatex -\ifx\pdfdraftmode\@undefined - \let\pdfdraftmode\draftmode -\fi -\else - \pdf@isprimitive -\fi -% \end{macrocode} -% -% \subsection{\cs{pdf@draftmode}} -% -% -% \begin{macrocode} -\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 -% \end{macrocode} -% \begin{macro}{\pdf@draftmode} -% \begin{macrocode} - \let\pdf@draftmode\ltx@zero -% \end{macrocode} -% \end{macro} -% \begin{macro}{\pdf@ifdraftmode} -% \begin{macrocode} - \let\pdf@ifdraftmode\ltx@secondoftwo -% \end{macrocode} -% \end{macro} -% \begin{macro}{\pdftexcmds@setdraftmode} -% \begin{macrocode} - \def\pdftexcmds@setdraftmode#1{}% -% \end{macrocode} -% \end{macro} -% \begin{macrocode} -\else -% \end{macrocode} -% \begin{macro}{\pdftexcmds@draftmode} -% \begin{macrocode} - \let\pdftexcmds@draftmode\pdfdraftmode -% \end{macrocode} -% \end{macro} -% \begin{macro}{\pdf@ifdraftmode} -% \begin{macrocode} - \def\pdf@ifdraftmode{% - \ifnum\pdftexcmds@draftmode=\ltx@one - \expandafter\ltx@firstoftwo - \else - \expandafter\ltx@secondoftwo - \fi - }% -% \end{macrocode} -% \end{macro} -% \begin{macro}{\pdf@draftmode} -% \begin{macrocode} - \def\pdf@draftmode{% - \ifnum\pdftexcmds@draftmode=\ltx@one - \expandafter\ltx@one - \else - \expandafter\ltx@zero - \fi - }% -% \end{macrocode} -% \end{macro} -% \begin{macro}{\pdftexcmds@setdraftmode} -% \begin{macrocode} - \def\pdftexcmds@setdraftmode#1{% - \pdftexcmds@draftmode=#1\relax - }% -% \end{macrocode} -% \end{macro} -% \begin{macrocode} -\fi -% \end{macrocode} -% \begin{macro}{\pdf@setdraftmode} -% \begin{macrocode} -\def\pdf@setdraftmode#1{% - \begingroup - \count\ltx@cclv=#1\relax - \edef\x{\endgroup - \noexpand\pdftexcmds@@setdraftmode{\the\count\ltx@cclv}% - }% - \x -} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\pdftexcmds@@setdraftmode} -% \begin{macrocode} -\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 -} -% \end{macrocode} -% \end{macro} -% -% \subsection{Load Lua module} -% -% \begin{macrocode} -\ifluatex -\else - \expandafter\pdftexcmds@AtEnd -\fi% -% \end{macrocode} -% -% \begin{macrocode} -\ifnum\luatexversion<80 - \begingroup\expandafter\expandafter\expandafter\endgroup - \expandafter\ifx\csname RequirePackage\endcsname\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 -\fi -\pdftexcmds@directlua{% - require("pdftexcmds")% -} -\ifnum\luatexversion>37 % - \ifnum0% - \pdftexcmds@directlua{% - if status.ini_version then % - tex.write("1")% - end% - }>0 % - \everyjob\expandafter{% - \the\everyjob - \pdftexcmds@directlua{% - require("pdftexcmds")% - }% - }% - \fi -\fi -\begingroup - \def\x{2019/07/25 v0.30}% - \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 -% \end{macrocode} -% -% \subsection{Lua functions} -% -% \subsubsection{Helper macros} -% -% \begin{macro}{\pdftexcmds@toks} -% \begin{macrocode} -\begingroup\expandafter\expandafter\expandafter\endgroup -\expandafter\ifx\csname newtoks\endcsname\relax - \toksdef\pdftexcmds@toks=0 % -\else - \csname newtoks\endcsname\pdftexcmds@toks -\fi -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\pdftexcmds@Patch} -% \begin{macrocode} -\def\pdftexcmds@Patch{0} -\ifnum\luatexversion>40 % - \ifnum\luatexversion<66 % - \def\pdftexcmds@Patch{1}% - \fi -\fi -% \end{macrocode} -% \end{macro} -% \begin{macrocode} -\ifcase\pdftexcmds@Patch - \catcode`\&=14 % -\else - \catcode`\&=9 % -% \end{macrocode} -% \begin{macro}{\pdftexcmds@PatchDecode} -% \begin{macrocode} - \def\pdftexcmds@PatchDecode#1\@nil{% - \pdftexcmds@DecodeA#1^^A^^A\@nil{}% - }% -% \end{macrocode} -% \end{macro} -% \begin{macro}{\pdftexcmds@DecodeA} -% \begin{macrocode} - \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 - }% -% \end{macrocode} -% \end{macro} -% \begin{macro}{\pdftexcmds@DecodeB} -% \begin{macrocode} - \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 - }% -% \end{macrocode} -% \end{macro} -% \begin{macrocode} -\fi -% \end{macrocode} -% -% \begin{macrocode} -\ifnum\luatexversion<36 % -\else - \catcode`\0=9 % -\fi -% \end{macrocode} -% -% \subsubsection[Strings]{Strings \cite[``7.15 Strings'']{pdftex-manual}} -% -% \begin{macro}{\pdf@strcmp} -% \begin{macrocode} -\long\def\pdf@strcmp#1#2{% - \directlua0{% - oberdiek.pdftexcmds.strcmp("\luaescapestring{#1}",% - "\luaescapestring{#2}")% - }% -}% -% \end{macrocode} -% \end{macro} -% \begin{macrocode} -\pdf@isprimitive -% \end{macrocode} -% \begin{macro}{\pdf@escapehex} -% \begin{macrocode} -\long\def\pdf@escapehex#1{% - \directlua0{% - oberdiek.pdftexcmds.escapehex("\luaescapestring{#1}", "byte")% - }% -}% -% \end{macrocode} -% \end{macro} -% \begin{macro}{\pdf@escapehexnative} -% \begin{macrocode} -\long\def\pdf@escapehexnative#1{% - \directlua0{% - oberdiek.pdftexcmds.escapehex("\luaescapestring{#1}")% - }% -}% -% \end{macrocode} -% \end{macro} -% \begin{macro}{\pdf@unescapehex} -% \begin{macrocode} -\def\pdf@unescapehex#1{% -& \romannumeral\expandafter\pdftexcmds@PatchDecode - \the\expandafter\pdftexcmds@toks - \directlua0{% - oberdiek.pdftexcmds.toks="pdftexcmds@toks"% - oberdiek.pdftexcmds.unescapehex("\luaescapestring{#1}", "byte", \pdftexcmds@Patch)% - }% -& \@nil -}% -% \end{macrocode} -% \end{macro} -% \begin{macro}{\pdf@unescapehexnative} -% \begin{macrocode} -\def\pdf@unescapehexnative#1{% -& \romannumeral\expandafter\pdftexcmds@PatchDecode - \the\expandafter\pdftexcmds@toks - \directlua0{% - oberdiek.pdftexcmds.toks="pdftexcmds@toks"% - oberdiek.pdftexcmds.unescapehex("\luaescapestring{#1}", \pdftexcmds@Patch)% - }% -& \@nil -}% -% \end{macrocode} -% \end{macro} -% \begin{macro}{\pdf@escapestring} -% \begin{macrocode} -\long\def\pdf@escapestring#1{% - \directlua0{% - oberdiek.pdftexcmds.escapestring("\luaescapestring{#1}", "byte")% - }% -} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\pdf@escapename} -% \begin{macrocode} -\long\def\pdf@escapename#1{% - \directlua0{% - oberdiek.pdftexcmds.escapename("\luaescapestring{#1}", "byte")% - }% -} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\pdf@escapenamenative} -% \begin{macrocode} -\long\def\pdf@escapenamenative#1{% - \directlua0{% - oberdiek.pdftexcmds.escapename("\luaescapestring{#1}")% - }% -} -% \end{macrocode} -% \end{macro} -% -% \subsubsection[Files]{Files \cite[``7.18 Files'']{pdftex-manual}} -% -% \begin{macro}{\pdf@filesize} -% \begin{macrocode} -\def\pdf@filesize#1{% - \directlua0{% - oberdiek.pdftexcmds.filesize("\luaescapestring{#1}")% - }% -} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\pdf@filemoddate} -% \begin{macrocode} -\def\pdf@filemoddate#1{% - \directlua0{% - oberdiek.pdftexcmds.filemoddate("\luaescapestring{#1}")% - }% -} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\pdf@filedump} -% \begin{macrocode} -\def\pdf@filedump#1#2#3{% - \directlua0{% - oberdiek.pdftexcmds.filedump("\luaescapestring{\number#1}",% - "\luaescapestring{\number#2}",% - "\luaescapestring{#3}")% - }% -}% -% \end{macrocode} -% \end{macro} -% \begin{macro}{\pdf@mdfivesum} -% \begin{macrocode} -\long\def\pdf@mdfivesum#1{% - \directlua0{% - oberdiek.pdftexcmds.mdfivesum("\luaescapestring{#1}", "byte")% - }% -}% -% \end{macrocode} -% \end{macro} -% \begin{macro}{\pdf@mdfivesumnative} -% \begin{macrocode} -\long\def\pdf@mdfivesumnative#1{% - \directlua0{% - oberdiek.pdftexcmds.mdfivesum("\luaescapestring{#1}")% - }% -}% -% \end{macrocode} -% \end{macro} -% \begin{macro}{\pdf@filemdfivesum} -% \begin{macrocode} -\def\pdf@filemdfivesum#1{% - \directlua0{% - oberdiek.pdftexcmds.filemdfivesum("\luaescapestring{#1}")% - }% -}% -% \end{macrocode} -% \end{macro} -% -% \subsubsection[Timekeeping]{Timekeeping \cite[``7.17 Timekeeping'']{pdftex-manual}} -% -% \begin{macro}{\protected} -% \begin{macrocode} -\let\pdftexcmds@temp=Y% -\begingroup\expandafter\expandafter\expandafter\endgroup -\expandafter\ifx\csname protected\endcsname\relax - \pdftexcmds@directlua0{% - if tex.enableprimitives then % - tex.enableprimitives('', {'protected'})% - end% - }% -\fi -\begingroup\expandafter\expandafter\expandafter\endgroup -\expandafter\ifx\csname protected\endcsname\relax - \let\pdftexcmds@temp=N% -\fi -% \end{macrocode} -% \end{macro} -% \begin{macro}{\numexpr} -% \begin{macrocode} -\begingroup\expandafter\expandafter\expandafter\endgroup -\expandafter\ifx\csname numexpr\endcsname\relax - \pdftexcmds@directlua0{% - if tex.enableprimitives then % - tex.enableprimitives('', {'numexpr'})% - end% - }% -\fi -\begingroup\expandafter\expandafter\expandafter\endgroup -\expandafter\ifx\csname numexpr\endcsname\relax - \let\pdftexcmds@temp=N% -\fi -% \end{macrocode} -% \end{macro} -% -% \begin{macrocode} -\ifx\pdftexcmds@temp N% - \@PackageWarningNoLine{pdftexcmds}{% - Definitions of \ltx@backslashchar pdf@resettimer and% - \MessageBreak - \ltx@backslashchar pdf@elapsedtime are skipped, because% - \MessageBreak - e-TeX's \ltx@backslashchar protected or % - \ltx@backslashchar numexpr are missing% - }% -\else -% \end{macrocode} -% -% \begin{macro}{\pdf@resettimer} -% \begin{macrocode} - \protected\def\pdf@resettimer{% - \pdftexcmds@directlua0{% - oberdiek.pdftexcmds.resettimer()% - }% - }% -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\pdf@elapsedtime} -% \begin{macrocode} - \protected\def\pdf@elapsedtime{% - \numexpr - \pdftexcmds@directlua0{% - oberdiek.pdftexcmds.elapsedtime()% - }% - \relax - }% -% \end{macrocode} -% \end{macro} -% \begin{macrocode} -\fi -% \end{macrocode} -% -% \subsubsection{Shell escape} -% -% \begin{macro}{\pdf@shellescape} -% -% \begin{macrocode} -\ifnum\luatexversion<68 % -\else - \protected\edef\pdf@shellescape{% - \numexpr\directlua{tex.sprint(% - \number\catcodetable@string,status.shell_escape)}\relax} -\fi -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\pdf@system} -% \begin{macrocode} -\def\pdf@system#1{% - \directlua0{% - oberdiek.pdftexcmds.system("\luaescapestring{#1}")% - }% -} -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\pdf@lastsystemstatus} -% \begin{macrocode} -\def\pdf@lastsystemstatus{% - \directlua0{% - oberdiek.pdftexcmds.lastsystemstatus()% - }% -} -% \end{macrocode} -% \end{macro} -% \begin{macro}{\pdf@lastsystemexit} -% \begin{macrocode} -\def\pdf@lastsystemexit{% - \directlua0{% - oberdiek.pdftexcmds.lastsystemexit()% - }% -} -% \end{macrocode} -% \end{macro} -% -% \begin{macrocode} -\catcode`\0=12 % -% \end{macrocode} -% -% \begin{macro}{\pdf@pipe} -% Check availability of |io.popen| first. -% \begin{macrocode} -\ifnum0% - \pdftexcmds@directlua{% - if io.popen then % - tex.write("1")% - end% - }% - =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}", \pdftexcmds@Patch)% - }% -& \@nil - }% -\fi -% \end{macrocode} -% \end{macro} -% -% \begin{macrocode} -\pdftexcmds@AtEnd% -% -% \end{macrocode} -% -% \subsection{Lua module} -% -% \begin{macrocode} -%<*lua> -% \end{macrocode} -% -% \begin{macrocode} -oberdiek = oberdiek or {} -local pdftexcmds = oberdiek.pdftexcmds or {} -oberdiek.pdftexcmds = pdftexcmds -local systemexitstatus -function pdftexcmds.getversion() - tex.write("2019/07/25 v0.30") -end -% \end{macrocode} -% -% \subsubsection[Strings]{Strings \cite[``7.15 Strings'']{pdftex-manual}} -% -% \begin{macrocode} -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 -local function 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 = utf8_to_byte(str) - end - tex.write((string.gsub(str, ".", - function (ch) - return string.format("%02X", string.byte(ch)) - end - ))) -end -% \end{macrocode} -% See procedure |unescapehex| in file \xfile{utils.c} of \hologo{pdfTeX}. -% Caution: |tex.write| ignores leading spaces. -% \begin{macrocode} -function pdftexcmds.unescapehex(str, mode, patch) - 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 patch == 1 then - local temp = {} - for i, a in ipairs(result) do - if a == 0 then - table.insert(temp, 1) - table.insert(temp, 1) - else - if a == 1 then - table.insert(temp, 1) - table.insert(temp, 2) - else - table.insert(temp, a) - end - end - end - result = temp - 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 -% \end{macrocode} -% this next line added for current luatex; this is the only -% change in the file. eroux, 28apr13. (v 0.21) -% \begin{macrocode} - local unpack = _G["unpack"] or table.unpack - tex.settoks(pdftexcmds.toks, string.char(unpack(result))) -end -% \end{macrocode} -% See procedure |escapestring| in file \xfile{utils.c} of \hologo{pdfTeX}. -% \begin{macrocode} -function pdftexcmds.escapestring(str, mode) - if mode == "byte" then - str = 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 -% \end{macrocode} -% Lua 5.1 returns the match in case of return value |nil|. -% \begin{macrocode} - return nil - end - ))) -end -% \end{macrocode} -% See procedure |escapename| in file \xfile{utils.c} of \hologo{pdfTeX}. -% \begin{macrocode} -function pdftexcmds.escapename(str, mode) - if mode == "byte" then - str = utf8_to_byte(str) - end - tex.write((string.gsub(str, ".", - function (ch) - local b = string.byte(ch) - if b == 0 then -% \end{macrocode} -% In Lua 5.0 |nil| could be used for the empty string, -% But |nil| returns the match in Lua 5.1, thus we use -% the empty string explicitly. -% \begin{macrocode} - 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 -% \end{macrocode} -% Lua 5.1 returns the match in case of return value |nil|. -% \begin{macrocode} - return nil - end - end - ))) -end -% \end{macrocode} -% -% \subsubsection[Files]{Files \cite[``7.18 Files'']{pdftex-manual}} -% -% \begin{macrocode} -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 -% \end{macrocode} -% See procedure |makepdftime| in file \xfile{utils.c} of \hologo{pdfTeX}. -% \begin{macrocode} -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, "rb") - if filehandle then - if offset > 0 then - filehandle:seek("set", offset) - end - local dump = filehandle:read(length) - pdftexcmds.escapehex(dump) - filehandle:close() - end - end - end -end -function pdftexcmds.mdfivesum(str, mode) - if mode == "byte" then - str = 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, "rb") - if filehandle then - local contents = filehandle:read("*a") - pdftexcmds.escapehex(md5.sum(contents)) - filehandle:close() - end - end -end -% \end{macrocode} -% -% \subsubsection[Timekeeping]{Timekeeping \cite[``7.17 Timekeeping'']{pdftex-manual}} -% -% The functions for timekeeping are based on -% Andy Thomas' work \cite{AndyThomas:Analog}. -% Changes: -% \begin{itemize} -% \item Overflow check is added. -% \item |string.format| is used to avoid exponential number -% representation for sure. -% \item |tex.write| is used instead of |tex.print| to get -% tokens with catcode 12 and without appended \cs{endlinechar}. -% \end{itemize} -% \begin{macrocode} -local basetime = 0 -function pdftexcmds.resettimer() - basetime = os.clock() -end -function pdftexcmds.elapsedtime() - local val = (os.clock() - basetime) * 65536 + .5 - if val > 2147483647 then - val = 2147483647 - end - tex.write(string.format("%d", val)) -end -% \end{macrocode} -% -% \subsubsection[Miscellaneous]{Miscellaneous \cite[``7.21 Miscellaneous'']{pdftex-manual}} -% -% \begin{macrocode} -function pdftexcmds.shellescape() - if os.execute then - if status - and status.luatex_version - and status.luatex_version >= 68 then - tex.write(os.execute()) - else - local result = os.execute() - if result == 0 then - tex.write("0") - else - if result == nil then - tex.write("0") - else - tex.write("1") - end - end - end - else - tex.write("0") - end -end -function pdftexcmds.system(cmdline) - systemexitstatus = nil - texio.write_nl("log", "system(" .. cmdline .. ") ") - if os.execute then - texio.write("log", "executed.") - systemexitstatus = os.execute(cmdline) - else - texio.write("log", "disabled.") - end -end -function pdftexcmds.lastsystemstatus() - local result = tonumber(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(systemexitstatus) - if result then - tex.write(math.floor(result / 256)) - end -end -function pdftexcmds.pipe(cmdline, patch) - local result - 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 - if patch == 1 then - local temp = {} - for i, a in ipairs(result) do - if a == 0 then - table.insert(temp, 1) - table.insert(temp, 1) - else - if a == 1 then - table.insert(temp, 1) - table.insert(temp, 2) - else - table.insert(temp, a) - end - end - end - result = temp - end - tex.settoks(pdftexcmds.toks, result) - else - tex.settoks(pdftexcmds.toks, "") - end -end -% \end{macrocode} -% \begin{macrocode} -% -% \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} -% -% \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 -% -% \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 -% -% \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 -% -% \end{macrocode} -% -% \section{Installation} -% -% \subsection{Download} -% -% \paragraph{Package.} This package is available on -% CTAN\footnote{\CTANpkg{pdftexcmds}}: -% \begin{description} -% \item[\CTAN{macros/latex/contrib/oberdiek/pdftexcmds.dtx}] The source file. -% \item[\CTAN{macros/latex/contrib/oberdiek/pdftexcmds.pdf}] Documentation. -% \end{description} -% -% -% \paragraph{Bundle.} All the packages of the bundle `oberdiek' -% are also available in a TDS compliant ZIP archive. There -% the packages are already unpacked and the documentation files -% are generated. The files and directories obey the TDS standard. -% \begin{description} -% \item[\CTANinstall{install/macros/latex/contrib/oberdiek.tds.zip}] -% \end{description} -% \emph{TDS} refers to the standard ``A Directory Structure -% for \TeX\ Files'' (\CTAN{tds/tds.pdf}). Directories -% with \xfile{texmf} in their name are usually organized this way. -% -% \subsection{Bundle installation} -% -% \paragraph{Unpacking.} Unpack the \xfile{oberdiek.tds.zip} in the -% TDS tree (also known as \xfile{texmf} tree) of your choice. -% Example (linux): -% \begin{quote} -% |unzip oberdiek.tds.zip -d ~/texmf| -% \end{quote} -% -% \paragraph{Script installation.} -% Check the directory \xfile{TDS:scripts/oberdiek/} for -% scripts that need further installation steps. -% Package \xpackage{attachfile2} comes with the Perl script -% \xfile{pdfatfi.pl} that should be installed in such a way -% that it can be called as \texttt{pdfatfi}. -% Example (linux): -% \begin{quote} -% |chmod +x scripts/oberdiek/pdfatfi.pl|\\ -% |cp scripts/oberdiek/pdfatfi.pl /usr/local/bin/| -% \end{quote} -% -% \subsection{Package installation} -% -% \paragraph{Unpacking.} The \xfile{.dtx} file is a self-extracting -% \docstrip\ archive. The files are extracted by running the -% \xfile{.dtx} through \plainTeX: -% \begin{quote} -% \verb|tex pdftexcmds.dtx| -% \end{quote} -% -% \paragraph{TDS.} Now the different files must be moved into -% the different directories in your installation TDS tree -% (also known as \xfile{texmf} tree): -% \begin{quote} -% \def\t{^^A -% \begin{tabular}{@{}>{\ttfamily}l@{ $\rightarrow$ }>{\ttfamily}l@{}} -% pdftexcmds.sty & tex/generic/oberdiek/pdftexcmds.sty\\ -% oberdiek.pdftexcmds.lua & scripts/oberdiek/oberdiek.pdftexcmds.lua\\ -% pdftexcmds.lua & scripts/oberdiek/pdftexcmds.lua\\ -% pdftexcmds.pdf & doc/latex/oberdiek/pdftexcmds.pdf\\ -% test/pdftexcmds-test1.tex & doc/latex/oberdiek/test/pdftexcmds-test1.tex\\ -% test/pdftexcmds-test2.tex & doc/latex/oberdiek/test/pdftexcmds-test2.tex\\ -% test/pdftexcmds-test-shell.tex & doc/latex/oberdiek/test/pdftexcmds-test-shell.tex\\ -% test/pdftexcmds-test-escape.tex & doc/latex/oberdiek/test/pdftexcmds-test-escape.tex\\ -% pdftexcmds.dtx & source/latex/oberdiek/pdftexcmds.dtx\\ -% \end{tabular}^^A -% }^^A -% \sbox0{\t}^^A -% \ifdim\wd0>\linewidth -% \begingroup -% \advance\linewidth by\leftmargin -% \advance\linewidth by\rightmargin -% \edef\x{\endgroup -% \def\noexpand\lw{\the\linewidth}^^A -% }\x -% \def\lwbox{^^A -% \leavevmode -% \hbox to \linewidth{^^A -% \kern-\leftmargin\relax -% \hss -% \usebox0 -% \hss -% \kern-\rightmargin\relax -% }^^A -% }^^A -% \ifdim\wd0>\lw -% \sbox0{\small\t}^^A -% \ifdim\wd0>\linewidth -% \ifdim\wd0>\lw -% \sbox0{\footnotesize\t}^^A -% \ifdim\wd0>\linewidth -% \ifdim\wd0>\lw -% \sbox0{\scriptsize\t}^^A -% \ifdim\wd0>\linewidth -% \ifdim\wd0>\lw -% \sbox0{\tiny\t}^^A -% \ifdim\wd0>\linewidth -% \lwbox -% \else -% \usebox0 -% \fi -% \else -% \lwbox -% \fi -% \else -% \usebox0 -% \fi -% \else -% \lwbox -% \fi -% \else -% \usebox0 -% \fi -% \else -% \lwbox -% \fi -% \else -% \usebox0 -% \fi -% \else -% \lwbox -% \fi -% \else -% \usebox0 -% \fi -% \end{quote} -% If you have a \xfile{docstrip.cfg} that configures and enables \docstrip's -% TDS installing feature, then some files can already be in the right -% place, see the documentation of \docstrip. -% -% \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 -% \verb|mktexlsr|. -% -% \subsection{Some details for the interested} -% -% \paragraph{Unpacking with \LaTeX.} -% The \xfile{.dtx} chooses its action depending on the format: -% \begin{description} -% \item[\plainTeX:] Run \docstrip\ and extract the files. -% \item[\LaTeX:] Generate the documentation. -% \end{description} -% If you insist on using \LaTeX\ for \docstrip\ (really, -% \docstrip\ does not need \LaTeX), then inform the autodetect routine -% about your intention: -% \begin{quote} -% \verb|latex \let\install=y\input{pdftexcmds.dtx}| -% \end{quote} -% Do not forget to quote the argument according to the demands -% of your shell. -% -% \paragraph{Generating the documentation.} -% You can use both the \xfile{.dtx} or the \xfile{.drv} to generate -% the documentation. The process can be configured by the -% configuration file \xfile{ltxdoc.cfg}. For instance, put this -% line into this file, if you want to have A4 as paper format: -% \begin{quote} -% \verb|\PassOptionsToClass{a4paper}{article}| -% \end{quote} -% An example follows how to generate the -% documentation with pdf\LaTeX: -% \begin{quote} -%\begin{verbatim} -%pdflatex pdftexcmds.dtx -%bibtex pdftexcmds.aux -%makeindex -s gind.ist pdftexcmds.idx -%pdflatex pdftexcmds.dtx -%makeindex -s gind.ist pdftexcmds.idx -%pdflatex pdftexcmds.dtx -%\end{verbatim} -% \end{quote} -% -% \printbibliography[ -% heading=bibnumbered, -% ] -% -% \begin{History} -% \begin{Version}{2007/11/11 v0.1} -% \item -% First version. -% \end{Version} -% \begin{Version}{2007/11/12 v0.2} -% \item -% Short description fixed. -% \end{Version} -% \begin{Version}{2007/12/12 v0.3} -% \item -% Organization of Lua code as module. -% \end{Version} -% \begin{Version}{2009/04/10 v0.4} -% \item -% Adaptation for syntax change of \cs{directlua} in -% \hologo{LuaTeX} 0.36. -% \end{Version} -% \begin{Version}{2009/09/22 v0.5} -% \item -% \cs{pdf@primitive}, \cs{pdf@ifprimitive} added. -% \item -% \hologo{XeTeX}'s variants are detected for -% \cs{pdf@shellescape}, \cs{pdf@strcmp}, \cs{pdf@primitive}, -% \cs{pdf@ifprimitive}. -% \end{Version} -% \begin{Version}{2009/09/23 v0.6} -% \item -% Macro \cs{pdf@isprimitive} added. -% \end{Version} -% \begin{Version}{2009/12/12 v0.7} -% \item -% Short info shortened. -% \end{Version} -% \begin{Version}{2010/03/01 v0.8} -% \item -% Required date for package \xpackage{ifluatex} updated. -% \end{Version} -% \begin{Version}{2010/04/01 v0.9} -% \item -% Use \cs{ifeof18} for defining \cs{pdf@shellescape} between -% \hologo{pdfTeX} 1.21a (inclusive) and 1.30.0 (exclusive). -% \end{Version} -% \begin{Version}{2010/11/04 v0.10} -% \item -% \cs{pdf@draftmode}, \cs{pdf@ifdraftmode} and -% \cs{pdf@setdraftmode} added. -% \end{Version} -% \begin{Version}{2010/11/11 v0.11} -% \item -% Missing \cs{RequirePackage} for package \xpackage{ifpdf} added. -% \end{Version} -% \begin{Version}{2011/01/30 v0.12} -% \item -% Already loaded package files are not input in \hologo{plainTeX}. -% \end{Version} -% \begin{Version}{2011/03/04 v0.13} -% \item -% Improved Lua function \texttt{shellescape} that also -% uses the result of \texttt{os.execute()} (thanks to Philipp Stephani). -% \end{Version} -% \begin{Version}{2011/04/10 v0.14} -% \item -% Version check of loaded module added. -% \item -% Patch for bug in \hologo{LuaTeX} between 0.40.6 and 0.65 that -% is fixed in revision 4096. -% \end{Version} -% \begin{Version}{2011/04/16 v0.15} -% \item -% \hologo{LuaTeX}: \cs{pdf@shellescape} is only supported -% for version 0.70.0 and higher due to a bug, \texttt{os.execute()} -% crashes in some circumstances. Fixed in \hologo{LuaTeX} -% beta-0.70.0, revision 4167. -% \end{Version} -% \begin{Version}{2011/04/22 v0.16} -% \item -% Previous fix was not working due to a wrong catcode of digit -% zero (due to easily support the old \cs{directlua0}). -% The version border is lowered to 0.68, because some -% beta-0.67.0 seems also to work. -% \end{Version} -% \begin{Version}{2011/06/29 v0.17} -% \item -% Documentation addition to \cs{pdf@shellescape}. -% \end{Version} -% \begin{Version}{2011/07/01 v0.18} -% \item -% Add Lua module loading in \cs{everyjob} for \hologo{iniTeX} -% (\hologo{LuaTeX} only). -% \end{Version} -% \begin{Version}{2011/07/28 v0.19} -% \item -% Missing space in an info message added (Martin M\"unch). -% \end{Version} -% \begin{Version}{2011/11/29 v0.20} -% \item -% \cs{pdf@resettimer} and \cs{pdf@elapsedtime} added -% (thanks Andy Thomas). -% \end{Version} -% \begin{Version}{2016/05/10 v0.21} -% \item -% local unpack added -% (thanks \'{E}lie Roux). -% \end{Version} -% \begin{Version}{2016/05/21 v0.22} -% \item -% adjust \cs{textbackslas}h usage in bib file for biber bug. -% \end{Version} -% \begin{Version}{2016/10/02 v0.23} -% \item -% add file.close to lua filehandles (github pull request). -% \end{Version} -% \begin{Version}{2017/01/29 v0.24} -% \item -% Avoid loading luatex-loader for current luatex. (Use -% pdftexcmds.lua not oberdiek.pdftexcmds.lua to simplify file -% search with standard require) -% \end{Version} -% \begin{Version}{2017/03/19 v0.25} -% \item -% New \cs{pdf@shellescape} for Lua\TeX, see github issue 20. -% \end{Version} -% \begin{Version}{2018/01/21 v0.26} -% \item -% use rb not r mode for file open github issue 34. -% \end{Version} -% \begin{Version}{2018/01/30 v0.27} -% \item -% \cs{pdf@mdfivesum} for \hologo{XeTeX} -% \end{Version} -% \begin{Version}{2018/09/07 v0.28} -% \item -% Fix catcode regime in luatex sprint for \cs{pdf@shellescape} GH issue 45 -% \end{Version} -% \begin{Version}{2018/09/10 v0.29} -% \item -% Actually do the fix described above in the code, not just document it. -% \end{Version} -% \begin{Version}{2019/07/25 v0.30} -% \item -% remove uses of module function, see PR70 -% \end{Version} -% \end{History} -% -% \PrintIndex -% -% \Finale -\endinput diff --git a/macros/latex/contrib/oberdiek/pdftexcmds.pdf b/macros/latex/contrib/oberdiek/pdftexcmds.pdf deleted file mode 100644 index 9968622cb8..0000000000 Binary files a/macros/latex/contrib/oberdiek/pdftexcmds.pdf and /dev/null differ diff --git a/macros/latex/contrib/oberdiek/picture.dtx b/macros/latex/contrib/oberdiek/picture.dtx index 139ce8c2d6..ceff2dea9a 100644 --- a/macros/latex/contrib/oberdiek/picture.dtx +++ b/macros/latex/contrib/oberdiek/picture.dtx @@ -629,14 +629,6 @@ and the derived files % \paragraph{Script installation.} % Check the directory \xfile{TDS:scripts/oberdiek/} for % scripts that need further installation steps. -% Package \xpackage{attachfile2} comes with the Perl script -% \xfile{pdfatfi.pl} that should be installed in such a way -% that it can be called as \texttt{pdfatfi}. -% Example (linux): -% \begin{quote} -% |chmod +x scripts/oberdiek/pdfatfi.pl|\\ -% |cp scripts/oberdiek/pdfatfi.pl /usr/local/bin/| -% \end{quote} % % \subsection{Package installation} % diff --git a/macros/latex/contrib/oberdiek/picture.pdf b/macros/latex/contrib/oberdiek/picture.pdf index a874afcaaf..a5e22bf846 100644 Binary files a/macros/latex/contrib/oberdiek/picture.pdf and b/macros/latex/contrib/oberdiek/picture.pdf differ diff --git a/macros/latex/contrib/oberdiek/pmboxdraw.dtx b/macros/latex/contrib/oberdiek/pmboxdraw.dtx index 113fe799bf..35c476f457 100644 --- a/macros/latex/contrib/oberdiek/pmboxdraw.dtx +++ b/macros/latex/contrib/oberdiek/pmboxdraw.dtx @@ -5416,14 +5416,6 @@ $ \kern.5\pmbd@C % \paragraph{Script installation.} % Check the directory \xfile{TDS:scripts/oberdiek/} for % scripts that need further installation steps. -% Package \xpackage{attachfile2} comes with the Perl script -% \xfile{pdfatfi.pl} that should be installed in such a way -% that it can be called as \texttt{pdfatfi}. -% Example (linux): -% \begin{quote} -% |chmod +x scripts/oberdiek/pdfatfi.pl|\\ -% |cp scripts/oberdiek/pdfatfi.pl /usr/local/bin/| -% \end{quote} % % \subsection{Package installation} % diff --git a/macros/latex/contrib/oberdiek/pmboxdraw.pdf b/macros/latex/contrib/oberdiek/pmboxdraw.pdf index 12bf903e46..40aba00872 100644 Binary files a/macros/latex/contrib/oberdiek/pmboxdraw.pdf and b/macros/latex/contrib/oberdiek/pmboxdraw.pdf differ diff --git a/macros/latex/contrib/oberdiek/protecteddef.dtx b/macros/latex/contrib/oberdiek/protecteddef.dtx index 7c9dca3a37..0b86d8b03f 100644 --- a/macros/latex/contrib/oberdiek/protecteddef.dtx +++ b/macros/latex/contrib/oberdiek/protecteddef.dtx @@ -855,14 +855,6 @@ and the derived files % \paragraph{Script installation.} % Check the directory \xfile{TDS:scripts/oberdiek/} for % scripts that need further installation steps. -% Package \xpackage{attachfile2} comes with the Perl script -% \xfile{pdfatfi.pl} that should be installed in such a way -% that it can be called as \texttt{pdfatfi}. -% Example (linux): -% \begin{quote} -% |chmod +x scripts/oberdiek/pdfatfi.pl|\\ -% |cp scripts/oberdiek/pdfatfi.pl /usr/local/bin/| -% \end{quote} % % \subsection{Package installation} % diff --git a/macros/latex/contrib/oberdiek/protecteddef.pdf b/macros/latex/contrib/oberdiek/protecteddef.pdf index fb6bd80338..2b30c1b9b5 100644 Binary files a/macros/latex/contrib/oberdiek/protecteddef.pdf and b/macros/latex/contrib/oberdiek/protecteddef.pdf differ diff --git a/macros/latex/contrib/oberdiek/refcount.dtx b/macros/latex/contrib/oberdiek/refcount.dtx index dc6df6b5c7..7e242274f3 100644 --- a/macros/latex/contrib/oberdiek/refcount.dtx +++ b/macros/latex/contrib/oberdiek/refcount.dtx @@ -1342,14 +1342,6 @@ and the derived files % \paragraph{Script installation.} % Check the directory \xfile{TDS:scripts/oberdiek/} for % scripts that need further installation steps. -% Package \xpackage{attachfile2} comes with the Perl script -% \xfile{pdfatfi.pl} that should be installed in such a way -% that it can be called as \texttt{pdfatfi}. -% Example (linux): -% \begin{quote} -% |chmod +x scripts/oberdiek/pdfatfi.pl|\\ -% |cp scripts/oberdiek/pdfatfi.pl /usr/local/bin/| -% \end{quote} % % \subsection{Package installation} % diff --git a/macros/latex/contrib/oberdiek/refcount.pdf b/macros/latex/contrib/oberdiek/refcount.pdf index 7086e41cdf..8c10768548 100644 Binary files a/macros/latex/contrib/oberdiek/refcount.pdf and b/macros/latex/contrib/oberdiek/refcount.pdf differ diff --git a/macros/latex/contrib/oberdiek/rerunfilecheck.dtx b/macros/latex/contrib/oberdiek/rerunfilecheck.dtx index 94732005d4..2cb3cbd52b 100644 --- a/macros/latex/contrib/oberdiek/rerunfilecheck.dtx +++ b/macros/latex/contrib/oberdiek/rerunfilecheck.dtx @@ -874,14 +874,6 @@ and the derived files % \paragraph{Script installation.} % Check the directory \xfile{TDS:scripts/oberdiek/} for % scripts that need further installation steps. -% Package \xpackage{attachfile2} comes with the Perl script -% \xfile{pdfatfi.pl} that should be installed in such a way -% that it can be called as \texttt{pdfatfi}. -% Example (linux): -% \begin{quote} -% |chmod +x scripts/oberdiek/pdfatfi.pl|\\ -% |cp scripts/oberdiek/pdfatfi.pl /usr/local/bin/| -% \end{quote} % % \subsection{Package installation} % diff --git a/macros/latex/contrib/oberdiek/rerunfilecheck.pdf b/macros/latex/contrib/oberdiek/rerunfilecheck.pdf index 8996fe806e..87fa86a818 100644 Binary files a/macros/latex/contrib/oberdiek/rerunfilecheck.pdf and b/macros/latex/contrib/oberdiek/rerunfilecheck.pdf differ diff --git a/macros/latex/contrib/oberdiek/resizegather.dtx b/macros/latex/contrib/oberdiek/resizegather.dtx index b335070f08..afc9808fb2 100644 --- a/macros/latex/contrib/oberdiek/resizegather.dtx +++ b/macros/latex/contrib/oberdiek/resizegather.dtx @@ -826,14 +826,6 @@ and the derived files % \paragraph{Script installation.} % Check the directory \xfile{TDS:scripts/oberdiek/} for % scripts that need further installation steps. -% Package \xpackage{attachfile2} comes with the Perl script -% \xfile{pdfatfi.pl} that should be installed in such a way -% that it can be called as \texttt{pdfatfi}. -% Example (linux): -% \begin{quote} -% |chmod +x scripts/oberdiek/pdfatfi.pl|\\ -% |cp scripts/oberdiek/pdfatfi.pl /usr/local/bin/| -% \end{quote} % % \subsection{Package installation} % diff --git a/macros/latex/contrib/oberdiek/resizegather.pdf b/macros/latex/contrib/oberdiek/resizegather.pdf index b88ef36c22..c2853465aa 100644 Binary files a/macros/latex/contrib/oberdiek/resizegather.pdf and b/macros/latex/contrib/oberdiek/resizegather.pdf differ diff --git a/macros/latex/contrib/oberdiek/rotchiffre.dtx b/macros/latex/contrib/oberdiek/rotchiffre.dtx index eab273787f..747aee813e 100644 --- a/macros/latex/contrib/oberdiek/rotchiffre.dtx +++ b/macros/latex/contrib/oberdiek/rotchiffre.dtx @@ -1158,14 +1158,6 @@ and the derived files % \paragraph{Script installation.} % Check the directory \xfile{TDS:scripts/oberdiek/} for % scripts that need further installation steps. -% Package \xpackage{attachfile2} comes with the Perl script -% \xfile{pdfatfi.pl} that should be installed in such a way -% that it can be called as \texttt{pdfatfi}. -% Example (linux): -% \begin{quote} -% |chmod +x scripts/oberdiek/pdfatfi.pl|\\ -% |cp scripts/oberdiek/pdfatfi.pl /usr/local/bin/| -% \end{quote} % % \subsection{Package installation} % diff --git a/macros/latex/contrib/oberdiek/rotchiffre.pdf b/macros/latex/contrib/oberdiek/rotchiffre.pdf index 40783bb896..c161579a4d 100644 Binary files a/macros/latex/contrib/oberdiek/rotchiffre.pdf and b/macros/latex/contrib/oberdiek/rotchiffre.pdf differ diff --git a/macros/latex/contrib/oberdiek/scrindex.dtx b/macros/latex/contrib/oberdiek/scrindex.dtx index 8b754c2297..ddda8f22c1 100644 --- a/macros/latex/contrib/oberdiek/scrindex.dtx +++ b/macros/latex/contrib/oberdiek/scrindex.dtx @@ -570,14 +570,6 @@ and the derived files % \paragraph{Script installation.} % Check the directory \xfile{TDS:scripts/oberdiek/} for % scripts that need further installation steps. -% Package \xpackage{attachfile2} comes with the Perl script -% \xfile{pdfatfi.pl} that should be installed in such a way -% that it can be called as \texttt{pdfatfi}. -% Example (linux): -% \begin{quote} -% |chmod +x scripts/oberdiek/pdfatfi.pl|\\ -% |cp scripts/oberdiek/pdfatfi.pl /usr/local/bin/| -% \end{quote} % % \subsection{Package installation} % diff --git a/macros/latex/contrib/oberdiek/scrindex.pdf b/macros/latex/contrib/oberdiek/scrindex.pdf index 961528a70b..a35b135af2 100644 Binary files a/macros/latex/contrib/oberdiek/scrindex.pdf and b/macros/latex/contrib/oberdiek/scrindex.pdf differ diff --git a/macros/latex/contrib/oberdiek/selinput.dtx b/macros/latex/contrib/oberdiek/selinput.dtx index 36cbd1b5de..2c536b648d 100644 --- a/macros/latex/contrib/oberdiek/selinput.dtx +++ b/macros/latex/contrib/oberdiek/selinput.dtx @@ -816,14 +816,6 @@ and the derived files % \paragraph{Script installation.} % Check the directory \xfile{TDS:scripts/oberdiek/} for % scripts that need further installation steps. -% Package \xpackage{attachfile2} comes with the Perl script -% \xfile{pdfatfi.pl} that should be installed in such a way -% that it can be called as \texttt{pdfatfi}. -% Example (linux): -% \begin{quote} -% |chmod +x scripts/oberdiek/pdfatfi.pl|\\ -% |cp scripts/oberdiek/pdfatfi.pl /usr/local/bin/| -% \end{quote} % % \subsection{Package installation} % diff --git a/macros/latex/contrib/oberdiek/selinput.pdf b/macros/latex/contrib/oberdiek/selinput.pdf index 0f78dc3a93..f30f44bdc5 100644 Binary files a/macros/latex/contrib/oberdiek/selinput.pdf and b/macros/latex/contrib/oberdiek/selinput.pdf differ diff --git a/macros/latex/contrib/oberdiek/setouterhbox.dtx b/macros/latex/contrib/oberdiek/setouterhbox.dtx index 6d85677a0a..760d8d5a00 100644 --- a/macros/latex/contrib/oberdiek/setouterhbox.dtx +++ b/macros/latex/contrib/oberdiek/setouterhbox.dtx @@ -968,14 +968,6 @@ by/a/very_long_long_long_path.html}% % \paragraph{Script installation.} % Check the directory \xfile{TDS:scripts/oberdiek/} for % scripts that need further installation steps. -% Package \xpackage{attachfile2} comes with the Perl script -% \xfile{pdfatfi.pl} that should be installed in such a way -% that it can be called as \texttt{pdfatfi}. -% Example (linux): -% \begin{quote} -% |chmod +x scripts/oberdiek/pdfatfi.pl|\\ -% |cp scripts/oberdiek/pdfatfi.pl /usr/local/bin/| -% \end{quote} % % \subsection{Package installation} % diff --git a/macros/latex/contrib/oberdiek/setouterhbox.pdf b/macros/latex/contrib/oberdiek/setouterhbox.pdf index a015980ca7..887945ff4f 100644 Binary files a/macros/latex/contrib/oberdiek/setouterhbox.pdf and b/macros/latex/contrib/oberdiek/setouterhbox.pdf differ diff --git a/macros/latex/contrib/oberdiek/settobox.dtx b/macros/latex/contrib/oberdiek/settobox.dtx index 59f07638ac..1ba8c60fb1 100644 --- a/macros/latex/contrib/oberdiek/settobox.dtx +++ b/macros/latex/contrib/oberdiek/settobox.dtx @@ -580,14 +580,6 @@ and the derived files % \paragraph{Script installation.} % Check the directory \xfile{TDS:scripts/oberdiek/} for % scripts that need further installation steps. -% Package \xpackage{attachfile2} comes with the Perl script -% \xfile{pdfatfi.pl} that should be installed in such a way -% that it can be called as \texttt{pdfatfi}. -% Example (linux): -% \begin{quote} -% |chmod +x scripts/oberdiek/pdfatfi.pl|\\ -% |cp scripts/oberdiek/pdfatfi.pl /usr/local/bin/| -% \end{quote} % % \subsection{Package installation} % diff --git a/macros/latex/contrib/oberdiek/settobox.pdf b/macros/latex/contrib/oberdiek/settobox.pdf index be824220ee..5636e9bdc1 100644 Binary files a/macros/latex/contrib/oberdiek/settobox.pdf and b/macros/latex/contrib/oberdiek/settobox.pdf differ diff --git a/macros/latex/contrib/oberdiek/soulutf8.dtx b/macros/latex/contrib/oberdiek/soulutf8.dtx index a239f608a1..fc97c5e725 100644 --- a/macros/latex/contrib/oberdiek/soulutf8.dtx +++ b/macros/latex/contrib/oberdiek/soulutf8.dtx @@ -1708,14 +1708,6 @@ and the derived files % \paragraph{Script installation.} % Check the directory \xfile{TDS:scripts/oberdiek/} for % scripts that need further installation steps. -% Package \xpackage{attachfile2} comes with the Perl script -% \xfile{pdfatfi.pl} that should be installed in such a way -% that it can be called as \texttt{pdfatfi}. -% Example (linux): -% \begin{quote} -% |chmod +x scripts/oberdiek/pdfatfi.pl|\\ -% |cp scripts/oberdiek/pdfatfi.pl /usr/local/bin/| -% \end{quote} % % \subsection{Package installation} % diff --git a/macros/latex/contrib/oberdiek/soulutf8.pdf b/macros/latex/contrib/oberdiek/soulutf8.pdf index 291441c643..727d4cea46 100644 Binary files a/macros/latex/contrib/oberdiek/soulutf8.pdf and b/macros/latex/contrib/oberdiek/soulutf8.pdf differ diff --git a/macros/latex/contrib/oberdiek/stackrel.dtx b/macros/latex/contrib/oberdiek/stackrel.dtx index c04ba1f2e5..50119e5424 100644 --- a/macros/latex/contrib/oberdiek/stackrel.dtx +++ b/macros/latex/contrib/oberdiek/stackrel.dtx @@ -338,14 +338,6 @@ and the derived files % \paragraph{Script installation.} % Check the directory \xfile{TDS:scripts/oberdiek/} for % scripts that need further installation steps. -% Package \xpackage{attachfile2} comes with the Perl script -% \xfile{pdfatfi.pl} that should be installed in such a way -% that it can be called as \texttt{pdfatfi}. -% Example (linux): -% \begin{quote} -% |chmod +x scripts/oberdiek/pdfatfi.pl|\\ -% |cp scripts/oberdiek/pdfatfi.pl /usr/local/bin/| -% \end{quote} % % \subsection{Package installation} % diff --git a/macros/latex/contrib/oberdiek/stackrel.pdf b/macros/latex/contrib/oberdiek/stackrel.pdf index f9a76ae18e..66000cabe9 100644 Binary files a/macros/latex/contrib/oberdiek/stackrel.pdf and b/macros/latex/contrib/oberdiek/stackrel.pdf differ diff --git a/macros/latex/contrib/oberdiek/stampinclude.dtx b/macros/latex/contrib/oberdiek/stampinclude.dtx index 62b3d2cf4f..d20f2da6b1 100644 --- a/macros/latex/contrib/oberdiek/stampinclude.dtx +++ b/macros/latex/contrib/oberdiek/stampinclude.dtx @@ -480,14 +480,6 @@ and the derived files % \paragraph{Script installation.} % Check the directory \xfile{TDS:scripts/oberdiek/} for % scripts that need further installation steps. -% Package \xpackage{attachfile2} comes with the Perl script -% \xfile{pdfatfi.pl} that should be installed in such a way -% that it can be called as \texttt{pdfatfi}. -% Example (linux): -% \begin{quote} -% |chmod +x scripts/oberdiek/pdfatfi.pl|\\ -% |cp scripts/oberdiek/pdfatfi.pl /usr/local/bin/| -% \end{quote} % % \subsection{Package installation} % diff --git a/macros/latex/contrib/oberdiek/stampinclude.pdf b/macros/latex/contrib/oberdiek/stampinclude.pdf index 0d98223617..587329bd59 100644 Binary files a/macros/latex/contrib/oberdiek/stampinclude.pdf and b/macros/latex/contrib/oberdiek/stampinclude.pdf differ diff --git a/macros/latex/contrib/oberdiek/stringenc.dtx b/macros/latex/contrib/oberdiek/stringenc.dtx index 7236faf756..9720553751 100644 --- a/macros/latex/contrib/oberdiek/stringenc.dtx +++ b/macros/latex/contrib/oberdiek/stringenc.dtx @@ -6604,14 +6604,6 @@ $ \fi % \paragraph{Script installation.} % Check the directory \xfile{TDS:scripts/oberdiek/} for % scripts that need further installation steps. -% Package \xpackage{attachfile2} comes with the Perl script -% \xfile{pdfatfi.pl} that should be installed in such a way -% that it can be called as \texttt{pdfatfi}. -% Example (linux): -% \begin{quote} -% |chmod +x scripts/oberdiek/pdfatfi.pl|\\ -% |cp scripts/oberdiek/pdfatfi.pl /usr/local/bin/| -% \end{quote} % % \subsection{Package installation} % diff --git a/macros/latex/contrib/oberdiek/stringenc.pdf b/macros/latex/contrib/oberdiek/stringenc.pdf index c288e4c9e2..b910941478 100644 Binary files a/macros/latex/contrib/oberdiek/stringenc.pdf and b/macros/latex/contrib/oberdiek/stringenc.pdf differ diff --git a/macros/latex/contrib/oberdiek/tabularht.dtx b/macros/latex/contrib/oberdiek/tabularht.dtx index 559084a35f..010fc42e69 100644 --- a/macros/latex/contrib/oberdiek/tabularht.dtx +++ b/macros/latex/contrib/oberdiek/tabularht.dtx @@ -1025,14 +1025,6 @@ and the derived files % \paragraph{Script installation.} % Check the directory \xfile{TDS:scripts/oberdiek/} for % scripts that need further installation steps. -% Package \xpackage{attachfile2} comes with the Perl script -% \xfile{pdfatfi.pl} that should be installed in such a way -% that it can be called as \texttt{pdfatfi}. -% Example (linux): -% \begin{quote} -% |chmod +x scripts/oberdiek/pdfatfi.pl|\\ -% |cp scripts/oberdiek/pdfatfi.pl /usr/local/bin/| -% \end{quote} % % \subsection{Package installation} % diff --git a/macros/latex/contrib/oberdiek/tabularht.pdf b/macros/latex/contrib/oberdiek/tabularht.pdf index ab24beeb09..cf52c402d3 100644 Binary files a/macros/latex/contrib/oberdiek/tabularht.pdf and b/macros/latex/contrib/oberdiek/tabularht.pdf differ diff --git a/macros/latex/contrib/oberdiek/tabularkv.dtx b/macros/latex/contrib/oberdiek/tabularkv.dtx index 3c3fc3f48c..d9a3335250 100644 --- a/macros/latex/contrib/oberdiek/tabularkv.dtx +++ b/macros/latex/contrib/oberdiek/tabularkv.dtx @@ -343,14 +343,6 @@ and the derived files % \paragraph{Script installation.} % Check the directory \xfile{TDS:scripts/oberdiek/} for % scripts that need further installation steps. -% Package \xpackage{attachfile2} comes with the Perl script -% \xfile{pdfatfi.pl} that should be installed in such a way -% that it can be called as \texttt{pdfatfi}. -% Example (linux): -% \begin{quote} -% |chmod +x scripts/oberdiek/pdfatfi.pl|\\ -% |cp scripts/oberdiek/pdfatfi.pl /usr/local/bin/| -% \end{quote} % % \subsection{Package installation} % diff --git a/macros/latex/contrib/oberdiek/tabularkv.pdf b/macros/latex/contrib/oberdiek/tabularkv.pdf index 57324c76a2..0433d0e11e 100644 Binary files a/macros/latex/contrib/oberdiek/tabularkv.pdf and b/macros/latex/contrib/oberdiek/tabularkv.pdf differ diff --git a/macros/latex/contrib/oberdiek/telprint.dtx b/macros/latex/contrib/oberdiek/telprint.dtx index 8d81cf81f1..329a7b3dc2 100644 --- a/macros/latex/contrib/oberdiek/telprint.dtx +++ b/macros/latex/contrib/oberdiek/telprint.dtx @@ -773,14 +773,6 @@ and the derived files % \paragraph{Script installation.} % Check the directory \xfile{TDS:scripts/oberdiek/} for % scripts that need further installation steps. -% Package \xpackage{attachfile2} comes with the Perl script -% \xfile{pdfatfi.pl} that should be installed in such a way -% that it can be called as \texttt{pdfatfi}. -% Example (linux): -% \begin{quote} -% |chmod +x scripts/oberdiek/pdfatfi.pl|\\ -% |cp scripts/oberdiek/pdfatfi.pl /usr/local/bin/| -% \end{quote} % % \subsection{Package installation} % diff --git a/macros/latex/contrib/oberdiek/telprint.pdf b/macros/latex/contrib/oberdiek/telprint.pdf index 9f3e2d984f..088efd0f80 100644 Binary files a/macros/latex/contrib/oberdiek/telprint.pdf and b/macros/latex/contrib/oberdiek/telprint.pdf differ diff --git a/macros/latex/contrib/oberdiek/thepdfnumber.dtx b/macros/latex/contrib/oberdiek/thepdfnumber.dtx index 98b65bbccf..2195b32745 100644 --- a/macros/latex/contrib/oberdiek/thepdfnumber.dtx +++ b/macros/latex/contrib/oberdiek/thepdfnumber.dtx @@ -1432,14 +1432,6 @@ $ \else\ifnum`#2=46 % . % \paragraph{Script installation.} % Check the directory \xfile{TDS:scripts/oberdiek/} for % scripts that need further installation steps. -% Package \xpackage{attachfile2} comes with the Perl script -% \xfile{pdfatfi.pl} that should be installed in such a way -% that it can be called as \texttt{pdfatfi}. -% Example (linux): -% \begin{quote} -% |chmod +x scripts/oberdiek/pdfatfi.pl|\\ -% |cp scripts/oberdiek/pdfatfi.pl /usr/local/bin/| -% \end{quote} % % \subsection{Package installation} % diff --git a/macros/latex/contrib/oberdiek/thepdfnumber.pdf b/macros/latex/contrib/oberdiek/thepdfnumber.pdf index 8244592592..7fabbf22f1 100644 Binary files a/macros/latex/contrib/oberdiek/thepdfnumber.pdf and b/macros/latex/contrib/oberdiek/thepdfnumber.pdf differ diff --git a/macros/latex/contrib/oberdiek/transparent.dtx b/macros/latex/contrib/oberdiek/transparent.dtx index c9a4ca231f..701e643a06 100644 --- a/macros/latex/contrib/oberdiek/transparent.dtx +++ b/macros/latex/contrib/oberdiek/transparent.dtx @@ -455,14 +455,6 @@ Hello World % \paragraph{Script installation.} % Check the directory \xfile{TDS:scripts/oberdiek/} for % scripts that need further installation steps. -% Package \xpackage{attachfile2} comes with the Perl script -% \xfile{pdfatfi.pl} that should be installed in such a way -% that it can be called as \texttt{pdfatfi}. -% Example (linux): -% \begin{quote} -% |chmod +x scripts/oberdiek/pdfatfi.pl|\\ -% |cp scripts/oberdiek/pdfatfi.pl /usr/local/bin/| -% \end{quote} % % \subsection{Package installation} % diff --git a/macros/latex/contrib/oberdiek/transparent.pdf b/macros/latex/contrib/oberdiek/transparent.pdf index 5d1581280e..eb249ba722 100644 Binary files a/macros/latex/contrib/oberdiek/transparent.pdf and b/macros/latex/contrib/oberdiek/transparent.pdf differ diff --git a/macros/latex/contrib/oberdiek/twoopt.dtx b/macros/latex/contrib/oberdiek/twoopt.dtx index f63139d4a6..f4528af812 100644 --- a/macros/latex/contrib/oberdiek/twoopt.dtx +++ b/macros/latex/contrib/oberdiek/twoopt.dtx @@ -422,14 +422,6 @@ and the derived files % \paragraph{Script installation.} % Check the directory \xfile{TDS:scripts/oberdiek/} for % scripts that need further installation steps. -% Package \xpackage{attachfile2} comes with the Perl script -% \xfile{pdfatfi.pl} that should be installed in such a way -% that it can be called as \texttt{pdfatfi}. -% Example (linux): -% \begin{quote} -% |chmod +x scripts/oberdiek/pdfatfi.pl|\\ -% |cp scripts/oberdiek/pdfatfi.pl /usr/local/bin/| -% \end{quote} % % \subsection{Package installation} % diff --git a/macros/latex/contrib/oberdiek/twoopt.pdf b/macros/latex/contrib/oberdiek/twoopt.pdf index fb3a3d0e53..f9a0777eaa 100644 Binary files a/macros/latex/contrib/oberdiek/twoopt.pdf and b/macros/latex/contrib/oberdiek/twoopt.pdf differ diff --git a/macros/latex/contrib/oberdiek/uniquecounter.dtx b/macros/latex/contrib/oberdiek/uniquecounter.dtx index 1fd992554e..d11090da70 100644 --- a/macros/latex/contrib/oberdiek/uniquecounter.dtx +++ b/macros/latex/contrib/oberdiek/uniquecounter.dtx @@ -848,14 +848,6 @@ and the derived files % \paragraph{Script installation.} % Check the directory \xfile{TDS:scripts/oberdiek/} for % scripts that need further installation steps. -% Package \xpackage{attachfile2} comes with the Perl script -% \xfile{pdfatfi.pl} that should be installed in such a way -% that it can be called as \texttt{pdfatfi}. -% Example (linux): -% \begin{quote} -% |chmod +x scripts/oberdiek/pdfatfi.pl|\\ -% |cp scripts/oberdiek/pdfatfi.pl /usr/local/bin/| -% \end{quote} % % \subsection{Package installation} % diff --git a/macros/latex/contrib/oberdiek/uniquecounter.pdf b/macros/latex/contrib/oberdiek/uniquecounter.pdf index e89d429082..95bb0e1215 100644 Binary files a/macros/latex/contrib/oberdiek/uniquecounter.pdf and b/macros/latex/contrib/oberdiek/uniquecounter.pdf differ diff --git a/macros/latex/contrib/oberdiek/zref.dtx b/macros/latex/contrib/oberdiek/zref.dtx index d8e7070cd2..0a8e7f0505 100644 --- a/macros/latex/contrib/oberdiek/zref.dtx +++ b/macros/latex/contrib/oberdiek/zref.dtx @@ -7,7 +7,7 @@ % Copyright (C) 2006-2012 by % Heiko Oberdiek % 2016 -% https://github.com/ho-tex/oberdiek/issueso +% https://github.com/ho-tex/oberdiek/issues % % This work may be distributed and/or modified under the % conditions of the LaTeX Project Public License, either @@ -6423,14 +6423,6 @@ the height difference of the two baselines is % \paragraph{Script installation.} % Check the directory \xfile{TDS:scripts/oberdiek/} for % scripts that need further installation steps. -% Package \xpackage{attachfile2} comes with the Perl script -% \xfile{pdfatfi.pl} that should be installed in such a way -% that it can be called as \texttt{pdfatfi}. -% Example (linux): -% \begin{quote} -% |chmod +x scripts/oberdiek/pdfatfi.pl|\\ -% |cp scripts/oberdiek/pdfatfi.pl /usr/local/bin/| -% \end{quote} % % \subsection{Package installation} % diff --git a/macros/latex/contrib/oberdiek/zref.pdf b/macros/latex/contrib/oberdiek/zref.pdf index e5d5de9d07..9a6a9e03a2 100644 Binary files a/macros/latex/contrib/oberdiek/zref.pdf and b/macros/latex/contrib/oberdiek/zref.pdf differ diff --git a/macros/latex/contrib/pdfcolmk/README.md b/macros/latex/contrib/pdfcolmk/README.md new file mode 100644 index 0000000000..2377abfd29 --- /dev/null +++ b/macros/latex/contrib/pdfcolmk/README.md @@ -0,0 +1,14 @@ +# pdfcolmk + +legacy stub for pdfcolmk package + + +This package does nothing at all. + +The original documented source is available at + +https://github.com/ho-tex/old-source + +Please report any issues to + +https://github.com/ho-tex/pdfcolmk/issues diff --git a/macros/latex/contrib/pdfcolmk/pdfcolmk.sty b/macros/latex/contrib/pdfcolmk/pdfcolmk.sty new file mode 100644 index 0000000000..1dc259b5f1 --- /dev/null +++ b/macros/latex/contrib/pdfcolmk/pdfcolmk.sty @@ -0,0 +1,24 @@ +% pdfcolmk +% +% Copyright 2019 Oberdiek Package Support Group +% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either +%% version 1.3c of this license or (at your option) any later +%% version. + +\ProvidesPackage{pdfcolmk}% + [2019/11/24 v2.0 Color support for pdfTeX via marks] + +% This is a legacy stub for the original pdfcolmk package +% which provided color stack support for pdftex prior to +% release 1.40 (which was released in 2007) + +% This package does nothing at all. + +% The original documented source is available at +% https://github.com/ho-tex/old-source + +% Please report any issues to +% https://github.com/ho-tex/pdfcolmk/issues + diff --git a/macros/latex/contrib/pdftexcmds/README.md b/macros/latex/contrib/pdftexcmds/README.md new file mode 100644 index 0000000000..1079a2ccf2 --- /dev/null +++ b/macros/latex/contrib/pdftexcmds/README.md @@ -0,0 +1,11 @@ +# pdftexcmds +pdftexcmds package for LaTeX + + + + + + doc/latex/pdftexcmds/pdftexcmds.pdf + scripts/pdftexcmds/pdftexcmds.lua + source/latex/pdftexcmds/pdftexcmds.dtx + tex/generic/pdftexcmds/pdftexcmds.sty diff --git a/macros/latex/contrib/pdftexcmds/pdftexcmds.dtx b/macros/latex/contrib/pdftexcmds/pdftexcmds.dtx new file mode 100644 index 0000000000..c7002222ea --- /dev/null +++ b/macros/latex/contrib/pdftexcmds/pdftexcmds.dtx @@ -0,0 +1,2662 @@ +% \iffalse meta-comment +% +% File: pdftexcmds.dtx +% Version: 2019/11/24 v0.31 +% Info: Utility functions of pdfTeX for LuaTeX +% +% Copyright (C) +% 2007, 2009-2011 Heiko Oberdiek +% 2016-2019 Oberdiek Package Support Group +% +% This work may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either +% version 1.3c of this license or (at your option) any later +% version. This version of this license is in +% https://www.latex-project.org/lppl/lppl-1-3c.txt +% and the latest version of this license is in +% https://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". +% +% The Current Maintainers of this work are +% Heiko Oberdiek and the Oberdiek Package Support Group +% https://github.com/ho-tex/pdftexcmds/issues +% +% The Base Interpreter refers to any `TeX-Format', +% because some files are installed in TDS:tex/generic//. +% +% This work consists of the main source file pdftexcmds.dtx +% and the derived files +% pdftexcmds.sty, pdftexcmds.pdf, pdftexcmds.ins, pdftexcmds.drv, +% pdftexcmds.bib, pdftexcmds-test1.tex, pdftexcmds-test2.tex, +% pdftexcmds-test-shell.tex, pdftexcmds-test-escape.tex, +% pdftexcmds.lua. +% +% Distribution: +% CTAN:macros/latex/contrib/pdftexcmds/pdftexcmds.dtx +% CTAN:macros/latex/contrib/pdftexcmds/pdftexcmds.pdf +% +% Unpacking: +% (a) If pdftexcmds.ins is present: +% tex pdftexcmds.ins +% (b) Without pdftexcmds.ins: +% tex pdftexcmds.dtx +% (c) If you insist on using LaTeX +% latex \let\install=y\input{pdftexcmds.dtx} +% (quote the arguments according to the demands of your shell) +% +% Documentation: +% (a) If pdftexcmds.drv is present: +% latex pdftexcmds.drv +% (b) Without pdftexcmds.drv: +% latex pdftexcmds.dtx; ... +% The class ltxdoc loads the configuration file ltxdoc.cfg +% if available. Here you can specify further options, e.g. +% use A4 as paper format: +% \PassOptionsToClass{a4paper}{article} +% +% Programm calls to get the documentation (example): +% pdflatex pdftexcmds.dtx +% bibtex pdftexcmds.aux +% makeindex -s gind.ist pdftexcmds.idx +% pdflatex pdftexcmds.dtx +% makeindex -s gind.ist pdftexcmds.idx +% pdflatex pdftexcmds.dtx +% +% Installation: +% TDS:tex/generic/pdftexcmds/pdftexcmds.sty +% TDS:scripts/pdftexcmds/pdftexcmds.lua +% TDS:doc/latex/pdftexcmds/pdftexcmds.pdf +% TDS:source/latex/pdftexcmds/pdftexcmds.dtx +% +%<*ignore> +\begingroup + \catcode123=1 % + \catcode125=2 % + \def\x{LaTeX2e}% +\expandafter\endgroup +\ifcase 0\ifx\install y1\fi\expandafter + \ifx\csname processbatchFile\endcsname\relax\else1\fi + \ifx\fmtname\x\else 1\fi\relax +\else\csname fi\endcsname +% +%<*install> +\input docstrip.tex +\Msg{************************************************************************} +\Msg{* Installation} +\Msg{* Package: pdftexcmds 2019/11/24 v0.31 Utility functions of pdfTeX for LuaTeX (HO)} +\Msg{************************************************************************} + +\keepsilent +\askforoverwritefalse + +\let\MetaPrefix\relax +\preamble + +This is a generated file. + +Project: pdftexcmds +Version: 2019/11/24 v0.31 + +Copyright (C) + 2007, 2009-2011 Heiko Oberdiek + 2016-2019 Oberdiek Package Support Group + +This work may be distributed and/or modified under the +conditions of the LaTeX Project Public License, either +version 1.3c of this license or (at your option) any later +version. This version of this license is in + https://www.latex-project.org/lppl/lppl-1-3c.txt +and the latest version of this license is in + https://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". + +The Current Maintainers of this work are +Heiko Oberdiek and the Oberdiek Package Support Group +https://github.com/ho-tex/pdftexcmds/issues + + +The Base Interpreter refers to any `TeX-Format', +because some files are installed in TDS:tex/generic//. + +This work consists of the main source file pdftexcmds.dtx +and the derived files + pdftexcmds.sty, pdftexcmds.pdf, pdftexcmds.ins, pdftexcmds.drv, + pdftexcmds.lua. + +\endpreamble +\let\MetaPrefix\DoubleperCent + +\generate{% + \file{pdftexcmds.ins}{\from{pdftexcmds.dtx}{install}}% + \file{pdftexcmds.drv}{\from{pdftexcmds.dtx}{driver}}% + \nopreamble + \nopostamble + \file{pdftexcmds.bib}{\from{pdftexcmds.dtx}{bib}}% + \usepreamble\defaultpreamble + \usepostamble\defaultpostamble + \usedir{tex/generic/pdftexcmds}% + \file{pdftexcmds.sty}{\from{pdftexcmds.dtx}{package}}% +% \usedir{doc/latex/pdftexcmds/test}% +% \file{pdftexcmds-test1.tex}{\from{pdftexcmds.dtx}{test1}}% +% \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{% + \MetaPrefix^^J% + \MetaPrefix\space End of File `\outFileName'.% +} +\def\currentpostamble{\defaultpostamble}% +\generate{% + \usedir{scripts/pdftexcmds}% + \file{pdftexcmds.lua}{\from{pdftexcmds.dtx}{lua}}% +} + +\catcode32=13\relax% active space +\let =\space% +\Msg{************************************************************************} +\Msg{*} +\Msg{* To finish the installation you have to move the following} +\Msg{* file into a directory searched by TeX:} +\Msg{*} +\Msg{* pdftexcmds.sty} +\Msg{*} +\Msg{* And install the following script files:} +\Msg{*} +\Msg{* pdftexcmds.lua} +\Msg{*} +\Msg{* To produce the documentation run the file `pdftexcmds.drv'} +\Msg{* through LaTeX.} +\Msg{*} +\Msg{* Happy TeXing!} +\Msg{*} +\Msg{************************************************************************} + +\endbatchfile +% +%<*bib> +@online{AndyThomas:Analog, + author={Thomas, Andy}, + title={Analog of {\texttt{\csname textbackslash\endcsname}pdfelapsedtime} for + {\hologo{LuaTeX}} and {\hologo{XeTeX}}}, + url={http://tex.stackexchange.com/a/32531}, + urldate={2011-11-29}, +} +% +%<*ignore> +\fi +% +%<*driver> +\NeedsTeXFormat{LaTeX2e} +\ProvidesFile{pdftexcmds.drv}% + [2019/11/24 v0.31 Utility functions of pdfTeX for LuaTeX (HO)]% +\documentclass{ltxdoc} +\usepackage{holtxdoc}[2011/11/22] +\usepackage{paralist} +\usepackage{csquotes} +\usepackage[ + backend=bibtex, + bibencoding=ascii, + alldates=iso8601, +]{biblatex}[2011/11/13] +\bibliography{oberdiek-source} +\bibliography{pdftexcmds} +\begin{document} + \DocInput{pdftexcmds.dtx}% +\end{document} +% +% \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} +% \author{Heiko Oberdiek\thanks +% {Please report any issues at \url{https://github.com/ho-tex/pdftexcmds/issues}}} +% +% \maketitle +% +% \begin{abstract} +% \hologo{LuaTeX} provides most of the commands of \hologo{pdfTeX} 1.40. However +% a number of utility functions are removed. This package tries to fill +% the gap and implements some of the missing primitive using Lua. +% \end{abstract} +% +% \tableofcontents +% +% \def\csi#1{\texttt{\textbackslash\textit{#1}}} +% +% \section{Documentation} +% +% Some primitives of \hologo{pdfTeX} \cite{pdftex-manual} +% are not defined by \hologo{LuaTeX} \cite{luatex-manual}. +% This package implements macro based solutions using Lua code +% for the following missing \hologo{pdfTeX} primitives; +% \begin{compactitem} +% \item \cs{pdfstrcmp} +% \item \cs{pdfunescapehex} +% \item \cs{pdfescapehex} +% \item \cs{pdfescapename} +% \item \cs{pdfescapestring} +% \item \cs{pdffilesize} +% \item \cs{pdffilemoddate} +% \item \cs{pdffiledump} +% \item \cs{pdfmdfivesum} +% \item \cs{pdfresettimer} +% \item \cs{pdfelapsedtime} +% \item |\immediate\write18| +% \end{compactitem} +% The original names of the primitives cannot be used: +% \begin{itemize} +% \item +% The syntax for their arguments cannot easily +% simulated by macros. The primitives using key words +% such as |file| (\cs{pdfmdfivesum}) or |offset| and |length| +% (\cs{pdffiledump}) and uses \meta{general text} for the other +% arguments. Using token registers assignments, \meta{general text} could +% be catched. However, the simulated primitives are expandable +% and register assignments would destroy this important property. +% (\meta{general text} allows something like |\expandafter\bgroup ...}|.) +% \item +% The original primitives can be expanded using one expansion step. +% The new macros need two expansion steps because of the additional +% macro expansion. Example: +% \begin{quote} +% |\expandafter\foo\pdffilemoddate{file}|\\ +% vs.\\ +% |\expandafter\expandafter\expandafter|\\ +% |\foo\pdf@filemoddate{file}| +% \end{quote} +% \end{itemize} +% +% \hologo{LuaTeX} isn't stable yet and thus the status of this package is +% \emph{experimental}. Feedback is welcome. +% +% \subsection{General principles} +% +% \begin{description} +% \item[Naming convention:] +% Usually this package defines a macro |\pdf@|\meta{cmd} if +% \hologo{pdfTeX} provides |\pdf|\meta{cmd}. +% \item[Arguments:] The order of arguments in |\pdf@|\meta{cmd} +% is the same as for the corresponding primitive of \hologo{pdfTeX}. +% The arguments are ordinary undelimited \hologo{TeX} arguments, +% no \meta{general text} and without additional keywords. +% \item[Expandibility:] +% The macro |\pdf@|\meta{cmd} is expandable if the +% corresponding \hologo{pdfTeX} primitive has this property. +% Exact two expansion steps are necessary (first is the macro +% expansion) except for \cs{pdf@primitive} and \cs{pdf@ifprimitive}. +% The latter ones are not macros, but have the direct meaning of the +% primitive. +% \item[Without \hologo{LuaTeX}:] +% The macros |\pdf@|\meta{cmd} are mapped to the commands +% of \hologo{pdfTeX} if they are available. Otherwise they are undefined. +% \item[Availability:] +% The macros that the packages provides are undefined, if +% the necessary primitives are not found and cannot be +% implemented by Lua. +% \end{description} +% +% \subsection{Macros} +% +% \subsubsection[Strings]{Strings \cite[``7.15 Strings'']{pdftex-manual}} +% +% \begin{declcs}{pdf@strcmp} \M{stringA} \M{stringB} +% \end{declcs} +% Same as |\pdfstrcmp{|\meta{stringA}|}{|\meta{stringB}|}|. +% +% \begin{declcs}{pdf@unescapehex} \M{string} +% \end{declcs} +% Same as |\pdfunescapehex{|\meta{string}|}|. +% The argument is a byte string given in hexadecimal notation. +% The result are character tokens from 0 until 255 with +% catcode 12 and the space with catcode 10. +% +% \begin{declcs}{pdf@escapehex} \M{string}\\ +% \cs{pdf@escapestring} \M{string}\\ +% \cs{pdf@escapename} \M{string} +% \end{declcs} +% Same as the primitives of \hologo{pdfTeX}. However \hologo{pdfTeX} does not +% know about characters with codes 256 and larger. Thus the +% string is treated as byte string, characters with more than +% eight bits are ignored. +% +% \subsubsection[Files]{Files \cite[``7.18 Files'']{pdftex-manual}} +% +% \begin{declcs}{pdf@filesize} \M{filename} +% \end{declcs} +% Same as |\pdffilesize{|\meta{filename}|}|. +% +% \begin{declcs}{pdf@filemoddate} \M{filename} +% \end{declcs} +% Same as |\pdffilemoddate{|\meta{filename}|}|. +% +% \begin{declcs}{pdf@filedump} \M{offset} \M{length} \M{filename} +% \end{declcs} +% Same as |\pdffiledump offset| \meta{offset} |length| \meta{length} +% |{|\meta{filename}|}|. Both \meta{offset} and \meta{length} must +% not be empty, but must be a valid \hologo{TeX} number. +% +% \begin{declcs}{pdf@mdfivesum} \M{string} +% \end{declcs} +% Same as |\pdfmdfivesum{|\meta{string}|}|. Keyword |file| is supported +% by macro \cs{pdf@filemdfivesum}. +% +% \begin{declcs}{pdf@filemdfivesum} \M{filename} +% \end{declcs} +% Same as |\pdfmdfivesum file{|\meta{filename}|}|. +% +% \subsubsection[Timekeeping]{Timekeeping \cite[``7.17 Timekeeping'']{pdftex-manual}} +% +% The timekeeping macros are based on Andy Thomas' work \cite{AndyThomas:Analog}. +% +% \begin{declcs}{pdf@resettimer} +% \end{declcs} +% Same as \cs{pdfresettimer}, it resets the internal timer. +% +% \begin{declcs}{pdf@elapsedtime} +% \end{declcs} +% Same as \cs{pdfelapsedtime}. It behaves like a read-only integer. +% For printing purposes it can be prefixed by \cs{the} or \cs{number}. +% It measures the time in scaled seconds (seconds multiplied with 65536) +% since the latest call of \cs{pdf@resettimer} or start of +% program/package. The resolution, the shortest time interval that +% can be measured, depends on the program and system. +% \begin{itemize} +% \item \hologo{pdfTeX} with |gettimeofday|: $\ge$ 1/65536\,s +% \item \hologo{pdfTeX} with |ftime|: $\ge$ 1\,ms +% \item \hologo{pdfTeX} with |time|: $\ge$ 1\,s +% \item \hologo{LuaTeX}: $\ge$ 10\,ms\\ +% (|os.clock()| returns a float number with two decimal digits in +% \hologo{LuaTeX} beta-0.70.1-2011061416 (rev 4277)). +% \end{itemize} +% +% \subsubsection[Miscellaneous]{Miscellaneous \cite[``7.21 Miscellaneous'']{pdftex-manual}} +% +% \begin{declcs}{pdf@draftmode} +% \end{declcs} +% If the \TeX\ compiler knows \cs{pdfdraftmode} or \cs{draftmode} +% (\hologo{pdfTeX}, +% \hologo{LuaTeX}), then \cs{pdf@draftmode} returns, whether +% this mode is enabled. The result is an implicit number: +% one means the draft mode is available and enabled. +% If the value is zero, then the mode is not active or +% \cs{pdfdraftmode} is not available. +% An explicit number is yielded by \cs{number}\cs{pdf@draftmode}. +% The macro cannot +% be used to change the mode, see \cs{pdf@setdraftmode}. +% +% \begin{declcs}{pdf@ifdraftmode} \M{true} \M{false} +% \end{declcs} +% If \cs{pdfdraftmode} is available and enabled, \meta{true} is +% called, otherwise \meta{false} is executed. +% +% \begin{declcs}{pdf@setdraftmode} \M{value} +% \end{declcs} +% Macro \cs{pdf@setdraftmode} expects the number zero or one as +% \meta{value}. Zero deactivates the mode and one enables the draft mode. +% The macro does not have an effect, if the feature \cs{pdfdraftmode} is not +% available. +% +% \begin{declcs}{pdf@shellescape} +% \end{declcs} +% Same as |\pdfshellescape|. It is or expands to |1| if external +% commands can be executed and |0| otherwise. In \hologo{pdfTeX} external +% commands must be enabled first by command line option or +% configuration option. In \hologo{LuaTeX} option |--safer| disables +% the execution of external commands. +% +% In \hologo{LuaTeX} before 0.68.0 \cs{pdf@shellescape} is not +% available due to a bug in |os.execute()|. The argumentless form +% crashes in some circumstances with segmentation fault. +% (It is fixed in version 0.68.0 or revision 4167 of \hologo{LuaTeX}. +% and packported to some version of 0.67.0). +% +% Hints for usage: +% \begin{itemize} +% \item Before its use \cs{pdf@shellescape} should be tested, +% whether it is available. Example with package \xpackage{ltxcmds} +% (loaded by package \xpackage{pdftexcmds}): +%\begin{quote} +%\begin{verbatim} +%\ltx@IfUndefined{pdf@shellescape}{% +% % \pdf@shellescape is undefined +%}{% +% % \pdf@shellescape is available +%} +%\end{verbatim} +%\end{quote} +% Use \cs{ltx@ifundefined} in expandable contexts. +% \item \cs{pdf@shellescape} might be a numerical constant, +% expands to the primitive, or expands to a plain number. +% Therefore use it in contexts where these differences does not matter. +% \item Use in comparisons, e.g.: +% \begin{quote} +% |\ifnum\pdf@shellescape=0 ...| +% \end{quote} +% \item Print the number: |\number\pdf@shellescape| +% \end{itemize} +% +% \begin{declcs}{pdf@system} \M{cmdline} +% \end{declcs} +% It is a wrapper for |\immediate\write18| in \hologo{pdfTeX} or +% |os.execute| in \hologo{LuaTeX}. +% +% In theory |os.execute| +% returns a status number. But its meaning is quite +% undefined. Are there some reliable properties? +% Does it make sense to provide an user interface to +% this status exit code? +% +% \begin{declcs}{pdf@primitive} \csi{cmd} +% \end{declcs} +% Same as \cs{pdfprimitive} in \hologo{pdfTeX} or \hologo{LuaTeX}. +% In \hologo{XeTeX} the +% primitive is called \cs{primitive}. Despite the current definition +% of the command \csi{cmd}, it's meaning as primitive is used. +% +% \begin{declcs}{pdf@ifprimitive} \csi{cmd} +% \end{declcs} +% Same as \cs{ifpdfprimitive} in \hologo{pdfTeX} or +% \hologo{LuaTeX}. \hologo{XeTeX} calls +% it \cs{ifprimitive}. It is a switch that checks if the command +% \csi{cmd} has it's primitive meaning. +% +% \subsubsection{Additional macro: \cs{pdf@isprimitive}} +% +% \begin{declcs}{pdf@isprimitive} \csi{cmd1} \csi{cmd2} \M{true} \M{false} +% \end{declcs} +% If \csi{cmd1} has the primitive meaning given by the primitive name +% of \csi{cmd2}, then the argument \meta{true} is executed, otherwise +% \meta{false}. The macro \cs{pdf@isprimitive} is expandable. +% Internally it checks the result of \cs{meaning} and is therefore +% available for all \hologo{TeX} variants, even the original \hologo{TeX}. +% Example with \hologo{LaTeX}: +%\begin{quote} +%\begin{verbatim} +%\makeatletter +%\pdf@isprimitive{@@input}{input}{% +% \typeout{\string\@@input\space is original\string\input}% +%}{% +% \typeout{Oops, \string\@@input\space is not the % +% original\string\input}% +%} +%\end{verbatim} +%\end{quote} +% +% \subsubsection{Experimental} +% +% \begin{declcs}{pdf@unescapehexnative} \M{string}\\ +% \cs{pdf@escapehexnative} \M{string}\\ +% \cs{pdf@escapenamenative} \M{string}\\ +% \cs{pdf@mdfivesumnative} \M{string} +% \end{declcs} +% The variants without |native| in the macro name are supposed to +% be compatible with \hologo{pdfTeX}. However characters with more than +% eight bits are not supported and are ignored. If \hologo{LuaTeX} is +% running, then its UTF-8 coded strings are used. Thus the full +% unicode character range is supported. However the result +% differs from \hologo{pdfTeX} for characters with eight or more bits. +% +% \begin{declcs}{pdf@pipe} \M{cmdline} +% \end{declcs} +% It calls \meta{cmdline} and returns the output of the external +% program in the usual manner as byte string (catcode 12, space with +% catcode 10). The Lua documentation says, that the used |io.popen| +% may not be available on all platforms. Then macro \cs{pdf@pipe} +% is undefined. +% +% \StopEventually{ +% } +% +% \section{Implementation} +% +% \begin{macrocode} +%<*package> +% \end{macrocode} +% +% \subsection{Reload check and package identification} +% Reload check, especially if the package is not used with \LaTeX. +% \begin{macrocode} +\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 + \def\empty{}% + \ifx\x\empty % LaTeX, first loading, + % variable is initialized, but \ProvidesPackage not yet seen + \else + \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{pdftexcmds}{The package is already loaded}% + \aftergroup\endinput + \fi + \fi +\endgroup% +% \end{macrocode} +% Package identification: +% \begin{macrocode} +\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}% + \xdef#1{#4}% + }% + \else + \def\x#1#2[#3]{\endgroup + #2[{#3}]% + \ifx#1\@undefined + \xdef#1{#3}% + \fi + \ifx#1\relax + \xdef#1{#3}% + \fi + }% + \fi +\expandafter\x\csname ver@pdftexcmds.sty\endcsname +\ProvidesPackage{pdftexcmds}% + [2019/11/24 v0.31 Utility functions of pdfTeX for LuaTeX (HO)]% +% \end{macrocode} +% +% \subsection{Catcodes} +% +% \begin{macrocode} +\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{% + \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\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=#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}% ) +\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{58}{12}% : +\TMP@EnsureCode{60}{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}% ` +\TMP@EnsureCode{126}{12}% ~ (other) +\edef\pdftexcmds@AtEnd{% + \pdftexcmds@AtEnd + \escapechar=\number\escapechar\relax + \noexpand\endinput +} +\escapechar=92 % +% \end{macrocode} +% +% \subsection{Load packages} +% +% \begin{macrocode} +\begingroup\expandafter\expandafter\expandafter\endgroup +\expandafter\ifx\csname RequirePackage\endcsname\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{iftex}[2019/11/07]%% + \TMP@RequirePackage{ltxcmds}[2010/12/02]% +\else + \RequirePackage{infwarerr}[2007/09/09]% + \RequirePackage{iftex}[2019/11/07]% + \RequirePackage{ltxcmds}[2010/12/02]% +\fi +% \end{macrocode} +% +% \subsection{Without \hologo{LuaTeX}} +% +% \begin{macrocode} +\ifluatex +\else + \def\pdftexcmds@nopdftex{% + \let\pdftexcmds@nopdftex\relax + }% + \def\pdftexcmds@temp#1{% + \begingroup\expandafter\expandafter\expandafter\endgroup + \expandafter\ifx\csname + \expandafter\ifx\csname pdf#1\endcsname\relax\else pdf\fi#1\endcsname\relax + \pdftexcmds@nopdftex + \else + \expandafter\def\csname pdf@#1\expandafter\endcsname + \expandafter{% + \csname\expandafter\ifx\csname pdf#1\endcsname\relax\else pdf\fi#1\endcsname + }% + \fi + }% + \pdftexcmds@temp{strcmp}% + \pdftexcmds@temp{escapehex}% + \let\pdf@escapehexnative\pdf@escapehex + \pdftexcmds@temp{unescapehex}% + \let\pdf@unescapehexnative\pdf@unescapehex + \pdftexcmds@temp{escapestring}% + \pdftexcmds@temp{escapename}% + \pdftexcmds@temp{filesize}% + \pdftexcmds@temp{filemoddate}% + \begingroup\expandafter\expandafter\expandafter\endgroup + \expandafter\ifx\csname pdfshellescape\endcsname\relax + \pdftexcmds@nopdftex + \ltx@IfUndefined{pdftexversion}{% + }{% + \ifnum\pdftexversion>120 % 1.21a supports \ifeof18 + \ifeof18 % + \chardef\pdf@shellescape=0 % + \else + \chardef\pdf@shellescape=1 % + \fi + \fi + }% + \else + \def\pdf@shellescape{% + \pdfshellescape + }% + \fi + \begingroup\expandafter\expandafter\expandafter\endgroup + \expandafter\ifx\csname pdffiledump\endcsname\relax + \pdftexcmds@nopdftex + \else + \def\pdf@filedump#1#2#3{% + \pdffiledump offset#1 length#2{#3}% + }% + \fi +% \end{macrocode} +% \begin{macrocode} + \begingroup\expandafter\expandafter\expandafter\endgroup + \expandafter\ifx\csname pdfmdfivesum\endcsname\relax + \begingroup\expandafter\expandafter\expandafter\endgroup + \expandafter\ifx\csname mdfivesum\endcsname\relax + \pdftexcmds@nopdftex + \else + \def\pdf@mdfivesum#{\mdfivesum}% + \let\pdf@mdfivesumnative\pdf@mdfivesum + \def\pdf@filemdfivesum#{\mdfivesum file}% + \fi + \else + \def\pdf@mdfivesum#{\pdfmdfivesum}% + \let\pdf@mdfivesumnative\pdf@mdfivesum + \def\pdf@filemdfivesum#{\pdfmdfivesum file}% + \fi +% \end{macrocode} +% \begin{macrocode} + \def\pdf@system#{% + \immediate\write18% + }% + \def\pdftexcmds@temp#1{% + \begingroup\expandafter\expandafter\expandafter\endgroup + \expandafter\ifx\csname + \expandafter\ifx\csname pdf#1\endcsname\relax\else pdf\fi#1\endcsname\relax + \pdftexcmds@nopdftex + \else + \expandafter\let\csname pdf@#1\expandafter\endcsname + \csname\expandafter\ifx\csname pdf#1\endcsname\relax\else pdf\fi#1\endcsname + \fi + }% + \pdftexcmds@temp{resettimer}% + \pdftexcmds@temp{elapsedtime}% +\fi +% \end{macrocode} +% +% \subsection{\cs{pdf@primitive}, \cs{pdf@ifprimitive}} +% +% Since version 1.40.0 \hologo{pdfTeX} has \cs{pdfprimitive} and +% \cs{ifpdfprimitive}. And \cs{pdfprimitive} was fixed in +% version 1.40.4. +% +% \hologo{XeTeX} provides them under the name \cs{primitive} and +% \cs{ifprimitive}. \hologo{LuaTeX} knows both name variants, +% but they have possibly to be enabled first (|tex.enableprimitives|). +% +% Depending on the format TeX Live uses a prefix |luatex|. +% +% Caution: \cs{let} must be used for the definition of +% the macros, especially because of \cs{ifpdfprimitive}. +% +% \subsubsection{Using \hologo{LuaTeX}'s \texttt{tex.enableprimitives}} +% +% \begin{macrocode} +\ifluatex +% \end{macrocode} +% \begin{macro}{\pdftexcmds@directlua} +% \begin{macrocode} + \ifnum\luatexversion<36 % + \def\pdftexcmds@directlua{\directlua0 }% + \else + \let\pdftexcmds@directlua\directlua + \fi +% \end{macrocode} +% \end{macro} +% +% \begin{macrocode} + \begingroup + \newlinechar=10 % + \endlinechar=\newlinechar + \pdftexcmds@directlua{% + if tex.enableprimitives then + tex.enableprimitives( + 'pdf@', + {'primitive', 'ifprimitive', 'pdfdraftmode','draftmode'} + ) + tex.enableprimitives('', {'luaescapestring'}) + end + }% + \endgroup % +% \end{macrocode} +% +% \begin{macrocode} +\fi +% \end{macrocode} +% +% \subsubsection{Trying various names to find the primitives} +% +% \begin{macro}{\pdftexcmds@strip@prefix} +% \begin{macrocode} +\def\pdftexcmds@strip@prefix#1>{} +% \end{macrocode} +% \end{macro} +% \begin{macrocode} +\def\pdftexcmds@temp#1#2#3{% + \begingroup\expandafter\expandafter\expandafter\endgroup + \expandafter\ifx\csname pdf@#1\endcsname\relax + \begingroup + \def\x{#3}% + \edef\x{\expandafter\pdftexcmds@strip@prefix\meaning\x}% + \escapechar=-1 % + \edef\y{\expandafter\meaning\csname#2\endcsname}% + \expandafter\endgroup + \ifx\x\y + \expandafter\let\csname pdf@#1\expandafter\endcsname + \csname #2\endcsname + \fi + \fi +} +% \end{macrocode} +% +% \begin{macro}{\pdf@primitive} +% \begin{macrocode} +\pdftexcmds@temp{primitive}{pdfprimitive}{pdfprimitive}% pdfTeX, oldLuaTeX +\pdftexcmds@temp{primitive}{primitive}{primitive}% XeTeX, luatex +\pdftexcmds@temp{primitive}{luatexprimitive}{pdfprimitive}% oldLuaTeX +\pdftexcmds@temp{primitive}{luatexpdfprimitive}{pdfprimitive}% oldLuaTeX +% \end{macrocode} +% \end{macro} +% \begin{macro}{\pdf@ifprimitive} +% \begin{macrocode} +\pdftexcmds@temp{ifprimitive}{ifpdfprimitive}{ifpdfprimitive}% pdfTeX, oldLuaTeX +\pdftexcmds@temp{ifprimitive}{ifprimitive}{ifprimitive}% XeTeX, luatex +\pdftexcmds@temp{ifprimitive}{luatexifprimitive}{ifpdfprimitive}% oldLuaTeX +\pdftexcmds@temp{ifprimitive}{luatexifpdfprimitive}{ifpdfprimitive}% oldLuaTeX +% \end{macrocode} +% \end{macro} +% +% Disable broken \cs{pdfprimitive}. +% \begin{macrocode} +\ifluatex\else +\begingroup + \expandafter\ifx\csname pdf@primitive\endcsname\relax + \else + \expandafter\ifx\csname pdftexversion\endcsname\relax + \else + \ifnum\pdftexversion=140 % + \expandafter\ifx\csname pdftexrevision\endcsname\relax + \else + \ifnum\pdftexrevision<4 % + \endgroup + \let\pdf@primitive\@undefined + \@PackageInfoNoLine{pdftexcmds}{% + \string\pdf@primitive\space disabled, % + because\MessageBreak + \string\pdfprimitive\space is broken until pdfTeX 1.40.4% + }% + \begingroup + \fi + \fi + \fi + \fi + \fi +\endgroup +\fi +% \end{macrocode} +% +% \subsubsection{Result} +% +% \begin{macrocode} +\begingroup + \@PackageInfoNoLine{pdftexcmds}{% + \string\pdf@primitive\space is % + \expandafter\ifx\csname pdf@primitive\endcsname\relax not \fi + available% + }% + \@PackageInfoNoLine{pdftexcmds}{% + \string\pdf@ifprimitive\space is % + \expandafter\ifx\csname pdf@ifprimitive\endcsname\relax not \fi + available% + }% +\endgroup +% \end{macrocode} +% +% \subsection{\hologo{XeTeX}} +% +% Look for primitives \cs{shellescape}, \cs{strcmp}. +% \begin{macrocode} +\def\pdftexcmds@temp#1{% + \begingroup\expandafter\expandafter\expandafter\endgroup + \expandafter\ifx\csname pdf@#1\endcsname\relax + \begingroup + \escapechar=-1 % + \edef\x{\expandafter\meaning\csname#1\endcsname}% + \def\y{#1}% + \def\z##1->{}% + \edef\y{\expandafter\z\meaning\y}% + \expandafter\endgroup + \ifx\x\y + \expandafter\def\csname pdf@#1\expandafter\endcsname + \expandafter{% + \csname#1\endcsname + }% + \fi + \fi +}% +\pdftexcmds@temp{shellescape}% +\pdftexcmds@temp{strcmp}% +% \end{macrocode} +% +% \subsection{\cs{pdf@isprimitive}} +% +% \begin{macrocode} +\def\pdf@isprimitive{% + \begingroup\expandafter\expandafter\expandafter\endgroup + \expandafter\ifx\csname pdf@strcmp\endcsname\relax + \long\def\pdf@isprimitive##1{% + \expandafter\pdftexcmds@isprimitive\expandafter{\meaning##1}% + }% + \long\def\pdftexcmds@isprimitive##1##2{% + \expandafter\pdftexcmds@@isprimitive\expandafter{\string##2}{##1}% + }% + \def\pdftexcmds@@isprimitive##1##2{% + \ifnum0\pdftexcmds@equal##1\delimiter##2\delimiter=1 % + \expandafter\ltx@firstoftwo + \else + \expandafter\ltx@secondoftwo + \fi + }% + \def\pdftexcmds@equal##1##2\delimiter##3##4\delimiter{% + \ifx##1##3% + \ifx\relax##2##4\relax + 1% + \else + \ifx\relax##2\relax + \else + \ifx\relax##4\relax + \else + \pdftexcmds@equalcont{##2}{##4}% + \fi + \fi + \fi + \fi + }% + \def\pdftexcmds@equalcont##1{% + \def\pdftexcmds@equalcont####1####2##1##1##1##1{% + ##1##1##1##1% + \pdftexcmds@equal####1\delimiter####2\delimiter + }% + }% + \expandafter\pdftexcmds@equalcont\csname fi\endcsname + \else + \long\def\pdf@isprimitive##1##2{% + \ifnum\pdf@strcmp{\meaning##1}{\string##2}=0 % + \expandafter\ltx@firstoftwo + \else + \expandafter\ltx@secondoftwo + \fi + }% + \fi +} +\ifluatex +\ifx\pdfdraftmode\@undefined + \let\pdfdraftmode\draftmode +\fi +\else + \pdf@isprimitive +\fi +% \end{macrocode} +% +% \subsection{\cs{pdf@draftmode}} +% +% +% \begin{macrocode} +\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 +% \end{macrocode} +% \begin{macro}{\pdf@draftmode} +% \begin{macrocode} + \let\pdf@draftmode\ltx@zero +% \end{macrocode} +% \end{macro} +% \begin{macro}{\pdf@ifdraftmode} +% \begin{macrocode} + \let\pdf@ifdraftmode\ltx@secondoftwo +% \end{macrocode} +% \end{macro} +% \begin{macro}{\pdftexcmds@setdraftmode} +% \begin{macrocode} + \def\pdftexcmds@setdraftmode#1{}% +% \end{macrocode} +% \end{macro} +% \begin{macrocode} +\else +% \end{macrocode} +% \begin{macro}{\pdftexcmds@draftmode} +% \begin{macrocode} + \let\pdftexcmds@draftmode\pdfdraftmode +% \end{macrocode} +% \end{macro} +% \begin{macro}{\pdf@ifdraftmode} +% \begin{macrocode} + \def\pdf@ifdraftmode{% + \ifnum\pdftexcmds@draftmode=\ltx@one + \expandafter\ltx@firstoftwo + \else + \expandafter\ltx@secondoftwo + \fi + }% +% \end{macrocode} +% \end{macro} +% \begin{macro}{\pdf@draftmode} +% \begin{macrocode} + \def\pdf@draftmode{% + \ifnum\pdftexcmds@draftmode=\ltx@one + \expandafter\ltx@one + \else + \expandafter\ltx@zero + \fi + }% +% \end{macrocode} +% \end{macro} +% \begin{macro}{\pdftexcmds@setdraftmode} +% \begin{macrocode} + \def\pdftexcmds@setdraftmode#1{% + \pdftexcmds@draftmode=#1\relax + }% +% \end{macrocode} +% \end{macro} +% \begin{macrocode} +\fi +% \end{macrocode} +% \begin{macro}{\pdf@setdraftmode} +% \begin{macrocode} +\def\pdf@setdraftmode#1{% + \begingroup + \count\ltx@cclv=#1\relax + \edef\x{\endgroup + \noexpand\pdftexcmds@@setdraftmode{\the\count\ltx@cclv}% + }% + \x +} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\pdftexcmds@@setdraftmode} +% \begin{macrocode} +\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 +} +% \end{macrocode} +% \end{macro} +% +% \subsection{Load Lua module} +% +% \begin{macrocode} +\ifluatex +\else + \expandafter\pdftexcmds@AtEnd +\fi% +% \end{macrocode} +% +% \begin{macrocode} +\pdftexcmds@directlua{% + require("pdftexcmds")% +} +\ifnum\luatexversion>37 % + \ifnum0% + \pdftexcmds@directlua{% + if status.ini_version then % + tex.write("1")% + end% + }>0 % + \everyjob\expandafter{% + \the\everyjob + \pdftexcmds@directlua{% + require("pdftexcmds")% + }% + }% + \fi +\fi +\begingroup + \def\x{2019/11/24 v0.31}% + \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 +% \end{macrocode} +% +% \subsection{Lua functions} +% +% \subsubsection{Helper macros} +% +% \begin{macro}{\pdftexcmds@toks} +% \begin{macrocode} +\begingroup\expandafter\expandafter\expandafter\endgroup +\expandafter\ifx\csname newtoks\endcsname\relax + \toksdef\pdftexcmds@toks=0 % +\else + \csname newtoks\endcsname\pdftexcmds@toks +\fi +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\pdftexcmds@Patch} +% \begin{macrocode} +\def\pdftexcmds@Patch{0} +\ifnum\luatexversion>40 % + \ifnum\luatexversion<66 % + \def\pdftexcmds@Patch{1}% + \fi +\fi +% \end{macrocode} +% \end{macro} +% \begin{macrocode} +\ifcase\pdftexcmds@Patch + \catcode`\&=14 % +\else + \catcode`\&=9 % +% \end{macrocode} +% \begin{macro}{\pdftexcmds@PatchDecode} +% \begin{macrocode} + \def\pdftexcmds@PatchDecode#1\@nil{% + \pdftexcmds@DecodeA#1^^A^^A\@nil{}% + }% +% \end{macrocode} +% \end{macro} +% \begin{macro}{\pdftexcmds@DecodeA} +% \begin{macrocode} + \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 + }% +% \end{macrocode} +% \end{macro} +% \begin{macro}{\pdftexcmds@DecodeB} +% \begin{macrocode} + \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 + }% +% \end{macrocode} +% \end{macro} +% \begin{macrocode} +\fi +% \end{macrocode} +% +% \begin{macrocode} +\ifnum\luatexversion<36 % +\else + \catcode`\0=9 % +\fi +% \end{macrocode} +% +% \subsubsection[Strings]{Strings \cite[``7.15 Strings'']{pdftex-manual}} +% +% \begin{macro}{\pdf@strcmp} +% \begin{macrocode} +\long\def\pdf@strcmp#1#2{% + \directlua0{% + oberdiek.pdftexcmds.strcmp("\luaescapestring{#1}",% + "\luaescapestring{#2}")% + }% +}% +% \end{macrocode} +% \end{macro} +% \begin{macrocode} +\pdf@isprimitive +% \end{macrocode} +% \begin{macro}{\pdf@escapehex} +% \begin{macrocode} +\long\def\pdf@escapehex#1{% + \directlua0{% + oberdiek.pdftexcmds.escapehex("\luaescapestring{#1}", "byte")% + }% +}% +% \end{macrocode} +% \end{macro} +% \begin{macro}{\pdf@escapehexnative} +% \begin{macrocode} +\long\def\pdf@escapehexnative#1{% + \directlua0{% + oberdiek.pdftexcmds.escapehex("\luaescapestring{#1}")% + }% +}% +% \end{macrocode} +% \end{macro} +% \begin{macro}{\pdf@unescapehex} +% \begin{macrocode} +\def\pdf@unescapehex#1{% +& \romannumeral\expandafter\pdftexcmds@PatchDecode + \the\expandafter\pdftexcmds@toks + \directlua0{% + oberdiek.pdftexcmds.toks="pdftexcmds@toks"% + oberdiek.pdftexcmds.unescapehex("\luaescapestring{#1}", "byte", \pdftexcmds@Patch)% + }% +& \@nil +}% +% \end{macrocode} +% \end{macro} +% \begin{macro}{\pdf@unescapehexnative} +% \begin{macrocode} +\def\pdf@unescapehexnative#1{% +& \romannumeral\expandafter\pdftexcmds@PatchDecode + \the\expandafter\pdftexcmds@toks + \directlua0{% + oberdiek.pdftexcmds.toks="pdftexcmds@toks"% + oberdiek.pdftexcmds.unescapehex("\luaescapestring{#1}", \pdftexcmds@Patch)% + }% +& \@nil +}% +% \end{macrocode} +% \end{macro} +% \begin{macro}{\pdf@escapestring} +% \begin{macrocode} +\long\def\pdf@escapestring#1{% + \directlua0{% + oberdiek.pdftexcmds.escapestring("\luaescapestring{#1}")% + }% +} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\pdf@escapename} +% \begin{macrocode} +\long\def\pdf@escapename#1{% + \directlua0{% + oberdiek.pdftexcmds.escapename("\luaescapestring{#1}", "byte")% + }% +} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\pdf@escapenamenative} +% \begin{macrocode} +\long\def\pdf@escapenamenative#1{% + \directlua0{% + oberdiek.pdftexcmds.escapename("\luaescapestring{#1}")% + }% +} +% \end{macrocode} +% \end{macro} +% +% \subsubsection[Files]{Files \cite[``7.18 Files'']{pdftex-manual}} +% +% \begin{macro}{\pdf@filesize} +% \begin{macrocode} +\def\pdf@filesize#1{% + \directlua0{% + oberdiek.pdftexcmds.filesize("\luaescapestring{#1}")% + }% +} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\pdf@filemoddate} +% \begin{macrocode} +\def\pdf@filemoddate#1{% + \directlua0{% + oberdiek.pdftexcmds.filemoddate("\luaescapestring{#1}")% + }% +} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\pdf@filedump} +% \begin{macrocode} +\def\pdf@filedump#1#2#3{% + \directlua0{% + oberdiek.pdftexcmds.filedump("\luaescapestring{\number#1}",% + "\luaescapestring{\number#2}",% + "\luaescapestring{#3}")% + }% +}% +% \end{macrocode} +% \end{macro} +% \begin{macro}{\pdf@mdfivesum} +% \begin{macrocode} +\long\def\pdf@mdfivesum#1{% + \directlua0{% + oberdiek.pdftexcmds.mdfivesum("\luaescapestring{#1}", "byte")% + }% +}% +% \end{macrocode} +% \end{macro} +% \begin{macro}{\pdf@mdfivesumnative} +% \begin{macrocode} +\long\def\pdf@mdfivesumnative#1{% + \directlua0{% + oberdiek.pdftexcmds.mdfivesum("\luaescapestring{#1}")% + }% +}% +% \end{macrocode} +% \end{macro} +% \begin{macro}{\pdf@filemdfivesum} +% \begin{macrocode} +\def\pdf@filemdfivesum#1{% + \directlua0{% + oberdiek.pdftexcmds.filemdfivesum("\luaescapestring{#1}")% + }% +}% +% \end{macrocode} +% \end{macro} +% +% \subsubsection[Timekeeping]{Timekeeping \cite[``7.17 Timekeeping'']{pdftex-manual}} +% +% \begin{macro}{\protected} +% \begin{macrocode} +\let\pdftexcmds@temp=Y% +\begingroup\expandafter\expandafter\expandafter\endgroup +\expandafter\ifx\csname protected\endcsname\relax + \pdftexcmds@directlua0{% + if tex.enableprimitives then % + tex.enableprimitives('', {'protected'})% + end% + }% +\fi +\begingroup\expandafter\expandafter\expandafter\endgroup +\expandafter\ifx\csname protected\endcsname\relax + \let\pdftexcmds@temp=N% +\fi +% \end{macrocode} +% \end{macro} +% \begin{macro}{\numexpr} +% \begin{macrocode} +\begingroup\expandafter\expandafter\expandafter\endgroup +\expandafter\ifx\csname numexpr\endcsname\relax + \pdftexcmds@directlua0{% + if tex.enableprimitives then % + tex.enableprimitives('', {'numexpr'})% + end% + }% +\fi +\begingroup\expandafter\expandafter\expandafter\endgroup +\expandafter\ifx\csname numexpr\endcsname\relax + \let\pdftexcmds@temp=N% +\fi +% \end{macrocode} +% \end{macro} +% +% \begin{macrocode} +\ifx\pdftexcmds@temp N% + \@PackageWarningNoLine{pdftexcmds}{% + Definitions of \ltx@backslashchar pdf@resettimer and% + \MessageBreak + \ltx@backslashchar pdf@elapsedtime are skipped, because% + \MessageBreak + e-TeX's \ltx@backslashchar protected or % + \ltx@backslashchar numexpr are missing% + }% +\else +% \end{macrocode} +% +% \begin{macro}{\pdf@resettimer} +% \begin{macrocode} + \protected\def\pdf@resettimer{% + \pdftexcmds@directlua0{% + oberdiek.pdftexcmds.resettimer()% + }% + }% +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\pdf@elapsedtime} +% \begin{macrocode} + \protected\def\pdf@elapsedtime{% + \numexpr + \pdftexcmds@directlua0{% + oberdiek.pdftexcmds.elapsedtime()% + }% + \relax + }% +% \end{macrocode} +% \end{macro} +% \begin{macrocode} +\fi +% \end{macrocode} +% +% \subsubsection{Shell escape} +% +% \begin{macro}{\pdf@shellescape} +% +% \begin{macrocode} +\ifnum\luatexversion<68 % +\else + \protected\edef\pdf@shellescape{% + \numexpr\directlua{tex.sprint(% + \number\catcodetable@string,status.shell_escape)}\relax} +\fi +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\pdf@system} +% \begin{macrocode} +\def\pdf@system#1{% + \directlua0{% + oberdiek.pdftexcmds.system("\luaescapestring{#1}")% + }% +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\pdf@lastsystemstatus} +% \begin{macrocode} +\def\pdf@lastsystemstatus{% + \directlua0{% + oberdiek.pdftexcmds.lastsystemstatus()% + }% +} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\pdf@lastsystemexit} +% \begin{macrocode} +\def\pdf@lastsystemexit{% + \directlua0{% + oberdiek.pdftexcmds.lastsystemexit()% + }% +} +% \end{macrocode} +% \end{macro} +% +% \begin{macrocode} +\catcode`\0=12 % +% \end{macrocode} +% +% \begin{macro}{\pdf@pipe} +% Check availability of |io.popen| first. +% \begin{macrocode} +\ifnum0% + \pdftexcmds@directlua{% + if io.popen then % + tex.write("1")% + end% + }% + =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}", \pdftexcmds@Patch)% + }% +& \@nil + }% +\fi +% \end{macrocode} +% \end{macro} +% +% \begin{macrocode} +\pdftexcmds@AtEnd% +% +% \end{macrocode} +% +% \subsection{Lua module} +% +% \begin{macrocode} +%<*lua> +% \end{macrocode} +% +% \begin{macrocode} +oberdiek = oberdiek or {} +local pdftexcmds = oberdiek.pdftexcmds or {} +oberdiek.pdftexcmds = pdftexcmds +local systemexitstatus +function pdftexcmds.getversion() + tex.write("2019/11/24 v0.31") +end +% \end{macrocode} +% +% \subsubsection[Strings]{Strings \cite[``7.15 Strings'']{pdftex-manual}} +% +% \begin{macrocode} +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 +local function 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 = utf8_to_byte(str) + end + tex.write((string.gsub(str, ".", + function (ch) + return string.format("%02X", string.byte(ch)) + end + ))) +end +% \end{macrocode} +% See procedure |unescapehex| in file \xfile{utils.c} of \hologo{pdfTeX}. +% Caution: |tex.write| ignores leading spaces. +% \begin{macrocode} +function pdftexcmds.unescapehex(str, mode, patch) + 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 patch == 1 then + local temp = {} + for i, a in ipairs(result) do + if a == 0 then + table.insert(temp, 1) + table.insert(temp, 1) + else + if a == 1 then + table.insert(temp, 1) + table.insert(temp, 2) + else + table.insert(temp, a) + end + end + end + result = temp + 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 +% \end{macrocode} +% this next line added for current luatex; this is the only +% change in the file. eroux, 28apr13. (v 0.21) +% \begin{macrocode} + local unpack = _G["unpack"] or table.unpack + tex.settoks(pdftexcmds.toks, string.char(unpack(result))) +end +% \end{macrocode} +% See procedure |escapestring| in file \xfile{utils.c} of \hologo{pdfTeX}. +% \begin{macrocode} +function pdftexcmds.escapestring(str, mode) + if mode == "byte" then + str = 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 +% \end{macrocode} +% Lua 5.1 returns the match in case of return value |nil|. +% \begin{macrocode} + return nil + end + ))) +end +% \end{macrocode} +% See procedure |escapename| in file \xfile{utils.c} of \hologo{pdfTeX}. +% \begin{macrocode} +function pdftexcmds.escapename(str, mode) + if mode == "byte" then + str = utf8_to_byte(str) + end + tex.write((string.gsub(str, ".", + function (ch) + local b = string.byte(ch) + if b == 0 then +% \end{macrocode} +% In Lua 5.0 |nil| could be used for the empty string, +% But |nil| returns the match in Lua 5.1, thus we use +% the empty string explicitly. +% \begin{macrocode} + 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 +% \end{macrocode} +% Lua 5.1 returns the match in case of return value |nil|. +% \begin{macrocode} + return nil + end + end + ))) +end +% \end{macrocode} +% +% \subsubsection[Files]{Files \cite[``7.18 Files'']{pdftex-manual}} +% +% \begin{macrocode} +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 +% \end{macrocode} +% See procedure |makepdftime| in file \xfile{utils.c} of \hologo{pdfTeX}. +% \begin{macrocode} +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, "rb") + if filehandle then + if offset > 0 then + filehandle:seek("set", offset) + end + local dump = filehandle:read(length) + pdftexcmds.escapehex(dump) + filehandle:close() + end + end + end +end +function pdftexcmds.mdfivesum(str, mode) + if mode == "byte" then + str = 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, "rb") + if filehandle then + local contents = filehandle:read("*a") + pdftexcmds.escapehex(md5.sum(contents)) + filehandle:close() + end + end +end +% \end{macrocode} +% +% \subsubsection[Timekeeping]{Timekeeping \cite[``7.17 Timekeeping'']{pdftex-manual}} +% +% The functions for timekeeping are based on +% Andy Thomas' work \cite{AndyThomas:Analog}. +% Changes: +% \begin{itemize} +% \item Overflow check is added. +% \item |string.format| is used to avoid exponential number +% representation for sure. +% \item |tex.write| is used instead of |tex.print| to get +% tokens with catcode 12 and without appended \cs{endlinechar}. +% \end{itemize} +% \begin{macrocode} +local basetime = 0 +function pdftexcmds.resettimer() + basetime = os.clock() +end +function pdftexcmds.elapsedtime() + local val = (os.clock() - basetime) * 65536 + .5 + if val > 2147483647 then + val = 2147483647 + end + tex.write(string.format("%d", val)) +end +% \end{macrocode} +% +% \subsubsection[Miscellaneous]{Miscellaneous \cite[``7.21 Miscellaneous'']{pdftex-manual}} +% +% \begin{macrocode} +function pdftexcmds.shellescape() + if os.execute then + if status + and status.luatex_version + and status.luatex_version >= 68 then + tex.write(os.execute()) + else + local result = os.execute() + if result == 0 then + tex.write("0") + else + if result == nil then + tex.write("0") + else + tex.write("1") + end + end + end + else + tex.write("0") + end +end +function pdftexcmds.system(cmdline) + systemexitstatus = nil + texio.write_nl("log", "system(" .. cmdline .. ") ") + if os.execute then + texio.write("log", "executed.") + systemexitstatus = os.execute(cmdline) + else + texio.write("log", "disabled.") + end +end +function pdftexcmds.lastsystemstatus() + local result = tonumber(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(systemexitstatus) + if result then + tex.write(math.floor(result / 256)) + end +end +function pdftexcmds.pipe(cmdline, patch) + local result + 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 + if patch == 1 then + local temp = {} + for i, a in ipairs(result) do + if a == 0 then + table.insert(temp, 1) + table.insert(temp, 1) + else + if a == 1 then + table.insert(temp, 1) + table.insert(temp, 2) + else + table.insert(temp, a) + end + end + end + result = temp + end + tex.settoks(pdftexcmds.toks, result) + else + tex.settoks(pdftexcmds.toks, "") + end +end +% \end{macrocode} +% \begin{macrocode} +% +% \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} +% +% \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 +% +% \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 +% +% \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 +% +% \end{macrocode} +% +% \section{Installation} +% +% \subsection{Download} +% +% \paragraph{Package.} This package is available on +% CTAN\footnote{\CTANpkg{pdftexcmds}}: +% \begin{description} +% \item[\CTAN{macros/latex/contrib/pdftexcmds/pdftexcmds.dtx}] The source file. +% \item[\CTAN{macros/latex/contrib/pdftexcmds/pdftexcmds.pdf}] Documentation. +% \end{description} +% +% +% \paragraph{Bundle.} All the packages of the bundle `pdftexcmds' +% are also available in a TDS compliant ZIP archive. There +% the packages are already unpacked and the documentation files +% are generated. The files and directories obey the TDS standard. +% \begin{description} +% \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 +% with \xfile{texmf} in their name are usually organized this way. +% +% \subsection{Bundle installation} +% +% \paragraph{Unpacking.} Unpack the \xfile{pdftexcmds.tds.zip} in the +% TDS tree (also known as \xfile{texmf} tree) of your choice. +% Example (linux): +% \begin{quote} +% |unzip pdftexcmds.tds.zip -d ~/texmf| +% \end{quote} +% +% \paragraph{Script installation.} +% Check the directory \xfile{TDS:scripts/pdftexcmds/} for +% scripts that need further installation steps. +% +% \subsection{Package installation} +% +% \paragraph{Unpacking.} The \xfile{.dtx} file is a self-extracting +% \docstrip\ archive. The files are extracted by running the +% \xfile{.dtx} through \plainTeX: +% \begin{quote} +% \verb|tex pdftexcmds.dtx| +% \end{quote} +% +% \paragraph{TDS.} Now the different files must be moved into +% the different directories in your installation TDS tree +% (also known as \xfile{texmf} tree): +% \begin{quote} +% \def\t{^^A +% \begin{tabular}{@{}>{\ttfamily}l@{ $\rightarrow$ }>{\ttfamily}l@{}} +% pdftexcmds.sty & tex/generic/pdftexcmds/pdftexcmds.sty\\ +% pdftexcmds.lua & scripts/pdftexcmds/pdftexcmds.lua\\ +% pdftexcmds.pdf & doc/latex/pdftexcmds/pdftexcmds.pdf\\ +% pdftexcmds.dtx & source/latex/pdftexcmds/pdftexcmds.dtx\\ +% \end{tabular}^^A +% }^^A +% \sbox0{\t}^^A +% \ifdim\wd0>\linewidth +% \begingroup +% \advance\linewidth by\leftmargin +% \advance\linewidth by\rightmargin +% \edef\x{\endgroup +% \def\noexpand\lw{\the\linewidth}^^A +% }\x +% \def\lwbox{^^A +% \leavevmode +% \hbox to \linewidth{^^A +% \kern-\leftmargin\relax +% \hss +% \usebox0 +% \hss +% \kern-\rightmargin\relax +% }^^A +% }^^A +% \ifdim\wd0>\lw +% \sbox0{\small\t}^^A +% \ifdim\wd0>\linewidth +% \ifdim\wd0>\lw +% \sbox0{\footnotesize\t}^^A +% \ifdim\wd0>\linewidth +% \ifdim\wd0>\lw +% \sbox0{\scriptsize\t}^^A +% \ifdim\wd0>\linewidth +% \ifdim\wd0>\lw +% \sbox0{\tiny\t}^^A +% \ifdim\wd0>\linewidth +% \lwbox +% \else +% \usebox0 +% \fi +% \else +% \lwbox +% \fi +% \else +% \usebox0 +% \fi +% \else +% \lwbox +% \fi +% \else +% \usebox0 +% \fi +% \else +% \lwbox +% \fi +% \else +% \usebox0 +% \fi +% \else +% \lwbox +% \fi +% \else +% \usebox0 +% \fi +% \end{quote} +% If you have a \xfile{docstrip.cfg} that configures and enables \docstrip's +% TDS installing feature, then some files can already be in the right +% place, see the documentation of \docstrip. +% +% \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 +% \verb|mktexlsr|. +% +% \subsection{Some details for the interested} +% +% \paragraph{Unpacking with \LaTeX.} +% The \xfile{.dtx} chooses its action depending on the format: +% \begin{description} +% \item[\plainTeX:] Run \docstrip\ and extract the files. +% \item[\LaTeX:] Generate the documentation. +% \end{description} +% If you insist on using \LaTeX\ for \docstrip\ (really, +% \docstrip\ does not need \LaTeX), then inform the autodetect routine +% about your intention: +% \begin{quote} +% \verb|latex \let\install=y\input{pdftexcmds.dtx}| +% \end{quote} +% Do not forget to quote the argument according to the demands +% of your shell. +% +% \paragraph{Generating the documentation.} +% You can use both the \xfile{.dtx} or the \xfile{.drv} to generate +% the documentation. The process can be configured by the +% configuration file \xfile{ltxdoc.cfg}. For instance, put this +% line into this file, if you want to have A4 as paper format: +% \begin{quote} +% \verb|\PassOptionsToClass{a4paper}{article}| +% \end{quote} +% An example follows how to generate the +% documentation with pdf\LaTeX: +% \begin{quote} +%\begin{verbatim} +%pdflatex pdftexcmds.dtx +%bibtex pdftexcmds.aux +%makeindex -s gind.ist pdftexcmds.idx +%pdflatex pdftexcmds.dtx +%makeindex -s gind.ist pdftexcmds.idx +%pdflatex pdftexcmds.dtx +%\end{verbatim} +% \end{quote} +% +% \printbibliography[ +% heading=bibnumbered, +% ] +% +% \begin{History} +% \begin{Version}{2007/11/11 v0.1} +% \item +% First version. +% \end{Version} +% \begin{Version}{2007/11/12 v0.2} +% \item +% Short description fixed. +% \end{Version} +% \begin{Version}{2007/12/12 v0.3} +% \item +% Organization of Lua code as module. +% \end{Version} +% \begin{Version}{2009/04/10 v0.4} +% \item +% Adaptation for syntax change of \cs{directlua} in +% \hologo{LuaTeX} 0.36. +% \end{Version} +% \begin{Version}{2009/09/22 v0.5} +% \item +% \cs{pdf@primitive}, \cs{pdf@ifprimitive} added. +% \item +% \hologo{XeTeX}'s variants are detected for +% \cs{pdf@shellescape}, \cs{pdf@strcmp}, \cs{pdf@primitive}, +% \cs{pdf@ifprimitive}. +% \end{Version} +% \begin{Version}{2009/09/23 v0.6} +% \item +% Macro \cs{pdf@isprimitive} added. +% \end{Version} +% \begin{Version}{2009/12/12 v0.7} +% \item +% Short info shortened. +% \end{Version} +% \begin{Version}{2010/03/01 v0.8} +% \item +% Required date for package \xpackage{ifluatex} updated. +% \end{Version} +% \begin{Version}{2010/04/01 v0.9} +% \item +% Use \cs{ifeof18} for defining \cs{pdf@shellescape} between +% \hologo{pdfTeX} 1.21a (inclusive) and 1.30.0 (exclusive). +% \end{Version} +% \begin{Version}{2010/11/04 v0.10} +% \item +% \cs{pdf@draftmode}, \cs{pdf@ifdraftmode} and +% \cs{pdf@setdraftmode} added. +% \end{Version} +% \begin{Version}{2010/11/11 v0.11} +% \item +% Missing \cs{RequirePackage} for package \xpackage{ifpdf} added. +% \end{Version} +% \begin{Version}{2011/01/30 v0.12} +% \item +% Already loaded package files are not input in \hologo{plainTeX}. +% \end{Version} +% \begin{Version}{2011/03/04 v0.13} +% \item +% Improved Lua function \texttt{shellescape} that also +% uses the result of \texttt{os.execute()} (thanks to Philipp Stephani). +% \end{Version} +% \begin{Version}{2011/04/10 v0.14} +% \item +% Version check of loaded module added. +% \item +% Patch for bug in \hologo{LuaTeX} between 0.40.6 and 0.65 that +% is fixed in revision 4096. +% \end{Version} +% \begin{Version}{2011/04/16 v0.15} +% \item +% \hologo{LuaTeX}: \cs{pdf@shellescape} is only supported +% for version 0.70.0 and higher due to a bug, \texttt{os.execute()} +% crashes in some circumstances. Fixed in \hologo{LuaTeX} +% beta-0.70.0, revision 4167. +% \end{Version} +% \begin{Version}{2011/04/22 v0.16} +% \item +% Previous fix was not working due to a wrong catcode of digit +% zero (due to easily support the old \cs{directlua0}). +% The version border is lowered to 0.68, because some +% beta-0.67.0 seems also to work. +% \end{Version} +% \begin{Version}{2011/06/29 v0.17} +% \item +% Documentation addition to \cs{pdf@shellescape}. +% \end{Version} +% \begin{Version}{2011/07/01 v0.18} +% \item +% Add Lua module loading in \cs{everyjob} for \hologo{iniTeX} +% (\hologo{LuaTeX} only). +% \end{Version} +% \begin{Version}{2011/07/28 v0.19} +% \item +% Missing space in an info message added (Martin M\"unch). +% \end{Version} +% \begin{Version}{2011/11/29 v0.20} +% \item +% \cs{pdf@resettimer} and \cs{pdf@elapsedtime} added +% (thanks Andy Thomas). +% \end{Version} +% \begin{Version}{2016/05/10 v0.21} +% \item +% local unpack added +% (thanks \'{E}lie Roux). +% \end{Version} +% \begin{Version}{2016/05/21 v0.22} +% \item +% adjust \cs{textbackslas}h usage in bib file for biber bug. +% \end{Version} +% \begin{Version}{2016/10/02 v0.23} +% \item +% add file.close to lua filehandles (github pull request). +% \end{Version} +% \begin{Version}{2017/01/29 v0.24} +% \item +% Avoid loading luatex-loader for current luatex. (Use +% pdftexcmds.lua not oberdiek.pdftexcmds.lua to simplify file +% search with standard require) +% \end{Version} +% \begin{Version}{2017/03/19 v0.25} +% \item +% New \cs{pdf@shellescape} for Lua\TeX, see github issue 20. +% \end{Version} +% \begin{Version}{2018/01/21 v0.26} +% \item +% use rb not r mode for file open github issue 34. +% \end{Version} +% \begin{Version}{2018/01/30 v0.27} +% \item +% \cs{pdf@mdfivesum} for \hologo{XeTeX} +% \end{Version} +% \begin{Version}{2018/09/07 v0.28} +% \item +% Fix catcode regime in luatex sprint for \cs{pdf@shellescape} GH issue 45 +% \end{Version} +% \begin{Version}{2018/09/10 v0.29} +% \item +% Actually do the fix described above in the code, not just document it. +% \end{Version} +% \begin{Version}{2019/07/25 v0.30} +% \item +% Remove uses of module function, see PR70 +% \end{Version} +% \begin{Version}{2019/11/24 v0.31} +% \item +% Use \xpackage{iftex} directly rather than \xpackage{ifluatex} and \xpackage{ifpdf} wrappers. +% \item detect \verb|\filmoddate| and other \hologo{XeTeX} commands. +% \item Adjust \cs{pdf@escapestring} in \hologo{LuaTeX} to produce +% the same as in \hologo{pdfTeX} in the 8bit +% range and not drop all non ascii characters. +% \end{Version} +% \end{History} +% +% \PrintIndex +% +% \Finale +\endinput diff --git a/macros/latex/contrib/pdftexcmds/pdftexcmds.pdf b/macros/latex/contrib/pdftexcmds/pdftexcmds.pdf new file mode 100644 index 0000000000..3de8102fc2 Binary files /dev/null and b/macros/latex/contrib/pdftexcmds/pdftexcmds.pdf differ -- cgit v1.2.3